From 14a2f6bc18743d40bb1050223044fa8bb33dbcdf Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Tue, 27 Nov 2018 20:53:11 +0100 Subject: [PATCH] gnrc: use gnrc_netif_default_init() for all implementations --- cpu/esp_common/esp-now/esp_now_gnrc.c | 1 + cpu/nrf5x_common/radio/nrfmin/nrfmin_gnrc.c | 1 + drivers/cc1xxx_common/gnrc_netif_cc1xxx.c | 1 + drivers/xbee/gnrc_xbee.c | 1 + pkg/nimble/netif/nimble_netif.c | 1 + pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c | 2 +- sys/net/gnrc/link_layer/gomach/gomach.c | 1 + sys/net/gnrc/link_layer/lwmac/lwmac.c | 1 + sys/net/gnrc/netif/ethernet/gnrc_netif_ethernet.c | 1 + sys/net/gnrc/netif/gnrc_netif.c | 1 - sys/net/gnrc/netif/gnrc_netif_raw.c | 1 + sys/net/gnrc/netif/ieee802154/gnrc_netif_ieee802154.c | 1 + tests/gnrc_ndp/main.c | 1 + tests/gnrc_netif/main.c | 1 + 14 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cpu/esp_common/esp-now/esp_now_gnrc.c b/cpu/esp_common/esp-now/esp_now_gnrc.c index 8c40bbfb5a..ce8ff50933 100644 --- a/cpu/esp_common/esp-now/esp_now_gnrc.c +++ b/cpu/esp_common/esp-now/esp_now_gnrc.c @@ -192,6 +192,7 @@ err: } static const gnrc_netif_ops_t _esp_now_ops = { + .init = gnrc_netif_default_init, .send = _send, .recv = _recv, .get = gnrc_netif_get_from_netdev, diff --git a/cpu/nrf5x_common/radio/nrfmin/nrfmin_gnrc.c b/cpu/nrf5x_common/radio/nrfmin/nrfmin_gnrc.c index dc0cdc4e75..dedff9abf8 100644 --- a/cpu/nrf5x_common/radio/nrfmin/nrfmin_gnrc.c +++ b/cpu/nrf5x_common/radio/nrfmin/nrfmin_gnrc.c @@ -173,6 +173,7 @@ static gnrc_pktsnip_t *gnrc_nrfmin_recv(gnrc_netif_t *dev) } static const gnrc_netif_ops_t gnrc_nrfmin_ops = { + .init = gnrc_netif_default_init, .send = gnrc_nrfmin_send, .recv = gnrc_nrfmin_recv, .get = gnrc_netif_get_from_netdev, diff --git a/drivers/cc1xxx_common/gnrc_netif_cc1xxx.c b/drivers/cc1xxx_common/gnrc_netif_cc1xxx.c index 0c4498427e..25bcba2d24 100644 --- a/drivers/cc1xxx_common/gnrc_netif_cc1xxx.c +++ b/drivers/cc1xxx_common/gnrc_netif_cc1xxx.c @@ -159,6 +159,7 @@ static int cc1xxx_adpt_send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt) } static const gnrc_netif_ops_t cc1xxx_netif_ops = { + .init = gnrc_netif_default_init, .send = cc1xxx_adpt_send, .recv = cc1xxx_adpt_recv, .get = gnrc_netif_get_from_netdev, diff --git a/drivers/xbee/gnrc_xbee.c b/drivers/xbee/gnrc_xbee.c index c3df55d24d..04365ee072 100644 --- a/drivers/xbee/gnrc_xbee.c +++ b/drivers/xbee/gnrc_xbee.c @@ -160,6 +160,7 @@ static int xbee_adpt_send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt) } static const gnrc_netif_ops_t _xbee_ops = { + .init = gnrc_netif_default_init, .send = xbee_adpt_send, .recv = xbee_adpt_recv, .get = gnrc_netif_get_from_netdev, diff --git a/pkg/nimble/netif/nimble_netif.c b/pkg/nimble/netif/nimble_netif.c index 07baf2d4cc..f70e074d0e 100644 --- a/pkg/nimble/netif/nimble_netif.c +++ b/pkg/nimble/netif/nimble_netif.c @@ -90,6 +90,7 @@ static void _netif_init(gnrc_netif_t *netif) { (void)netif; + gnrc_netif_default_init(netif); /* save the threads context pointer, so we can set its flags */ _netif_thread = (thread_t *)thread_get(thread_getpid()); diff --git a/pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c b/pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c index 5fdd1d0718..4c56d1c186 100644 --- a/pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c +++ b/pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c @@ -258,7 +258,7 @@ static void _netif_msg_handler(gnrc_netif_t *netif, msg_t *msg) } static const gnrc_netif_ops_t _ble_ops = { - .init = NULL, + .init = gnrc_netif_default_init, .send = _netif_send, .recv = _netif_recv, .get = gnrc_netif_get_from_netdev, diff --git a/sys/net/gnrc/link_layer/gomach/gomach.c b/sys/net/gnrc/link_layer/gomach/gomach.c index c87282477f..b0cdebfedf 100644 --- a/sys/net/gnrc/link_layer/gomach/gomach.c +++ b/sys/net/gnrc/link_layer/gomach/gomach.c @@ -2108,6 +2108,7 @@ static void _gomach_init(gnrc_netif_t *netif) { netdev_t *dev; + gnrc_netif_default_init(netif); dev = netif->dev; dev->event_callback = _gomach_event_cb; diff --git a/sys/net/gnrc/link_layer/lwmac/lwmac.c b/sys/net/gnrc/link_layer/lwmac/lwmac.c index f9cf821edc..1e7216f260 100644 --- a/sys/net/gnrc/link_layer/lwmac/lwmac.c +++ b/sys/net/gnrc/link_layer/lwmac/lwmac.c @@ -901,6 +901,7 @@ static void _lwmac_init(gnrc_netif_t *netif) { netdev_t *dev; + gnrc_netif_default_init(netif); dev = netif->dev; dev->event_callback = _lwmac_event_cb; diff --git a/sys/net/gnrc/netif/ethernet/gnrc_netif_ethernet.c b/sys/net/gnrc/netif/ethernet/gnrc_netif_ethernet.c index 8517cc1d6b..908e8d1614 100644 --- a/sys/net/gnrc/netif/ethernet/gnrc_netif_ethernet.c +++ b/sys/net/gnrc/netif/ethernet/gnrc_netif_ethernet.c @@ -37,6 +37,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif); static char addr_str[ETHERNET_ADDR_LEN * 3]; static const gnrc_netif_ops_t ethernet_ops = { + .init = gnrc_netif_default_init, .send = _send, .recv = _recv, .get = gnrc_netif_get_from_netdev, diff --git a/sys/net/gnrc/netif/gnrc_netif.c b/sys/net/gnrc/netif/gnrc_netif.c index 617a5cbecf..186908d7a7 100644 --- a/sys/net/gnrc/netif/gnrc_netif.c +++ b/sys/net/gnrc/netif/gnrc_netif.c @@ -1361,7 +1361,6 @@ static void *_gnrc_netif_thread(void *args) _test_options(netif); #endif netif->cur_hl = GNRC_NETIF_DEFAULT_HL; - gnrc_netif_default_init(netif); if (netif->ops->init) { netif->ops->init(netif); } diff --git a/sys/net/gnrc/netif/gnrc_netif_raw.c b/sys/net/gnrc/netif/gnrc_netif_raw.c index 886c00731e..84ae3eb678 100644 --- a/sys/net/gnrc/netif/gnrc_netif_raw.c +++ b/sys/net/gnrc/netif/gnrc_netif_raw.c @@ -28,6 +28,7 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt); static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif); static const gnrc_netif_ops_t raw_ops = { + .init = gnrc_netif_default_init, .send = _send, .recv = _recv, .get = gnrc_netif_get_from_netdev, diff --git a/sys/net/gnrc/netif/ieee802154/gnrc_netif_ieee802154.c b/sys/net/gnrc/netif/ieee802154/gnrc_netif_ieee802154.c index 374ab6b979..ad15ec080a 100644 --- a/sys/net/gnrc/netif/ieee802154/gnrc_netif_ieee802154.c +++ b/sys/net/gnrc/netif/ieee802154/gnrc_netif_ieee802154.c @@ -32,6 +32,7 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt); static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif); static const gnrc_netif_ops_t ieee802154_ops = { + .init = gnrc_netif_default_init, .send = _send, .recv = _recv, .get = gnrc_netif_get_from_netdev, diff --git a/tests/gnrc_ndp/main.c b/tests/gnrc_ndp/main.c index fa2df65569..363f54290e 100644 --- a/tests/gnrc_ndp/main.c +++ b/tests/gnrc_ndp/main.c @@ -1221,6 +1221,7 @@ static int _test_netif_set(gnrc_netif_t *netif, const gnrc_netapi_opt_t *opt) } static const gnrc_netif_ops_t _test_netif_ops = { + .init = gnrc_netif_default_init, .send = _test_netif_send, .recv = _test_netif_recv, .get = gnrc_netif_get_from_netdev, diff --git a/tests/gnrc_netif/main.c b/tests/gnrc_netif/main.c index 7020c0b9ab..2b55d1bac8 100644 --- a/tests/gnrc_netif/main.c +++ b/tests/gnrc_netif/main.c @@ -106,6 +106,7 @@ static void _set_up(void) static inline void _test_init(gnrc_netif_t *netif) { (void)netif; + gnrc_netif_default_init(netif); init_called = true; }