netdev/ieee802154_submac: add retransmission reporting#15208
netdev/ieee802154_submac: add retransmission reporting#15208benpicco merged 2 commits intoRIOT-OS:masterfrom
Conversation
4871b00 to
2fc600d
Compare
| submac); | ||
| netdev_t *netdev = (netdev_t *)netdev_submac; | ||
|
|
||
| netdev_submac->retrans = info->retrans; |
There was a problem hiding this comment.
Ah yes, indeed this works. But maybe we should handle the case where there are HW retrans but no tx_info in the SubMAC. That way, the SubMAC always gives this information
There was a problem hiding this comment.
alternatively, we can return an error when NETOPT_TX_RETRIES_NEEDED is called in such case
There was a problem hiding this comment.
Ah I wasn't sure if info could be NULL.
| if (info) { | ||
| netdev_submac->retrans = info->retrans; | ||
| } else { | ||
| netdev_submac->retrans = -1; | ||
| } | ||
|
|
There was a problem hiding this comment.
Since you are there, could you add this patch?
diff --git a/sys/net/link_layer/ieee802154/submac.c b/sys/net/link_layer/ieee802154/submac.c
index 0584ba95a3..392714b995 100644
--- a/sys/net/link_layer/ieee802154/submac.c
+++ b/sys/net/link_layer/ieee802154/submac.c
@@ -194,6 +194,9 @@ static void _handle_tx_success(ieee802154_submac_t *submac,
if (ieee802154_radio_has_frame_retrans(dev) ||
ieee802154_radio_has_irq_ack_timeout(dev) || !submac->wait_for_ack) {
+ if (!ieee802154_radio_has_frame_retrans_info()) {
+ info->retrans = -1;
+ }
_tx_end(submac, info->status, info);
}
else {
And change these lines to:
| if (info) { | |
| netdev_submac->retrans = info->retrans; | |
| } else { | |
| netdev_submac->retrans = -1; | |
| } | |
| if (info) { | |
| netdev_submac->retrans = info->retrans; | |
| } |
?
That way the SubMAC will always give its best effort to report the retransmissions. And if there's no info (TX_MEDIUM_BUSY or TX_NO_ACK), then netdev_submac->retrans doesn't get updated.
There was a problem hiding this comment.
I think turning the _get_cap() function into a bitfield would be a good optimization.
|
Looks good to me. Please squash. |
189d55b to
914be5b
Compare
If we do software retransmissions, we already keep a count. Allow to query it with `NETOPT_TX_RETRIES_NEEDED`.
914be5b to
87151db
Compare
Contribution description
If we do software retransmissions, we already keep a count.
Allow to query it with
NETOPT_TX_RETRIES_NEEDED.Testing procedure
Issues/PRs references
#14448