gnrc_netif2: add IEEE 802.15.4 support#7409
Conversation
763d0b5 to
3f26117
Compare
3f26117 to
eab9e4d
Compare
eab9e4d to
c73b6d7
Compare
|
Rebased to current master and current dependencies |
91c1c27 to
fbadffe
Compare
|
(also adapted for changes in #7370) |
63b9000 to
d3a314a
Compare
|
Rebased to and adapted for changes in master and dependencies |
d3a314a to
a190862
Compare
|
Rebased to current master, no longer waiting for other PR |
|
I couldn't find anything comment worthy here. Changes between the old |
|
@kaspar030 made some comments about my usage of |
| if ((dst_len < 0) || (src_len < 0)) { | ||
| DEBUG("_make_netif_hdr: unable to get addresses\n"); | ||
| return NULL; | ||
| } |
There was a problem hiding this comment.
Is there a valid reason this should happen at runtime or could we go with an assert here?
There was a problem hiding this comment.
Sure, if the address mode field in the network received mhr is of an unexpected value (not 2 or 3) the functions above return a negative value.
| size_t n, src_len, dst_len; | ||
| uint8_t mhr[IEEE802154_MAX_HDR_LEN]; | ||
| uint8_t flags = (uint8_t)(state->flags & NETDEV_IEEE802154_SEND_MASK); | ||
| le_uint16_t dev_pan = byteorder_btols(byteorder_htons(state->pan)); |
There was a problem hiding this comment.
What's the idea behind this double-swap?
There was a problem hiding this comment.
Getting it from host byte order to definitely little-endian (ideally it is optimized to 0-1 swaps).
| if (pkt == NULL) { | ||
| DEBUG("_send_ieee802154: pkt was NULL\n"); | ||
| return -EINVAL; | ||
| } |
There was a problem hiding this comment.
The other (and gnrc_netdev equivalents) don't do that as well, so there might be a reason to not do it.
| } | ||
| netif_hdr = pkt->data; | ||
| /* prepare destination address */ | ||
| if (netif_hdr->flags & /* If any of these flags is set so this is correct */ |
There was a problem hiding this comment.
I don't understand the comment.
miri64
left a comment
There was a problem hiding this comment.
(Not an excuse, but) most of this was just copy-pasta'd from the already reviewed gnrc_netdev's IEEE 802.15.4 glue-code
| if ((dst_len < 0) || (src_len < 0)) { | ||
| DEBUG("_make_netif_hdr: unable to get addresses\n"); | ||
| return NULL; | ||
| } |
There was a problem hiding this comment.
Sure, if the address mode field in the network received mhr is of an unexpected value (not 2 or 3) the functions above return a negative value.
| size_t n, src_len, dst_len; | ||
| uint8_t mhr[IEEE802154_MAX_HDR_LEN]; | ||
| uint8_t flags = (uint8_t)(state->flags & NETDEV_IEEE802154_SEND_MASK); | ||
| le_uint16_t dev_pan = byteorder_btols(byteorder_htons(state->pan)); |
There was a problem hiding this comment.
Getting it from host byte order to definitely little-endian (ideally it is optimized to 0-1 swaps).
| if (pkt == NULL) { | ||
| DEBUG("_send_ieee802154: pkt was NULL\n"); | ||
| return -EINVAL; | ||
| } |
There was a problem hiding this comment.
The other (and gnrc_netdev equivalents) don't do that as well, so there might be a reason to not do it.
| } | ||
| netif_hdr = pkt->data; | ||
| /* prepare destination address */ | ||
| if (netif_hdr->flags & /* If any of these flags is set so this is correct */ |
6e97db1 to
9f9737d
Compare
|
ACK & GO |
IEEE 802.15.4 support for
gnrc_netif2.Requires #7370.This PR is part of the network layer remodelling effort:
