drivers/at86rf2xx: isolate netdev logic#18988
Conversation
19dcb76 to
a544b98
Compare
|
This PR is technically an API change, because I removed several functions (getters, |
a544b98 to
f34695f
Compare
83f27d0 to
fa61430
Compare
benpicco
left a comment
There was a problem hiding this comment.
Just moves code around, solid cleanup.
Some small comments:
drivers/at86rf2xx/at86rf2xx_getset.c
Outdated
| @@ -363,7 +363,6 @@ void at86rf2xx_set_option(at86rf2xx_t *dev, uint16_t option, bool state) | |||
| DEBUG("[at86rf2xx] opt: enabling CSMA mode" \ | |||
| "(4 retries, min BE: 3 max BE: 5)\n"); | |||
| /* Initialize CSMA seed with hardware address */ | |||
There was a problem hiding this comment.
The comment needs to be moved too
| #ifdef MODULE_SIXLOWPAN | ||
| /* https://tools.ietf.org/html/rfc4944#section-12 requires the first bit to | ||
| * 0 for unicast addresses */ | ||
| dev->netdev.short_addr[0] &= 0x7F; |
There was a problem hiding this comment.
netdev_eui64_get() should already take care of this
There was a problem hiding this comment.
Alright, if you are getting rid of this anyway you might as well keep it.
| netdev_ieee802154_reset(&dev->netdev); | ||
| /* set short and long address */ | ||
| at86rf2xx_set_addr_long(dev, (eui64_t *)dev->netdev.long_addr); | ||
| at86rf2xx_set_addr_short(dev, (network_uint16_t *)dev->netdev.short_addr); | ||
|
|
||
| if (!IS_ACTIVE(AT86RF2XX_BASIC_MODE)) { | ||
| static const netopt_enable_t enable = NETOPT_ENABLE; | ||
| netdev_ieee802154_set(&dev->netdev, NETOPT_ACK_REQ, | ||
| &enable, sizeof(enable)); | ||
| } | ||
| at86rf2xx_reset(dev); |
There was a problem hiding this comment.
maybe just call _init() here (btw: is NETOPT_STATE_RESET even used by anything?)
There was a problem hiding this comment.
Well if it goes away anyway no need to bother with it.
a4ca5eb to
1d60301
Compare
Contribution description
This PR isolates the netdev logic, in order to facilitate the replacement with the Radio HAL interface.
There's still more cleanup to be done, but I think this is the bare minimum to write the Radio HAL port. We can later continue with optimizations.
Testing procedure
AT86RF2xx devices should still work as expected.
Issues/PRs references
#18967