From: Chandru Gopi IEEE Std 802.11-2024 subclause 9.4.2.216 (Max Channel Switch Time element) defines a Switch Time field in the Channel Switch Announcement (CSA) element that indicates the time delta between the time the last beacon is transmitted by the AP in the current channel and the expected time of the first beacon transmitted by the AP in the new channel. Add a new u32 nl80211 attribute, NL80211_ATTR_MAX_CH_SWITCH_TIME, to carry this value in the NL80211_CMD_CH_SWITCH_STARTED_NOTIFY event. Userspace can use this information to decide whether to remain connected or disconnect before the AP moves to the new channel. Signed-off-by: Chandru Gopi Signed-off-by: Shashikala Prabhu --- include/uapi/linux/nl80211.h | 11 +++++++++++ net/wireless/nl80211.c | 1 + 2 files changed, 12 insertions(+) diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 9998f6c0a665..65c04e1e54b6 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -953,6 +953,10 @@ * after %NL80211_ATTR_CH_SWITCH_COUNT TBTT's. The userspace may * decide to react to this indication by requesting other * interfaces to change channel as well. + * %NL80211_ATTR_MAX_CH_SWITCH_TIME included in this command indicates the + * AP's Max Channel Switch Time. Userspace can use this information to + * decide whether to remain connected or disconnect before the AP moves to + * the new channel. * * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by * its %NL80211_ATTR_WDEV identifier. It must have been created with @@ -3165,6 +3169,12 @@ enum nl80211_commands { * @NL80211_ATTR_NPCA_PRIMARY_FREQ: NPCA primary channel (u32) * @NL80211_ATTR_NPCA_PUNCT_BITMAP: NPCA puncturing bitmap (u32) * + * @NL80211_ATTR_MAX_CH_SWITCH_TIME: u32 attribute carrying the Switch Time + * field from the MCST (Max Channel Switch Time) element, indicating the + * time delta between the time the last beacon is transmitted by the AP in + * the current channel and the expected time of the first beacon + * transmitted by the AP in the new channel, expressed in TUs. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use @@ -3763,6 +3773,7 @@ enum nl80211_attrs { NL80211_ATTR_NPCA_PRIMARY_FREQ, NL80211_ATTR_NPCA_PUNCT_BITMAP, + NL80211_ATTR_MAX_CH_SWITCH_TIME, /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index c272a2fbad03..14d41142cf79 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -1093,6 +1093,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_NPCA_PRIMARY_FREQ] = { .type = NLA_U32 }, [NL80211_ATTR_NPCA_PUNCT_BITMAP] = NLA_POLICY_FULL_RANGE(NLA_U32, &nl80211_punct_bitmap_range), + [NL80211_ATTR_MAX_CH_SWITCH_TIME] = { .type = NLA_U32 }, }; /* policy for the key attributes */ -- 2.34.1