aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Merello <andrea.merello@gmail.com>2014-05-31 12:30:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-06-19 15:49:12 -0400
commit7049327a686d2ba888b28a0456eddd3c71fb4b55 (patch)
tree1afaad26b794bc4da9ed3ffd85615ac6e19be2aa
parentafbedbf7dfc0ebff0ea3280530fe0609fd307486 (diff)
rtl818x_pci: provide dBm signal information for rtl8185
This patch makes the driver report signal information for rtl8185 boards using dBm instead of unspecified unit. Rtl8180 remains untouched. I did some tests to confirm the correctness of the measure performed by the board and it seems reasonably correct. The test setup has been made by connecting an AP with coax and RF attenuators to the card antenna port. In order to get a reference measure I tried with several cards with different chipset I own. I found that many gave different results, and I finally selected two cards that gave me consistent results to use as reference: AR9271 and Prism54-usb (isl3887 with Frisbee radio). Using this references I compared the RSSI information with my rtl8185 and I repeated tests with three different attenuation values, increasing attenuation by 10dB each step. I made only relative measures, making NO assumption about source power. CCK measures seem very close to my references, OFDM are a little bit less precise but, considering that these cards are not measuring instrumentation, IMHO this is still fairly good. CCK measures (1Mbps beacons) ATTENUATOR 1 p54usb: -58dBm ath9k_htc: -59dBm rtl8185: -59dBm ATTENUATOR 2 p54usb: -67dBm ath9k_htc: -68dBm rtl8185: -70dBm ATTENUATOR 3 p54usb: -78dBm ath9k_htc: -79dBm rtl8185: -79dBm OFDM measures (54Mbps ping) ATTENUATOR 1 p54usb: -58dBm ath9k_htc: -57dBm rtl8185: -62dBm ATTENUATOR 2 p54usb: -68dBm rtl8185: -71dBm Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/dev.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index c2dd5e636d28..cd8c09076b52 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -269,9 +269,9 @@ static void rtl8180_handle_rx(struct ieee80211_hw *dev)
269 switch (priv->chip_family) { 269 switch (priv->chip_family) {
270 case RTL818X_CHIP_FAMILY_RTL8185: 270 case RTL818X_CHIP_FAMILY_RTL8185:
271 if (rx_status.rate_idx > 3) 271 if (rx_status.rate_idx > 3)
272 signal = 90 - clamp_t(u8, agc, 25, 90); 272 signal = -clamp_t(u8, agc, 25, 90) - 9;
273 else 273 else
274 signal = 95 - clamp_t(u8, agc, 30, 95); 274 signal = -clamp_t(u8, agc, 30, 95);
275 break; 275 break;
276 case RTL818X_CHIP_FAMILY_RTL8180: 276 case RTL818X_CHIP_FAMILY_RTL8180:
277 sq = flags2 & 0xff; 277 sq = flags2 & 0xff;
@@ -1754,8 +1754,7 @@ static int rtl8180_probe(struct pci_dev *pdev,
1754 dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band; 1754 dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band;
1755 1755
1756 dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | 1756 dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
1757 IEEE80211_HW_RX_INCLUDES_FCS | 1757 IEEE80211_HW_RX_INCLUDES_FCS;
1758 IEEE80211_HW_SIGNAL_UNSPEC;
1759 dev->vif_data_size = sizeof(struct rtl8180_vif); 1758 dev->vif_data_size = sizeof(struct rtl8180_vif);
1760 dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | 1759 dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
1761 BIT(NL80211_IFTYPE_ADHOC); 1760 BIT(NL80211_IFTYPE_ADHOC);
@@ -1812,6 +1811,11 @@ static int rtl8180_probe(struct pci_dev *pdev,
1812 pci_try_set_mwi(pdev); 1811 pci_try_set_mwi(pdev);
1813 } 1812 }
1814 1813
1814 if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8185)
1815 dev->flags |= IEEE80211_HW_SIGNAL_DBM;
1816 else
1817 dev->flags |= IEEE80211_HW_SIGNAL_UNSPEC;
1818
1815 rtl8180_eeprom_read(priv); 1819 rtl8180_eeprom_read(priv);
1816 1820
1817 switch (priv->rf_type) { 1821 switch (priv->rf_type) {