|
@@ -47,6 +47,9 @@
|
|
|
#define BCM43xx_WX_VERSION 18
|
|
|
|
|
|
#define MAX_WX_STRING 80
|
|
|
+/* FIXME: the next line is a guess as to what the maximum value of RX power
|
|
|
+ (in dBm) might be */
|
|
|
+#define RX_POWER_MAX -10
|
|
|
|
|
|
|
|
|
static int bcm43xx_wx_get_name(struct net_device *net_dev,
|
|
@@ -56,12 +59,11 @@ static int bcm43xx_wx_get_name(struct net_device *net_dev,
|
|
|
{
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
int i;
|
|
|
- unsigned long flags;
|
|
|
struct bcm43xx_phyinfo *phy;
|
|
|
char suffix[7] = { 0 };
|
|
|
int have_a = 0, have_b = 0, have_g = 0;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
for (i = 0; i < bcm->nr_80211_available; i++) {
|
|
|
phy = &(bcm->core_80211_ext[i].phy);
|
|
|
switch (phy->type) {
|
|
@@ -77,7 +79,7 @@ static int bcm43xx_wx_get_name(struct net_device *net_dev,
|
|
|
assert(0);
|
|
|
}
|
|
|
}
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
i = 0;
|
|
|
if (have_a) {
|
|
@@ -111,7 +113,9 @@ static int bcm43xx_wx_set_channelfreq(struct net_device *net_dev,
|
|
|
int freq;
|
|
|
int err = -EINVAL;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
+ spin_lock_irqsave(&bcm->irq_lock, flags);
|
|
|
+
|
|
|
if ((data->freq.m >= 0) && (data->freq.m <= 1000)) {
|
|
|
channel = data->freq.m;
|
|
|
freq = bcm43xx_channel_to_freq(bcm, channel);
|
|
@@ -131,7 +135,8 @@ static int bcm43xx_wx_set_channelfreq(struct net_device *net_dev,
|
|
|
err = 0;
|
|
|
}
|
|
|
out_unlock:
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return err;
|
|
|
}
|
|
@@ -143,11 +148,10 @@ static int bcm43xx_wx_get_channelfreq(struct net_device *net_dev,
|
|
|
{
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
struct bcm43xx_radioinfo *radio;
|
|
|
- unsigned long flags;
|
|
|
int err = -ENODEV;
|
|
|
u16 channel;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
radio = bcm43xx_current_radio(bcm);
|
|
|
channel = radio->channel;
|
|
|
if (channel == 0xFF) {
|
|
@@ -162,7 +166,7 @@ static int bcm43xx_wx_get_channelfreq(struct net_device *net_dev,
|
|
|
|
|
|
err = 0;
|
|
|
out_unlock:
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return err;
|
|
|
}
|
|
@@ -180,13 +184,15 @@ static int bcm43xx_wx_set_mode(struct net_device *net_dev,
|
|
|
if (mode == IW_MODE_AUTO)
|
|
|
mode = BCM43xx_INITIAL_IWMODE;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
+ spin_lock_irqsave(&bcm->irq_lock, flags);
|
|
|
if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) {
|
|
|
if (bcm->ieee->iw_mode != mode)
|
|
|
bcm43xx_set_iwmode(bcm, mode);
|
|
|
} else
|
|
|
bcm->ieee->iw_mode = mode;
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -197,11 +203,10 @@ static int bcm43xx_wx_get_mode(struct net_device *net_dev,
|
|
|
char *extra)
|
|
|
{
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
- unsigned long flags;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
data->mode = bcm->ieee->iw_mode;
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -214,7 +219,6 @@ static int bcm43xx_wx_get_rangeparams(struct net_device *net_dev,
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
struct iw_range *range = (struct iw_range *)extra;
|
|
|
const struct ieee80211_geo *geo;
|
|
|
- unsigned long flags;
|
|
|
int i, j;
|
|
|
struct bcm43xx_phyinfo *phy;
|
|
|
|
|
@@ -227,14 +231,14 @@ static int bcm43xx_wx_get_rangeparams(struct net_device *net_dev,
|
|
|
|
|
|
range->max_qual.qual = 100;
|
|
|
/* TODO: Real max RSSI */
|
|
|
- range->max_qual.level = 3;
|
|
|
- range->max_qual.noise = 100;
|
|
|
- range->max_qual.updated = 7;
|
|
|
+ range->max_qual.level = 0;
|
|
|
+ range->max_qual.noise = 0;
|
|
|
+ range->max_qual.updated = IW_QUAL_ALL_UPDATED;
|
|
|
|
|
|
- range->avg_qual.qual = 70;
|
|
|
- range->avg_qual.level = 2;
|
|
|
- range->avg_qual.noise = 40;
|
|
|
- range->avg_qual.updated = 7;
|
|
|
+ range->avg_qual.qual = 50;
|
|
|
+ range->avg_qual.level = 0;
|
|
|
+ range->avg_qual.noise = 0;
|
|
|
+ range->avg_qual.updated = IW_QUAL_ALL_UPDATED;
|
|
|
|
|
|
range->min_rts = BCM43xx_MIN_RTS_THRESHOLD;
|
|
|
range->max_rts = BCM43xx_MAX_RTS_THRESHOLD;
|
|
@@ -254,7 +258,7 @@ static int bcm43xx_wx_get_rangeparams(struct net_device *net_dev,
|
|
|
IW_ENC_CAPA_CIPHER_TKIP |
|
|
|
IW_ENC_CAPA_CIPHER_CCMP;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
phy = bcm43xx_current_phy(bcm);
|
|
|
|
|
|
range->num_bitrates = 0;
|
|
@@ -301,7 +305,7 @@ static int bcm43xx_wx_get_rangeparams(struct net_device *net_dev,
|
|
|
}
|
|
|
range->num_frequency = j;
|
|
|
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -314,11 +318,11 @@ static int bcm43xx_wx_set_nick(struct net_device *net_dev,
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
size_t len;
|
|
|
|
|
|
- bcm43xx_lock_noirq(bcm);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
len = min((size_t)data->data.length, (size_t)IW_ESSID_MAX_SIZE);
|
|
|
memcpy(bcm->nick, extra, len);
|
|
|
bcm->nick[len] = '\0';
|
|
|
- bcm43xx_unlock_noirq(bcm);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -331,12 +335,12 @@ static int bcm43xx_wx_get_nick(struct net_device *net_dev,
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
size_t len;
|
|
|
|
|
|
- bcm43xx_lock_noirq(bcm);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
len = strlen(bcm->nick) + 1;
|
|
|
memcpy(extra, bcm->nick, len);
|
|
|
data->data.length = (__u16)len;
|
|
|
data->data.flags = 1;
|
|
|
- bcm43xx_unlock_noirq(bcm);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -350,7 +354,8 @@ static int bcm43xx_wx_set_rts(struct net_device *net_dev,
|
|
|
unsigned long flags;
|
|
|
int err = -EINVAL;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
+ spin_lock_irqsave(&bcm->irq_lock, flags);
|
|
|
if (data->rts.disabled) {
|
|
|
bcm->rts_threshold = BCM43xx_MAX_RTS_THRESHOLD;
|
|
|
err = 0;
|
|
@@ -361,7 +366,8 @@ static int bcm43xx_wx_set_rts(struct net_device *net_dev,
|
|
|
err = 0;
|
|
|
}
|
|
|
}
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return err;
|
|
|
}
|
|
@@ -372,13 +378,12 @@ static int bcm43xx_wx_get_rts(struct net_device *net_dev,
|
|
|
char *extra)
|
|
|
{
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
- unsigned long flags;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
data->rts.value = bcm->rts_threshold;
|
|
|
data->rts.fixed = 0;
|
|
|
data->rts.disabled = (bcm->rts_threshold == BCM43xx_MAX_RTS_THRESHOLD);
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -392,7 +397,8 @@ static int bcm43xx_wx_set_frag(struct net_device *net_dev,
|
|
|
unsigned long flags;
|
|
|
int err = -EINVAL;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
+ spin_lock_irqsave(&bcm->irq_lock, flags);
|
|
|
if (data->frag.disabled) {
|
|
|
bcm->ieee->fts = MAX_FRAG_THRESHOLD;
|
|
|
err = 0;
|
|
@@ -403,7 +409,8 @@ static int bcm43xx_wx_set_frag(struct net_device *net_dev,
|
|
|
err = 0;
|
|
|
}
|
|
|
}
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return err;
|
|
|
}
|
|
@@ -414,13 +421,12 @@ static int bcm43xx_wx_get_frag(struct net_device *net_dev,
|
|
|
char *extra)
|
|
|
{
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
- unsigned long flags;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
data->frag.value = bcm->ieee->fts;
|
|
|
data->frag.fixed = 0;
|
|
|
data->frag.disabled = (bcm->ieee->fts == MAX_FRAG_THRESHOLD);
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -442,7 +448,8 @@ static int bcm43xx_wx_set_xmitpower(struct net_device *net_dev,
|
|
|
return -EOPNOTSUPP;
|
|
|
}
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
+ spin_lock_irqsave(&bcm->irq_lock, flags);
|
|
|
if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED)
|
|
|
goto out_unlock;
|
|
|
radio = bcm43xx_current_radio(bcm);
|
|
@@ -466,7 +473,8 @@ static int bcm43xx_wx_set_xmitpower(struct net_device *net_dev,
|
|
|
err = 0;
|
|
|
|
|
|
out_unlock:
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return err;
|
|
|
}
|
|
@@ -478,10 +486,9 @@ static int bcm43xx_wx_get_xmitpower(struct net_device *net_dev,
|
|
|
{
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
struct bcm43xx_radioinfo *radio;
|
|
|
- unsigned long flags;
|
|
|
int err = -ENODEV;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED)
|
|
|
goto out_unlock;
|
|
|
radio = bcm43xx_current_radio(bcm);
|
|
@@ -493,7 +500,7 @@ static int bcm43xx_wx_get_xmitpower(struct net_device *net_dev,
|
|
|
|
|
|
err = 0;
|
|
|
out_unlock:
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return err;
|
|
|
}
|
|
@@ -580,7 +587,8 @@ static int bcm43xx_wx_set_interfmode(struct net_device *net_dev,
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
+ spin_lock_irqsave(&bcm->irq_lock, flags);
|
|
|
if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) {
|
|
|
err = bcm43xx_radio_set_interference_mitigation(bcm, mode);
|
|
|
if (err) {
|
|
@@ -595,7 +603,8 @@ static int bcm43xx_wx_set_interfmode(struct net_device *net_dev,
|
|
|
} else
|
|
|
bcm43xx_current_radio(bcm)->interfmode = mode;
|
|
|
}
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return err;
|
|
|
}
|
|
@@ -606,12 +615,11 @@ static int bcm43xx_wx_get_interfmode(struct net_device *net_dev,
|
|
|
char *extra)
|
|
|
{
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
- unsigned long flags;
|
|
|
int mode;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
mode = bcm43xx_current_radio(bcm)->interfmode;
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
switch (mode) {
|
|
|
case BCM43xx_RADIO_INTERFMODE_NONE:
|
|
@@ -641,9 +649,11 @@ static int bcm43xx_wx_set_shortpreamble(struct net_device *net_dev,
|
|
|
int on;
|
|
|
|
|
|
on = *((int *)extra);
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
+ spin_lock_irqsave(&bcm->irq_lock, flags);
|
|
|
bcm->short_preamble = !!on;
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -654,12 +664,11 @@ static int bcm43xx_wx_get_shortpreamble(struct net_device *net_dev,
|
|
|
char *extra)
|
|
|
{
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
- unsigned long flags;
|
|
|
int on;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
on = bcm->short_preamble;
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
if (on)
|
|
|
strncpy(extra, "1 (Short Preamble enabled)", MAX_WX_STRING);
|
|
@@ -681,11 +690,13 @@ static int bcm43xx_wx_set_swencryption(struct net_device *net_dev,
|
|
|
|
|
|
on = *((int *)extra);
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
+ spin_lock_irqsave(&bcm->irq_lock, flags);
|
|
|
bcm->ieee->host_encrypt = !!on;
|
|
|
bcm->ieee->host_decrypt = !!on;
|
|
|
bcm->ieee->host_build_iv = !on;
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -696,12 +707,11 @@ static int bcm43xx_wx_get_swencryption(struct net_device *net_dev,
|
|
|
char *extra)
|
|
|
{
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
- unsigned long flags;
|
|
|
int on;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
on = bcm->ieee->host_encrypt;
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
|
|
|
if (on)
|
|
|
strncpy(extra, "1 (SW encryption enabled) ", MAX_WX_STRING);
|
|
@@ -764,11 +774,13 @@ static int bcm43xx_wx_sprom_read(struct net_device *net_dev,
|
|
|
if (!sprom)
|
|
|
goto out;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
+ spin_lock_irqsave(&bcm->irq_lock, flags);
|
|
|
err = -ENODEV;
|
|
|
if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED)
|
|
|
err = bcm43xx_sprom_read(bcm, sprom);
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
if (!err)
|
|
|
data->data.length = sprom2hex(sprom, extra);
|
|
|
kfree(sprom);
|
|
@@ -809,11 +821,15 @@ static int bcm43xx_wx_sprom_write(struct net_device *net_dev,
|
|
|
if (err)
|
|
|
goto out_kfree;
|
|
|
|
|
|
- bcm43xx_lock_irqsafe(bcm, flags);
|
|
|
+ mutex_lock(&bcm->mutex);
|
|
|
+ spin_lock_irqsave(&bcm->irq_lock, flags);
|
|
|
+ spin_lock(&bcm->leds_lock);
|
|
|
err = -ENODEV;
|
|
|
if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED)
|
|
|
err = bcm43xx_sprom_write(bcm, sprom);
|
|
|
- bcm43xx_unlock_irqsafe(bcm, flags);
|
|
|
+ spin_unlock(&bcm->leds_lock);
|
|
|
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
|
|
|
+ mutex_unlock(&bcm->mutex);
|
|
|
out_kfree:
|
|
|
kfree(sprom);
|
|
|
out:
|
|
@@ -827,6 +843,9 @@ static struct iw_statistics *bcm43xx_get_wireless_stats(struct net_device *net_d
|
|
|
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
|
|
|
struct ieee80211softmac_device *mac = ieee80211_priv(net_dev);
|
|
|
struct iw_statistics *wstats;
|
|
|
+ struct ieee80211_network *network = NULL;
|
|
|
+ static int tmp_level = 0;
|
|
|
+ unsigned long flags;
|
|
|
|
|
|
wstats = &bcm->stats.wstats;
|
|
|
if (!mac->associated) {
|
|
@@ -844,16 +863,25 @@ static struct iw_statistics *bcm43xx_get_wireless_stats(struct net_device *net_d
|
|
|
wstats->qual.level = 0;
|
|
|
wstats->qual.noise = 0;
|
|
|
wstats->qual.updated = 7;
|
|
|
- wstats->qual.updated |= IW_QUAL_NOISE_INVALID |
|
|
|
- IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_INVALID;
|
|
|
+ wstats->qual.updated |= IW_QUAL_ALL_UPDATED;
|
|
|
return wstats;
|
|
|
}
|
|
|
/* fill in the real statistics when iface associated */
|
|
|
- wstats->qual.qual = 100; // TODO: get the real signal quality
|
|
|
- wstats->qual.level = 3 - bcm->stats.link_quality;
|
|
|
+ spin_lock_irqsave(&mac->ieee->lock, flags);
|
|
|
+ list_for_each_entry(network, &mac->ieee->network_list, list) {
|
|
|
+ if (!memcmp(mac->associnfo.bssid, network->bssid, ETH_ALEN)) {
|
|
|
+ if (!tmp_level) /* get initial value */
|
|
|
+ tmp_level = network->stats.rssi;
|
|
|
+ else /* smooth results */
|
|
|
+ tmp_level = (7 * tmp_level + network->stats.rssi)/8;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ spin_unlock_irqrestore(&mac->ieee->lock, flags);
|
|
|
+ wstats->qual.level = tmp_level;
|
|
|
+ wstats->qual.qual = 100 + tmp_level - RX_POWER_MAX; // TODO: get the real signal quality
|
|
|
wstats->qual.noise = bcm->stats.noise;
|
|
|
- wstats->qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED |
|
|
|
- IW_QUAL_NOISE_UPDATED;
|
|
|
+ wstats->qual.updated = IW_QUAL_ALL_UPDATED;
|
|
|
wstats->discard.code = bcm->ieee->ieee_stats.rx_discards_undecryptable;
|
|
|
wstats->discard.retries = bcm->ieee->ieee_stats.tx_retry_limit_exceeded;
|
|
|
wstats->discard.nwid = bcm->ieee->ieee_stats.tx_discards_wrong_sa;
|