From 04ddf6f957431b74b332d192d632c83e4c3dcab7 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Thu, 5 Mar 2020 14:37:44 +0100 Subject: [PATCH] net: ieee802154_radio: Extend frame pending bit handling configuration Thread and Zigbee differ in how do they handle Frame Pending Bit field in their frames. Introduce a new enum, `ieee802154_fpb_mode`, which allows to configure the radio driver in an appropriate mode. Signed-off-by: Robert Lubos --- include/net/ieee802154_radio.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/include/net/ieee802154_radio.h b/include/net/ieee802154_radio.h index 67985eccc22..51ea4f2f56f 100644 --- a/include/net/ieee802154_radio.h +++ b/include/net/ieee802154_radio.h @@ -84,14 +84,26 @@ enum ieee802154_tx_mode { IEEE802154_TX_MODE_TXTIME_CCA, }; +/** IEEE802.15.4 Frame Pending Bit table address matching mode. */ +enum ieee802154_fpb_mode { + /** The pending bit shall be set only for addresses found in the list. + */ + IEEE802154_FPB_ADDR_MATCH_THREAD, + + /** The pending bit shall be cleared for short addresses found in + * the list. + */ + IEEE802154_FPB_ADDR_MATCH_ZIGBEE, +}; + /** IEEE802.15.4 driver configuration types. */ enum ieee802154_config_type { /** Indicates how radio driver should set Frame Pending bit in ACK * responses for Data Requests. If enabled, radio driver should * determine whether to set the bit or not based on the information - * provided with ``IEEE802154_CONFIG_ACK_FPB`` config. Otherwise, - * Frame Pending bit should be set to ``1``(see IEEE Std 802.15.4-2006, - * 7.2.2.3.1). + * provided with ``IEEE802154_CONFIG_ACK_FPB`` config and FPB address + * matching mode specified. Otherwise, Frame Pending bit should be set + * to ``1``(see IEEE Std 802.15.4-2006, 7.2.2.3.1). */ IEEE802154_CONFIG_AUTO_ACK_FPB, @@ -120,6 +132,7 @@ struct ieee802154_config { /** ``IEEE802154_CONFIG_AUTO_ACK_FPB`` */ struct { bool enabled; + enum ieee802154_fpb_mode mode; } auto_ack_fpb; /** ``IEEE802154_CONFIG_ACK_FPB`` */