Search Linux Wireless

[RFC 15/15] mac80211: create and pass the ies for each band in periodic scans

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

 



Create the scan IEs for each band and pass to the driver as part of the
periodic scan op.

For now, we don't support IEs passed from the userspace.

Signed-off-by: Luciano Coelho <luciano.coelho@xxxxxxxxx>
---
 net/mac80211/scan.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index fda8d41..2e7661f 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -828,7 +828,7 @@ int ieee80211_request_periodic_start(struct ieee80211_sub_if_data *sdata,
 				     struct cfg80211_periodic_request *req)
 {
 	struct ieee80211_local *local = sdata->local;
-	int ret;
+	int ret, i;
 
 	mutex_lock(&sdata->local->mtx);
 
@@ -844,6 +844,16 @@ int ieee80211_request_periodic_start(struct ieee80211_sub_if_data *sdata,
 		goto out;
 	}
 
+	for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
+		req->ie[i] = kzalloc(2 + IEEE80211_MAX_SSID_LEN +
+				     local->scan_ies_len, GFP_KERNEL);
+
+		req->ie_len[i] = ieee80211_build_preq_ies(local,
+							  (u8 *) req->ie[i],
+							  NULL, 0, i,
+							  (u32) -1, 0);
+	}
+
 	local->periodic_req = req;
 
 	ret = drv_periodic_start(local, sdata, req);
@@ -860,7 +870,7 @@ out:
 int ieee80211_request_periodic_stop(struct ieee80211_sub_if_data *sdata)
 {
 	struct ieee80211_local *local = sdata->local;
-	int ret = 0;
+	int ret = 0, i;
 
 	mutex_lock(&sdata->local->mtx);
 
@@ -870,6 +880,9 @@ int ieee80211_request_periodic_stop(struct ieee80211_sub_if_data *sdata)
 	}
 
 	if (local->periodic_req) {
+		for (i = 0; i < IEEE80211_NUM_BANDS; i++)
+			kfree(local->periodic_req->ie[i]);
+
 		ret = drv_periodic_stop(local, sdata);
 		local->periodic_req = NULL;
 		__clear_bit(SCAN_PERIODIC_SCANNING, &local->scanning);
-- 
1.7.0.4

--
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