rt2x00: update to new statistics reporting API
This patch updates rt2x00 to the new statistics reporting API.
Signed-off-by: Michael Wu <[email protected]>
---
drivers/net/wireless/d80211/rt2x00/rt2400pci.c | 12 +-----------
drivers/net/wireless/d80211/rt2x00/rt2500pci.c | 16 ++++------------
drivers/net/wireless/d80211/rt2x00/rt2500usb.c | 16 ++++------------
drivers/net/wireless/d80211/rt2x00/rt61pci.c | 12 ++----------
drivers/net/wireless/d80211/rt2x00/rt73usb.c | 12 ++----------
5 files changed, 13 insertions(+), 55 deletions(-)
diff --git a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
index 3be2aa8..8853876 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
@@ -1571,16 +1571,6 @@ static void rt2400pci_rxdone(struct work
rt2x00dev->rx_params.ssi =
rt2x00_get_field32(word2, RXD_W2_RSSI);
- /*
- * The following set of assignments supply
- * additional data for wireless statistics. The
- * necessary quantities are (1) the "noise" value
- * in dBm, and (2) the "signal" value in dBm.
- */
- rt2x00dev->rx_params.noise = 0;
- rt2x00dev->rx_params.signal = rt2x00dev->rx_params.ssi
- - rt2x00dev->hw->maxssi;
-
__ieee80211_rx(rt2x00dev->hw,
skb, &rt2x00dev->rx_params);
}
@@ -2655,7 +2645,7 @@ static int rt2400pci_init_hw(struct rt2x
IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
IEEE80211_HW_MONITOR_DURING_OPER;
rt2x00dev->hw->extra_tx_headroom = 0;
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_rssi = MAX_RX_SSI;
rt2x00dev->hw->queues = RING_NUM_TX;
status = rt2400pci_init_hw_modes(rt2x00dev);
diff --git a/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
b/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
index 7e69825..2c4e729 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
@@ -1728,17 +1728,8 @@ static void rt2500pci_rxdone(struct work
rt2x00dev->rx_params.ssi =
rt2x00_get_field32(word2, RXD_W2_RSSI);
-
- /*
- * The following set of assignments supply
- * additional data for wireless statistics. The
- * necessary quantities are (1) the "noise" value
- * in dBm, and (2) the "signal" value in dBm.
- */
rt2x00dev->rx_params.noise =
rt2x00_get_link_noise(&rt2x00dev->link);
- rt2x00dev->rx_params.signal = rt2x00dev->rx_params.ssi
- - rt2x00dev->hw->maxssi;
__ieee80211_rx(rt2x00dev->hw,
skb, &rt2x00dev->rx_params);
@@ -2649,10 +2640,11 @@ static int rt2500pci_init_eeprom(struct
* Read the RSSI <-> dBm offset information.
*/
rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET, &eeprom);
- rt2x00dev->hw->maxssi =
+ rt2x00dev->hw->max_rssi =
rt2x00_get_field16(eeprom, EEPROM_CALIBRATE_OFFSET_RSSI);
- if (rt2x00dev->hw->maxssi == 0x00 || rt2x00dev->hw->maxssi == 0xff)
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
+ if (rt2x00dev->hw->max_rssi == 0x00 || rt2x00dev->hw->max_rssi == 0xff)
+ rt2x00dev->hw->max_rssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_noise = -110;
return 0;
}
diff --git a/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
b/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
index cb8f7e6..eade5ff 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
@@ -1709,17 +1709,8 @@ static void rt2500usb_rxdone(struct work
rt2x00dev->rx_params.ssi =
rt2x00_get_field32(word1, RXD_W1_RSSI);
-
- /*
- * The following set of assignments supply
- * additional data for wireless statistics. The
- * necessary quantities are (1) the "noise" value
- * in dBm, and (2) the "signal" value in dBm.
- */
rt2x00dev->rx_params.noise =
rt2x00_get_link_noise(&rt2x00dev->link);
- rt2x00dev->rx_params.signal = rt2x00dev->rx_params.ssi
- - rt2x00dev->hw->maxssi;
__ieee80211_rx(rt2x00dev->hw,
skb, &rt2x00dev->rx_params);
@@ -2493,10 +2484,11 @@ static int rt2500usb_init_eeprom(struct
* Read the RSSI <-> dBm offset information.
*/
rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET, &eeprom);
- rt2x00dev->hw->maxssi =
+ rt2x00dev->hw->max_rssi =
rt2x00_get_field16(eeprom, EEPROM_CALIBRATE_OFFSET_RSSI);
- if (rt2x00dev->hw->maxssi == 0x00 || rt2x00dev->hw->maxssi == 0xff)
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
+ if (rt2x00dev->hw->max_rssi == 0x00 || rt2x00dev->hw->max_rssi == 0xff)
+ rt2x00dev->hw->max_rssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_noise = -110;
return 0;
}
diff --git a/drivers/net/wireless/d80211/rt2x00/rt61pci.c
b/drivers/net/wireless/d80211/rt2x00/rt61pci.c
index 7f2d4c0..5899d2c 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt61pci.c
@@ -2198,17 +2198,8 @@ static void rt61pci_rxdone(struct work_s
rt2x00dev->rx_params.ssi =
rt2x00_get_field32(word1, RXD_W1_RSSI);
-
- /*
- * The following set of assignments supply
- * additional data for wireless statistics. The
- * necessary quantities are (1) the "noise" value
- * in dBm, and (2) the "signal" value in dBm.
- */
rt2x00dev->rx_params.noise =
rt2x00_get_link_noise(&rt2x00dev->link);
- rt2x00dev->rx_params.signal = rt2x00dev->rx_params.ssi
- - rt2x00dev->hw->maxssi;
__ieee80211_rx(rt2x00dev->hw,
skb, &rt2x00dev->rx_params);
@@ -3490,7 +3481,8 @@ static int rt61pci_init_hw(struct rt2x00
IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
IEEE80211_HW_MONITOR_DURING_OPER;
rt2x00dev->hw->extra_tx_headroom = 0;
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_rssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_noise = -110;
rt2x00dev->hw->queues = RING_NUM_TX;
num_modes = rt61pci_init_hw_modes(rt2x00dev);
diff --git a/drivers/net/wireless/d80211/rt2x00/rt73usb.c
b/drivers/net/wireless/d80211/rt2x00/rt73usb.c
index 0915636..6116d44 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt73usb.c
@@ -1986,17 +1986,8 @@ static void rt73usb_rxdone(struct work_s
rt2x00dev->rx_params.ssi =
rt2x00_get_field32(word1, RXD_W1_RSSI);
-
- /*
- * The following set of assignments supply
- * additional data for wireless statistics. The
- * necessary quantities are (1) the "noise" value
- * in dBm, and (2) the "signal" value in dBm.
- */
rt2x00dev->rx_params.noise =
rt2x00_get_link_noise(&rt2x00dev->link);
- rt2x00dev->rx_params.signal = rt2x00dev->rx_params.ssi
- - rt2x00dev->hw->maxssi;
__ieee80211_rx(rt2x00dev->hw,
skb, &rt2x00dev->rx_params);
@@ -3146,7 +3137,8 @@ static int rt73usb_init_hw(struct rt2x00
IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
IEEE80211_HW_MONITOR_DURING_OPER;
rt2x00dev->hw->extra_tx_headroom = 0;
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_rssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_noise = -110;
rt2x00dev->hw->queues = RING_NUM_TX;
num_modes = rt73usb_init_hw_modes(rt2x00dev);
Hi,
> rt2x00: update to new statistics reporting API
>
> This patch updates rt2x00 to the new statistics reporting API.
>
> Signed-off-by: Michael Wu <[email protected]>
Looks good. I will look into the real max_noise values later,
but this patch is good. :)
Ivo
Ok, here's a better version that actually compiles. rt2x00 didn't compile at
the time I wrote the patch, so I didn't actually get to compile test it.
--
rt2x00: update to new statistics reporting API
This patch updates rt2x00 to the new statistics reporting API.
Signed-off-by: Michael Wu <[email protected]>
---
drivers/net/wireless/d80211/rt2x00/rt2400pci.c | 12 +-----------
drivers/net/wireless/d80211/rt2x00/rt2500pci.c | 17 ++++-------------
drivers/net/wireless/d80211/rt2x00/rt2500usb.c | 17 ++++-------------
drivers/net/wireless/d80211/rt2x00/rt61pci.c | 12 ++----------
drivers/net/wireless/d80211/rt2x00/rt73usb.c | 12 ++----------
5 files changed, 13 insertions(+), 57 deletions(-)
diff --git a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
index 2e3a514..b46e686 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
@@ -1560,16 +1560,6 @@ static void rt2400pci_rxdone(struct work
rt2x00dev->rx_params.ssi =
rt2x00_get_field32(word2, RXD_W2_RSSI);
- /*
- * The following set of assignments supply
- * additional data for wireless statistics. The
- * necessary quantities are (1) the "noise" value
- * in dBm, and (2) the "signal" value in dBm.
- */
- rt2x00dev->rx_params.noise = 0;
- rt2x00dev->rx_params.signal = rt2x00dev->rx_params.ssi
- - rt2x00dev->hw->maxssi;
-
__ieee80211_rx(rt2x00dev->hw,
skb, &rt2x00dev->rx_params);
}
@@ -2643,7 +2633,7 @@ static int rt2400pci_init_hw(struct rt2x
IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
IEEE80211_HW_MONITOR_DURING_OPER;
rt2x00dev->hw->extra_tx_headroom = 0;
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_rssi = MAX_RX_SSI;
rt2x00dev->hw->queues = RING_NUM_TX;
status = rt2400pci_init_hw_modes(rt2x00dev);
diff --git a/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
b/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
index 305cff6..6a10d4b 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
@@ -1717,17 +1717,8 @@ static void rt2500pci_rxdone(struct work
rt2x00dev->rx_params.ssi =
rt2x00_get_field32(word2, RXD_W2_RSSI);
-
- /*
- * The following set of assignments supply
- * additional data for wireless statistics. The
- * necessary quantities are (1) the "noise" value
- * in dBm, and (2) the "signal" value in dBm.
- */
rt2x00dev->rx_params.noise =
rt2x00_get_link_noise(&rt2x00dev->link);
- rt2x00dev->rx_params.signal = rt2x00dev->rx_params.ssi
- - rt2x00dev->hw->maxssi;
__ieee80211_rx(rt2x00dev->hw,
skb, &rt2x00dev->rx_params);
@@ -2637,10 +2628,11 @@ static int rt2500pci_init_eeprom(struct
* Read the RSSI <-> dBm offset information.
*/
rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET, &eeprom);
- rt2x00dev->hw->maxssi =
+ rt2x00dev->hw->max_rssi =
rt2x00_get_field16(eeprom, EEPROM_CALIBRATE_OFFSET_RSSI);
- if (rt2x00dev->hw->maxssi == 0x00 || rt2x00dev->hw->maxssi == 0xff)
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
+ if (rt2x00dev->hw->max_rssi == 0x00 || rt2x00dev->hw->max_rssi == 0xff)
+ rt2x00dev->hw->max_rssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_noise = -110;
return 0;
}
@@ -2949,7 +2941,6 @@ static int rt2500pci_init_hw(struct rt2x
IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
IEEE80211_HW_MONITOR_DURING_OPER;
rt2x00dev->hw->extra_tx_headroom = 0;
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
rt2x00dev->hw->queues = RING_NUM_TX;
num_modes = rt2500pci_init_hw_modes(rt2x00dev);
diff --git a/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
b/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
index 0976c98..6222c11 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
@@ -1698,17 +1698,8 @@ static void rt2500usb_rxdone(struct work
rt2x00dev->rx_params.ssi =
rt2x00_get_field32(word1, RXD_W1_RSSI);
-
- /*
- * The following set of assignments supply
- * additional data for wireless statistics. The
- * necessary quantities are (1) the "noise" value
- * in dBm, and (2) the "signal" value in dBm.
- */
rt2x00dev->rx_params.noise =
rt2x00_get_link_noise(&rt2x00dev->link);
- rt2x00dev->rx_params.signal = rt2x00dev->rx_params.ssi
- - rt2x00dev->hw->maxssi;
__ieee80211_rx(rt2x00dev->hw,
skb, &rt2x00dev->rx_params);
@@ -2481,10 +2472,11 @@ static int rt2500usb_init_eeprom(struct
* Read the RSSI <-> dBm offset information.
*/
rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET, &eeprom);
- rt2x00dev->hw->maxssi =
+ rt2x00dev->hw->max_rssi =
rt2x00_get_field16(eeprom, EEPROM_CALIBRATE_OFFSET_RSSI);
- if (rt2x00dev->hw->maxssi == 0x00 || rt2x00dev->hw->maxssi == 0xff)
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
+ if (rt2x00dev->hw->max_rssi == 0x00 || rt2x00dev->hw->max_rssi == 0xff)
+ rt2x00dev->hw->max_rssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_noise = -110;
return 0;
}
@@ -2792,7 +2784,6 @@ static int rt2500usb_init_hw(struct rt2x
IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
IEEE80211_HW_MONITOR_DURING_OPER;
rt2x00dev->hw->extra_tx_headroom = 0;
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
rt2x00dev->hw->queues = RING_NUM_TX;
num_modes = rt2500usb_init_hw_modes(rt2x00dev);
diff --git a/drivers/net/wireless/d80211/rt2x00/rt61pci.c
b/drivers/net/wireless/d80211/rt2x00/rt61pci.c
index 547c660..e4985bc 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt61pci.c
@@ -2187,17 +2187,8 @@ static void rt61pci_rxdone(struct work_s
rt2x00dev->rx_params.ssi =
rt2x00_get_field32(word1, RXD_W1_RSSI);
-
- /*
- * The following set of assignments supply
- * additional data for wireless statistics. The
- * necessary quantities are (1) the "noise" value
- * in dBm, and (2) the "signal" value in dBm.
- */
rt2x00dev->rx_params.noise =
rt2x00_get_link_noise(&rt2x00dev->link);
- rt2x00dev->rx_params.signal = rt2x00dev->rx_params.ssi
- - rt2x00dev->hw->maxssi;
__ieee80211_rx(rt2x00dev->hw,
skb, &rt2x00dev->rx_params);
@@ -3478,7 +3469,8 @@ static int rt61pci_init_hw(struct rt2x00
IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
IEEE80211_HW_MONITOR_DURING_OPER;
rt2x00dev->hw->extra_tx_headroom = 0;
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_rssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_noise = -110;
rt2x00dev->hw->queues = RING_NUM_TX;
num_modes = rt61pci_init_hw_modes(rt2x00dev);
diff --git a/drivers/net/wireless/d80211/rt2x00/rt73usb.c
b/drivers/net/wireless/d80211/rt2x00/rt73usb.c
index be66e2f..c2817a4 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt73usb.c
@@ -1975,17 +1975,8 @@ static void rt73usb_rxdone(struct work_s
rt2x00dev->rx_params.ssi =
rt2x00_get_field32(word1, RXD_W1_RSSI);
-
- /*
- * The following set of assignments supply
- * additional data for wireless statistics. The
- * necessary quantities are (1) the "noise" value
- * in dBm, and (2) the "signal" value in dBm.
- */
rt2x00dev->rx_params.noise =
rt2x00_get_link_noise(&rt2x00dev->link);
- rt2x00dev->rx_params.signal = rt2x00dev->rx_params.ssi
- - rt2x00dev->hw->maxssi;
__ieee80211_rx(rt2x00dev->hw,
skb, &rt2x00dev->rx_params);
@@ -3134,7 +3125,8 @@ static int rt73usb_init_hw(struct rt2x00
IEEE80211_HW_NO_TKIP_WMM_HWACCEL |
IEEE80211_HW_MONITOR_DURING_OPER;
rt2x00dev->hw->extra_tx_headroom = 0;
- rt2x00dev->hw->maxssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_rssi = MAX_RX_SSI;
+ rt2x00dev->hw->max_noise = -110;
rt2x00dev->hw->queues = RING_NUM_TX;
num_modes = rt73usb_init_hw_modes(rt2x00dev);