aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2008-04-15 19:01:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-16 15:59:59 -0400
commit49ea85961cf8b60b5387cc1c1bc06fe4b6a31ee4 (patch)
tree467058c7a44b216a70849ceca7d3acd23f0a4bf4 /drivers/net/wireless/iwlwifi/iwl-4965.c
parentba380013b681e91e059f95b51002f8d43024b371 (diff)
iwlwifi: remove the statistics work
This patch does 3 things 1) It removes the statistics work. The request statistics command is sent in ASYNC mode in this flow, the mutex is uneeded, so the request statistics function can't go to sleep. No need for a workqueue anymore. 2) iwl4965_send_statistics_request has been renamed to iwl_send_statistics_request and moved to iwl-core.c 3) A request for statistics is sent in alive_notify, the makes the uCode sends statistics notification periodically starting from association. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index a10a6e81769f..3df70f89f11b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -976,40 +976,21 @@ int iwl4965_hw_nic_reset(struct iwl_priv *priv)
976/** 976/**
977 * iwl4965_bg_statistics_periodic - Timer callback to queue statistics 977 * iwl4965_bg_statistics_periodic - Timer callback to queue statistics
978 * 978 *
979 * This callback is provided in order to queue the statistics_work 979 * This callback is provided in order to send a statistics request.
980 * in work_queue context (v. softirq)
981 * 980 *
982 * This timer function is continually reset to execute within 981 * This timer function is continually reset to execute within
983 * REG_RECALIB_PERIOD seconds since the last STATISTICS_NOTIFICATION 982 * REG_RECALIB_PERIOD seconds since the last STATISTICS_NOTIFICATION
984 * was received. We need to ensure we receive the statistics in order 983 * was received. We need to ensure we receive the statistics in order
985 * to update the temperature used for calibrating the TXPOWER. However, 984 * to update the temperature used for calibrating the TXPOWER.
986 * we can't send the statistics command from softirq context (which
987 * is the context which timers run at) so we have to queue off the
988 * statistics_work to actually send the command to the hardware.
989 */ 985 */
990static void iwl4965_bg_statistics_periodic(unsigned long data) 986static void iwl4965_bg_statistics_periodic(unsigned long data)
991{ 987{
992 struct iwl_priv *priv = (struct iwl_priv *)data; 988 struct iwl_priv *priv = (struct iwl_priv *)data;
993 989
994 queue_work(priv->workqueue, &priv->statistics_work);
995}
996
997/**
998 * iwl4965_bg_statistics_work - Send the statistics request to the hardware.
999 *
1000 * This is queued by iwl4965_bg_statistics_periodic.
1001 */
1002static void iwl4965_bg_statistics_work(struct work_struct *work)
1003{
1004 struct iwl_priv *priv = container_of(work, struct iwl_priv,
1005 statistics_work);
1006
1007 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 990 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
1008 return; 991 return;
1009 992
1010 mutex_lock(&priv->mutex); 993 iwl_send_statistics_request(priv, CMD_ASYNC);
1011 iwl4965_send_statistics_request(priv);
1012 mutex_unlock(&priv->mutex);
1013} 994}
1014 995
1015#define CT_LIMIT_CONST 259 996#define CT_LIMIT_CONST 259
@@ -2026,6 +2007,9 @@ int iwl4965_alive_notify(struct iwl_priv *priv)
2026 iwl_release_nic_access(priv); 2007 iwl_release_nic_access(priv);
2027 spin_unlock_irqrestore(&priv->lock, flags); 2008 spin_unlock_irqrestore(&priv->lock, flags);
2028 2009
2010 /* Ask for statistics now, the uCode will send statistics notification
2011 * periodically after association */
2012 iwl_send_statistics_request(priv, CMD_ASYNC);
2029 return ret; 2013 return ret;
2030} 2014}
2031 2015
@@ -4903,7 +4887,6 @@ void iwl4965_hw_rx_handler_setup(struct iwl_priv *priv)
4903void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv) 4887void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv)
4904{ 4888{
4905 INIT_WORK(&priv->txpower_work, iwl4965_bg_txpower_work); 4889 INIT_WORK(&priv->txpower_work, iwl4965_bg_txpower_work);
4906 INIT_WORK(&priv->statistics_work, iwl4965_bg_statistics_work);
4907#ifdef CONFIG_IWL4965_SENSITIVITY 4890#ifdef CONFIG_IWL4965_SENSITIVITY
4908 INIT_WORK(&priv->sensitivity_work, iwl4965_bg_sensitivity_work); 4891 INIT_WORK(&priv->sensitivity_work, iwl4965_bg_sensitivity_work);
4909#endif 4892#endif