]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rt2x00: Implement get_ringparam callback function
authorIvo van Doorn <IvDoorn@gmail.com>
Mon, 18 Apr 2011 13:34:41 +0000 (15:34 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 19 Apr 2011 19:40:04 +0000 (15:40 -0400)
With the get_ringparam callback function we can export ring parameters
to ethtool through the mac80211 interface.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2800pci.c
drivers/net/wireless/rt2x00/rt2800usb.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00mac.c
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index d4acdde7c75a1b8d3e9e5fea02067a86e7632e3e..bbe76f79b62e3e699f070347c7ed75825508684e 100644 (file)
@@ -1720,6 +1720,7 @@ static const struct ieee80211_ops rt2400pci_mac80211_ops = {
        .tx_last_beacon         = rt2400pci_tx_last_beacon,
        .rfkill_poll            = rt2x00mac_rfkill_poll,
        .flush                  = rt2x00mac_flush,
+       .get_ringparam          = rt2x00mac_get_ringparam,
 };
 
 static const struct rt2x00lib_ops rt2400pci_rt2x00_ops = {
index 15f5649e2caee19b90877e6e023ebae2e9461a77..6f489968e7a402930115a815203be84b4486c76c 100644 (file)
@@ -2013,6 +2013,7 @@ static const struct ieee80211_ops rt2500pci_mac80211_ops = {
        .tx_last_beacon         = rt2500pci_tx_last_beacon,
        .rfkill_poll            = rt2x00mac_rfkill_poll,
        .flush                  = rt2x00mac_flush,
+       .get_ringparam          = rt2x00mac_get_ringparam,
 };
 
 static const struct rt2x00lib_ops rt2500pci_rt2x00_ops = {
index d88c36712ef0d9906932ff6eb7843d951b9bc20b..5ef338671d73f2820a8b69fd633d6752d540f4f9 100644 (file)
@@ -1823,6 +1823,7 @@ static const struct ieee80211_ops rt2500usb_mac80211_ops = {
        .conf_tx                = rt2x00mac_conf_tx,
        .rfkill_poll            = rt2x00mac_rfkill_poll,
        .flush                  = rt2x00mac_flush,
+       .get_ringparam          = rt2x00mac_get_ringparam,
 };
 
 static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = {
index b0c729b25c73ca351e1d116c57897968dd80c9cb..08d3947fcb26b7e4e75ee6f9228adc77c3c56557 100644 (file)
@@ -1028,6 +1028,7 @@ static const struct ieee80211_ops rt2800pci_mac80211_ops = {
        .ampdu_action           = rt2800_ampdu_action,
        .flush                  = rt2x00mac_flush,
        .get_survey             = rt2800_get_survey,
+       .get_ringparam          = rt2x00mac_get_ringparam,
 };
 
 static const struct rt2800_ops rt2800pci_rt2800_ops = {
index 44ead759e20fd16af766de2922c67b33e767cc8d..0d4e8fa3e1f8e065b15752093d106415e7427407 100644 (file)
@@ -673,6 +673,7 @@ static const struct ieee80211_ops rt2800usb_mac80211_ops = {
        .ampdu_action           = rt2800_ampdu_action,
        .flush                  = rt2x00mac_flush,
        .get_survey             = rt2800_get_survey,
+       .get_ringparam          = rt2x00mac_get_ringparam,
 };
 
 static const struct rt2800_ops rt2800usb_rt2800_ops = {
index dcdc50d27ea0055858500148f5ab044e4b581ef0..f1d8f55d3ca80040066831544b4a82812f7540da 100644 (file)
@@ -1254,6 +1254,8 @@ int rt2x00mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
                      const struct ieee80211_tx_queue_params *params);
 void rt2x00mac_rfkill_poll(struct ieee80211_hw *hw);
 void rt2x00mac_flush(struct ieee80211_hw *hw, bool drop);
+void rt2x00mac_get_ringparam(struct ieee80211_hw *hw,
+                            u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max);
 
 /*
  * Driver allocation handlers.
index 4770156df1a8085c3188d75d6719cead6b674166..6d1d38329e52fc8a64a62dcc0728da16d5cf77d0 100644 (file)
@@ -737,3 +737,19 @@ void rt2x00mac_flush(struct ieee80211_hw *hw, bool drop)
                rt2x00queue_flush_queue(queue, drop);
 }
 EXPORT_SYMBOL_GPL(rt2x00mac_flush);
+
+void rt2x00mac_get_ringparam(struct ieee80211_hw *hw,
+                            u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max)
+{
+       struct rt2x00_dev *rt2x00dev = hw->priv;
+       struct data_queue *queue;
+
+       tx_queue_for_each(rt2x00dev, queue) {
+               *tx += queue->length;
+               *tx_max += queue->limit;
+       }
+
+       *rx = rt2x00dev->rx->length;
+       *rx_max = rt2x00dev->rx->limit;
+}
+EXPORT_SYMBOL_GPL(rt2x00mac_get_ringparam);
index c5dccdb2f175a9acaa62f067c29baf44cff3d034..eb540310839426d46c369cdc0632fa071e6e47d4 100644 (file)
@@ -2979,6 +2979,7 @@ static const struct ieee80211_ops rt61pci_mac80211_ops = {
        .get_tsf                = rt61pci_get_tsf,
        .rfkill_poll            = rt2x00mac_rfkill_poll,
        .flush                  = rt2x00mac_flush,
+       .get_ringparam          = rt2x00mac_get_ringparam,
 };
 
 static const struct rt2x00lib_ops rt61pci_rt2x00_ops = {
index be3eb5e894efa86063e0136a7e5d6cba2e7a54c6..bf7fea4cb961ed519676f577142d9c8faae91073 100644 (file)
@@ -2310,6 +2310,7 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = {
        .get_tsf                = rt73usb_get_tsf,
        .rfkill_poll            = rt2x00mac_rfkill_poll,
        .flush                  = rt2x00mac_flush,
+       .get_ringparam          = rt2x00mac_get_ringparam,
 };
 
 static const struct rt2x00lib_ops rt73usb_rt2x00_ops = {