aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-04-08 14:26:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:43 -0400
commitaa89f31e708d469f5dd824c59c98e4856a2e3572 (patch)
tree765fc149a8a1f297755fb8c8e8fea52d09a7467f /drivers
parent5ee5811e24b20d49ea553fda568433effbab7a62 (diff)
iwl3945: use iwl_mac_get_tx_stats from iwlwifi
3945 can now use iwl_mac_get_tx_stats from iwlwifi. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c35
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c36
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c37
4 files changed, 39 insertions, 71 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index edfece6e0d4c..3ebf80fbebab 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2223,41 +2223,6 @@ static int iwl_mac_ampdu_action(struct ieee80211_hw *hw,
2223 return 0; 2223 return 0;
2224} 2224}
2225 2225
2226static int iwl_mac_get_tx_stats(struct ieee80211_hw *hw,
2227 struct ieee80211_tx_queue_stats *stats)
2228{
2229 struct iwl_priv *priv = hw->priv;
2230 int i, avail;
2231 struct iwl_tx_queue *txq;
2232 struct iwl_queue *q;
2233 unsigned long flags;
2234
2235 IWL_DEBUG_MAC80211(priv, "enter\n");
2236
2237 if (!iwl_is_ready_rf(priv)) {
2238 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
2239 return -EIO;
2240 }
2241
2242 spin_lock_irqsave(&priv->lock, flags);
2243
2244 for (i = 0; i < AC_NUM; i++) {
2245 txq = &priv->txq[i];
2246 q = &txq->q;
2247 avail = iwl_queue_space(q);
2248
2249 stats[i].len = q->n_window - avail;
2250 stats[i].limit = q->n_window - q->high_mark;
2251 stats[i].count = q->n_window;
2252
2253 }
2254 spin_unlock_irqrestore(&priv->lock, flags);
2255
2256 IWL_DEBUG_MAC80211(priv, "leave\n");
2257
2258 return 0;
2259}
2260
2261static int iwl_mac_get_stats(struct ieee80211_hw *hw, 2226static int iwl_mac_get_stats(struct ieee80211_hw *hw,
2262 struct ieee80211_low_level_stats *stats) 2227 struct ieee80211_low_level_stats *stats)
2263{ 2228{
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index e8b74fc82515..144630b25491 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -2679,6 +2679,42 @@ int iwl_mac_config_interface(struct ieee80211_hw *hw,
2679} 2679}
2680EXPORT_SYMBOL(iwl_mac_config_interface); 2680EXPORT_SYMBOL(iwl_mac_config_interface);
2681 2681
2682int iwl_mac_get_tx_stats(struct ieee80211_hw *hw,
2683 struct ieee80211_tx_queue_stats *stats)
2684{
2685 struct iwl_priv *priv = hw->priv;
2686 int i, avail;
2687 struct iwl_tx_queue *txq;
2688 struct iwl_queue *q;
2689 unsigned long flags;
2690
2691 IWL_DEBUG_MAC80211(priv, "enter\n");
2692
2693 if (!iwl_is_ready_rf(priv)) {
2694 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
2695 return -EIO;
2696 }
2697
2698 spin_lock_irqsave(&priv->lock, flags);
2699
2700 for (i = 0; i < AC_NUM; i++) {
2701 txq = &priv->txq[i];
2702 q = &txq->q;
2703 avail = iwl_queue_space(q);
2704
2705 stats[i].len = q->n_window - avail;
2706 stats[i].limit = q->n_window - q->high_mark;
2707 stats[i].count = q->n_window;
2708
2709 }
2710 spin_unlock_irqrestore(&priv->lock, flags);
2711
2712 IWL_DEBUG_MAC80211(priv, "leave\n");
2713
2714 return 0;
2715}
2716EXPORT_SYMBOL(iwl_mac_get_tx_stats);
2717
2682#ifdef CONFIG_PM 2718#ifdef CONFIG_PM
2683 2719
2684int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) 2720int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 92a42c880488..7e0d0ed0a5db 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -284,6 +284,8 @@ void iwl_config_ap(struct iwl_priv *priv);
284int iwl_mac_config_interface(struct ieee80211_hw *hw, 284int iwl_mac_config_interface(struct ieee80211_hw *hw,
285 struct ieee80211_vif *vif, 285 struct ieee80211_vif *vif,
286 struct ieee80211_if_conf *conf); 286 struct ieee80211_if_conf *conf);
287int iwl_mac_get_tx_stats(struct ieee80211_hw *hw,
288 struct ieee80211_tx_queue_stats *stats);
287 289
288/***************************************************** 290/*****************************************************
289 * RX handlers. 291 * RX handlers.
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 3461768e5a2b..07883b264b7e 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3494,41 +3494,6 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3494 return ret; 3494 return ret;
3495} 3495}
3496 3496
3497static int iwl3945_mac_get_tx_stats(struct ieee80211_hw *hw,
3498 struct ieee80211_tx_queue_stats *stats)
3499{
3500 struct iwl_priv *priv = hw->priv;
3501 int i, avail;
3502 struct iwl_tx_queue *txq;
3503 struct iwl_queue *q;
3504 unsigned long flags;
3505
3506 IWL_DEBUG_MAC80211(priv, "enter\n");
3507
3508 if (!iwl_is_ready_rf(priv)) {
3509 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
3510 return -EIO;
3511 }
3512
3513 spin_lock_irqsave(&priv->lock, flags);
3514
3515 for (i = 0; i < AC_NUM; i++) {
3516 txq = &priv->txq[i];
3517 q = &txq->q;
3518 avail = iwl_queue_space(q);
3519
3520 stats[i].len = q->n_window - avail;
3521 stats[i].limit = q->n_window - q->high_mark;
3522 stats[i].count = q->n_window;
3523
3524 }
3525 spin_unlock_irqrestore(&priv->lock, flags);
3526
3527 IWL_DEBUG_MAC80211(priv, "leave\n");
3528
3529 return 0;
3530}
3531
3532static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw) 3497static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
3533{ 3498{
3534 struct iwl_priv *priv = hw->priv; 3499 struct iwl_priv *priv = hw->priv;
@@ -4116,7 +4081,7 @@ static struct ieee80211_ops iwl3945_hw_ops = {
4116 .config_interface = iwl_mac_config_interface, 4081 .config_interface = iwl_mac_config_interface,
4117 .configure_filter = iwl_configure_filter, 4082 .configure_filter = iwl_configure_filter,
4118 .set_key = iwl3945_mac_set_key, 4083 .set_key = iwl3945_mac_set_key,
4119 .get_tx_stats = iwl3945_mac_get_tx_stats, 4084 .get_tx_stats = iwl_mac_get_tx_stats,
4120 .conf_tx = iwl_mac_conf_tx, 4085 .conf_tx = iwl_mac_conf_tx,
4121 .reset_tsf = iwl3945_mac_reset_tsf, 4086 .reset_tsf = iwl3945_mac_reset_tsf,
4122 .bss_info_changed = iwl_bss_info_changed, 4087 .bss_info_changed = iwl_bss_info_changed,