drivers: ieee802154: deprecate OT "sleep" nomenclature

"Sleeping" has a well defined meaning in Zephyr related to threading and
power management. This differs from OpenThread's definition:

- Deprecates the "SLEEP_TO_TX" capability as it is redundant and
  conflicts with all of Zephyr's nomenclature, #61227, RFC 2863, Thread
  standard and IEEE 802.15.4. This binds the API to an implementation
  detail of OpenThread, instead. See #63670 for the agreed migration path.

- Renames the "SLEEP" event to "RX_OFF" which conforms to the
  nomenclature in Zephyr, this API and IEEE 802.15.4.

Fixes: #62995

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This commit is contained in:
Florian Grandel 2023-09-22 18:47:13 +02:00 committed by Carles Cufí
parent 768fe29f90
commit 62396443fc
3 changed files with 28 additions and 5 deletions

View file

@ -663,7 +663,7 @@ static int nrf5_stop(const struct device *dev)
#if defined(CONFIG_IEEE802154_CSL_ENDPOINT)
if (nrf_802154_sleep_if_idle() != NRF_802154_SLEEP_ERROR_NONE) {
if (nrf5_data.event_handler) {
nrf5_data.event_handler(dev, IEEE802154_EVENT_SLEEP, NULL);
nrf5_data.event_handler(dev, IEEE802154_EVENT_RX_OFF, NULL);
} else {
LOG_WRN("Transition to radio sleep cannot be handled.");
}
@ -1024,7 +1024,7 @@ void nrf_802154_receive_failed(nrf_802154_rx_error_t error, uint32_t id)
* As a side effect, regular failure notifications would be reported with the
* incorrect ID.
*/
nrf5_data.event_handler(dev, IEEE802154_EVENT_SLEEP, NULL);
nrf5_data.event_handler(dev, IEEE802154_EVENT_RX_OFF, NULL);
#endif
if (error == NRF_802154_RX_ERROR_DELAYED_TIMEOUT) {
return;

View file

@ -482,7 +482,30 @@ enum ieee802154_hw_caps {
/** TX at specified time supported */
IEEE802154_HW_TXTIME = BIT(8),
/** TX directly from sleep supported */
/** TX directly from sleep supported
*
* @note This HW capability does not conform to the requirements
* specified in #61227 as it closely couples the driver to OpenThread's
* capability and device model which is different from Zephyr's:
* - "Sleeping" is a well defined term in Zephyr related to internal
* power and thread management and different from "RX off" as
* defined in OT.
* - Currently all OT-capable drivers have the "sleep to TX"
* capability anyway plus we expect future drivers to implement it
* ootb as well, so no information is actually conveyed by this
* capability.
* - The `start()`/`stop()` API of a net device controls the
* interface's operational state. Drivers MUST respond with
* -ENETDOWN when calling `tx()` while their operational state is
* "DOWN", only devices in the "UP" state MAY transmit packets (RFC
* 2863).
* - A migration path has been defined in #63670 for actual removal of
* this capability in favor of a standard compliant
* `configure(rx_on/rx_off)` call, see there for details.
*
* @deprecated Drivers and L2 SHALL not introduce additional references
* to this capability and remove existing ones as outlined in #63670.
*/
IEEE802154_HW_SLEEP_TO_TX = BIT(9),
/** Timed RX window scheduling supported */
@ -524,7 +547,7 @@ enum ieee802154_event {
* synchronously switched of due to a call to `stop()` or an RX slot
* being configured.
*/
IEEE802154_EVENT_SLEEP,
IEEE802154_EVENT_RX_OFF,
};
/** RX failed event reasons, see @ref IEEE802154_EVENT_RX_FAILED */

View file

@ -224,7 +224,7 @@ void handle_radio_event(const struct device *dev, enum ieee802154_event evt,
set_pending_event(PENDING_EVENT_RX_FAILED);
}
break;
case IEEE802154_EVENT_SLEEP:
case IEEE802154_EVENT_RX_OFF:
set_pending_event(PENDING_EVENT_SLEEP);
break;
default: