summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/hostap
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-09-08 01:01:14 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-09-08 01:01:14 -0300
commite5fd91f1ef340da553f7a79da9540c3db711c937 (patch)
treeb11842027dc6641da63f4bcc524f8678263304a3 /drivers/net/wireless/hostap
parent2a9b0348e685a63d97486f6749622b61e9e3292f (diff)
Linux-libre 4.2-gnu
Diffstat (limited to 'drivers/net/wireless/hostap')
-rw-r--r--drivers/net/wireless/hostap/hostap.h1
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c24
-rw-r--r--drivers/net/wireless/hostap/hostap_config.h5
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c1
-rw-r--r--drivers/net/wireless/hostap/hostap_info.c5
-rw-r--r--drivers/net/wireless/hostap/hostap_ioctl.c43
6 files changed, 19 insertions, 60 deletions
diff --git a/drivers/net/wireless/hostap/hostap.h b/drivers/net/wireless/hostap/hostap.h
index c638a8359..ce8721fbc 100644
--- a/drivers/net/wireless/hostap/hostap.h
+++ b/drivers/net/wireless/hostap/hostap.h
@@ -90,7 +90,6 @@ extern const struct iw_handler_def hostap_iw_handler_def;
extern const struct ethtool_ops prism2_ethtool_ops;
int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
-int hostap_restore_power(struct net_device *dev);
#endif /* HOSTAP_H */
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index 993da7d5b..c995ace15 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -2403,13 +2403,13 @@ int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],
addr[count].sa_family = ARPHRD_ETHER;
memcpy(addr[count].sa_data, sta->addr, ETH_ALEN);
if (sta->last_rx_silence == 0)
- qual[count].qual = (sta->last_rx_signal - 156) == 0 ?
- 0 : (sta->last_rx_signal - 156) * 92 / 64;
+ qual[count].qual = sta->last_rx_signal < 27 ?
+ 0 : (sta->last_rx_signal - 27) * 92 / 127;
else
- qual[count].qual = (sta->last_rx_signal -
- sta->last_rx_silence) * 92 / 64;
- qual[count].level = sta->last_rx_signal;
- qual[count].noise = sta->last_rx_silence;
+ qual[count].qual = sta->last_rx_signal -
+ sta->last_rx_silence - 35;
+ qual[count].level = HFA384X_LEVEL_TO_dBm(sta->last_rx_signal);
+ qual[count].noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence);
qual[count].updated = sta->last_rx_updated;
sta->last_rx_updated = IW_QUAL_DBM;
@@ -2475,13 +2475,13 @@ int prism2_ap_translate_scan(struct net_device *dev,
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVQUAL;
if (sta->last_rx_silence == 0)
- iwe.u.qual.qual = (sta->last_rx_signal -156) == 0 ?
- 0 : (sta->last_rx_signal - 156) * 92 / 64;
+ iwe.u.qual.qual = sta->last_rx_signal < 27 ?
+ 0 : (sta->last_rx_signal - 27) * 92 / 127;
else
- iwe.u.qual.qual = (sta->last_rx_signal -
- sta->last_rx_silence) * 92 / 64;
- iwe.u.qual.level = sta->last_rx_signal;
- iwe.u.qual.noise = sta->last_rx_silence;
+ iwe.u.qual.qual = sta->last_rx_signal -
+ sta->last_rx_silence - 35;
+ iwe.u.qual.level = HFA384X_LEVEL_TO_dBm(sta->last_rx_signal);
+ iwe.u.qual.noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence);
iwe.u.qual.updated = sta->last_rx_updated;
iwe.len = IW_EV_QUAL_LEN;
current_ev = iwe_stream_add_event(info, current_ev, end_buf,
diff --git a/drivers/net/wireless/hostap/hostap_config.h b/drivers/net/wireless/hostap/hostap_config.h
index d37d1fd53..2c8f71f0e 100644
--- a/drivers/net/wireless/hostap/hostap_config.h
+++ b/drivers/net/wireless/hostap/hostap_config.h
@@ -45,9 +45,4 @@
*/
/* #define PRISM2_NO_STATION_MODES */
-/* Enable TX power Setting functions
- * (min att = -128 , max att = 127)
- */
-#define RAW_TXPOWER_SETTING
-
#endif /* HOSTAP_CONFIG_H */
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index 09ed859e4..6df3ee561 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -928,7 +928,6 @@ static int hfa384x_set_rid(struct net_device *dev, u16 rid, void *buf, int len)
prism2_hw_reset(dev);
}
- hostap_restore_power(dev);
return res;
}
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c
index 333ef11c4..7635ac4f6 100644
--- a/drivers/net/wireless/hostap/hostap_info.c
+++ b/drivers/net/wireless/hostap/hostap_info.c
@@ -435,11 +435,6 @@ static void handle_info_queue_linkstatus(local_info_t *local)
}
/* Get BSSID if we have a valid AP address */
-
- if ( val == HFA384X_LINKSTATUS_CONNECTED ||
- val == HFA384X_LINKSTATUS_DISCONNECTED )
- hostap_restore_power(local->dev);
-
if (connected) {
netif_carrier_on(local->dev);
netif_carrier_on(local->ddev);
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index 7e28b8300..3e5fa7872 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -1479,20 +1479,23 @@ static int prism2_txpower_hfa386x_to_dBm(u16 val)
val = 255;
tmp = val;
+ tmp >>= 2;
- return tmp;
+ return -12 - tmp;
}
static u16 prism2_txpower_dBm_to_hfa386x(int val)
{
signed char tmp;
- if (val > 127)
- return 127;
- else if (val < -128)
+ if (val > 20)
return 128;
+ else if (val < -43)
+ return 127;
tmp = val;
+ tmp = -12 - tmp;
+ tmp <<= 2;
return (unsigned char) tmp;
}
@@ -4049,35 +4052,3 @@ int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return ret;
}
-
-/* BUG FIX: Restore power setting value when lost due to F/W bug */
-
-int hostap_restore_power(struct net_device *dev)
-{
- struct hostap_interface *iface = netdev_priv(dev);
- local_info_t *local = iface->local;
-
- u16 val;
- int ret = 0;
-
- if (local->txpower_type == PRISM2_TXPOWER_OFF) {
- val = 0xff; /* use all standby and sleep modes */
- ret = local->func->cmd(dev, HFA384X_CMDCODE_WRITEMIF,
- HFA386X_CR_A_D_TEST_MODES2,
- &val, NULL);
- }
-
-#ifdef RAW_TXPOWER_SETTING
- if (local->txpower_type == PRISM2_TXPOWER_FIXED) {
- val = HFA384X_TEST_CFG_BIT_ALC;
- local->func->cmd(dev, HFA384X_CMDCODE_TEST |
- (HFA384X_TEST_CFG_BITS << 8), 0, &val, NULL);
- val = prism2_txpower_dBm_to_hfa386x(local->txpower);
- ret = (local->func->cmd(dev, HFA384X_CMDCODE_WRITEMIF,
- HFA386X_CR_MANUAL_TX_POWER, &val, NULL));
- }
-#endif /* RAW_TXPOWER_SETTING */
- return (ret ? -EOPNOTSUPP : 0);
-}
-
-EXPORT_SYMBOL(hostap_restore_power);