gnrc_netif: add NETDEV_EVENT_PDU_CHANGED event#12835
gnrc_netif: add NETDEV_EVENT_PDU_CHANGED event#12835benpicco wants to merge 1 commit intoRIOT-OS:masterfrom
Conversation
For some devices the maximum frame size is dependant on the configuration. This adds a NETDEV_EVENT_PDU_CHANGED event that a network driver can generate if a change in configuration resulted in a different PDU than before. For this the driver must implement the NETOPT_MAX_PDU_SIZE `.get()` request.
|
What is the flow for the decision of the PDU change? The device decides (by a packet triggering it or whatever) to change its PDU size? Or is this done via user configuration? |
|
Right now it's only though (user) configuration changes. (Setting Since the device can listen to both legacy and non-legacy OQPSK frames one could also imagine a mode of operation where the TX mode is chosen based on the destination, but that would likely also just use [1] this is driver specific. 802.15.4-2006 also knows about BPSK and ASK that will use a 127 PDU, but this particular device does only supports OQPSK in legacy mode. |
|
Mhhh.. In both cases this would be handled by the MAC implementation (using names for |
Because that's not so simple. How would the MAC layer know what frame size the radio is able to send based on the setting? |
Because it is written in the IEEE 802.15.4 standard I hope. |
It is indeed. Still, if you switch from, say FSK to OFDM you would have an unnecessary round-trip to the driver as opposed to just having the driver inform you if the PDU changed. (Which it would not do in this case) |
The current approach seems to me like an unnecessary round-trip to the MAC...
IMHO this should also be implemented in the respective MAC layers. But maybe other reviewers have differing opinions? |
There's a similar situation in LoRaWAN. The PDU is dependent of the Datarate, a combination of 2 PHY layer attributes: SF (Spreading Factor) and BW (Bandwidth). For GNRC LoRaWAN, as pointed out by @miri64 above, this is solved in the MAC layer. In practice the MAC layer must always maintain this information (e.g the IEEE802.15.4 is designed to run with more than one PHY layer, 2.4 GHz and SubGHz. LoRaWAN runs both the LoRa modulation and FSK). So I tend to think it will be easier in the long run to keep the information there and not in the transceiver/PHY layers. It will become more evident after the PHY/MAC rework in the scope of #12741 |
|
Extending However, when I add a
Should the device then call If the call chain is gnrc -> netdev -> driver then the upper layer can't know if the lower layer operation succeeded and |
|
Should we close this one @benpicco? |
|
Yes this is obsolete now |
Contribution description
For some devices the maximum frame size is dependant on the configuration.
This adds a
NETDEV_EVENT_PDU_CHANGEDevent that a network driver can generateif a change in configuration resulted in a different PDU than before.
For this the driver must implement an answer to the
NETOPT_MAX_PDU_SIZE.get()request.Testing procedure
nothing to test yet
Issues/PRs references
Will be used by #12128