Search Linux Wireless

[PATCH v2 5/6] wl12xx: AP mode - support hidden SSID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Detect whether our SSID is hidden by comparing beacon data with
the SSID in bss_conf.

Signed-off-by: Arik Nemtsov <arik@xxxxxxxxxx>
---
 drivers/net/wireless/wl12xx/cmd.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index e28d9ca..7a6f39e 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -966,16 +966,6 @@ int wl1271_cmd_start_bss(struct wl1271 *wl)
 
 	wl1271_debug(DEBUG_CMD, "cmd start bss");
 
-	/*
-	 * FIXME: We currently do not support hidden SSID. The real SSID
-	 * should be fetched from mac80211 first.
-	 */
-	if (wl->ssid_len == 0) {
-		wl1271_warning("Hidden SSID currently not supported for AP");
-		ret = -EINVAL;
-		goto out;
-	}
-
 	cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
 	if (!cmd) {
 		ret = -ENOMEM;
@@ -993,9 +983,16 @@ int wl1271_cmd_start_bss(struct wl1271 *wl)
 	cmd->dtim_interval = bss_conf->dtim_period;
 	cmd->beacon_expiry = WL1271_AP_DEF_BEACON_EXP;
 	cmd->channel = wl->channel;
-	cmd->ssid_len = wl->ssid_len;
-	cmd->ssid_type = SSID_TYPE_PUBLIC;
-	memcpy(cmd->ssid, wl->ssid, wl->ssid_len);
+
+	/* We use a visible SSID if the beacon SSID matches bss_conf */
+	if (wl->ssid_len > 0 && wl->ssid_len == bss_conf->ssid_len &&
+	    !memcmp(wl->ssid, bss_conf->ssid, wl->ssid_len))
+		cmd->ssid_type = SSID_TYPE_PUBLIC;
+	else
+		cmd->ssid_type = SSID_TYPE_HIDDEN;
+
+	cmd->ssid_len = bss_conf->ssid_len;
+	memcpy(cmd->ssid, bss_conf->ssid, bss_conf->ssid_len);
 
 	switch (wl->band) {
 	case IEEE80211_BAND_2GHZ:
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux