diff options
author | Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> | 2012-03-13 21:00:15 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-04-12 17:22:26 -0400 |
commit | 193219cf0f9fd687b53e18b8b8310d59b2d0ca2c (patch) | |
tree | c76af0e2bfc41f050e75e40c5a2eb77094e6eae8 /drivers/net/wireless | |
parent | bedec3a67df5223e5f2c832f91592cda59ec97b1 (diff) |
iwlwifi: move iwlagn_fw_error to iwl-agn.c
Move this as part of iwl-core.c cleanup.
Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@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 | 59 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 59 |
3 files changed, 59 insertions, 60 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index b0cadcc30b60..5773cbe35dd7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2119,6 +2119,65 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
2119 | return pos; | 2119 | return pos; |
2120 | } | 2120 | } |
2121 | 2121 | ||
2122 | static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand) | ||
2123 | { | ||
2124 | unsigned int reload_msec; | ||
2125 | unsigned long reload_jiffies; | ||
2126 | |||
2127 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
2128 | if (iwl_have_debug_level(IWL_DL_FW_ERRORS)) | ||
2129 | iwl_print_rx_config_cmd(priv, IWL_RXON_CTX_BSS); | ||
2130 | #endif | ||
2131 | |||
2132 | /* uCode is no longer loaded. */ | ||
2133 | priv->ucode_loaded = false; | ||
2134 | |||
2135 | /* Set the FW error flag -- cleared on iwl_down */ | ||
2136 | set_bit(STATUS_FW_ERROR, &priv->status); | ||
2137 | |||
2138 | /* Cancel currently queued command. */ | ||
2139 | clear_bit(STATUS_HCMD_ACTIVE, &priv->shrd->status); | ||
2140 | |||
2141 | iwl_abort_notification_waits(&priv->notif_wait); | ||
2142 | |||
2143 | /* Keep the restart process from trying to send host | ||
2144 | * commands by clearing the ready bit */ | ||
2145 | clear_bit(STATUS_READY, &priv->status); | ||
2146 | |||
2147 | wake_up(&trans(priv)->wait_command_queue); | ||
2148 | |||
2149 | if (!ondemand) { | ||
2150 | /* | ||
2151 | * If firmware keep reloading, then it indicate something | ||
2152 | * serious wrong and firmware having problem to recover | ||
2153 | * from it. Instead of keep trying which will fill the syslog | ||
2154 | * and hang the system, let's just stop it | ||
2155 | */ | ||
2156 | reload_jiffies = jiffies; | ||
2157 | reload_msec = jiffies_to_msecs((long) reload_jiffies - | ||
2158 | (long) priv->reload_jiffies); | ||
2159 | priv->reload_jiffies = reload_jiffies; | ||
2160 | if (reload_msec <= IWL_MIN_RELOAD_DURATION) { | ||
2161 | priv->reload_count++; | ||
2162 | if (priv->reload_count >= IWL_MAX_CONTINUE_RELOAD_CNT) { | ||
2163 | IWL_ERR(priv, "BUG_ON, Stop restarting\n"); | ||
2164 | return; | ||
2165 | } | ||
2166 | } else | ||
2167 | priv->reload_count = 0; | ||
2168 | } | ||
2169 | |||
2170 | if (!test_bit(STATUS_EXIT_PENDING, &priv->status)) { | ||
2171 | if (iwlagn_mod_params.restart_fw) { | ||
2172 | IWL_DEBUG_FW_ERRORS(priv, | ||
2173 | "Restarting adapter due to uCode error.\n"); | ||
2174 | queue_work(priv->workqueue, &priv->restart); | ||
2175 | } else | ||
2176 | IWL_DEBUG_FW_ERRORS(priv, | ||
2177 | "Detected FW error, but not restarting\n"); | ||
2178 | } | ||
2179 | } | ||
2180 | |||
2122 | static void iwl_nic_error(struct iwl_op_mode *op_mode) | 2181 | static void iwl_nic_error(struct iwl_op_mode *op_mode) |
2123 | { | 2182 | { |
2124 | struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); | 2183 | struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index ac0e8ba98a1d..455231988d24 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -149,7 +149,6 @@ int iwl_send_calib_results(struct iwl_priv *priv); | |||
149 | int iwl_calib_set(struct iwl_priv *priv, | 149 | int iwl_calib_set(struct iwl_priv *priv, |
150 | const struct iwl_calib_hdr *cmd, int len); | 150 | const struct iwl_calib_hdr *cmd, int len); |
151 | void iwl_calib_free_results(struct iwl_priv *priv); | 151 | void iwl_calib_free_results(struct iwl_priv *priv); |
152 | void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand); | ||
153 | int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | 152 | int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, |
154 | char **buf, bool display); | 153 | char **buf, bool display); |
155 | int iwlagn_hw_valid_rtc_data_addr(u32 addr); | 154 | int iwlagn_hw_valid_rtc_data_addr(u32 addr); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index f43a1e57e6c1..42789ed6e49f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -66,65 +66,6 @@ void iwl_print_rx_config_cmd(struct iwl_priv *priv, | |||
66 | } | 66 | } |
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand) | ||
70 | { | ||
71 | unsigned int reload_msec; | ||
72 | unsigned long reload_jiffies; | ||
73 | |||
74 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
75 | if (iwl_have_debug_level(IWL_DL_FW_ERRORS)) | ||
76 | iwl_print_rx_config_cmd(priv, IWL_RXON_CTX_BSS); | ||
77 | #endif | ||
78 | |||
79 | /* uCode is no longer loaded. */ | ||
80 | priv->ucode_loaded = false; | ||
81 | |||
82 | /* Set the FW error flag -- cleared on iwl_down */ | ||
83 | set_bit(STATUS_FW_ERROR, &priv->status); | ||
84 | |||
85 | /* Cancel currently queued command. */ | ||
86 | clear_bit(STATUS_HCMD_ACTIVE, &priv->shrd->status); | ||
87 | |||
88 | iwl_abort_notification_waits(&priv->notif_wait); | ||
89 | |||
90 | /* Keep the restart process from trying to send host | ||
91 | * commands by clearing the ready bit */ | ||
92 | clear_bit(STATUS_READY, &priv->status); | ||
93 | |||
94 | wake_up(&trans(priv)->wait_command_queue); | ||
95 | |||
96 | if (!ondemand) { | ||
97 | /* | ||
98 | * If firmware keep reloading, then it indicate something | ||
99 | * serious wrong and firmware having problem to recover | ||
100 | * from it. Instead of keep trying which will fill the syslog | ||
101 | * and hang the system, let's just stop it | ||
102 | */ | ||
103 | reload_jiffies = jiffies; | ||
104 | reload_msec = jiffies_to_msecs((long) reload_jiffies - | ||
105 | (long) priv->reload_jiffies); | ||
106 | priv->reload_jiffies = reload_jiffies; | ||
107 | if (reload_msec <= IWL_MIN_RELOAD_DURATION) { | ||
108 | priv->reload_count++; | ||
109 | if (priv->reload_count >= IWL_MAX_CONTINUE_RELOAD_CNT) { | ||
110 | IWL_ERR(priv, "BUG_ON, Stop restarting\n"); | ||
111 | return; | ||
112 | } | ||
113 | } else | ||
114 | priv->reload_count = 0; | ||
115 | } | ||
116 | |||
117 | if (!test_bit(STATUS_EXIT_PENDING, &priv->status)) { | ||
118 | if (iwlagn_mod_params.restart_fw) { | ||
119 | IWL_DEBUG_FW_ERRORS(priv, | ||
120 | "Restarting adapter due to uCode error.\n"); | ||
121 | queue_work(priv->workqueue, &priv->restart); | ||
122 | } else | ||
123 | IWL_DEBUG_FW_ERRORS(priv, | ||
124 | "Detected FW error, but not restarting\n"); | ||
125 | } | ||
126 | } | ||
127 | |||
128 | int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force) | 69 | int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force) |
129 | { | 70 | { |
130 | int ret; | 71 | int ret; |