diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.h | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h index d38a350ba0bd..56bad3f60d81 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.h +++ b/drivers/net/wireless/iwlwifi/iwl-sta.h | |||
@@ -44,32 +44,37 @@ | |||
44 | 44 | ||
45 | 45 | ||
46 | int iwl_remove_default_wep_key(struct iwl_priv *priv, | 46 | int iwl_remove_default_wep_key(struct iwl_priv *priv, |
47 | struct iwl_rxon_context *ctx, | ||
47 | struct ieee80211_key_conf *key); | 48 | struct ieee80211_key_conf *key); |
48 | int iwl_set_default_wep_key(struct iwl_priv *priv, | 49 | int iwl_set_default_wep_key(struct iwl_priv *priv, |
50 | struct iwl_rxon_context *ctx, | ||
49 | struct ieee80211_key_conf *key); | 51 | struct ieee80211_key_conf *key); |
50 | int iwl_restore_default_wep_keys(struct iwl_priv *priv); | 52 | int iwl_restore_default_wep_keys(struct iwl_priv *priv, |
51 | int iwl_set_dynamic_key(struct iwl_priv *priv, | 53 | struct iwl_rxon_context *ctx); |
54 | int iwl_set_dynamic_key(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | ||
52 | struct ieee80211_key_conf *key, u8 sta_id); | 55 | struct ieee80211_key_conf *key, u8 sta_id); |
53 | int iwl_remove_dynamic_key(struct iwl_priv *priv, | 56 | int iwl_remove_dynamic_key(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
54 | struct ieee80211_key_conf *key, u8 sta_id); | 57 | struct ieee80211_key_conf *key, u8 sta_id); |
55 | void iwl_update_tkip_key(struct iwl_priv *priv, | 58 | void iwl_update_tkip_key(struct iwl_priv *priv, |
56 | struct ieee80211_key_conf *keyconf, | 59 | struct iwl_rxon_context *ctx, |
57 | struct ieee80211_sta *sta, u32 iv32, u16 *phase1key); | 60 | struct ieee80211_key_conf *keyconf, |
58 | 61 | struct ieee80211_sta *sta, u32 iv32, u16 *phase1key); | |
59 | void iwl_restore_stations(struct iwl_priv *priv); | 62 | |
60 | void iwl_clear_ucode_stations(struct iwl_priv *priv); | 63 | void iwl_restore_stations(struct iwl_priv *priv, struct iwl_rxon_context *ctx); |
61 | int iwl_alloc_bcast_station(struct iwl_priv *priv, bool init_lq); | 64 | void iwl_clear_ucode_stations(struct iwl_priv *priv, |
62 | void iwl_dealloc_bcast_station(struct iwl_priv *priv); | 65 | struct iwl_rxon_context *ctx); |
63 | int iwl_update_bcast_station(struct iwl_priv *priv); | 66 | int iwl_alloc_bcast_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
67 | bool init_lq); | ||
68 | void iwl_dealloc_bcast_stations(struct iwl_priv *priv); | ||
69 | int iwl_update_bcast_stations(struct iwl_priv *priv); | ||
64 | int iwl_get_free_ucode_key_index(struct iwl_priv *priv); | 70 | int iwl_get_free_ucode_key_index(struct iwl_priv *priv); |
65 | int iwl_send_add_sta(struct iwl_priv *priv, | 71 | int iwl_send_add_sta(struct iwl_priv *priv, |
66 | struct iwl_addsta_cmd *sta, u8 flags); | 72 | struct iwl_addsta_cmd *sta, u8 flags); |
67 | int iwl_add_bssid_station(struct iwl_priv *priv, const u8 *addr, bool init_rs, | 73 | int iwl_add_bssid_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
68 | u8 *sta_id_r); | 74 | const u8 *addr, bool init_rs, u8 *sta_id_r); |
69 | int iwl_add_station_common(struct iwl_priv *priv, const u8 *addr, | 75 | int iwl_add_station_common(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
70 | bool is_ap, | 76 | const u8 *addr, bool is_ap, |
71 | struct ieee80211_sta_ht_cap *ht_info, | 77 | struct ieee80211_sta *sta, u8 *sta_id_r); |
72 | u8 *sta_id_r); | ||
73 | int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, | 78 | int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, |
74 | const u8 *addr); | 79 | const u8 *addr); |
75 | int iwl_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 80 | int iwl_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
@@ -94,20 +99,25 @@ void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt); | |||
94 | static inline void iwl_clear_driver_stations(struct iwl_priv *priv) | 99 | static inline void iwl_clear_driver_stations(struct iwl_priv *priv) |
95 | { | 100 | { |
96 | unsigned long flags; | 101 | unsigned long flags; |
102 | struct iwl_rxon_context *ctx; | ||
97 | 103 | ||
98 | spin_lock_irqsave(&priv->sta_lock, flags); | 104 | spin_lock_irqsave(&priv->sta_lock, flags); |
99 | memset(priv->stations, 0, sizeof(priv->stations)); | 105 | memset(priv->stations, 0, sizeof(priv->stations)); |
100 | priv->num_stations = 0; | 106 | priv->num_stations = 0; |
101 | 107 | ||
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; | 108 | priv->ucode_key_table = 0; |
109 | priv->key_mapping_key = 0; | 109 | |
110 | memset(priv->wep_keys, 0, sizeof(priv->wep_keys)); | 110 | for_each_context(priv, ctx) { |
111 | /* | ||
112 | * Remove all key information that is not stored as part | ||
113 | * of station information since mac80211 may not have had | ||
114 | * a chance to remove all the keys. When device is | ||
115 | * reconfigured by mac80211 after an error all keys will | ||
116 | * be reconfigured. | ||
117 | */ | ||
118 | memset(ctx->wep_keys, 0, sizeof(ctx->wep_keys)); | ||
119 | ctx->key_mapping_keys = 0; | ||
120 | } | ||
111 | 121 | ||
112 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 122 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
113 | } | 123 | } |
@@ -123,6 +133,7 @@ static inline int iwl_sta_id(struct ieee80211_sta *sta) | |||
123 | /** | 133 | /** |
124 | * iwl_sta_id_or_broadcast - return sta_id or broadcast sta | 134 | * iwl_sta_id_or_broadcast - return sta_id or broadcast sta |
125 | * @priv: iwl priv | 135 | * @priv: iwl priv |
136 | * @context: the current context | ||
126 | * @sta: mac80211 station | 137 | * @sta: mac80211 station |
127 | * | 138 | * |
128 | * In certain circumstances mac80211 passes a station pointer | 139 | * In certain circumstances mac80211 passes a station pointer |
@@ -131,12 +142,13 @@ static inline int iwl_sta_id(struct ieee80211_sta *sta) | |||
131 | * inline wraps that pattern. | 142 | * inline wraps that pattern. |
132 | */ | 143 | */ |
133 | static inline int iwl_sta_id_or_broadcast(struct iwl_priv *priv, | 144 | static inline int iwl_sta_id_or_broadcast(struct iwl_priv *priv, |
145 | struct iwl_rxon_context *context, | ||
134 | struct ieee80211_sta *sta) | 146 | struct ieee80211_sta *sta) |
135 | { | 147 | { |
136 | int sta_id; | 148 | int sta_id; |
137 | 149 | ||
138 | if (!sta) | 150 | if (!sta) |
139 | return priv->hw_params.bcast_sta_id; | 151 | return context->bcast_sta_id; |
140 | 152 | ||
141 | sta_id = iwl_sta_id(sta); | 153 | sta_id = iwl_sta_id(sta); |
142 | 154 | ||