From 78fc1e76544a1255d8e4d762c8a39f45defd87a2 Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Thu, 25 Jun 2020 10:51:05 +0200 Subject: [PATCH 1/8] nrfmin: remove NETOPT_IPV6_IID support This option is handled in the `gnrc_netif`-layer without any access to the driver's option since 7ae90564d91284dd5be63e89e4be1b4c6e8cfdef. --- cpu/nrf5x_common/radio/nrfmin/nrfmin.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/cpu/nrf5x_common/radio/nrfmin/nrfmin.c b/cpu/nrf5x_common/radio/nrfmin/nrfmin.c index de492eeb15..9dcb7d9f0c 100644 --- a/cpu/nrf5x_common/radio/nrfmin/nrfmin.c +++ b/cpu/nrf5x_common/radio/nrfmin/nrfmin.c @@ -187,14 +187,6 @@ uint16_t nrfmin_get_addr(void) return my_addr; } -void nrfmin_get_iid(uint16_t *iid) -{ - iid[0] = 0; - iid[1] = 0xff00; - iid[2] = 0x00fe; - iid[3] = my_addr; -} - uint16_t nrfmin_get_channel(void) { return (uint16_t)(NRF_RADIO->FREQUENCY >> 2); @@ -506,10 +498,6 @@ static int nrfmin_get(netdev_t *dev, netopt_t opt, void *val, size_t max_len) assert(max_len >= sizeof(uint16_t)); *((uint16_t *)val) = NETDEV_TYPE_NRFMIN; return sizeof(uint16_t); - case NETOPT_IPV6_IID: - assert(max_len >= sizeof(uint64_t)); - nrfmin_get_iid((uint16_t *)val); - return sizeof(uint64_t); default: return -ENOTSUP; } From 4c01c716fc51eb83432e87a80e03b2889c1cecf9 Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Thu, 25 Jun 2020 10:55:22 +0200 Subject: [PATCH 2/8] cc110x: remove NETOPT_IPV6_IID support This option is handled in the `gnrc_netif`-layer without any access to the driver's option since 7ae90564d91284dd5be63e89e4be1b4c6e8cfdef. --- drivers/cc110x/cc110x_netdev.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/drivers/cc110x/cc110x_netdev.c b/drivers/cc110x/cc110x_netdev.c index b42716482b..9d42a48d81 100644 --- a/drivers/cc110x/cc110x_netdev.c +++ b/drivers/cc110x/cc110x_netdev.c @@ -505,26 +505,6 @@ static int cc110x_send(netdev_t *netdev, const iolist_t *iolist) return (int)size; } -/** - * @brief Generate an IPv6 interface identifier for a CC110X transceiver - * - * @param dev Transceiver to create the IPv6 interface identifier (IID) - * @param iid Store the generated IID here - * - * @return Returns the size of @ref eui64_t to confirm with the API - * in @ref netdev_driver_t::get - */ -static int cc110x_get_iid(cc110x_t *dev, eui64_t *iid) -{ - static const eui64_t empty_iid = { - .uint8 = { 0x00, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x00 } - }; - - *iid = empty_iid; - iid->uint8[7] = dev->addr; - return sizeof(eui64_t); -} - /** * @brief Checks if the CC110x's address filter is disabled * @param dev Transceiver to check if in promiscuous mode @@ -551,6 +531,7 @@ static int cc110x_get(netdev_t *netdev, netopt_t opt, { cc110x_t *dev = (cc110x_t *)netdev; + (void)max_len; /* only used in assert() */ switch (opt) { case NETOPT_DEVICE_TYPE: assert(max_len == sizeof(uint16_t)); @@ -574,11 +555,6 @@ static int cc110x_get(netdev_t *netdev, netopt_t opt, assert(max_len >= CC1XXX_ADDR_SIZE); *((uint8_t *)val) = dev->addr; return CC1XXX_ADDR_SIZE; - case NETOPT_IPV6_IID: - if (max_len < sizeof(eui64_t)) { - return -EOVERFLOW; - } - return cc110x_get_iid(dev, val); case NETOPT_CHANNEL: assert(max_len == sizeof(uint16_t)); *((uint16_t *)val) = dev->channel; From 3a60a786060cab05c81f48c758110fc764e2a111 Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Thu, 25 Jun 2020 10:55:49 +0200 Subject: [PATCH 3/8] netdev_eth: remove NETOPT_IPV6_IID support This option is handled in the `gnrc_netif`-layer without any access to the driver's option since 7ae90564d91284dd5be63e89e4be1b4c6e8cfdef. --- drivers/netdev_eth/netdev_eth.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/netdev_eth/netdev_eth.c b/drivers/netdev_eth/netdev_eth.c index 9bdbefad5b..de0e9d1bd5 100644 --- a/drivers/netdev_eth/netdev_eth.c +++ b/drivers/netdev_eth/netdev_eth.c @@ -29,23 +29,14 @@ #define ENABLE_DEBUG (0) #include "debug.h" -static int _get_iid(netdev_t *netdev, eui64_t *value, size_t max_len) -{ - if (max_len < sizeof(eui64_t)) { - return -EOVERFLOW; - } - - eui48_t mac; - netdev->driver->get(netdev, NETOPT_ADDRESS, mac.uint8, sizeof(eui48_t)); - eui48_to_ipv6_iid(value, &mac); - - return sizeof(eui64_t); -} - int netdev_eth_get(netdev_t *dev, netopt_t opt, void *value, size_t max_len) { int res = 0; +#ifndef MODULE_L2FILTER + (void)dev; +#endif + (void)max_len; /* only used in assert() */ switch (opt) { case NETOPT_DEVICE_TYPE: { @@ -76,10 +67,6 @@ int netdev_eth_get(netdev_t *dev, netopt_t opt, void *value, size_t max_len) res = 1; break; } - case NETOPT_IPV6_IID: - { - return _get_iid(dev, value, max_len); - } #ifdef MODULE_L2FILTER case NETOPT_L2FILTER: { From 7777c172dd4aeaa554748e9cc9065fcf2017f22a Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Thu, 25 Jun 2020 10:56:14 +0200 Subject: [PATCH 4/8] netdev_ieee802154: remove NETOPT_IPV6_IID support This option is handled in the `gnrc_netif`-layer without any access to the driver's option since 7ae90564d91284dd5be63e89e4be1b4c6e8cfdef. --- drivers/netdev_ieee802154/netdev_ieee802154.c | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/drivers/netdev_ieee802154/netdev_ieee802154.c b/drivers/netdev_ieee802154/netdev_ieee802154.c index 3a973a1a6c..eb16d7b74c 100644 --- a/drivers/netdev_ieee802154/netdev_ieee802154.c +++ b/drivers/netdev_ieee802154/netdev_ieee802154.c @@ -29,30 +29,6 @@ #define ENABLE_DEBUG (0) #include "debug.h" -static int _get_iid(netdev_ieee802154_t *dev, eui64_t *value, size_t max_len) -{ - (void)max_len; - - uint8_t addr[IEEE802154_LONG_ADDRESS_LEN]; - uint16_t addr_len; - - assert(max_len >= sizeof(eui64_t)); - - dev->netdev.driver->get(&dev->netdev, NETOPT_SRC_LEN, &addr_len, - sizeof(addr_len)); - if (addr_len == IEEE802154_LONG_ADDRESS_LEN) { - dev->netdev.driver->get(&dev->netdev, NETOPT_ADDRESS_LONG, addr, - addr_len); - } - else { - dev->netdev.driver->get(&dev->netdev, NETOPT_ADDRESS, addr, - addr_len); - } - ieee802154_get_iid(value, addr, addr_len); - - return sizeof(eui64_t); -} - void netdev_ieee802154_reset(netdev_ieee802154_t *dev) { /* Only the least significant byte of the random value is used */ @@ -106,6 +82,7 @@ int netdev_ieee802154_get(netdev_ieee802154_t *dev, netopt_t opt, void *value, { int res = -ENOTSUP; + (void)max_len; /* only used in assert() */ switch (opt) { case NETOPT_ADDRESS: assert(max_len >= sizeof(dev->short_addr)); @@ -170,9 +147,6 @@ int netdev_ieee802154_get(netdev_ieee802154_t *dev, netopt_t opt, void *value, *((uint16_t *)value) = NETDEV_TYPE_IEEE802154; res = sizeof(uint16_t); break; - case NETOPT_IPV6_IID: - res = _get_iid(dev, value, max_len); - break; #ifdef MODULE_L2FILTER case NETOPT_L2FILTER: assert(max_len >= sizeof(l2filter_t **)); From 14afbe1030d1723476278f1347476e968ac87697 Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Thu, 25 Jun 2020 13:41:20 +0200 Subject: [PATCH 5/8] xbee: remove NETOPT_IPV6_IID support This option is handled in the `gnrc_netif`-layer without any access to the driver's option since 7ae90564d91284dd5be63e89e4be1b4c6e8cfdef. --- drivers/xbee/xbee.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/xbee/xbee.c b/drivers/xbee/xbee.c index 88a3ecc345..7ef0dcc041 100644 --- a/drivers/xbee/xbee.c +++ b/drivers/xbee/xbee.c @@ -763,19 +763,6 @@ static int xbee_get(netdev_t *ndev, netopt_t opt, void *value, size_t max_len) assert(max_len == sizeof(uint16_t)); *((uint16_t *)value) = NETDEV_TYPE_IEEE802154; return sizeof(uint16_t); - case NETOPT_IPV6_IID: - if (max_len < sizeof(eui64_t)) { - return -EOVERFLOW; - } - if (dev->addr_flags & XBEE_ADDR_FLAGS_LONG) { - ieee802154_get_iid(value, dev->addr_long.uint8, - IEEE802154_LONG_ADDRESS_LEN); - } - else { - ieee802154_get_iid(value, dev->addr_short, - IEEE802154_SHORT_ADDRESS_LEN); - } - return sizeof(eui64_t); case NETOPT_CHANNEL: return _get_channel(dev, (uint8_t *)value, max_len); case NETOPT_MAX_PDU_SIZE: From 0035bf03bd8960eb8d9ff79e9f2eb7ad7c122178 Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Thu, 25 Jun 2020 10:58:56 +0200 Subject: [PATCH 6/8] pkg/nordic_softdevice_ble: remove NETOPT_IPV6_IID support This option is handled in the `gnrc_netif`-layer without any access to the driver's option since 7ae90564d91284dd5be63e89e4be1b4c6e8cfdef. --- pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c | 4 ---- 1 file changed, 4 deletions(-) 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 40cf5ffa92..9c1a44fdc7 100644 --- a/pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c +++ b/pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c @@ -221,10 +221,6 @@ static int _netdev_get(netdev_t *netdev, netopt_t opt, *((uint16_t *)value) = NETDEV_TYPE_BLE; res = sizeof(uint16_t); break; - case NETOPT_IPV6_IID: - eui48_to_ipv6_iid((eui64_t *)value, (eui48_t *)_ble_netif->l2addr); - res = sizeof(uint64_t); - break; default: break; } From 1399f6f2ffdec8d4cf11e0095af466ca9923baa8 Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Thu, 25 Jun 2020 10:59:38 +0200 Subject: [PATCH 7/8] tests/gnrc_ipv6_nib_6ln: remove NETOPT_IPV6_IID support in mock-device This option is handled in the `gnrc_netif`-layer without any access to the driver's option since 7ae90564d91284dd5be63e89e4be1b4c6e8cfdef. --- tests/gnrc_ipv6_nib_6ln/main.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/gnrc_ipv6_nib_6ln/main.c b/tests/gnrc_ipv6_nib_6ln/main.c index d1a6309f8b..b0c77805f2 100644 --- a/tests/gnrc_ipv6_nib_6ln/main.c +++ b/tests/gnrc_ipv6_nib_6ln/main.c @@ -1327,12 +1327,6 @@ int _mock_netif_get(gnrc_netapi_opt_t *opt) *val = sizeof(_loc_l2); return sizeof(uint16_t); } - case NETOPT_IPV6_IID: - if (opt->data_len < sizeof(_loc_iid)) { - return -EOVERFLOW; - } - memcpy(opt->data, _loc_iid, sizeof(_loc_iid)); - return sizeof(_loc_iid); case NETOPT_IS_WIRED: return 1; case NETOPT_MAX_PDU_SIZE: { From de74765c7b813316da33a5b0c0b120b28a88d435 Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Thu, 25 Jun 2020 11:17:59 +0200 Subject: [PATCH 8/8] netopt: transform NETOPT_IPV6_IID deprecation note to implementor note --- sys/include/net/netopt.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/include/net/netopt.h b/sys/include/net/netopt.h index f552f910da..0962f1d194 100644 --- a/sys/include/net/netopt.h +++ b/sys/include/net/netopt.h @@ -120,10 +120,9 @@ typedef enum { * RFC 4291, section 2.5.1 * * - * @deprecated Do not implement this in a network device. Other APIs - * utilizing [netopt](@ref net_netopt) may still implement it. - * Existing support of drivers will be dropped after the - * 2019.07 release. + * @note Do not implement this in a network device driver. Other APIs + * utilizing [netopt](@ref net_netopt) such as @ref net_gnrc_netif + * or @ref net_netif may still implement it. * * The generation of the interface identifier is dependent on the link-layer. * Please refer to the appropriate IPv6 over `` specification for