Skip to content
Snippets Groups Projects
Unverified Commit 90ad1a07 authored by Koen Zandberg's avatar Koen Zandberg
Browse files

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
parent 3c032e56
No related branches found
No related tags found
No related merge requests found
......@@ -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),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment