Repository navigation
[radio] allow otPlatRadioReceiveAt() to replace or update a window - #1360
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Nordic Semiconductor 802154 radio driver to support seamless updates and replacements of delayed RX windows without interrupting ongoing reception. The review feedback highlights several critical issues, including potential linked list corruption in the timer scheduler when adding a timer without first removing it, race conditions caused by non-atomic direct state modifications of RSCH_DLY_RX, and a potential double failure notification to the upper layer when an ongoing window is stopped.
|
Thank you for the PR! @pkwiek is going to review it asap. |
pkwiek
left a comment
There was a problem hiding this comment.
The functionality is sound albeit a bit opinionated. With the state of bare-metal OT support from us I am fine with this. I commented on some possible readability improvements.
4ffb8c1 to
29a665a
Compare
`otPlatRadioReceiveAt()` failed when a previously scheduled receive window was pending or ongoing, since the driver accepted a delayed reception only when no delayed reception was in progress. The delayed reception now tracks the requested window (not started yet) separately from the ongoing window, so that it behaves as defined by `otPlatRadioReceiveAt()`: - A requested window which has not started yet is replaced. - An ongoing window is not interrupted. If the new window starts before the ongoing one ends, reception continues until the new window starts; otherwise the ongoing window ends as scheduled. The new window then dictates the channel and the end of the reception. - A window whose start is too close or has passed starts immediately, and a window which has already ended ends the ongoing reception (after the frame being received, if any). - The receiver is not restarted when the channel does not change, and it is retuned when switching channel within an ongoing window (the channel update was previously vetoed by the delayed RX abort hook). In addition, `otPlatRadioReceiveAt()` returns `OT_ERROR_INVALID_STATE` when the radio is disabled, and `otPlatRadioDisable()` cancels any scheduled or ongoing receive window.
29a665a to
f6f3084
Compare
otPlatRadioReceiveAt()failed when a previously scheduled receivewindow was pending or ongoing, since the driver accepted a delayed
reception only when no delayed reception was in progress.
The delayed reception now tracks the requested window (not started yet)
separately from the ongoing window, so that it behaves as defined by
otPlatRadioReceiveAt():the ongoing one ends, reception continues until the new window
starts; otherwise the ongoing window ends as scheduled. The new
window then dictates the channel and the end of the reception.
and a window which has already ended ends the ongoing reception
(after the frame being received, if any).
it is retuned when switching channel within an ongoing window (the
channel update was previously vetoed by the delayed RX abort hook).
In addition,
otPlatRadioReceiveAt()returnsOT_ERROR_INVALID_STATEwhen the radio is disabled, and
otPlatRadioDisable()cancels anyscheduled or ongoing receive window.