1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #20515 from miri64/gnrc_netif/cleanup/rm-CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR

gnrc_netif: remove deprecated CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR
This commit is contained in:
Martine Lenders 2024-03-28 08:32:09 +00:00 committed by GitHub
commit 6c46d26796
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 34 additions and 79 deletions

View File

@ -47,15 +47,6 @@ include $(RIOTBASE)/Makefile.include
# Check if being configured via Kconfig
ifndef CONFIG_KCONFIG_USEMODULE_LORAWAN
# Tell GNRC to encode LoRaWAN port in the GNRC netif header.
# This allows us to use `gnrc_txtsnd` to send data from the shell using the
# `txtsnd` command.
#
# Note: From Release 22.01 all GNRC LoRaWAN packets will include the netif
# header. Therefore this flag will be removed after that
CFLAGS += -DCONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR
CFLAGS += -DCONFIG_LORAMAC_APP_KEY_DEFAULT=\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"
CFLAGS += -DCONFIG_LORAMAC_NWK_KEY_DEFAULT=\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"
CFLAGS += -DCONFIG_LORAMAC_APP_EUI_DEFAULT=\"BBBBBBBBBBBBBBBB\"

View File

@ -1 +0,0 @@
CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR=y

View File

@ -4,6 +4,7 @@ DEPRECATED_MODULES += gnrc_gomach
DEPRECATED_MODULES += gnrc_lwmac
DEPRECATED_MODULES += gnrc_mac
DEPRECATED_MODULES += gnrc_nettype_gomach
DEPRECATED_MODULES += gnrc_nettype_lorawan
DEPRECATED_MODULES += gnrc_nettype_lwmac
DEPRECATED_MODULES += sema_deprecated
DEPRECATED_MODULES += ztimer_now64

View File

@ -156,6 +156,10 @@ PSEUDOMODULES += gnrc_nettype_ipv6_ext
## @defgroup net_gnrc_nettype_lorawan gnrc_nettype_lorawan
## Enables @ref GNRC_NETTYPE_LORAWAN
##
## @deprecated LoRaWAN payloads do not have a special type anymore and just use
## @ref GNRC_NETTYPE_UNDEF. There is no module needed for that.
## This module will be removed after 2024.10 release.
## @{
PSEUDOMODULES += gnrc_nettype_lorawan
## @}

View File

