]> Pileus Git - ~andy/linux/commitdiff
iwlwifi: virtualize op_mode's fw_error
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 9 Feb 2012 14:08:15 +0000 (16:08 +0200)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Mon, 27 Feb 2012 21:26:58 +0000 (13:26 -0800)
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>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-agn.h
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-op-mode.h
drivers/net/wireless/iwlwifi/iwl-shared.h
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c

index 28fda18df2b55a4611a5d1671141263c5fe906e5..a0346edbf0127b57f3f2102e6b4ca4e6075d0697 100644 (file)
@@ -1390,6 +1390,7 @@ const struct iwl_op_mode_ops iwl_dvm_ops = {
        .queue_not_full = iwl_wake_sw_queue,
        .hw_rf_kill = iwl_set_hw_rfkill_state,
        .free_skb = iwl_free_skb,
+       .nic_error = iwl_nic_error,
 };
 
 /*****************************************************************************
index 39d1e7960908c316fbc38357c1e6bd9864803239..3c7f0c1190d8a895e979a0df0a7fcfb76cad2263 100644 (file)
@@ -87,6 +87,8 @@ int __must_check iwl_rx_dispatch(struct iwl_op_mode *op_mode,
 void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, u8 ac);
 void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, u8 ac);
 void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state);
+void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, u8 ac);
+void iwl_nic_error(struct iwl_op_mode *op_mode);
 
 /* MAC80211 */
 struct ieee80211_hw *iwl_alloc_all(void);
index 3b91b6b811aa284ca1ba4063651a1220d406b908..88a8c74ea21ec9a0c5416218fa1d4e9c2c098ed1 100644 (file)
@@ -830,7 +830,7 @@ void iwl_print_rx_config_cmd(struct iwl_priv *priv,
 }
 #endif
 
-void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)
+static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)
 {
        unsigned int reload_msec;
        unsigned long reload_jiffies;
@@ -1455,6 +1455,13 @@ __le32 iwl_add_beacon_time(struct iwl_priv *priv, u32 base,
        return cpu_to_le32(res);
 }
 
+void iwl_nic_error(struct iwl_op_mode *op_mode)
+{
+       struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
+
+       iwlagn_fw_error(priv, false);
+}
+
 void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)
 {
        struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
index 8ce4aac29b0a9cea8b9502d0c6b575c361e615a0..e2a780d124673957a3b6b9e767bd144d6b5247bc 100644 (file)
@@ -90,6 +90,7 @@ struct iwl_rx_mem_buffer;
  *     reclaimed by the op_mode. This can happen when the driver is freed and
  *     there are Tx packets pending in the transport layer.
  *     Must be atomic
+ * @nic_error: error notification. Must be atomic
  */
 struct iwl_op_mode_ops {
        struct iwl_op_mode *(*start)(struct iwl_trans *trans);
@@ -100,6 +101,7 @@ struct iwl_op_mode_ops {
        void (*queue_not_full)(struct iwl_op_mode *op_mode, u8 ac);
        void (*hw_rf_kill)(struct iwl_op_mode *op_mode, bool state);
        void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb);
+       void (*nic_error)(struct iwl_op_mode *op_mode);
 };
 
 /**
@@ -151,6 +153,11 @@ static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode,
        op_mode->ops->free_skb(op_mode, skb);
 }
 
+static inline void iwl_op_mode_nic_error(struct iwl_op_mode *op_mode)
+{
+       op_mode->ops->nic_error(op_mode);
+}
+
 /*****************************************************
 * Op mode layers implementations
 ******************************************************/
index 5cbc637e63b659924876114cdeb9925f48e65afe..f3b6fd7ae4dd9891806eb1db9d9eef057f25f424 100644 (file)
@@ -534,7 +534,6 @@ enum iwl_rxon_context_id {
 
 int iwlagn_hw_valid_rtc_data_addr(u32 addr);
 void iwl_nic_config(struct iwl_priv *priv);
-void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand);
 const char *get_cmd_string(u8 cmd);
 bool iwl_check_for_ct_kill(struct iwl_priv *priv);
 
index abb5277f98e7b44bb8a96ec5c0b09b24c145ed8d..2072bc20f2e2d958cfc21423dc4bf4d3d42084f3 100644 (file)
@@ -701,7 +701,7 @@ static void iwl_irq_handle_error(struct iwl_trans *trans)
                iwl_print_rx_config_cmd(priv(trans), IWL_RXON_CTX_BSS);
 #endif
 
-       iwlagn_fw_error(priv, false);
+       iwl_op_mode_nic_error(trans->op_mode);
 }
 
 #define EVENT_START_OFFSET  (4 * sizeof(u32))
index bca0f4fa2ffa5aa9421cea2b415c74cca93fc50d..82e34484fa5edd2e36997f524f400ce5809840b1 100644 (file)
@@ -689,7 +689,7 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
                is_ct_kill = iwl_check_for_ct_kill(priv(trans));
                if (!is_ct_kill) {
                        IWL_ERR(trans, "Restarting adapter queue is full\n");
-                       iwlagn_fw_error(priv(trans), false);
+                       iwl_op_mode_nic_error(trans->op_mode);
                }
                return -ENOSPC;
        }
@@ -822,7 +822,7 @@ static void iwl_hcmd_queue_reclaim(struct iwl_trans *trans, int txq_id,
                if (nfreed++ > 0) {
                        IWL_ERR(trans, "HCMD skipped: index (%d) %d %d\n", idx,
                                        q->write_ptr, q->read_ptr);
-                       iwlagn_fw_error(priv(trans), false);
+                       iwl_op_mode_nic_error(trans->op_mode);
                }
 
        }