Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac802154: change frame_retries behaviour

This patch changes the default minimum value of frame_retries to 0 and
changes the frame_retries default value to 3 which is also 802.15.4
default.

We don't use the frame_retries "-1" value as indicator for no-aret mode
anymore, instead we checking on the ack request bit inside the 802.15.4
frame control field. This allows a acknowledge handling per frame. This
checking is done by transceiver or inside xmit callback of driver layer.

If a transceiver doesn't support ARET handling the transmit
functionality ignores ack frames then, which isn't well but should not
effect anything of current functionality.

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Alexander Aring and committed by
Marcel Holtmann
89c7d788 91f02b3d

+4 -8
+1 -2
net/mac802154/iface.c
··· 498 498 wpan_dev->min_be = 3; 499 499 wpan_dev->max_be = 5; 500 500 wpan_dev->csma_retries = 4; 501 - /* for compatibility, actual default is 3 */ 502 - wpan_dev->frame_retries = -1; 501 + wpan_dev->frame_retries = 3; 503 502 504 503 wpan_dev->pan_id = cpu_to_le16(IEEE802154_PANID_BROADCAST); 505 504 wpan_dev->short_addr = cpu_to_le16(IEEE802154_ADDR_BROADCAST);
+3 -6
net/mac802154/main.c
··· 111 111 phy->supported.max_minbe = 8; 112 112 phy->supported.min_maxbe = 3; 113 113 phy->supported.max_maxbe = 8; 114 - phy->supported.min_frame_retries = -1; 114 + phy->supported.min_frame_retries = 0; 115 115 phy->supported.max_frame_retries = 7; 116 116 phy->supported.max_csma_backoffs = 5; 117 117 phy->supported.lbt = NL802154_SUPPORTED_BOOL_FALSE; ··· 177 177 } 178 178 179 179 if (!(hw->flags & IEEE802154_HW_FRAME_RETRIES)) { 180 - /* TODO should be 3, but our default value is -1 which means 181 - * no ARET handling. 182 - */ 183 - local->phy->supported.min_frame_retries = -1; 184 - local->phy->supported.max_frame_retries = -1; 180 + local->phy->supported.min_frame_retries = 3; 181 + local->phy->supported.max_frame_retries = 3; 185 182 } 186 183 187 184 if (hw->flags & IEEE802154_HW_PROMISCUOUS)