Add support for drivers to advertise NDP offload capability through the NAN capabilities response so userspace can determine whether the driver supports firmware-assisted NDP session management. Signed-off-by: Shivani Baranwal --- include/uapi/linux/nl80211.h | 3 +++ net/wireless/nl80211.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index af2b3a12572e..154d76dbcb1c 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -9279,6 +9279,8 @@ enum nl80211_s1g_short_beacon_attrs { * @NL80211_NAN_CAPA_OFFLOAD_RANGING: flag attribute. Firmware supports the * fully offloaded NAN ranging procedure, including ranging session setup, * update, and termination, FTM protocol and procedure, and ranging reports. + * @NL80211_NAN_CAPA_OFFLOAD_NDP: flag attribute. Driver handles NAN Data + * Path (NDP) handshake frames and data path key installation. * @__NL80211_NAN_CAPABILITIES_LAST: Internal * @NL80211_NAN_CAPABILITIES_MAX: Highest NAN capability attribute. */ @@ -9294,6 +9296,7 @@ enum nl80211_nan_capabilities { NL80211_NAN_CAPA_PHY, NL80211_NAN_CAPA_INSTANT_COMM, NL80211_NAN_CAPA_OFFLOAD_RANGING, + NL80211_NAN_CAPA_OFFLOAD_NDP, /* keep last */ __NL80211_NAN_CAPABILITIES_LAST, NL80211_NAN_CAPABILITIES_MAX = __NL80211_NAN_CAPABILITIES_LAST - 1, diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index eb74a9d3eeb0..6188102ade33 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -3168,6 +3168,10 @@ static int nl80211_put_nan_capa(struct wiphy *wiphy, struct sk_buff *msg) nla_put_flag(msg, NL80211_NAN_CAPA_OFFLOAD_RANGING)) goto fail; + if ((wiphy->nan_capa.flags & WIPHY_NAN_FLAGS_OFFLOAD_NDP) && + nla_put_flag(msg, NL80211_NAN_CAPA_OFFLOAD_NDP)) + goto fail; + if (nla_put_u8(msg, NL80211_NAN_CAPA_OP_MODE, wiphy->nan_capa.op_mode) || nla_put_u8(msg, NL80211_NAN_CAPA_NUM_ANTENNAS, -- 2.34.1