diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-02-09 09:08:15 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-27 16:26:58 -0500 |
commit | bcb9321c8db86150004d615e03551911be84685e (patch) | |
tree | 830a0417c9a87a241947037fac3bd30aecf87cfd /drivers/net/wireless | |
parent | 7120d9894c363ee31fd529e5dd962452b639ab8e (diff) |
iwlwifi: virtualize op_mode's fw_error
Export it as "nic_error" notification, the error handling will be in
the op_mode.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-op-mode.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-shared.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 4 |
7 files changed, 21 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 28fda18df2b5..a0346edbf012 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1390,6 +1390,7 @@ const struct iwl_op_mode_ops iwl_dvm_ops = { | |||
1390 | .queue_not_full = iwl_wake_sw_queue, | 1390 | .queue_not_full = iwl_wake_sw_queue, |
1391 | .hw_rf_kill = iwl_set_hw_rfkill_state, | 1391 | .hw_rf_kill = iwl_set_hw_rfkill_state, |
1392 | .free_skb = iwl_free_skb, | 1392 | .free_skb = iwl_free_skb, |
1393 | .nic_error = iwl_nic_error, | ||
1393 | }; | 1394 | }; |
1394 | 1395 | ||
1395 | /***************************************************************************** | 1396 | /***************************************************************************** |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index 39d1e7960908..3c7f0c1190d8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -87,6 +87,8 @@ int __must_check iwl_rx_dispatch(struct iwl_op_mode *op_mode, | |||
87 | void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, u8 ac); | 87 | void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, u8 ac); |
88 | void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, u8 ac); | 88 | void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, u8 ac); |
89 | void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state); | 89 | void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state); |
90 | void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, u8 ac); | ||
91 | void iwl_nic_error(struct iwl_op_mode *op_mode); | ||
90 | 92 | ||
91 | /* MAC80211 */ | 93 | /* MAC80211 */ |
92 | struct ieee80211_hw *iwl_alloc_all(void); | 94 | struct ieee80211_hw *iwl_alloc_all(void); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 3b91b6b811aa..88a8c74ea21e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -830,7 +830,7 @@ void iwl_print_rx_config_cmd(struct iwl_priv *priv, | |||
830 | } | 830 | } |
831 | #endif | 831 | #endif |
832 | 832 | ||
833 | void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand) | 833 | static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand) |
834 | { | 834 | { |
835 | unsigned int reload_msec; | 835 | unsigned int reload_msec; |
836 | unsigned long reload_jiffies; | 836 | unsigned long reload_jiffies; |
@@ -1455,6 +1455,13 @@ __le32 iwl_add_beacon_time(struct iwl_priv *priv, u32 base, | |||
1455 | return cpu_to_le32(res); | 1455 | return cpu_to_le32(res); |
1456 | } | 1456 | } |
1457 | 1457 | ||
1458 | void iwl_nic_error(struct iwl_op_mode *op_mode) | ||
1459 | { | ||
1460 | struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); | ||
1461 | |||
1462 | iwlagn_fw_error(priv, false); | ||
1463 | } | ||
1464 | |||
1458 | void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state) | 1465 | void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state) |
1459 | { | 1466 | { |
1460 | struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); | 1467 | struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/iwlwifi/iwl-op-mode.h index 8ce4aac29b0a..e2a780d12467 100644 --- a/drivers/net/wireless/iwlwifi/iwl-op-mode.h +++ b/drivers/net/wireless/iwlwifi/iwl-op-mode.h | |||
@@ -90,6 +90,7 @@ struct iwl_rx_mem_buffer; | |||
90 | * reclaimed by the op_mode. This can happen when the driver is freed and | 90 | * reclaimed by the op_mode. This can happen when the driver is freed and |
91 | * there are Tx packets pending in the transport layer. | 91 | * there are Tx packets pending in the transport layer. |
92 | * Must be atomic | 92 | * Must be atomic |
93 | * @nic_error: error notification. Must be atomic | ||
93 | */ | 94 | */ |
94 | struct iwl_op_mode_ops { | 95 | struct iwl_op_mode_ops { |
95 | struct iwl_op_mode *(*start)(struct iwl_trans *trans); | 96 | struct iwl_op_mode *(*start)(struct iwl_trans *trans); |
@@ -100,6 +101,7 @@ struct iwl_op_mode_ops { | |||
100 | void (*queue_not_full)(struct iwl_op_mode *op_mode, u8 ac); | 101 | void (*queue_not_full)(struct iwl_op_mode *op_mode, u8 ac); |
101 | void (*hw_rf_kill)(struct iwl_op_mode *op_mode, bool state); | 102 | void (*hw_rf_kill)(struct iwl_op_mode *op_mode, bool state); |
102 | void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb); | 103 | void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb); |
104 | void (*nic_error)(struct iwl_op_mode *op_mode); | ||
103 | }; | 105 | }; |
104 | 106 | ||
105 | /** | 107 | /** |
@@ -151,6 +153,11 @@ static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode, | |||
151 | op_mode->ops->free_skb(op_mode, skb); | 153 | op_mode->ops->free_skb(op_mode, skb); |
152 | } | 154 | } |
153 | 155 | ||
156 | static inline void iwl_op_mode_nic_error(struct iwl_op_mode *op_mode) | ||
157 | { | ||
158 | op_mode->ops->nic_error(op_mode); | ||
159 | } | ||
160 | |||
154 | /***************************************************** | 161 | /***************************************************** |
155 | * Op mode layers implementations | 162 | * Op mode layers implementations |
156 | ******************************************************/ | 163 | ******************************************************/ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h index 5cbc637e63b6..f3b6fd7ae4dd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-shared.h +++ b/drivers/net/wireless/iwlwifi/iwl-shared.h | |||
@@ -534,7 +534,6 @@ enum iwl_rxon_context_id { | |||
534 | 534 | ||
535 | int iwlagn_hw_valid_rtc_data_addr(u32 addr); | 535 | int iwlagn_hw_valid_rtc_data_addr(u32 addr); |
536 | void iwl_nic_config(struct iwl_priv *priv); | 536 | void iwl_nic_config(struct iwl_priv *priv); |
537 | void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand); | ||
538 | const char *get_cmd_string(u8 cmd); | 537 | const char *get_cmd_string(u8 cmd); |
539 | bool iwl_check_for_ct_kill(struct iwl_priv *priv); | 538 | bool iwl_check_for_ct_kill(struct iwl_priv *priv); |
540 | 539 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c index abb5277f98e7..2072bc20f2e2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | |||
@@ -701,7 +701,7 @@ static void iwl_irq_handle_error(struct iwl_trans *trans) | |||
701 | iwl_print_rx_config_cmd(priv(trans), IWL_RXON_CTX_BSS); | 701 | iwl_print_rx_config_cmd(priv(trans), IWL_RXON_CTX_BSS); |
702 | #endif | 702 | #endif |
703 | 703 | ||
704 | iwlagn_fw_error(priv, false); | 704 | iwl_op_mode_nic_error(trans->op_mode); |
705 | } | 705 | } |
706 | 706 | ||
707 | #define EVENT_START_OFFSET (4 * sizeof(u32)) | 707 | #define EVENT_START_OFFSET (4 * sizeof(u32)) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c index bca0f4fa2ffa..82e34484fa5e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | |||
@@ -689,7 +689,7 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) | |||
689 | is_ct_kill = iwl_check_for_ct_kill(priv(trans)); | 689 | is_ct_kill = iwl_check_for_ct_kill(priv(trans)); |
690 | if (!is_ct_kill) { | 690 | if (!is_ct_kill) { |
691 | IWL_ERR(trans, "Restarting adapter queue is full\n"); | 691 | IWL_ERR(trans, "Restarting adapter queue is full\n"); |
692 | iwlagn_fw_error(priv(trans), false); | 692 | iwl_op_mode_nic_error(trans->op_mode); |
693 | } | 693 | } |
694 | return -ENOSPC; | 694 | return -ENOSPC; |
695 | } | 695 | } |
@@ -822,7 +822,7 @@ static void iwl_hcmd_queue_reclaim(struct iwl_trans *trans, int txq_id, | |||
822 | if (nfreed++ > 0) { | 822 | if (nfreed++ > 0) { |
823 | IWL_ERR(trans, "HCMD skipped: index (%d) %d %d\n", idx, | 823 | IWL_ERR(trans, "HCMD skipped: index (%d) %d %d\n", idx, |
824 | q->write_ptr, q->read_ptr); | 824 | q->write_ptr, q->read_ptr); |
825 | iwlagn_fw_error(priv(trans), false); | 825 | iwl_op_mode_nic_error(trans->op_mode); |
826 | } | 826 | } |
827 | 827 | ||
828 | } | 828 | } |