-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ieee802154/submac: fix initialization code #16533
Conversation
done! |
@@ -382,6 +382,7 @@ int ieee802154_submac_init(ieee802154_submac_t *submac, const network_uint16_t * | |||
CONFIG_IEEE802154_CCA_THRESH_DEFAULT) >= 0); | |||
|
|||
ieee802154_radio_request_set_trx_state(dev, IEEE802154_TRX_STATE_RX_ON); | |||
while(ieee802154_radio_confirm_set_trx_state(dev) == -EAGAIN) {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment also applies to all the previous radio HAL function calls: shouldn't we check for possible error return codes? Otherwise this function is always returning success.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this must be fixed. I will piggyback some changes
I added some commits that improve error checks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just some style nits.
Please squash directly
Murdock is not happy |
fixed! I also piggybacked another fix. I was calling one of the |
ping! I would like to move on with #16535, but this one is needed :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good and both our sub-MAC drivers are still working.
thanks for the review! |
Contribution description
This PR does essentially 3 things:
netdev_submac_ieee802154_init
to the actual_init
function ofnetdev_driver_t
. This is required in order to make sure the device is initialized before setting netdev stuff.confirm_set_trx_state
after setting the state to RX_ON during initialization. In some cases, the radio was not ready to do a state transition becauserequest_set_trx_state
didn't finish.Testing procedure
gnrc_networking
andtests/ieee802154_hal
Issues/PRs references
None so far