Commit 6504322e authored by Alessandro Rubini's avatar Alessandro Rubini

MAC address: use locally assigned, document it

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 642e3865
......@@ -392,6 +392,9 @@ int get_persistent_mac(uint8_t portnum, uint8_t * mac)
if (class != 0x28 && class != 0x42)
continue;
rom = wrpc_w1_bus.devs[i].rom;
mac[0] = 0x22;
mac[1] = 0x33;
mac[2] = rom >> 32;
mac[3] = rom >> 24;
mac[4] = rom >> 16;
mac[5] = rom >> 8;
......
......@@ -317,6 +317,9 @@ int get_persistent_mac(uint8_t portnum, uint8_t * mac)
if (class != 0x28 && class != 0x42)
continue;
rom = wrpc_w1_bus.devs[i].rom;
mac[0] = 0x22;
mac[1] = 0x33;
mac[2] = rom >> 32;
mac[3] = rom >> 24;
mac[4] = rom >> 16;
mac[5] = rom >> 8;
......
......@@ -512,8 +512,11 @@ First you should make sure your board has a proper @sc{mac} address assigned:
@example
wrc# mac get
@end example
If the result of above command is @t{MAC-address: 22:33:44:55:66:77}, this means
@sc{mac} was not yet configured and stored in the Flash/EEPROM. You should get
If the result of above command is @t{MAC-address: 22:33:ww:xx:yy:zz}, this means
@sc{mac} was not yet configured and stored in the Flash/EEPROM. The value is
based on thermometer serial number as is unique among SPEC devices,
globally accepted as ``locally assigned'', but you might want to assign your own address. A value @t{22:33:44:55:66:77} is the final fallback if no
thermometer is found (very unlikely). You should get
the @sc{mac} for your board from its manufacturer. To configure the address and
store it into the Flash/EEPROM (so that it's automatically loaded every time the
@sc{wrpc} starts) you should type two commands in the @sc{wrpc} shell:
......
......@@ -66,10 +66,6 @@ static void wrc_initialize(void)
/*init storage (Flash / W1 EEPROM / I2C EEPROM*/
storage_init(WRPC_FMC_I2C, FMC_EEPROM_ADR);
mac_addr[0] = 0x08; //
mac_addr[1] = 0x00; // CERN OUI
mac_addr[2] = 0x30; //
if (get_persistent_mac(ONEWIRE_PORT, mac_addr) == -1) {
mprintf("Unable to determine MAC address\n");
mac_addr[0] = 0x22; //
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment