ieee802154/radio_hal: detach hal descriptor from driver#16534
ieee802154/radio_hal: detach hal descriptor from driver#16534benpicco merged 1 commit intoRIOT-OS:masterfrom
Conversation
483b6cf to
5598c11
Compare
|
Ping results between cc2538 and nrf802154: |
|
Looks like this needs a rebase |
5598c11 to
9a11540
Compare
9a11540 to
77c6599
Compare
|
I just rebased it. I will post the results again just to be sure |
|
ping results are the same: |
|
Just to state a design decision that was discuss in as IRL as we can get with Corona. Moving the |
|
Murdock is not happy |
77c6599 to
dd9e916
Compare
|
More test results after the last push: `tests/ieee802154_hal` between `remote-revb` and `nrf52840``tests/ieee802154_submac` between `remote-revb` and `nrf52840`OpenThread seems to be broken for one of these radios on master... So it also doesn't work here. I will investigate but I propose to leave it out of this PR. `tests/lwip` between `samr21-xpro` and `nrf52840`I also squashed all commits to one because as it was it was not possible to ensure it would compile in all cases. EDIT: The previous ping tests are still valid because I didn't touch any radio/submac files. |
321d699 to
2801ade
Compare
|
murdock says there are some problems with openwsn stuff,please look into that. |
2801ade to
ddc9c7c
Compare
|
it should work now |
|
Is |
|
There we go, murdock is passing. |
I posted the tests results in #16534 (comment). I changed the initialization. |
Contribution description
This PR re-arranges the Radio HAL descriptor to be allocated outside of the private descriptor of radios.
In our current scheme, we usually allocate the upper layer descritptor (netdev, hal, etc) inside the private descriptor of the driver.
Therefore we assume it's possible to cast the private descriptor to the interface (and back). However, this approach has some disadvantages:
ieee802154_rf_opsfunctions simply use the HAL descriptor (ieee802154_dev_t) to fetch the private descriptor. The upper layer can always retrieve the network stack descriptor if they were allocated together (e.gcontainer_of(...)).EDIT: Also, there could be cases were several HAL types point to the same device descriptor. An example of this is radios that support crypto acceleration.
From now on,
ieee802154_dev_t'sctxwas renamed toprivin order to store the private descriptor of the radios. All Radio HAL functions can access the private descriptor simply following the pointer. Radio events must be boostrapped in order to pass the pointer to the HAL on ISR (this is already done in the current Radio HAL implementations, but it will require to pass the HAL pointer to the args of the ISR in SPI radios).A follow-up PR with the WIP HAL implementation of at86rf2xx will show this mechanism.
Testing procedure
Make sure all radio HAL radios still work properly (cc2538, nrf52840). Use e.g
examples/gnrc_networking.Issues/PRs references
Depends on #16533