@ -31,21 +31,6 @@ extern "C" {
*/
#define GNRC_NETIF_LORAWAN_FLAGS_LINK_CHECK (0x1U)
/**
* @brief Encode LoRaWAN port in GNRC netif header.
*
* When set, GNRC netif will interpret the destination address of the
* GNRC netif header as the LoRaWAN port. For downlinks, a GNRC netif header
* with the received port in destination field will be included in the
* first snip.
*
* @deprecated From Release 2021.10 all GNRC LoRaWAN packets will include
* the GNRC Netif header. Therefore this parameter will be removed
*/
#if defined(DOXYGEN)
#define CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR
#endif
/**
* @brief GNRC LoRaWAN interface descriptor
*/

View File

@ -91,7 +91,12 @@ typedef enum {
#endif
#if IS_USED(MODULE_GNRC_NETTYPE_LORAWAN) || defined(DOXYGEN)
GNRC_NETTYPE_LORAWAN, /**< Protocol is LoRaWAN */
/**
* @brief Protocol is LoRaWAN
* @deprecated LoRaWAN payloads do not have a special type anymore and just use
* @ref GNRC_NETTYPE_UNDEF. Will be removed after 2024.10 release.
*/
#define GNRC_NETTYPE_LORAWAN GNRC_NETTYPE_UNDEF
#endif
/**

View File

@ -155,7 +155,6 @@ ifneq (,$(filter gnrc_netif,$(USEMODULE)))
endif
ifneq (,$(filter gnrc_lorawan,$(USEMODULE)))
USEMODULE += gnrc_netif_lorawan
USEMODULE += gnrc_nettype_lorawan
endif
endif

View File

@ -44,18 +44,6 @@ config GNRC_NETIF_NONSTANDARD_6LO_MTU
This is non compliant with RFC 4944 and RFC 7668 and might not be
supported by other implementations.
config GNRC_NETIF_LORAWAN_NETIF_HDR
bool "Encode LoRaWAN port in GNRC netif header"
depends on USEMODULE_GNRC_LORAWAN
help
When set, GNRC Netif will interpret
the destination address of the GNRC netif header as
the LoRaWAN port. For downlinks, a GNRC netif header
with the received port in destination field will be
included in the first snip. From Release 2021.10 all
GNRC LoRaWAN packets will include the GNRC Netif
header. Therefore this parameter will be removed
config GNRC_NETIF_IPV6_BR_AUTO_6CTX
bool "Automatically add 6LoWPAN compression at border router"
default y

View File

@ -123,12 +123,8 @@ static inline void _set_be_addr(gnrc_lorawan_t *mac, uint8_t *be_addr)
void gnrc_lorawan_mcps_indication(gnrc_lorawan_t *mac, mcps_indication_t *ind)
{
gnrc_netif_t *netif = container_of(mac, gnrc_netif_t, lorawan.mac);
gnrc_nettype_t nettype = IS_ACTIVE(CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR)
? GNRC_NETTYPE_UNDEF
: GNRC_NETTYPE_LORAWAN;
uint32_t demux = IS_ACTIVE(CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR)
? GNRC_NETREG_DEMUX_CTX_ALL
: ind->data.port;
gnrc_nettype_t nettype = GNRC_NETTYPE_UNDEF;
uint32_t demux = GNRC_NETREG_DEMUX_CTX_ALL;
assert(ind->data.port >= LORAMAC_PORT_MIN && ind->data.port <= LORAMAC_PORT_MAX);
@ -141,20 +137,18 @@ void gnrc_lorawan_mcps_indication(gnrc_lorawan_t *mac, mcps_indication_t *ind)
return;
}
if (IS_ACTIVE(CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR)) {
gnrc_pktsnip_t *netif_snip = gnrc_netif_hdr_build(NULL, 0,
&ind->data.port,
sizeof(ind->data.port));
if (netif_snip == NULL) {
DEBUG("gnrc_lorawan_netif: no space left in packet buffer\n");
goto release;
}
gnrc_netif_hdr_t *hdr = netif_snip->data;
gnrc_netif_hdr_set_netif(hdr, netif);
pkt = gnrc_pkt_append(pkt, netif_snip);
gnrc_pktsnip_t *netif_snip = gnrc_netif_hdr_build(NULL, 0,
&ind->data.port,
sizeof(ind->data.port));
if (netif_snip == NULL) {
DEBUG("gnrc_lorawan_netif: no space left in packet buffer\n");
goto release;
}
gnrc_netif_hdr_t *hdr = netif_snip->data;
gnrc_netif_hdr_set_netif(hdr, netif);
pkt = gnrc_pkt_append(pkt, netif_snip);
if (!gnrc_netapi_dispatch_receive(nettype, demux, pkt)) {
DEBUG("gnrc_lorawan_netif: unable to forward packet\n");
goto release;
@ -363,6 +357,8 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *payload)
{
gnrc_netif_hdr_t *netif_hdr;
const uint8_t *dst;
mlme_request_t mlme_request;
mlme_confirm_t mlme_confirm;
@ -371,26 +367,18 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *payload)
assert(payload);
if (IS_ACTIVE(CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR)) {
gnrc_netif_hdr_t *netif_hdr;
const uint8_t *dst;
netif_hdr = payload->data;
dst = gnrc_netif_hdr_get_dst_addr(netif_hdr);
netif_hdr = payload->data;
dst = gnrc_netif_hdr_get_dst_addr(netif_hdr);
assert(payload->type == GNRC_NETTYPE_NETIF);
port = dst[0];
if (netif_hdr->dst_l2addr_len != sizeof(port)) {
goto end;
}
/* Remove the netif hdr snip and point to the MSDU */
payload = gnrc_pktbuf_remove_snip(payload, payload);
assert(payload->type == GNRC_NETTYPE_NETIF);
port = dst[0];
if (netif_hdr->dst_l2addr_len != sizeof(port)) {
goto end;
}
else {
port = netif->lorawan.port;
}
/* Remove the netif hdr snip and point to the MSDU */
payload = gnrc_pktbuf_remove_snip(payload, payload);
if (netif->lorawan.flags & GNRC_NETIF_LORAWAN_FLAGS_LINK_CHECK) {
mlme_request.type = MLME_LINK_CHECK;

View File

@ -70,11 +70,6 @@ static void _dump_snip(gnrc_pktsnip_t *pkt)
}
break;
#endif /* IS_USED(MODULE_GNRC_NETTYPE_SIXLOWPAN) */
#if IS_USED(MODULE_GNRC_NETTYPE_LORAWAN)
case GNRC_NETTYPE_LORAWAN:
printf("NETTYPE_LORAWAN (%i)\n", pkt->type);
break;
#endif /* IS_USED(MODULE_GNRC_NETTYPE_LORAWAN) */
#if IS_USED(MODULE_GNRC_NETTYPE_IPV6)
case GNRC_NETTYPE_IPV6:
printf("NETTYPE_IPV6 (%i)\n", pkt->type);