diff --git a/boards/avr-rss2/include/board.h b/boards/avr-rss2/include/board.h index a4dbe6b920..b9b50b8cd5 100644 --- a/boards/avr-rss2/include/board.h +++ b/boards/avr-rss2/include/board.h @@ -41,8 +41,10 @@ extern "C" { /** * @brief AT24Mac provides a EUI-64, this is also printed on the board */ -static inline int _at24mac_get_eui64(const void *arg, eui64_t *addr) +static inline int _at24mac_get_eui64(const void *arg, eui64_t *addr, uint8_t index) { + (void) index; + return at24mac_get_eui64((uintptr_t)arg, addr); } diff --git a/boards/derfmega256/include/board.h b/boards/derfmega256/include/board.h index cf850d7cb6..3d0d4d9138 100644 --- a/boards/derfmega256/include/board.h +++ b/boards/derfmega256/include/board.h @@ -37,9 +37,10 @@ extern "C" { /** * @brief Constant in EEPROM provides a EUI-64, this is also printed on the board */ -static inline int _eeprom_mac_get_eui64(const void *arg, eui64_t *addr) +static inline int _eeprom_mac_get_eui64(const void *arg, eui64_t *addr, uint8_t index) { (void) arg; + (void) index; if (eeprom_read(EEPROM_MAC_ADDR, addr, sizeof(eui64_t)) != sizeof(eui64_t)) { return -1; diff --git a/boards/same54-xpro/include/board.h b/boards/same54-xpro/include/board.h index 5618f18e63..1eaae2b4c6 100644 --- a/boards/same54-xpro/include/board.h +++ b/boards/same54-xpro/include/board.h @@ -48,8 +48,10 @@ extern "C" { /** * @brief AT24Mac provides a EUI-48 */ -static inline int _at24mac_get_eui48(const void *arg, eui48_t *addr) +static inline int _at24mac_get_eui48(const void *arg, eui48_t *addr, uint8_t index) { + (void) index; + return at24mac_get_eui48((uintptr_t)arg, addr); } diff --git a/boards/samr21-xpro/include/board.h b/boards/samr21-xpro/include/board.h index daba7670a4..807c02ebf5 100644 --- a/boards/samr21-xpro/include/board.h +++ b/boards/samr21-xpro/include/board.h @@ -62,9 +62,10 @@ extern "C" { /** * @brief EDBG provides a EUI-64, the same that is printed on the board */ -static inline int _edbg_get_eui64(const void *arg, eui64_t *addr) +static inline int _edbg_get_eui64(const void *arg, eui64_t *addr, uint8_t index) { (void) arg; + (void) index; /* EDBG can take a while to respond on cold boot */ unsigned tries = 10000; diff --git a/cpu/cc2538/include/cc2538_eui_primary.h b/cpu/cc2538/include/cc2538_eui_primary.h index a8d242071b..a46ab7c648 100644 --- a/cpu/cc2538/include/cc2538_eui_primary.h +++ b/cpu/cc2538/include/cc2538_eui_primary.h @@ -33,12 +33,14 @@ extern "C" { * * @param arg unused * @param[out] addr The EUI-64 + * @param index unused * * @return 0 */ -static inline int cc2538_get_eui64_primary(const void *arg, eui64_t *addr) +static inline int cc2538_get_eui64_primary(const void *arg, eui64_t *addr, uint8_t index) { (void) arg; + (void) index; /* * The primary EUI-64 seems to be written to memory in a non-sequential diff --git a/sys/include/net/eui_provider.h b/sys/include/net/eui_provider.h index 87282ae007..4c99db72d5 100644 --- a/sys/include/net/eui_provider.h +++ b/sys/include/net/eui_provider.h @@ -108,24 +108,26 @@ extern "C" { * * @param[in] arg Optional argument provided by eui48_conf_t * @param[out] addr Destination pointer for the EUI-48 address + * @param[in] index index of the netdev * * @return 0 on success, next provider in eui48_conf_t will be * used otherwise. * Will fall back to @see luid_get_eui48 eventually. */ -typedef int (*netdev_get_eui48_cb_t)(const void *arg, eui48_t *addr); +typedef int (*netdev_get_eui48_cb_t)(const void *arg, eui48_t *addr, uint8_t index); /** * @brief Function for providing a EUI-64 to a device * * @param[in] arg Optional argument provided by eui64_conf_t * @param[out] addr Destination pointer for the EUI-64 address + * @param[in] index index of the netdev * * @return 0 on success, next provider in eui64_conf_t will be * used otherwise. * Will fall back to @see luid_get_eui64 eventually. */ -typedef int (*netdev_get_eui64_cb_t)(const void *arg, eui64_t *addr); +typedef int (*netdev_get_eui64_cb_t)(const void *arg, eui64_t *addr, uint8_t index); /** * @brief Structure to hold providers for EUI-48 addresses diff --git a/sys/net/link_layer/eui_provider/eui_provider.c b/sys/net/link_layer/eui_provider/eui_provider.c index 558b5b4e35..d99475ab0f 100644 --- a/sys/net/link_layer/eui_provider/eui_provider.c +++ b/sys/net/link_layer/eui_provider/eui_provider.c @@ -35,7 +35,7 @@ void netdev_eui48_get(netdev_t *netdev, eui48_t *addr) #else (void) netdev; #endif - if (eui48_conf[i].provider(eui48_conf[i].arg, addr) == 0) { + if (eui48_conf[i].provider(eui48_conf[i].arg, addr, i) == 0) { return; } } @@ -60,7 +60,7 @@ void netdev_eui64_get(netdev_t *netdev, eui64_t *addr) #else (void) netdev; #endif - if (eui64_conf[i].provider(eui64_conf[i].arg, addr) == 0) { + if (eui64_conf[i].provider(eui64_conf[i].arg, addr, i) == 0) { return; } }