aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-sta.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.h72
1 files changed, 31 insertions, 41 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h
index d38a350ba0bd..ff64027ff4cb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.h
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2003 - 2010 Intel Corporation. All rights reserved. 3 * Copyright(c) 2003 - 2011 Intel Corporation. All rights reserved.
4 * 4 *
5 * Portions of this file are derived from the ipw3945 project, as well 5 * Portions of this file are derived from the ipw3945 project, as well
6 * as portions of the ieee80211 subsystem header files. 6 * as portions of the ieee80211 subsystem header files.
@@ -43,44 +43,27 @@
43#define IWL_STA_BCAST BIT(4) /* this station is the special bcast station */ 43#define IWL_STA_BCAST BIT(4) /* this station is the special bcast station */
44 44
45 45
46int iwl_remove_default_wep_key(struct iwl_priv *priv, 46void iwl_restore_stations(struct iwl_priv *priv, struct iwl_rxon_context *ctx);
47 struct ieee80211_key_conf *key); 47void iwl_clear_ucode_stations(struct iwl_priv *priv,
48int iwl_set_default_wep_key(struct iwl_priv *priv, 48 struct iwl_rxon_context *ctx);
49 struct ieee80211_key_conf *key); 49void iwl_dealloc_bcast_stations(struct iwl_priv *priv);
50int iwl_restore_default_wep_keys(struct iwl_priv *priv);
51int iwl_set_dynamic_key(struct iwl_priv *priv,
52 struct ieee80211_key_conf *key, u8 sta_id);
53int iwl_remove_dynamic_key(struct iwl_priv *priv,
54 struct ieee80211_key_conf *key, u8 sta_id);
55void iwl_update_tkip_key(struct iwl_priv *priv,
56 struct ieee80211_key_conf *keyconf,
57 struct ieee80211_sta *sta, u32 iv32, u16 *phase1key);
58
59void iwl_restore_stations(struct iwl_priv *priv);
60void iwl_clear_ucode_stations(struct iwl_priv *priv);
61int iwl_alloc_bcast_station(struct iwl_priv *priv, bool init_lq);
62void iwl_dealloc_bcast_station(struct iwl_priv *priv);
63int iwl_update_bcast_station(struct iwl_priv *priv);
64int iwl_get_free_ucode_key_index(struct iwl_priv *priv); 50int iwl_get_free_ucode_key_index(struct iwl_priv *priv);
65int iwl_send_add_sta(struct iwl_priv *priv, 51int iwl_send_add_sta(struct iwl_priv *priv,
66 struct iwl_addsta_cmd *sta, u8 flags); 52 struct iwl_addsta_cmd *sta, u8 flags);
67int iwl_add_bssid_station(struct iwl_priv *priv, const u8 *addr, bool init_rs, 53int iwl_add_station_common(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
68 u8 *sta_id_r); 54 const u8 *addr, bool is_ap,
69int iwl_add_station_common(struct iwl_priv *priv, const u8 *addr, 55 struct ieee80211_sta *sta, u8 *sta_id_r);
70 bool is_ap,
71 struct ieee80211_sta_ht_cap *ht_info,
72 u8 *sta_id_r);
73int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, 56int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id,
74 const u8 *addr); 57 const u8 *addr);
75int iwl_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 58int iwl_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
76 struct ieee80211_sta *sta); 59 struct ieee80211_sta *sta);
77int iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid); 60
78int iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta, 61u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
79 int tid, u16 ssn); 62 const u8 *addr, bool is_ap, struct ieee80211_sta *sta);
80int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta, 63
81 int tid); 64int iwl_send_lq_cmd(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
82void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id); 65 struct iwl_link_quality_cmd *lq, u8 flags, bool init);
83void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt); 66void iwl_reprogram_ap_sta(struct iwl_priv *priv, struct iwl_rxon_context *ctx);
84 67
85/** 68/**
86 * iwl_clear_driver_stations - clear knowledge of all stations from driver 69 * iwl_clear_driver_stations - clear knowledge of all stations from driver
@@ -94,20 +77,25 @@ void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt);
94static inline void iwl_clear_driver_stations(struct iwl_priv *priv) 77static inline void iwl_clear_driver_stations(struct iwl_priv *priv)
95{ 78{
96 unsigned long flags; 79 unsigned long flags;
80 struct iwl_rxon_context *ctx;
97 81
98 spin_lock_irqsave(&priv->sta_lock, flags); 82 spin_lock_irqsave(&priv->sta_lock, flags);
99 memset(priv->stations, 0, sizeof(priv->stations)); 83 memset(priv->stations, 0, sizeof(priv->stations));
100 priv->num_stations = 0; 84 priv->num_stations = 0;
101 85
102 /*
103 * Remove all key information that is not stored as part of station
104 * information since mac80211 may not have had a
105 * chance to remove all the keys. When device is reconfigured by
106 * mac80211 after an error all keys will be reconfigured.
107 */
108 priv->ucode_key_table = 0; 86 priv->ucode_key_table = 0;
109 priv->key_mapping_key = 0; 87
110 memset(priv->wep_keys, 0, sizeof(priv->wep_keys)); 88 for_each_context(priv, ctx) {
89 /*
90 * Remove all key information that is not stored as part
91 * of station information since mac80211 may not have had
92 * a chance to remove all the keys. When device is
93 * reconfigured by mac80211 after an error all keys will
94 * be reconfigured.
95 */
96 memset(ctx->wep_keys, 0, sizeof(ctx->wep_keys));
97 ctx->key_mapping_keys = 0;
98 }
111 99
112 spin_unlock_irqrestore(&priv->sta_lock, flags); 100 spin_unlock_irqrestore(&priv->sta_lock, flags);
113} 101}
@@ -123,6 +111,7 @@ static inline int iwl_sta_id(struct ieee80211_sta *sta)
123/** 111/**
124 * iwl_sta_id_or_broadcast - return sta_id or broadcast sta 112 * iwl_sta_id_or_broadcast - return sta_id or broadcast sta
125 * @priv: iwl priv 113 * @priv: iwl priv
114 * @context: the current context
126 * @sta: mac80211 station 115 * @sta: mac80211 station
127 * 116 *
128 * In certain circumstances mac80211 passes a station pointer 117 * In certain circumstances mac80211 passes a station pointer
@@ -131,12 +120,13 @@ static inline int iwl_sta_id(struct ieee80211_sta *sta)
131 * inline wraps that pattern. 120 * inline wraps that pattern.
132 */ 121 */
133static inline int iwl_sta_id_or_broadcast(struct iwl_priv *priv, 122static inline int iwl_sta_id_or_broadcast(struct iwl_priv *priv,
123 struct iwl_rxon_context *context,
134 struct ieee80211_sta *sta) 124 struct ieee80211_sta *sta)
135{ 125{
136 int sta_id; 126 int sta_id;
137 127
138 if (!sta) 128 if (!sta)
139 return priv->hw_params.bcast_sta_id; 129 return context->bcast_sta_id;
140 130
141 sta_id = iwl_sta_id(sta); 131 sta_id = iwl_sta_id(sta);
142 132