Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57665
b: refs/heads/master
c: 80e78ef
h: refs/heads/master
i:
  57663: c8974f3
v: v3
  • Loading branch information
Dan Williams authored and John W. Linville committed Jun 11, 2007
1 parent e32dd07 commit 05db0de
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 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: 94b23855c034ffa50e1f94f43ef4500520e4c36e
refs/heads/master: 80e78ef74dffb2195e2a1164c18579180a76fd5b
35 changes: 18 additions & 17 deletions trunk/drivers/net/wireless/libertas/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,6 @@ static inline char *libertas_translate_scan(wlan_private *priv,
char *current_val; /* For rates */
struct iw_event iwe; /* Temporary buffer */
int j;
int ret;
#define PERFECT_RSSI ((u8)50)
#define WORST_RSSI ((u8)0)
#define RSSI_DIFF ((u8)(PERFECT_RSSI - WORST_RSSI))
Expand Down Expand Up @@ -1560,22 +1559,18 @@ static inline char *libertas_translate_scan(wlan_private *priv,
iwe.u.qual.noise =
CAL_NF(adapter->NF[TYPE_BEACON][TYPE_NOAVG]);
}
if ((adapter->mode == IW_MODE_AUTO) &&
!libertas_SSID_cmp(&adapter->curbssparams.ssid, &bss->ssid)
&& adapter->adhoccreate) {
ret = libertas_prepare_and_send_command(priv,
cmd_802_11_rssi,
0,
cmd_option_waitforrsp,
0, NULL);

if (!ret) {
iwe.u.qual.level =
CAL_RSSI(adapter->SNR[TYPE_RXPD][TYPE_AVG] /
AVG_SCALE,
adapter->NF[TYPE_RXPD][TYPE_AVG] /
AVG_SCALE);
}

/* Locally created ad-hoc BSSs won't have beacons if this is the
* only station in the adhoc network; so get signal strength
* from receive statistics.
*/
if ((adapter->mode == IW_MODE_ADHOC)
&& adapter->adhoccreate
&& !libertas_SSID_cmp(&adapter->curbssparams.ssid, &bss->ssid)) {
int snr, nf;
snr = adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE;
nf = adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE;
iwe.u.qual.level = CAL_RSSI(snr, nf);
}
start = iwe_stream_add_event(start, stop, &iwe, IW_EV_QUAL_LEN);

Expand Down Expand Up @@ -1665,6 +1660,12 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,
if (!adapter->nr_cmd_pending && adapter->last_scanned_channel)
wlan_scan_networks(priv, NULL, 0);

/* Update RSSI if current BSS is a locally created ad-hoc BSS */
if ((adapter->inframode == wlan802_11ibss) && adapter->adhoccreate) {
libertas_prepare_and_send_command(priv, cmd_802_11_rssi, 0,
cmd_option_waitforrsp, 0, NULL);
}

mutex_lock(&adapter->lock);
list_for_each_entry_safe (iter_bss, safe, &adapter->network_list, list) {
char * next_ev;
Expand Down

0 comments on commit 05db0de

Please sign in to comment.