Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:guide-developer:mac.address [2019/10/08 14:26] – Headers, further clean-up adrianschmutzlerdocs:guide-developer:mac.address [2021/01/03 21:09] (current) – [Find out about flash locations] . /lib/functions/system.sh sources /lib/functions.sh borromini
Line 57: Line 57:
 or by using mtd_get_mac_binary (based on partition label): or by using mtd_get_mac_binary (based on partition label):
 <code>. /lib/functions/system.sh <code>. /lib/functions/system.sh
-. /lib/functions.sh 
 mtd_get_mac_binary art 0x4</code> mtd_get_mac_binary art 0x4</code>
  
Line 90: Line 89:
 Known cases: Known cases:
   * ath79: **mtd-cal-data**: The MAC address will be read from start +2   * ath79: **mtd-cal-data**: The MAC address will be read from start +2
-  * ramips: **mediatek,mtd-eeprom**: The MAC address will be read from start +4+  * ramips: **mediatek,mtd-eeprom/ralink,mtd-eeprom**: The MAC address will be read from start +4 
 +  * **ath9k**: offset + 2 (mostly)
   * **ath10k**: offset + 6   * **ath10k**: offset + 6
  
Line 98: Line 98:
 <code> <code>
 &wmac { &wmac {
-       status = "okay"; + status = "okay"; 
-       mtd-cal-data = <&art 0x1000>;+ 
 + mtd-cal-data = <&art 0x1000>;
 }; };
 </code> </code>
Line 106: Line 107:
 <code> <code>
 &wmac { &wmac {
-       status = "okay"; + status = "okay"; 
-       mtd-cal-data = <&art 0x1000>; + 
-       mtd-mac-address = <&art 0x1002>;+ mtd-cal-data = <&art 0x1000>; 
 + mtd-mac-address = <&art 0x1002>;
 }; };
 </code> </code>
  
 +This can also be exploited for setting the label MAC address (see below) via 02_network.
  
 ===== Label MAC address ===== ===== Label MAC address =====
Line 131: Line 134:
  
 <code>aliases { <code>aliases {
-   label-mac-device = &wifi0;+ label-mac-device = &wifi0;
 }</code> }</code>
  
Line 171: Line 174:
 <code>cudy,wr1000) <code>cudy,wr1000)
  wan_mac=$(mtd_get_mac_binary factory 0x2e)  wan_mac=$(mtd_get_mac_binary factory 0x2e)
- label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)+ label_mac=$(mtd_get_mac_binary factory 0x4# e.g. on ramips when caldata is read from factory 0x0
  
 belkin,f9k1109v1) belkin,f9k1109v1)
Line 184: Line 187:
  
  
 +==== Using the label MAC address ====
 +
 +When everything is set up correctly, the label MAC address can be accessed with:
 +
 +<code>
 +. /lib/functions.sh
 +. /lib/functions/system.sh
 +label_mac_addr=$(get_mac_label)
 +</code>
 ===== Common MAC address locations ===== ===== Common MAC address locations =====
  
  • Last modified: 2019/10/08 14:26
  • by adrianschmutzler