aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c33
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c41
4 files changed, 43 insertions, 38 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index e2c2d9f3edb5..be6b6ebc6bf8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -608,26 +608,6 @@ out:
608 608
609#define REG_RECALIB_PERIOD (60) 609#define REG_RECALIB_PERIOD (60)
610 610
611/**
612 * iwl4965_bg_statistics_periodic - Timer callback to queue statistics
613 *
614 * This callback is provided in order to send a statistics request.
615 *
616 * This timer function is continually reset to execute within
617 * REG_RECALIB_PERIOD seconds since the last STATISTICS_NOTIFICATION
618 * was received. We need to ensure we receive the statistics in order
619 * to update the temperature used for calibrating the TXPOWER.
620 */
621static void iwl4965_bg_statistics_periodic(unsigned long data)
622{
623 struct iwl_priv *priv = (struct iwl_priv *)data;
624
625 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
626 return;
627
628 iwl_send_statistics_request(priv, CMD_ASYNC);
629}
630
631void iwl4965_rf_kill_ct_config(struct iwl_priv *priv) 611void iwl4965_rf_kill_ct_config(struct iwl_priv *priv)
632{ 612{
633 struct iwl4965_ct_kill_config cmd; 613 struct iwl4965_ct_kill_config cmd;
@@ -3469,19 +3449,14 @@ static void iwl4965_rx_handler_setup(struct iwl_priv *priv)
3469 priv->rx_handlers[REPLY_COMPRESSED_BA] = iwl4965_rx_reply_compressed_ba; 3449 priv->rx_handlers[REPLY_COMPRESSED_BA] = iwl4965_rx_reply_compressed_ba;
3470} 3450}
3471 3451
3472void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv) 3452static void iwl4965_setup_deferred_work(struct iwl_priv *priv)
3473{ 3453{
3474 INIT_WORK(&priv->txpower_work, iwl4965_bg_txpower_work); 3454 INIT_WORK(&priv->txpower_work, iwl4965_bg_txpower_work);
3475 init_timer(&priv->statistics_periodic);
3476 priv->statistics_periodic.data = (unsigned long)priv;
3477 priv->statistics_periodic.function = iwl4965_bg_statistics_periodic;
3478} 3455}
3479 3456
3480void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv) 3457static void iwl4965_cancel_deferred_work(struct iwl_priv *priv)
3481{ 3458{
3482 del_timer_sync(&priv->statistics_periodic); 3459 cancel_work_sync(&priv->txpower_work);
3483
3484 cancel_delayed_work(&priv->init_alive_start);
3485} 3460}
3486 3461
3487 3462
@@ -3506,6 +3481,8 @@ static struct iwl_lib_ops iwl4965_lib = {
3506 .txq_agg_enable = iwl4965_txq_agg_enable, 3481 .txq_agg_enable = iwl4965_txq_agg_enable,
3507 .txq_agg_disable = iwl4965_txq_agg_disable, 3482 .txq_agg_disable = iwl4965_txq_agg_disable,
3508 .rx_handler_setup = iwl4965_rx_handler_setup, 3483 .rx_handler_setup = iwl4965_rx_handler_setup,
3484 .setup_deferred_work = iwl4965_setup_deferred_work,
3485 .cancel_deferred_work = iwl4965_cancel_deferred_work,
3509 .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, 3486 .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr,
3510 .alive_notify = iwl4965_alive_notify, 3487 .alive_notify = iwl4965_alive_notify,
3511 .init_alive_start = iwl4965_init_alive_start, 3488 .init_alive_start = iwl4965_init_alive_start,
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 192cda24a411..a86e08bef2d6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -116,6 +116,10 @@ struct iwl_lib_ops {
116 u8 tx_fifo); 116 u8 tx_fifo);
117 /* setup Rx handler */ 117 /* setup Rx handler */
118 void (*rx_handler_setup)(struct iwl_priv *priv); 118 void (*rx_handler_setup)(struct iwl_priv *priv);
119 /* setup deferred work */
120 void (*setup_deferred_work)(struct iwl_priv *priv);
121 /* cancel deferred work */
122 void (*cancel_deferred_work)(struct iwl_priv *priv);
119 /* alive notification after init uCode load */ 123 /* alive notification after init uCode load */
120 void (*init_alive_start)(struct iwl_priv *priv); 124 void (*init_alive_start)(struct iwl_priv *priv);
121 /* alive notification */ 125 /* alive notification */
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 631931c155a1..9e5a7cddf146 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1179,9 +1179,6 @@ struct iwl_priv {
1179 1179
1180 struct delayed_work init_alive_start; 1180 struct delayed_work init_alive_start;
1181 struct delayed_work alive_start; 1181 struct delayed_work alive_start;
1182 struct delayed_work activity_timer;
1183 struct delayed_work thermal_periodic;
1184 struct delayed_work gather_stats;
1185 struct delayed_work scan_check; 1182 struct delayed_work scan_check;
1186 struct delayed_work post_associate; 1183 struct delayed_work post_associate;
1187 1184
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index a8dfdcbb8b43..0acd42bd43c5 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -1647,6 +1647,26 @@ static void iwl4965_bg_beacon_update(struct work_struct *work)
1647 iwl4965_send_beacon_cmd(priv); 1647 iwl4965_send_beacon_cmd(priv);
1648} 1648}
1649 1649
1650/**
1651 * iwl4965_bg_statistics_periodic - Timer callback to queue statistics
1652 *
1653 * This callback is provided in order to send a statistics request.
1654 *
1655 * This timer function is continually reset to execute within
1656 * REG_RECALIB_PERIOD seconds since the last STATISTICS_NOTIFICATION
1657 * was received. We need to ensure we receive the statistics in order
1658 * to update the temperature used for calibrating the TXPOWER.
1659 */
1660static void iwl4965_bg_statistics_periodic(unsigned long data)
1661{
1662 struct iwl_priv *priv = (struct iwl_priv *)data;
1663
1664 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
1665 return;
1666
1667 iwl_send_statistics_request(priv, CMD_ASYNC);
1668}
1669
1650static void iwl4965_rx_beacon_notif(struct iwl_priv *priv, 1670static void iwl4965_rx_beacon_notif(struct iwl_priv *priv,
1651 struct iwl_rx_mem_buffer *rxb) 1671 struct iwl_rx_mem_buffer *rxb)
1652{ 1672{
@@ -2887,7 +2907,7 @@ static void iwl_alive_start(struct iwl_priv *priv)
2887 queue_work(priv->workqueue, &priv->restart); 2907 queue_work(priv->workqueue, &priv->restart);
2888} 2908}
2889 2909
2890static void iwl4965_cancel_deferred_work(struct iwl_priv *priv); 2910static void iwl_cancel_deferred_work(struct iwl_priv *priv);
2891 2911
2892static void __iwl4965_down(struct iwl_priv *priv) 2912static void __iwl4965_down(struct iwl_priv *priv)
2893{ 2913{
@@ -2991,7 +3011,7 @@ static void iwl4965_down(struct iwl_priv *priv)
2991 __iwl4965_down(priv); 3011 __iwl4965_down(priv);
2992 mutex_unlock(&priv->mutex); 3012 mutex_unlock(&priv->mutex);
2993 3013
2994 iwl4965_cancel_deferred_work(priv); 3014 iwl_cancel_deferred_work(priv);
2995} 3015}
2996 3016
2997#define MAX_HW_RESTARTS 5 3017#define MAX_HW_RESTARTS 5
@@ -5022,7 +5042,7 @@ static DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
5022 * 5042 *
5023 *****************************************************************************/ 5043 *****************************************************************************/
5024 5044
5025static void iwl4965_setup_deferred_work(struct iwl_priv *priv) 5045static void iwl_setup_deferred_work(struct iwl_priv *priv)
5026{ 5046{
5027 priv->workqueue = create_workqueue(DRV_NAME); 5047 priv->workqueue = create_workqueue(DRV_NAME);
5028 5048
@@ -5043,21 +5063,28 @@ static void iwl4965_setup_deferred_work(struct iwl_priv *priv)
5043 INIT_DELAYED_WORK(&priv->alive_start, iwl_bg_alive_start); 5063 INIT_DELAYED_WORK(&priv->alive_start, iwl_bg_alive_start);
5044 INIT_DELAYED_WORK(&priv->scan_check, iwl4965_bg_scan_check); 5064 INIT_DELAYED_WORK(&priv->scan_check, iwl4965_bg_scan_check);
5045 5065
5046 iwl4965_hw_setup_deferred_work(priv); 5066 if (priv->cfg->ops->lib->setup_deferred_work)
5067 priv->cfg->ops->lib->setup_deferred_work(priv);
5068
5069 init_timer(&priv->statistics_periodic);
5070 priv->statistics_periodic.data = (unsigned long)priv;
5071 priv->statistics_periodic.function = iwl4965_bg_statistics_periodic;
5047 5072
5048 tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) 5073 tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
5049 iwl4965_irq_tasklet, (unsigned long)priv); 5074 iwl4965_irq_tasklet, (unsigned long)priv);
5050} 5075}
5051 5076
5052static void iwl4965_cancel_deferred_work(struct iwl_priv *priv) 5077static void iwl_cancel_deferred_work(struct iwl_priv *priv)
5053{ 5078{
5054 iwl4965_hw_cancel_deferred_work(priv); 5079 if (priv->cfg->ops->lib->cancel_deferred_work)
5080 priv->cfg->ops->lib->cancel_deferred_work(priv);
5055 5081
5056 cancel_delayed_work_sync(&priv->init_alive_start); 5082 cancel_delayed_work_sync(&priv->init_alive_start);
5057 cancel_delayed_work(&priv->scan_check); 5083 cancel_delayed_work(&priv->scan_check);
5058 cancel_delayed_work(&priv->alive_start); 5084 cancel_delayed_work(&priv->alive_start);
5059 cancel_delayed_work(&priv->post_associate); 5085 cancel_delayed_work(&priv->post_associate);
5060 cancel_work_sync(&priv->beacon_update); 5086 cancel_work_sync(&priv->beacon_update);
5087 del_timer_sync(&priv->statistics_periodic);
5061} 5088}
5062 5089
5063static struct attribute *iwl4965_sysfs_entries[] = { 5090static struct attribute *iwl4965_sysfs_entries[] = {
@@ -5269,7 +5296,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5269 } 5296 }
5270 5297
5271 5298
5272 iwl4965_setup_deferred_work(priv); 5299 iwl_setup_deferred_work(priv);
5273 iwl4965_setup_rx_handlers(priv); 5300 iwl4965_setup_rx_handlers(priv);
5274 5301
5275 /******************** 5302 /********************