-
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
at86rf2xx: fix receive before send detection #12728
Merged
benpicco
merged 2 commits into
RIOT-OS:master
from
bergzand:pr/at86rf2xx/fix_recv_before_send
Feb 7, 2020
Merged
at86rf2xx: fix receive before send detection #12728
benpicco
merged 2 commits into
RIOT-OS:master
from
bergzand:pr/at86rf2xx/fix_recv_before_send
Feb 7, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bergzand
added
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Area: network
Area: Networking
Area: drivers
Area: Device drivers
labels
Nov 16, 2019
bergzand
force-pushed
the
pr/at86rf2xx/fix_recv_before_send
branch
from
November 16, 2019 21:29
ecd9334
to
ce56dc8
Compare
Thanks! |
ping @jia200x |
benpicco
added
the
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
label
Feb 5, 2020
benpicco
approved these changes
Feb 5, 2020
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.
The code looks good and I found no regressions.
#11256 is running fine - so let's go forward with this!
Murdock/clang are not happy about excessive parenthesis - you can squash directly. |
benpicco
reviewed
Feb 5, 2020
benpicco
reviewed
Feb 7, 2020
benpicco
reviewed
Feb 7, 2020
The at86rf2xx radio handled a transfer complete condition with the radio in the BUSY_TX_ARET state as a finished transmission. This condition and state also occurs when a reception occurs just before switching to transmitting. This would cause a condition where first a TX_COMPLETE was signalled and second a RX_COMPLETE was signalled. The network stack would then read the transmitted frame as a received frame. The patch fixes the errornous RX callback by only submitting the TX_COMPLETE condition when there are at least 2 frames pending (at86rf2xx::pending_tx).
bergzand
force-pushed
the
pr/at86rf2xx/fix_recv_before_send
branch
from
February 7, 2020 12:08
c4ca33c
to
42d5460
Compare
Thanks @benpicco! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: drivers
Area: Device drivers
Area: network
Area: Networking
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
The at86rf2xx radio handled a transfer complete condition with the radio in the BUSY_TX_ARET state as a finished transmission. This condition and state also occurs when a reception occurs just before switching to transmitting. This would cause a condition where first a TX_COMPLETE was
signalled and second a RX_COMPLETE was signalled. The network stack would then read the transmitted frame as a received frame.
The patch fixes the errornous RX callback by only submitting the TX_COMPLETE condition when there are at least 2 frames pending (at86rf2xx::pending_tx).
This should not impact packet loss with the radio. The frame received is also discarded without this patch.
The change set is not that big, it just appears big due to splitting out the tx complete handling from the
_isr()
call. Edit: splitted the tx complete refactor to a separate commit to ease reviewing.Testing procedure
The test as supplied with #11256 must pass.
examples/gnrc_networking
should work as usual on a samr21-xpro or on the iotlab-m3,Issues/PRs references
Fixes the issue described in #11256