mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
gnrc_netif_ieee802154: remove state access in recv
This replaces the netif->state accesses in netif::recv with a netdev call and the new netif RAWMODE flag
This commit is contained in:
parent
3c032e5688
commit
90ad1a0782
@ -78,7 +78,6 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
|
||||
{
|
||||
netdev_t *dev = netif->dev;
|
||||
netdev_ieee802154_rx_info_t rx_info;
|
||||
netdev_ieee802154_t *state = (netdev_ieee802154_t *)netif->dev;
|
||||
gnrc_pktsnip_t *pkt = NULL;
|
||||
int bytes_expected = dev->driver->recv(dev, NULL, 0, NULL);
|
||||
|
||||
@ -97,7 +96,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
|
||||
gnrc_pktbuf_release(pkt);
|
||||
return NULL;
|
||||
}
|
||||
if (!(state->flags & NETDEV_IEEE802154_RAW)) {
|
||||
if (!(netif->flags & GNRC_NETIF_FLAGS_RAWMODE)) {
|
||||
gnrc_pktsnip_t *ieee802154_hdr, *netif_hdr;
|
||||
gnrc_netif_hdr_t *hdr;
|
||||
#if ENABLE_DEBUG
|
||||
@ -140,7 +139,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
|
||||
hdr->lqi = rx_info.lqi;
|
||||
hdr->rssi = rx_info.rssi;
|
||||
hdr->if_pid = thread_getpid();
|
||||
pkt->type = state->proto;
|
||||
dev->driver->get(dev, NETOPT_PROTO, &pkt->type, sizeof(pkt->type));
|
||||
#if ENABLE_DEBUG
|
||||
DEBUG("_recv_ieee802154: received packet from %s of length %u\n",
|
||||
gnrc_netif_addr_to_str(gnrc_netif_hdr_get_src_addr(hdr),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user