提交 a7d0adae 编写于 作者: H Holger Schurig 提交者: David S. Miller

libertas: remove user-specified channel list

Remove the ability to specify channels to scan via debugfs
Signed-off-by: NHolger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: NDan Williams <dcbw@redhat.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 dd1d12da
......@@ -195,8 +195,6 @@ setuserscan
where [ARGS]:
chan=[chan#][band][mode] where band is [a,b,g] and mode is
blank for active or 'p' for passive
bssid=xx:xx:xx:xx:xx:xx specify a BSSID filter for the scan
ssid="[SSID]" specify a SSID filter for the scan
keep=[0 or 1] keep the previous scan results (1), discard (0)
......@@ -204,35 +202,26 @@ setuserscan
type=[1,2,3] BSS type: 1 (Infra), 2(Adhoc), 3(Any)
Any combination of the above arguments can be supplied on the command
line. If the chan token is absent, a full channel scan will be
completed by the driver. If dur tokens are absent, the driver default
setting will be used. The bssid and ssid fields, if blank, will
produce an unfiltered scan. The type field will default to 3 (Any) and
the keep field will default to 0 (Discard).
line. If dur tokens are absent, the driver default setting will be used.
The bssid and ssid fields, if blank, will produce an unfiltered scan.
The type field will default to 3 (Any) and the keep field will default
to 0 (Discard).
Examples:
1) Perform an active scan on channels 1, 6, and 11 in the 'g' band:
echo "chan=1g,6g,11g" > setuserscan
1) Perform a passive scan on all channels for 20 ms per channel:
echo "dur=20" > setuserscan
2) Perform a passive scan on channel 11 for 20 ms:
echo "chan=11gp dur=20" > setuserscan
2) Perform an active scan for a specific SSID:
echo "ssid="TestAP"" > setuserscan
3) Perform an active scan on channels 1, 6, and 11; and a passive scan on
channel 36 in the 'a' band:
echo "chan=1g,6g,11g,36ap" > setuserscan
4) Perform an active scan on channel 6 and 36 for a specific SSID:
echo "chan=6g,36a ssid="TestAP"" > setuserscan
5) Scan all available channels (B/G, A bands) for a specific BSSID, keep
3) Scan all available channels (B/G, A bands) for a specific BSSID, keep
the current scan table intact, update existing or append new scan data:
echo "bssid=00:50:43:20:12:82 keep=1" > setuserscan
6) Scan channel 6, for all infrastructure networks.
4) Scan for all infrastructure networks.
Keep the previous scan table intact. Update any duplicate BSSID/SSID
matches with the new scan data:
echo "chan=6g type=1 keep=1" > setuserscan
echo "type=1 keep=1" > setuserscan
All entries in the scan table (not just the new scan data when keep=1)
will be displayed upon completion by use of the getscantable ioctl.
......
......@@ -196,43 +196,6 @@ static ssize_t lbs_extscan(struct file *file, const char __user *userbuf,
return count;
}
static int lbs_parse_chan(char *buf, size_t count,
struct lbs_ioctl_user_scan_cfg *scan_cfg, int dur)
{
char *start, *end, *hold, *str;
int i = 0;
start = strstr(buf, "chan=");
if (!start)
return -EINVAL;
start += 5;
end = strchr(start, ' ');
if (!end)
end = buf + count;
hold = kzalloc((end - start)+1, GFP_KERNEL);
if (!hold)
return -ENOMEM;
strncpy(hold, start, end - start);
hold[(end-start)+1] = '\0';
while(hold && (str = strsep(&hold, ","))) {
int chan;
char band, passive = 0;
sscanf(str, "%d%c%c", &chan, &band, &passive);
scan_cfg->chanlist[i].channumber = chan;
scan_cfg->chanlist[i].scantype = passive ? 1 : 0;
if (band == 'b' || band == 'g')
scan_cfg->chanlist[i].radiotype = 0;
else if (band == 'a')
scan_cfg->chanlist[i].radiotype = 1;
scan_cfg->chanlist[i].scantime = dur;
i++;
}
kfree(hold);
return i;
}
static void lbs_parse_bssid(char *buf, size_t count,
struct lbs_ioctl_user_scan_cfg *scan_cfg)
{
......@@ -346,7 +309,6 @@ static ssize_t lbs_setuserscan(struct file *file,
scan_cfg->bsstype = LBS_SCAN_BSS_TYPE_ANY;
dur = lbs_parse_dur(buf, count, scan_cfg);
lbs_parse_chan(buf, count, scan_cfg, dur);
lbs_parse_bssid(buf, count, scan_cfg);
scan_cfg->clear_bssid = lbs_parse_clear(buf, count, "clear_bssid=");
lbs_parse_ssid(buf, count, scan_cfg);
......
......@@ -416,11 +416,6 @@ lbs_scan_setup_scan_config(struct lbs_private *priv,
struct mrvlietypes_ssidparamset *pssidtlv;
struct lbs_scan_cmd_config *pscancfgout = NULL;
u8 *ptlvpos;
int chanidx;
int scantype;
int scandur;
int channel;
int radiotype;
lbs_deb_enter(LBS_DEB_SCAN);
......@@ -505,58 +500,8 @@ lbs_scan_setup_scan_config(struct lbs_private *priv,
*/
*ppchantlvout = (struct mrvlietypes_chanlistparamset *) ptlvpos;
if (!puserscanin || !puserscanin->chanlist[0].channumber) {
/* Create a default channel scan list */
lbs_deb_scan("creating full region channel list\n");
lbs_scan_create_channel_list(priv, pscanchanlist,
*pfilteredscan);
goto out;
}
for (chanidx = 0;
chanidx < LBS_IOCTL_USER_SCAN_CHAN_MAX
&& puserscanin->chanlist[chanidx].channumber; chanidx++) {
channel = puserscanin->chanlist[chanidx].channumber;
(pscanchanlist + chanidx)->channumber = channel;
radiotype = puserscanin->chanlist[chanidx].radiotype;
(pscanchanlist + chanidx)->radiotype = radiotype;
scantype = puserscanin->chanlist[chanidx].scantype;
if (scantype == CMD_SCAN_TYPE_PASSIVE) {
(pscanchanlist +
chanidx)->chanscanmode.passivescan = 1;
} else {
(pscanchanlist +
chanidx)->chanscanmode.passivescan = 0;
}
if (puserscanin->chanlist[chanidx].scantime) {
scandur = puserscanin->chanlist[chanidx].scantime;
} else {
if (scantype == CMD_SCAN_TYPE_PASSIVE) {
scandur = MRVDRV_PASSIVE_SCAN_CHAN_TIME;
} else {
scandur = MRVDRV_ACTIVE_SCAN_CHAN_TIME;
}
}
(pscanchanlist + chanidx)->minscantime =
cpu_to_le16(scandur);
(pscanchanlist + chanidx)->maxscantime =
cpu_to_le16(scandur);
}
/* Check if we are only scanning the current channel */
if ((chanidx == 1) &&
(puserscanin->chanlist[0].channumber ==
priv->adapter->curbssparams.channel)) {
*pscancurrentonly = 1;
lbs_deb_scan("scanning current channel only");
}
lbs_scan_create_channel_list(priv, pscanchanlist,
*pfilteredscan);
out:
return pscancfgout;
}
......
......@@ -121,11 +121,6 @@ struct lbs_ioctl_user_scan_cfg {
/* Clear existing scan results matching this SSID */
u8 clear_ssid;
/**
* @brief Variable number (fixed maximum) of channels to scan up
*/
struct lbs_ioctl_user_scan_chan chanlist[LBS_IOCTL_USER_SCAN_CHAN_MAX];
};
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册