* [PATCH] ath6kl: add support for WPS
@ 2011-10-25 18:25 Aarthi Thiruvengadam
2011-10-27 7:53 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Aarthi Thiruvengadam @ 2011-10-25 18:25 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Aarthi Thiruvengadam, Aarthi Thiruvengadam
Add control flag CONNECT_WPS_FLAG if a WPS IE is present in the
Association Request IEs. This flag is needed when the station must
connect to a WPS-enabled AP.
Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 18 ++++++++++++++++++
drivers/net/wireless/ath/ath6kl/wmi.h | 1 +
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 0680d2b..11dd401 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -256,6 +256,14 @@ static bool ath6kl_is_rsn_ie(const u8 *pos)
return pos[0] == WLAN_EID_RSN;
}
+static bool ath6kl_is_wps_ie(const u8 *pos)
+{
+ return (pos[0] == WLAN_EID_VENDOR_SPECIFIC &&
+ pos[1] >= 4 &&
+ pos[2] == 0x00 && pos[3] == 0x50 && pos[4] == 0xf2 &&
+ pos[5] == 0x04);
+}
+
static int ath6kl_set_assoc_req_ies(struct ath6kl *ar, const u8 *ies,
size_t ies_len)
{
@@ -265,6 +273,12 @@ static int ath6kl_set_assoc_req_ies(struct ath6kl *ar, const u8 *ies,
int ret;
/*
+ * Clear previously set flag
+ */
+
+ ar->connect_ctrl_flags &= ~CONNECT_WPS_FLAG;
+
+ /*
* Filter out RSN/WPA IE(s)
*/
@@ -281,6 +295,10 @@ static int ath6kl_set_assoc_req_ies(struct ath6kl *ar, const u8 *ies,
memcpy(buf + len, pos, 2 + pos[1]);
len += 2 + pos[1];
}
+
+ if (ath6kl_is_wps_ie(pos))
+ ar->connect_ctrl_flags |= CONNECT_WPS_FLAG;
+
pos += 2 + pos[1];
}
}
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h
index f0ca899..37847cf 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.h
+++ b/drivers/net/wireless/ath/ath6kl/wmi.h
@@ -606,6 +606,7 @@ enum wmi_connect_ctrl_flags_bits {
CONNECT_CSA_FOLLOW_BSS = 0x0020,
CONNECT_DO_WPA_OFFLOAD = 0x0040,
CONNECT_DO_NOT_DEAUTH = 0x0080,
+ CONNECT_WPS_FLAG = 0x0100,
};
struct wmi_connect_cmd {
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-10-27 7:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25 18:25 [PATCH] ath6kl: add support for WPS Aarthi Thiruvengadam
2011-10-27 7:53 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).