History

wifi: cfg80211: Add MAC address filter to remain_on_channel

Currently the remain_on_channel operation does not support filtering incoming frames by destination MAC address. This prevents use cases such as PASN authentication in the responder side that need to receive frames addressed to a specific MAC during the off-channel period. Add an rx_addr parameter to the remain_on_channel operation callback and propagate it through the call chain from nl80211 to driver implementations. Introduce the extended feature NL80211_EXT_FEATURE_ROC_ADDR_FILTER as a capability gate so that cfg80211 rejects the request if the driver does not advertise support for address filtering. Extract the address from the NL80211_ATTR_MAC attribute when provided in the netlink message and update the tracing infrastructure to include the address in remain_on_channel trace events. The rx_addr parameter is optional and can be NULL, maintaining backward compatibility with existing drivers.

Peddolla Harshavardhan Reddy committed 6 months ago

Commit 4dbd1821 parent bef9d5e13 files · +50 −18Browse files

Showing the changes to include/uapi (1 of 13 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+10−1
@@ -729,7 +729,9 @@ · 728 unmodified lines
729729 * to remain on the channel. This command is also used as an event to
730730 * notify when the requested duration starts (it may take a while for the
731731 * driver to schedule this time due to other concurrent needs for the
732− * radio).
732+ * radio). An optional attribute %NL80211_ATTR_MAC can be used to filter
733+ * incoming frames during remain-on-channel, such that frames
734+ * addressed to the specified destination MAC are reported.
733735 * When called, this operation returns a cookie (%NL80211_ATTR_COOKIE)
734736 * that will be included with any events pertaining to this request;
735737 * the cookie is also used to cancel the request.
@@ -7040,6 +7042,12 @@ enum nl80211_feature_flags { · 6304 unmodified lines
70407042 * (NL80211_CMD_AUTHENTICATE) in non-AP STA mode, as specified in
70417043 * "IEEE P802.11bi/D4.0, 12.16.5".
70427044 *
7045+ * @NL80211_EXT_FEATURE_ROC_ADDR_FILTER: Driver supports MAC address
7046+ * filtering during remain-on-channel. When %NL80211_ATTR_MAC is
7047+ * provided with %NL80211_CMD_REMAIN_ON_CHANNEL, the driver will
7048+ * forward frames with a matching MAC address to userspace during
7049+ * the off-channel period.
7050+ *
70437051 * @NUM_NL80211_EXT_FEATURES: number of extended features.
70447052 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
70457053 */
@@ -7119,6 +7127,7 @@ enum nl80211_ext_feature_index { · 73 unmodified lines
71197127 NL80211_EXT_FEATURE_EPPKE,
71207128 NL80211_EXT_FEATURE_ASSOC_FRAME_ENCRYPTION,
71217129 NL80211_EXT_FEATURE_IEEE8021X_AUTH,
7130+ NL80211_EXT_FEATURE_ROC_ADDR_FILTER,
71227131
71237132 /* add new features before the definition below */
71247133 NUM_NL80211_EXT_FEATURES,