@@ -751,6 +751,8 @@ struct wpa_driver_capa {
#define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000
/* Driver requires external TDLS setup/teardown/discovery */
#define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000
+/* Driver indicates support for probe response offloading in AP mode */
+#define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000
unsigned int flags;
int max_scan_ssids;
@@ -768,6 +770,20 @@ struct wpa_driver_capa {
* supports in AP mode
*/
unsigned int max_stations;
+
+ /**
+ * probe_resp_offload_supp_protocols - bitmap of supported
+ * protocols by the driver for probe response offloading.
+ */
+/* Driver probe response offloading support for WPS ver. 1 */
+#define WPA_DRIVER_PROBE_RESP_OFFLOAD_SUPPORT_WPS 0x00000001
+/* Driver probe response offloading support for WPS ver. 2 */
+#define WPA_DRIVER_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 0x00000002
+/* Driver probe response offloading support for P2P */
+#define WPA_DRIVER_PROBE_RESP_OFFLOAD_SUPPORT_P2P 0x00000004
+/* Driver probe response offloading support for 802.11u (interworking) */
+#define WPA_DRIVER_PROBE_RESP_OFFLOAD_SUPPORT_80211U 0x00000008
+ unsigned int probe_resp_offload_protocols;
};
@@ -1880,6 +1880,23 @@ struct wiphy_info_data {
};
+static unsigned int probe_resp_offload_support(int supp_protocols)
+{
+ unsigned int prot = 0;
+
+ if (supp_protocols & NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS)
+ prot |= WPA_DRIVER_PROBE_RESP_OFFLOAD_SUPPORT_WPS;
+ if (supp_protocols & NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2)
+ prot |= WPA_DRIVER_PROBE_RESP_OFFLOAD_SUPPORT_WPS2;
+ if (supp_protocols & NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P)
+ prot |= WPA_DRIVER_PROBE_RESP_OFFLOAD_SUPPORT_P2P;
+ if (supp_protocols & NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U)
+ prot |= WPA_DRIVER_PROBE_RESP_OFFLOAD_SUPPORT_80211U;
+
+ return prot;
+}
+
+
static int wiphy_info_handler(struct nl_msg *msg, void *arg)
{
struct nlattr *tb[NL80211_ATTR_MAX + 1];
@@ -2058,6 +2075,16 @@ broken_combination:
}
}
+ if (tb[NL80211_ATTR_PROBE_RESP_OFFLOAD_SUPPORT]) {
+ int protocols =
+ nla_get_u32(tb[NL80211_ATTR_PROBE_RESP_OFFLOAD_SUPPORT]);
+ wpa_printf(MSG_DEBUG, "nl80211: Supports probe-resp offload "
+ "in AP-mode");
+ capa->flags |= WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD;
+ capa->probe_resp_offload_protocols =
+ probe_resp_offload_support(protocols);
+ }
+
return NL_SKIP;
}