diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 166 |
1 files changed, 85 insertions, 81 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index cb484e273b93..3780a03f2716 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -82,20 +82,26 @@ void iwl_cancel_deferred_work(struct iwl_priv *priv); | |||
82 | void iwlagn_prepare_restart(struct iwl_priv *priv); | 82 | void iwlagn_prepare_restart(struct iwl_priv *priv); |
83 | void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb); | 83 | void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb); |
84 | int __must_check iwl_rx_dispatch(struct iwl_op_mode *op_mode, | 84 | int __must_check iwl_rx_dispatch(struct iwl_op_mode *op_mode, |
85 | struct iwl_rx_mem_buffer *rxb, | 85 | struct iwl_rx_cmd_buffer *rxb, |
86 | struct iwl_device_cmd *cmd); | 86 | struct iwl_device_cmd *cmd); |
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); | ||
89 | void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state); | 87 | 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); | 88 | void iwl_nic_error(struct iwl_op_mode *op_mode); |
92 | 89 | ||
90 | bool iwl_check_for_ct_kill(struct iwl_priv *priv); | ||
91 | |||
92 | void iwlagn_lift_passive_no_rx(struct iwl_priv *priv); | ||
93 | |||
93 | /* MAC80211 */ | 94 | /* MAC80211 */ |
94 | struct ieee80211_hw *iwl_alloc_all(void); | 95 | struct ieee80211_hw *iwl_alloc_all(void); |
95 | int iwlagn_mac_setup_register(struct iwl_priv *priv, | 96 | int iwlagn_mac_setup_register(struct iwl_priv *priv, |
96 | struct iwl_ucode_capabilities *capa); | 97 | const struct iwl_ucode_capabilities *capa); |
97 | void iwlagn_mac_unregister(struct iwl_priv *priv); | 98 | void iwlagn_mac_unregister(struct iwl_priv *priv); |
98 | 99 | ||
100 | /* commands */ | ||
101 | int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd); | ||
102 | int iwl_dvm_send_cmd_pdu(struct iwl_priv *priv, u8 id, | ||
103 | u32 flags, u16 len, const void *data); | ||
104 | |||
99 | /* RXON */ | 105 | /* RXON */ |
100 | int iwlagn_set_pan_params(struct iwl_priv *priv); | 106 | int iwlagn_set_pan_params(struct iwl_priv *priv); |
101 | int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx); | 107 | int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx); |
@@ -110,9 +116,18 @@ void iwlagn_config_ht40(struct ieee80211_conf *conf, | |||
110 | 116 | ||
111 | /* uCode */ | 117 | /* uCode */ |
112 | int iwlagn_rx_calib_result(struct iwl_priv *priv, | 118 | int iwlagn_rx_calib_result(struct iwl_priv *priv, |
113 | struct iwl_rx_mem_buffer *rxb, | 119 | struct iwl_rx_cmd_buffer *rxb, |
114 | struct iwl_device_cmd *cmd); | 120 | struct iwl_device_cmd *cmd); |
115 | void iwl_init_context(struct iwl_priv *priv, u32 ucode_flags); | 121 | int iwl_send_bt_env(struct iwl_priv *priv, u8 action, u8 type); |
122 | void iwl_send_prio_tbl(struct iwl_priv *priv); | ||
123 | int iwl_init_alive_start(struct iwl_priv *priv); | ||
124 | int iwl_run_init_ucode(struct iwl_priv *priv); | ||
125 | int iwl_load_ucode_wait_alive(struct iwl_priv *priv, | ||
126 | enum iwl_ucode_type ucode_type); | ||
127 | int iwl_send_calib_results(struct iwl_priv *priv); | ||
128 | int iwl_calib_set(struct iwl_priv *priv, | ||
129 | const struct iwl_calib_hdr *cmd, int len); | ||
130 | void iwl_calib_free_results(struct iwl_priv *priv); | ||
116 | 131 | ||
117 | /* lib */ | 132 | /* lib */ |
118 | int iwlagn_send_tx_power(struct iwl_priv *priv); | 133 | int iwlagn_send_tx_power(struct iwl_priv *priv); |
@@ -124,8 +139,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv); | |||
124 | #ifdef CONFIG_PM_SLEEP | 139 | #ifdef CONFIG_PM_SLEEP |
125 | int iwlagn_send_patterns(struct iwl_priv *priv, | 140 | int iwlagn_send_patterns(struct iwl_priv *priv, |
126 | struct cfg80211_wowlan *wowlan); | 141 | struct cfg80211_wowlan *wowlan); |
127 | int iwlagn_suspend(struct iwl_priv *priv, | 142 | int iwlagn_suspend(struct iwl_priv *priv, struct cfg80211_wowlan *wowlan); |
128 | struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan); | ||
129 | #endif | 143 | #endif |
130 | 144 | ||
131 | /* rx */ | 145 | /* rx */ |
@@ -142,9 +156,9 @@ int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif, | |||
142 | int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif, | 156 | int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif, |
143 | struct ieee80211_sta *sta, u16 tid); | 157 | struct ieee80211_sta *sta, u16 tid); |
144 | int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, | 158 | int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, |
145 | struct iwl_rx_mem_buffer *rxb, | 159 | struct iwl_rx_cmd_buffer *rxb, |
146 | struct iwl_device_cmd *cmd); | 160 | struct iwl_device_cmd *cmd); |
147 | int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb, | 161 | int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb, |
148 | struct iwl_device_cmd *cmd); | 162 | struct iwl_device_cmd *cmd); |
149 | 163 | ||
150 | static inline u32 iwl_tx_status_to_mac80211(u32 status) | 164 | static inline u32 iwl_tx_status_to_mac80211(u32 status) |
@@ -179,7 +193,7 @@ void iwlagn_disable_roc(struct iwl_priv *priv); | |||
179 | /* bt coex */ | 193 | /* bt coex */ |
180 | void iwlagn_send_advance_bt_config(struct iwl_priv *priv); | 194 | void iwlagn_send_advance_bt_config(struct iwl_priv *priv); |
181 | int iwlagn_bt_coex_profile_notif(struct iwl_priv *priv, | 195 | int iwlagn_bt_coex_profile_notif(struct iwl_priv *priv, |
182 | struct iwl_rx_mem_buffer *rxb, | 196 | struct iwl_rx_cmd_buffer *rxb, |
183 | struct iwl_device_cmd *cmd); | 197 | struct iwl_device_cmd *cmd); |
184 | void iwlagn_bt_rx_handler_setup(struct iwl_priv *priv); | 198 | void iwlagn_bt_rx_handler_setup(struct iwl_priv *priv); |
185 | void iwlagn_bt_setup_deferred_work(struct iwl_priv *priv); | 199 | void iwlagn_bt_setup_deferred_work(struct iwl_priv *priv); |
@@ -220,6 +234,8 @@ int iwl_add_station_common(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | |||
220 | struct ieee80211_sta *sta, u8 *sta_id_r); | 234 | struct ieee80211_sta *sta, u8 *sta_id_r); |
221 | int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, | 235 | int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, |
222 | const u8 *addr); | 236 | const u8 *addr); |
237 | void iwl_deactivate_station(struct iwl_priv *priv, const u8 sta_id, | ||
238 | const u8 *addr); | ||
223 | u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | 239 | u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
224 | const u8 *addr, bool is_ap, struct ieee80211_sta *sta); | 240 | const u8 *addr, bool is_ap, struct ieee80211_sta *sta); |
225 | 241 | ||
@@ -227,46 +243,12 @@ void iwl_sta_fill_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | |||
227 | u8 sta_id, struct iwl_link_quality_cmd *link_cmd); | 243 | u8 sta_id, struct iwl_link_quality_cmd *link_cmd); |
228 | int iwl_send_lq_cmd(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | 244 | int iwl_send_lq_cmd(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
229 | struct iwl_link_quality_cmd *lq, u8 flags, bool init); | 245 | struct iwl_link_quality_cmd *lq, u8 flags, bool init); |
230 | void iwl_reprogram_ap_sta(struct iwl_priv *priv, struct iwl_rxon_context *ctx); | 246 | int iwl_add_sta_callback(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb, |
231 | int iwl_add_sta_callback(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb, | ||
232 | struct iwl_device_cmd *cmd); | 247 | struct iwl_device_cmd *cmd); |
248 | int iwl_sta_update_ht(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | ||
249 | struct ieee80211_sta *sta); | ||
233 | 250 | ||
234 | 251 | ||
235 | /** | ||
236 | * iwl_clear_driver_stations - clear knowledge of all stations from driver | ||
237 | * @priv: iwl priv struct | ||
238 | * | ||
239 | * This is called during iwl_down() to make sure that in the case | ||
240 | * we're coming there from a hardware restart mac80211 will be | ||
241 | * able to reconfigure stations -- if we're getting there in the | ||
242 | * normal down flow then the stations will already be cleared. | ||
243 | */ | ||
244 | static inline void iwl_clear_driver_stations(struct iwl_priv *priv) | ||
245 | { | ||
246 | unsigned long flags; | ||
247 | struct iwl_rxon_context *ctx; | ||
248 | |||
249 | spin_lock_irqsave(&priv->shrd->sta_lock, flags); | ||
250 | memset(priv->stations, 0, sizeof(priv->stations)); | ||
251 | priv->num_stations = 0; | ||
252 | |||
253 | priv->ucode_key_table = 0; | ||
254 | |||
255 | for_each_context(priv, ctx) { | ||
256 | /* | ||
257 | * Remove all key information that is not stored as part | ||
258 | * of station information since mac80211 may not have had | ||
259 | * a chance to remove all the keys. When device is | ||
260 | * reconfigured by mac80211 after an error all keys will | ||
261 | * be reconfigured. | ||
262 | */ | ||
263 | memset(ctx->wep_keys, 0, sizeof(ctx->wep_keys)); | ||
264 | ctx->key_mapping_keys = 0; | ||
265 | } | ||
266 | |||
267 | spin_unlock_irqrestore(&priv->shrd->sta_lock, flags); | ||
268 | } | ||
269 | |||
270 | static inline int iwl_sta_id(struct ieee80211_sta *sta) | 252 | static inline int iwl_sta_id(struct ieee80211_sta *sta) |
271 | { | 253 | { |
272 | if (WARN_ON(!sta)) | 254 | if (WARN_ON(!sta)) |
@@ -275,37 +257,6 @@ static inline int iwl_sta_id(struct ieee80211_sta *sta) | |||
275 | return ((struct iwl_station_priv *)sta->drv_priv)->sta_id; | 257 | return ((struct iwl_station_priv *)sta->drv_priv)->sta_id; |
276 | } | 258 | } |
277 | 259 | ||
278 | /** | ||
279 | * iwl_sta_id_or_broadcast - return sta_id or broadcast sta | ||
280 | * @priv: iwl priv | ||
281 | * @context: the current context | ||
282 | * @sta: mac80211 station | ||
283 | * | ||
284 | * In certain circumstances mac80211 passes a station pointer | ||
285 | * that may be %NULL, for example during TX or key setup. In | ||
286 | * that case, we need to use the broadcast station, so this | ||
287 | * inline wraps that pattern. | ||
288 | */ | ||
289 | static inline int iwl_sta_id_or_broadcast(struct iwl_priv *priv, | ||
290 | struct iwl_rxon_context *context, | ||
291 | struct ieee80211_sta *sta) | ||
292 | { | ||
293 | int sta_id; | ||
294 | |||
295 | if (!sta) | ||
296 | return context->bcast_sta_id; | ||
297 | |||
298 | sta_id = iwl_sta_id(sta); | ||
299 | |||
300 | /* | ||
301 | * mac80211 should not be passing a partially | ||
302 | * initialised station! | ||
303 | */ | ||
304 | WARN_ON(sta_id == IWL_INVALID_STATION); | ||
305 | |||
306 | return sta_id; | ||
307 | } | ||
308 | |||
309 | int iwlagn_alloc_bcast_station(struct iwl_priv *priv, | 260 | int iwlagn_alloc_bcast_station(struct iwl_priv *priv, |
310 | struct iwl_rxon_context *ctx); | 261 | struct iwl_rxon_context *ctx); |
311 | int iwlagn_add_bssid_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | 262 | int iwlagn_add_bssid_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
@@ -355,7 +306,6 @@ static inline __le32 iwl_hw_set_rate_n_flags(u8 rate, u32 flags) | |||
355 | } | 306 | } |
356 | 307 | ||
357 | /* eeprom */ | 308 | /* eeprom */ |
358 | void iwl_eeprom_enhanced_txpower(struct iwl_priv *priv); | ||
359 | void iwl_eeprom_get_mac(const struct iwl_shared *shrd, u8 *mac); | 309 | void iwl_eeprom_get_mac(const struct iwl_shared *shrd, u8 *mac); |
360 | 310 | ||
361 | extern int iwl_alive_start(struct iwl_priv *priv); | 311 | extern int iwl_alive_start(struct iwl_priv *priv); |
@@ -402,4 +352,58 @@ static inline void iwl_print_rx_config_cmd(struct iwl_priv *priv, | |||
402 | } | 352 | } |
403 | #endif | 353 | #endif |
404 | 354 | ||
355 | /* status checks */ | ||
356 | |||
357 | static inline int iwl_is_ready(struct iwl_priv *priv) | ||
358 | { | ||
359 | /* The adapter is 'ready' if READY and GEO_CONFIGURED bits are | ||
360 | * set but EXIT_PENDING is not */ | ||
361 | return test_bit(STATUS_READY, &priv->status) && | ||
362 | test_bit(STATUS_GEO_CONFIGURED, &priv->status) && | ||
363 | !test_bit(STATUS_EXIT_PENDING, &priv->status); | ||
364 | } | ||
365 | |||
366 | static inline int iwl_is_alive(struct iwl_priv *priv) | ||
367 | { | ||
368 | return test_bit(STATUS_ALIVE, &priv->status); | ||
369 | } | ||
370 | |||
371 | static inline int iwl_is_rfkill(struct iwl_priv *priv) | ||
372 | { | ||
373 | return test_bit(STATUS_RF_KILL_HW, &priv->status); | ||
374 | } | ||
375 | |||
376 | static inline int iwl_is_ctkill(struct iwl_priv *priv) | ||
377 | { | ||
378 | return test_bit(STATUS_CT_KILL, &priv->status); | ||
379 | } | ||
380 | |||
381 | static inline int iwl_is_ready_rf(struct iwl_priv *priv) | ||
382 | { | ||
383 | if (iwl_is_rfkill(priv)) | ||
384 | return 0; | ||
385 | |||
386 | return iwl_is_ready(priv); | ||
387 | } | ||
388 | |||
389 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
390 | #define IWL_DEBUG_QUIET_RFKILL(m, fmt, args...) \ | ||
391 | do { \ | ||
392 | if (!iwl_is_rfkill((m))) \ | ||
393 | IWL_ERR(m, fmt, ##args); \ | ||
394 | else \ | ||
395 | __iwl_err(trans(m)->dev, true, \ | ||
396 | !iwl_have_debug_level(IWL_DL_RADIO), \ | ||
397 | fmt, ##args); \ | ||
398 | } while (0) | ||
399 | #else | ||
400 | #define IWL_DEBUG_QUIET_RFKILL(m, fmt, args...) \ | ||
401 | do { \ | ||
402 | if (!iwl_is_rfkill((m))) \ | ||
403 | IWL_ERR(m, fmt, ##args); \ | ||
404 | else \ | ||
405 | __iwl_err(trans(m)->dev, true, true, fmt, ##args); \ | ||
406 | } while (0) | ||
407 | #endif /* CONFIG_IWLWIFI_DEBUG */ | ||
408 | |||
405 | #endif /* __iwl_agn_h__ */ | 409 | #endif /* __iwl_agn_h__ */ |