Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291127
b: refs/heads/master
c: be0b281
h: refs/heads/master
i:
  291125: d3219e5
  291123: ecda903
  291119: 45f1145
v: v3
  • Loading branch information
Amitkumar Karwar authored and John W. Linville committed Mar 5, 2012
1 parent 369bd53 commit 42cccb0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9be5f39bdabb25708a9de294c2cae7bdd8dfb17
refs/heads/master: be0b281e8f7afd56d2250a568b85dafc850bc9ae
10 changes: 4 additions & 6 deletions trunk/drivers/net/wireless/mwifiex/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,12 +1106,10 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev,
dev_err(priv->adapter->dev, "failed to alloc scan_req\n");
return -ENOMEM;
}
for (i = 0; i < request->n_ssids; i++) {
memcpy(priv->user_scan_cfg->ssid_list[i].ssid,
request->ssids[i].ssid, request->ssids[i].ssid_len);
priv->user_scan_cfg->ssid_list[i].max_len =
request->ssids[i].ssid_len;
}

priv->user_scan_cfg->num_ssids = request->n_ssids;
priv->user_scan_cfg->ssid_list = request->ssids;

for (i = 0; i < request->n_channels; i++) {
chan = request->channels[i];
priv->user_scan_cfg->chan_list[i].chan_number = chan->hw_value;
Expand Down
10 changes: 3 additions & 7 deletions trunk/drivers/net/wireless/mwifiex/fw.h
Original file line number Diff line number Diff line change
Expand Up @@ -852,11 +852,6 @@ struct mwifiex_user_scan_chan {
u32 scan_time;
} __packed;

struct mwifiex_user_scan_ssid {
u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
u8 max_len;
} __packed;

struct mwifiex_user_scan_cfg {
/*
* BSS mode to be sent in the firmware command
Expand All @@ -867,8 +862,9 @@ struct mwifiex_user_scan_cfg {
u8 reserved;
/* BSSID filter sent in the firmware command to limit the results */
u8 specific_bssid[ETH_ALEN];
/* SSID filter list used in the to limit the scan results */
struct mwifiex_user_scan_ssid ssid_list[MWIFIEX_MAX_SSID_LIST_LENGTH];
/* SSID filter list used in the firmware to limit the scan results */
struct cfg80211_ssid *ssid_list;
u8 num_ssids;
/* Variable number (fixed maximum) of channels to scan up */
struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
} __packed;
Expand Down
40 changes: 20 additions & 20 deletions trunk/drivers/net/wireless/mwifiex/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv,
u16 scan_dur;
u8 channel;
u8 radio_type;
u32 ssid_idx;
int i;
u8 ssid_filter;
u8 rates[MWIFIEX_SUPPORTED_RATES];
u32 rates_size;
Expand Down Expand Up @@ -792,14 +792,8 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv,
user_scan_in->specific_bssid,
sizeof(scan_cfg_out->specific_bssid));

for (ssid_idx = 0;
((ssid_idx < ARRAY_SIZE(user_scan_in->ssid_list))
&& (*user_scan_in->ssid_list[ssid_idx].ssid
|| user_scan_in->ssid_list[ssid_idx].max_len));
ssid_idx++) {

ssid_len = strlen(user_scan_in->ssid_list[ssid_idx].
ssid) + 1;
for (i = 0; i < user_scan_in->num_ssids; i++) {
ssid_len = user_scan_in->ssid_list[i].ssid_len;

wildcard_ssid_tlv =
(struct mwifiex_ie_types_wildcard_ssid_params *)
Expand All @@ -810,19 +804,26 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv,
(u16) (ssid_len + sizeof(wildcard_ssid_tlv->
max_ssid_length)));

/* max_ssid_length = 0 tells firmware to perform
specific scan for the SSID filled */
wildcard_ssid_tlv->max_ssid_length = 0;
/*
* max_ssid_length = 0 tells firmware to perform
* specific scan for the SSID filled, whereas
* max_ssid_length = IEEE80211_MAX_SSID_LEN is for
* wildcard scan.
*/
if (ssid_len)
wildcard_ssid_tlv->max_ssid_length = 0;
else
wildcard_ssid_tlv->max_ssid_length =
IEEE80211_MAX_SSID_LEN;

memcpy(wildcard_ssid_tlv->ssid,
user_scan_in->ssid_list[ssid_idx].ssid,
ssid_len);
user_scan_in->ssid_list[i].ssid, ssid_len);

tlv_pos += (sizeof(wildcard_ssid_tlv->header)
+ le16_to_cpu(wildcard_ssid_tlv->header.len));

dev_dbg(adapter->dev, "info: scan: ssid_list[%d]: %s, %d\n",
ssid_idx, wildcard_ssid_tlv->ssid,
dev_dbg(adapter->dev, "info: scan: ssid[%d]: %s, %d\n",
i, wildcard_ssid_tlv->ssid,
wildcard_ssid_tlv->max_ssid_length);

/* Empty wildcard ssid with a maxlen will match many or
Expand All @@ -831,7 +832,6 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv,
filtered. */
if (!ssid_len && wildcard_ssid_tlv->max_ssid_length)
ssid_filter = false;

}

/*
Expand All @@ -840,7 +840,7 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv,
* truncate scan results. That is not an issue with an SSID
* or BSSID filter applied to the scan results in the firmware.
*/
if ((ssid_idx && ssid_filter)
if ((i && ssid_filter)
|| memcmp(scan_cfg_out->specific_bssid, &zero_mac,
sizeof(zero_mac)))
*filtered_scan = true;
Expand Down Expand Up @@ -1876,8 +1876,8 @@ static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv,
return -ENOMEM;
}

memcpy(scan_cfg->ssid_list[0].ssid, req_ssid->ssid,
req_ssid->ssid_len);
scan_cfg->ssid_list = req_ssid;
scan_cfg->num_ssids = 1;

ret = mwifiex_scan_networks(priv, scan_cfg);

Expand Down

0 comments on commit 42cccb0

Please sign in to comment.