aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-11-28 11:30:21 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:04:58 -0500
commita7d0adae40d0effc1484261a66fb703eb7e840b5 (patch)
treee3ee3d27bee433c56a57cba2f773ce1533d9b06f /drivers
parentdd1d12dabfeb123881b0c813d0b7d3585312bacd (diff)
libertas: remove user-specified channel list
Remove the ability to specify channels to scan via debugfs Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/libertas/README33
-rw-r--r--drivers/net/wireless/libertas/debugfs.c38
-rw-r--r--drivers/net/wireless/libertas/scan.c59
-rw-r--r--drivers/net/wireless/libertas/scan.h5
4 files changed, 13 insertions, 122 deletions
diff --git a/drivers/net/wireless/libertas/README b/drivers/net/wireless/libertas/README
index 05cfc29e43c3..d860fc375752 100644
--- a/drivers/net/wireless/libertas/README
+++ b/drivers/net/wireless/libertas/README
@@ -195,8 +195,6 @@ setuserscan
195 195
196 where [ARGS]: 196 where [ARGS]:
197 197
198 chan=[chan#][band][mode] where band is [a,b,g] and mode is
199 blank for active or 'p' for passive
200 bssid=xx:xx:xx:xx:xx:xx specify a BSSID filter for the scan 198 bssid=xx:xx:xx:xx:xx:xx specify a BSSID filter for the scan
201 ssid="[SSID]" specify a SSID filter for the scan 199 ssid="[SSID]" specify a SSID filter for the scan
202 keep=[0 or 1] keep the previous scan results (1), discard (0) 200 keep=[0 or 1] keep the previous scan results (1), discard (0)
@@ -204,35 +202,26 @@ setuserscan
204 type=[1,2,3] BSS type: 1 (Infra), 2(Adhoc), 3(Any) 202 type=[1,2,3] BSS type: 1 (Infra), 2(Adhoc), 3(Any)
205 203
206 Any combination of the above arguments can be supplied on the command 204 Any combination of the above arguments can be supplied on the command
207 line. If the chan token is absent, a full channel scan will be 205 line. If dur tokens are absent, the driver default setting will be used.
208 completed by the driver. If dur tokens are absent, the driver default 206 The bssid and ssid fields, if blank, will produce an unfiltered scan.
209 setting will be used. The bssid and ssid fields, if blank, will 207 The type field will default to 3 (Any) and the keep field will default
210 produce an unfiltered scan. The type field will default to 3 (Any) and 208 to 0 (Discard).
211 the keep field will default to 0 (Discard).
212 209
213 Examples: 210 Examples:
214 1) Perform an active scan on channels 1, 6, and 11 in the 'g' band: 211 1) Perform a passive scan on all channels for 20 ms per channel:
215 echo "chan=1g,6g,11g" > setuserscan 212 echo "dur=20" > setuserscan
216 213
217 2) Perform a passive scan on channel 11 for 20 ms: 214 2) Perform an active scan for a specific SSID:
218 echo "chan=11gp dur=20" > setuserscan 215 echo "ssid="TestAP"" > setuserscan
219 216
220 3) Perform an active scan on channels 1, 6, and 11; and a passive scan on 217 3) Scan all available channels (B/G, A bands) for a specific BSSID, keep
221 channel 36 in the 'a' band:
222
223 echo "chan=1g,6g,11g,36ap" > setuserscan
224
225 4) Perform an active scan on channel 6 and 36 for a specific SSID:
226 echo "chan=6g,36a ssid="TestAP"" > setuserscan
227
228 5) Scan all available channels (B/G, A bands) for a specific BSSID, keep
229 the current scan table intact, update existing or append new scan data: 218 the current scan table intact, update existing or append new scan data:
230 echo "bssid=00:50:43:20:12:82 keep=1" > setuserscan 219 echo "bssid=00:50:43:20:12:82 keep=1" > setuserscan
231 220
232 6) Scan channel 6, for all infrastructure networks. 221 4) Scan for all infrastructure networks.
233 Keep the previous scan table intact. Update any duplicate BSSID/SSID 222 Keep the previous scan table intact. Update any duplicate BSSID/SSID
234 matches with the new scan data: 223 matches with the new scan data:
235 echo "chan=6g type=1 keep=1" > setuserscan 224 echo "type=1 keep=1" > setuserscan
236 225
237 All entries in the scan table (not just the new scan data when keep=1) 226 All entries in the scan table (not just the new scan data when keep=1)
238 will be displayed upon completion by use of the getscantable ioctl. 227 will be displayed upon completion by use of the getscantable ioctl.
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index e79236cfdbc1..d3a47cc95475 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -196,43 +196,6 @@ out_unlock:
196 return count; 196 return count;
197} 197}
198 198
199static int lbs_parse_chan(char *buf, size_t count,
200 struct lbs_ioctl_user_scan_cfg *scan_cfg, int dur)
201{
202 char *start, *end, *hold, *str;
203 int i = 0;
204
205 start = strstr(buf, "chan=");
206 if (!start)
207 return -EINVAL;
208 start += 5;
209 end = strchr(start, ' ');
210 if (!end)
211 end = buf + count;
212 hold = kzalloc((end - start)+1, GFP_KERNEL);
213 if (!hold)
214 return -ENOMEM;
215 strncpy(hold, start, end - start);
216 hold[(end-start)+1] = '\0';
217 while(hold && (str = strsep(&hold, ","))) {
218 int chan;
219 char band, passive = 0;
220 sscanf(str, "%d%c%c", &chan, &band, &passive);
221 scan_cfg->chanlist[i].channumber = chan;
222 scan_cfg->chanlist[i].scantype = passive ? 1 : 0;
223 if (band == 'b' || band == 'g')
224 scan_cfg->chanlist[i].radiotype = 0;
225 else if (band == 'a')
226 scan_cfg->chanlist[i].radiotype = 1;
227
228 scan_cfg->chanlist[i].scantime = dur;
229 i++;
230 }
231
232 kfree(hold);
233 return i;
234}
235
236static void lbs_parse_bssid(char *buf, size_t count, 199static void lbs_parse_bssid(char *buf, size_t count,
237 struct lbs_ioctl_user_scan_cfg *scan_cfg) 200 struct lbs_ioctl_user_scan_cfg *scan_cfg)
238{ 201{
@@ -346,7 +309,6 @@ static ssize_t lbs_setuserscan(struct file *file,
346 scan_cfg->bsstype = LBS_SCAN_BSS_TYPE_ANY; 309 scan_cfg->bsstype = LBS_SCAN_BSS_TYPE_ANY;
347 310
348 dur = lbs_parse_dur(buf, count, scan_cfg); 311 dur = lbs_parse_dur(buf, count, scan_cfg);
349 lbs_parse_chan(buf, count, scan_cfg, dur);
350 lbs_parse_bssid(buf, count, scan_cfg); 312 lbs_parse_bssid(buf, count, scan_cfg);
351 scan_cfg->clear_bssid = lbs_parse_clear(buf, count, "clear_bssid="); 313 scan_cfg->clear_bssid = lbs_parse_clear(buf, count, "clear_bssid=");
352 lbs_parse_ssid(buf, count, scan_cfg); 314 lbs_parse_ssid(buf, count, scan_cfg);
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index de9c548cb6a5..236bc7daf4de 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -416,11 +416,6 @@ lbs_scan_setup_scan_config(struct lbs_private *priv,
416 struct mrvlietypes_ssidparamset *pssidtlv; 416 struct mrvlietypes_ssidparamset *pssidtlv;
417 struct lbs_scan_cmd_config *pscancfgout = NULL; 417 struct lbs_scan_cmd_config *pscancfgout = NULL;
418 u8 *ptlvpos; 418 u8 *ptlvpos;
419 int chanidx;
420 int scantype;
421 int scandur;
422 int channel;
423 int radiotype;
424 419
425 lbs_deb_enter(LBS_DEB_SCAN); 420 lbs_deb_enter(LBS_DEB_SCAN);
426 421
@@ -505,58 +500,8 @@ lbs_scan_setup_scan_config(struct lbs_private *priv,
505 */ 500 */
506 *ppchantlvout = (struct mrvlietypes_chanlistparamset *) ptlvpos; 501 *ppchantlvout = (struct mrvlietypes_chanlistparamset *) ptlvpos;
507 502
508 if (!puserscanin || !puserscanin->chanlist[0].channumber) { 503 lbs_scan_create_channel_list(priv, pscanchanlist,
509 /* Create a default channel scan list */ 504 *pfilteredscan);
510 lbs_deb_scan("creating full region channel list\n");
511 lbs_scan_create_channel_list(priv, pscanchanlist,
512 *pfilteredscan);
513 goto out;
514 }
515
516 for (chanidx = 0;
517 chanidx < LBS_IOCTL_USER_SCAN_CHAN_MAX
518 && puserscanin->chanlist[chanidx].channumber; chanidx++) {
519
520 channel = puserscanin->chanlist[chanidx].channumber;
521 (pscanchanlist + chanidx)->channumber = channel;
522
523 radiotype = puserscanin->chanlist[chanidx].radiotype;
524 (pscanchanlist + chanidx)->radiotype = radiotype;
525
526 scantype = puserscanin->chanlist[chanidx].scantype;
527
528 if (scantype == CMD_SCAN_TYPE_PASSIVE) {
529 (pscanchanlist +
530 chanidx)->chanscanmode.passivescan = 1;
531 } else {
532 (pscanchanlist +
533 chanidx)->chanscanmode.passivescan = 0;
534 }
535
536 if (puserscanin->chanlist[chanidx].scantime) {
537 scandur = puserscanin->chanlist[chanidx].scantime;
538 } else {
539 if (scantype == CMD_SCAN_TYPE_PASSIVE) {
540 scandur = MRVDRV_PASSIVE_SCAN_CHAN_TIME;
541 } else {
542 scandur = MRVDRV_ACTIVE_SCAN_CHAN_TIME;
543 }
544 }
545
546 (pscanchanlist + chanidx)->minscantime =
547 cpu_to_le16(scandur);
548 (pscanchanlist + chanidx)->maxscantime =
549 cpu_to_le16(scandur);
550 }
551
552 /* Check if we are only scanning the current channel */
553 if ((chanidx == 1) &&
554 (puserscanin->chanlist[0].channumber ==
555 priv->adapter->curbssparams.channel)) {
556 *pscancurrentonly = 1;
557 lbs_deb_scan("scanning current channel only");
558 }
559
560out: 505out:
561 return pscancfgout; 506 return pscancfgout;
562} 507}
diff --git a/drivers/net/wireless/libertas/scan.h b/drivers/net/wireless/libertas/scan.h
index e420cd9217cd..9b62e2b01f68 100644
--- a/drivers/net/wireless/libertas/scan.h
+++ b/drivers/net/wireless/libertas/scan.h
@@ -121,11 +121,6 @@ struct lbs_ioctl_user_scan_cfg {
121 121
122 /* Clear existing scan results matching this SSID */ 122 /* Clear existing scan results matching this SSID */
123 u8 clear_ssid; 123 u8 clear_ssid;
124
125 /**
126 * @brief Variable number (fixed maximum) of channels to scan up
127 */
128 struct lbs_ioctl_user_scan_chan chanlist[LBS_IOCTL_USER_SCAN_CHAN_MAX];
129}; 124};
130 125
131/** 126/**