aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-core.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-core.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 64f4df53986..6d82376f43f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -148,6 +148,63 @@ int iwl_send_cmd_pdu_async(struct iwl_priv *priv, u8 id, u16 len,
148 int (*callback)(struct iwl_priv *priv, 148 int (*callback)(struct iwl_priv *priv,
149 struct iwl_cmd *cmd, 149 struct iwl_cmd *cmd,
150 struct sk_buff *skb)); 150 struct sk_buff *skb));
151/*************** DRIVER STATUS FUNCTIONS *****/
152
153#define STATUS_HCMD_ACTIVE 0 /* host command in progress */
154#define STATUS_HCMD_SYNC_ACTIVE 1 /* sync host command in progress */
155#define STATUS_INT_ENABLED 2
156#define STATUS_RF_KILL_HW 3
157#define STATUS_RF_KILL_SW 4
158#define STATUS_INIT 5
159#define STATUS_ALIVE 6
160#define STATUS_READY 7
161#define STATUS_TEMPERATURE 8
162#define STATUS_GEO_CONFIGURED 9
163#define STATUS_EXIT_PENDING 10
164#define STATUS_IN_SUSPEND 11
165#define STATUS_STATISTICS 12
166#define STATUS_SCANNING 13
167#define STATUS_SCAN_ABORTING 14
168#define STATUS_SCAN_HW 15
169#define STATUS_POWER_PMI 16
170#define STATUS_FW_ERROR 17
171#define STATUS_CONF_PENDING 18
172
173
174static inline int iwl_is_ready(struct iwl_priv *priv)
175{
176 /* The adapter is 'ready' if READY and GEO_CONFIGURED bits are
177 * set but EXIT_PENDING is not */
178 return test_bit(STATUS_READY, &priv->status) &&
179 test_bit(STATUS_GEO_CONFIGURED, &priv->status) &&
180 !test_bit(STATUS_EXIT_PENDING, &priv->status);
181}
182
183static inline int iwl_is_alive(struct iwl_priv *priv)
184{
185 return test_bit(STATUS_ALIVE, &priv->status);
186}
187
188static inline int iwl_is_init(struct iwl_priv *priv)
189{
190 return test_bit(STATUS_INIT, &priv->status);
191}
192
193static inline int iwl_is_rfkill(struct iwl_priv *priv)
194{
195 return test_bit(STATUS_RF_KILL_HW, &priv->status) ||
196 test_bit(STATUS_RF_KILL_SW, &priv->status);
197}
198
199static inline int iwl_is_ready_rf(struct iwl_priv *priv)
200{
201
202 if (iwl_is_rfkill(priv))
203 return 0;
204
205 return iwl_is_ready(priv);
206}
207
151 208
152enum iwlcore_card_notify { 209enum iwlcore_card_notify {
153 IWLCORE_INIT_EVT = 0, 210 IWLCORE_INIT_EVT = 0,