mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
gnrc_netif: remove deprecated CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR
This commit is contained in:
parent
4b3308cdef
commit
5c75f84d6e
@ -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\"
|
||||
|
@ -1 +0,0 @@
|
||||
CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR=y
|
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user