aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2011-12-10 14:50:00 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-10 19:11:32 (GMT)
commit562c9d976e267b6f1df10ec4cdd9bac85d4c35fc (patch)
tree062d00225cbad6d7e8d25b1619271d40bf97454d /src
parentafcc9ea1a6f1c6dcbb5912bb5740870925c92ee6 (diff)
downloadhostap-562c9d976e267b6f1df10ec4cdd9bac85d4c35fc.zip
hostap-562c9d976e267b6f1df10ec4cdd9bac85d4c35fc.tar.gz
hostap-562c9d976e267b6f1df10ec4cdd9bac85d4c35fc.tar.bz2
nl80211: Propagate Probe Response offload capabilities from kernel
Translate nl80211 flags to wpa_supplicant flags for Probe Response offload support. The existence of the nl80211 PROBE_RESP_OFFLOAD_SUPPORT attribute means Probe Response offload is supported. The value of the attribute is a bitmap of supported protocols. Signed-hostap: Arik Nemtsov <arik@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver.h16
-rw-r--r--src/drivers/driver_nl80211.c27
2 files changed, 43 insertions, 0 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index c8a71fd..b07b3a3 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -759,6 +759,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;
@@ -776,6 +778,20 @@ struct wpa_driver_capa {
* supports in AP mode
*/
unsigned int max_stations;
+
+ /**
+ * probe_resp_offloads - 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_WPS 0x00000001
+/* Driver Probe Response offloading support for WPS ver. 2 */
+#define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002
+/* Driver Probe Response offloading support for P2P */
+#define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004
+/* Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
+#define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008
+ unsigned int probe_resp_offloads;
};
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index d5d7c1f..50c4fa5 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2268,6 +2268,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_WPS;
+ if (supp_protocols & NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2)
+ prot |= WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2;
+ if (supp_protocols & NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P)
+ prot |= WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P;
+ if (supp_protocols & NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U)
+ prot |= WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING;
+
+ return prot;
+}
+
+
static int wiphy_info_handler(struct nl_msg *msg, void *arg)
{
struct nlattr *tb[NL80211_ATTR_MAX + 1];
@@ -2459,6 +2476,16 @@ broken_combination:
info->data_tx_status = 1;
}
+ if (tb[NL80211_ATTR_PROBE_RESP_OFFLOAD]) {
+ int protocols =
+ nla_get_u32(tb[NL80211_ATTR_PROBE_RESP_OFFLOAD]);
+ wpa_printf(MSG_DEBUG, "nl80211: Supports Probe Response "
+ "offload in AP mode");
+ capa->flags |= WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD;
+ capa->probe_resp_offloads =
+ probe_resp_offload_support(protocols);
+ }
+
return NL_SKIP;
}