diff --git a/boards/avr-rss2/include/eui_provider_params.h b/boards/avr-rss2/include/eui_provider_params.h index b19004faae..fad4dbb736 100644 --- a/boards/avr-rss2/include/eui_provider_params.h +++ b/boards/avr-rss2/include/eui_provider_params.h @@ -27,10 +27,8 @@ 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, uint8_t index) +static inline int _at24mac_get_eui64(uint8_t index, eui64_t *addr) { - (void) arg; - return at24mac_get_eui64(index, addr); } diff --git a/boards/derfmega256/include/eui_provider_params.h b/boards/derfmega256/include/eui_provider_params.h index cb01d1f02f..5bc489d845 100644 --- a/boards/derfmega256/include/eui_provider_params.h +++ b/boards/derfmega256/include/eui_provider_params.h @@ -34,9 +34,8 @@ 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, uint8_t index) +static inline int _eeprom_mac_get_eui64(uint8_t index, eui64_t *addr) { - (void) arg; (void) index; if (eeprom_read(EEPROM_MAC_ADDR, addr, sizeof(eui64_t)) != sizeof(eui64_t)) { diff --git a/boards/same54-xpro/include/eui_provider_params.h b/boards/same54-xpro/include/eui_provider_params.h index 5e8c8b503b..fbb7471c26 100644 --- a/boards/same54-xpro/include/eui_provider_params.h +++ b/boards/same54-xpro/include/eui_provider_params.h @@ -27,10 +27,8 @@ extern "C" { /** * @brief AT24Mac provides a EUI-48 */ -static inline int _at24mac_get_eui48(const void *arg, eui48_t *addr, uint8_t index) +static inline int _at24mac_get_eui48(uint8_t index, eui48_t *addr) { - (void) arg; - return at24mac_get_eui48(index, addr); } diff --git a/boards/samr21-xpro/include/eui_provider_params.h b/boards/samr21-xpro/include/eui_provider_params.h index dce5328686..8309c0acf2 100644 --- a/boards/samr21-xpro/include/eui_provider_params.h +++ b/boards/samr21-xpro/include/eui_provider_params.h @@ -27,9 +27,8 @@ 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, uint8_t index) +static inline int _edbg_get_eui64(uint8_t index, eui64_t *addr) { - (void) arg; (void) index; /* EDBG can take a while to respond on cold boot */ diff --git a/sys/include/net/eui_provider.h b/sys/include/net/eui_provider.h index 4c99db72d5..44f46a2d9d 100644 --- a/sys/include/net/eui_provider.h +++ b/sys/include/net/eui_provider.h @@ -106,35 +106,32 @@ extern "C" { /** * @brief Function for providing a EUI-48 to a device * - * @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 + * @param[out] addr Destination pointer for the EUI-48 address * * @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, uint8_t index); +typedef int (*netdev_get_eui48_cb_t)(uint8_t index, eui48_t *addr); /** * @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 + * @param[out] addr Destination pointer for the EUI-64 address * * @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, uint8_t index); +typedef int (*netdev_get_eui64_cb_t)(uint8_t index, eui64_t *addr); /** * @brief Structure to hold providers for EUI-48 addresses */ typedef struct { netdev_get_eui48_cb_t provider; /**< function to provide an EUI-48 */ - const void *arg; /**< argument to the provider function */ netdev_type_t type; /**< device type to match or `NETDEV_ANY` */ uint8_t index; /**< device index to match or `NETDEV_INDEX_ANY` */ } eui48_conf_t; @@ -144,7 +141,6 @@ typedef struct { */ typedef struct { netdev_get_eui64_cb_t provider; /**< function to provide an EUI-64 */ - const void *arg; /**< argument to the provider function */ netdev_type_t type; /**< device type to match or `NETDEV_ANY` */ uint8_t index; /**< device index to match or `NETDEV_INDEX_ANY` */ } eui64_conf_t; diff --git a/sys/net/link_layer/eui_provider/eui_provider.c b/sys/net/link_layer/eui_provider/eui_provider.c index d99475ab0f..54e348ff11 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, i) == 0) { + if (eui48_conf[i].provider(i, addr) == 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, i) == 0) { + if (eui64_conf[i].provider(i, addr) == 0) { return; } } diff --git a/sys/net/link_layer/eui_provider/include/eui48_provider_params.h b/sys/net/link_layer/eui_provider/include/eui48_provider_params.h index a7dd76d8d1..fc1bc946c2 100644 --- a/sys/net/link_layer/eui_provider/include/eui48_provider_params.h +++ b/sys/net/link_layer/eui_provider/include/eui48_provider_params.h @@ -40,13 +40,6 @@ extern "C" { #endif #endif -/** - * @brief Optional function argument to `netdev_get_eui48_cb_t` - */ -#ifndef EUI48_PROVIDER_ARG -#define EUI48_PROVIDER_ARG NULL -#endif - /** * @brief Driver type to match with EUI-48 provider */ @@ -68,7 +61,6 @@ extern "C" { #ifndef EUI48_PROVIDER_PARAMS #define EUI48_PROVIDER_PARAMS { \ .provider = EUI48_PROVIDER_FUNC, \ - .arg = EUI48_PROVIDER_ARG, \ .type = EUI48_PROVIDER_TYPE, \ .index = EUI48_PROVIDER_INDEX, \ }, diff --git a/sys/net/link_layer/eui_provider/include/eui64_provider_params.h b/sys/net/link_layer/eui_provider/include/eui64_provider_params.h index bd630cb2fa..d685694758 100644 --- a/sys/net/link_layer/eui_provider/include/eui64_provider_params.h +++ b/sys/net/link_layer/eui_provider/include/eui64_provider_params.h @@ -40,13 +40,6 @@ extern "C" { #endif #endif -/** - * @brief Optional function argument to `netdev_get_eui64_cb_t` - */ -#ifndef EUI64_PROVIDER_ARG -#define EUI64_PROVIDER_ARG NULL -#endif - /** * @brief Driver type to match with EUI-64 provider */ @@ -68,7 +61,6 @@ extern "C" { #ifndef EUI64_PROVIDER_PARAMS #define EUI64_PROVIDER_PARAMS { \ .provider = EUI64_PROVIDER_FUNC, \ - .arg = EUI64_PROVIDER_ARG, \ .type = EUI64_PROVIDER_TYPE, \ .index = EUI64_PROVIDER_INDEX, \ },