diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.h | 72 |
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 | ||
46 | int iwl_remove_default_wep_key(struct iwl_priv *priv, | 46 | void iwl_restore_stations(struct iwl_priv *priv, struct iwl_rxon_context *ctx); |
47 | struct ieee80211_key_conf *key); | 47 | void iwl_clear_ucode_stations(struct iwl_priv *priv, |
48 | int iwl_set_default_wep_key(struct iwl_priv *priv, | 48 | struct iwl_rxon_context *ctx); |
49 | struct ieee80211_key_conf *key); | 49 | void iwl_dealloc_bcast_stations(struct iwl_priv *priv); |
50 | int iwl_restore_default_wep_keys(struct iwl_priv *priv); | ||
51 | int iwl_set_dynamic_key(struct iwl_priv *priv, | ||
52 | struct ieee80211_key_conf *key, u8 sta_id); | ||
53 | int iwl_remove_dynamic_key(struct iwl_priv *priv, | ||
54 | struct ieee80211_key_conf *key, u8 sta_id); | ||
55 | void iwl_update_tkip_key(struct iwl_priv *priv, | ||
56 | struct ieee80211_key_conf *keyconf, | ||
57 | struct ieee80211_sta *sta, u32 iv32, u16 *phase1key); | ||
58 | |||
59 | void iwl_restore_stations(struct iwl_priv *priv); | ||
60 | void iwl_clear_ucode_stations(struct iwl_priv *priv); | ||
61 | int iwl_alloc_bcast_station(struct iwl_priv *priv, bool init_lq); | ||
62 | void iwl_dealloc_bcast_station(struct iwl_priv *priv); | ||
63 | int iwl_update_bcast_station(struct iwl_priv *priv); | ||
64 | int iwl_get_free_ucode_key_index(struct iwl_priv *priv); | 50 | int iwl_get_free_ucode_key_index(struct iwl_priv *priv); |
65 | int iwl_send_add_sta(struct iwl_priv *priv, | 51 | int iwl_send_add_sta(struct iwl_priv *priv, |
66 | struct iwl_addsta_cmd *sta, u8 flags); | 52 | struct iwl_addsta_cmd *sta, u8 flags); |
67 | int iwl_add_bssid_station(struct iwl_priv *priv, const u8 *addr, bool init_rs, | 53 | int 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, |
69 | int 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); | ||
73 | int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, | 56 | int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, |
74 | const u8 *addr); | 57 | const u8 *addr); |
75 | int iwl_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 58 | int iwl_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
76 | struct ieee80211_sta *sta); | 59 | struct ieee80211_sta *sta); |
77 | int iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid); | 60 | |
78 | int iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta, | 61 | u8 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); |
80 | int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta, | 63 | |
81 | int tid); | 64 | int iwl_send_lq_cmd(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
82 | void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id); | 65 | struct iwl_link_quality_cmd *lq, u8 flags, bool init); |
83 | void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt); | 66 | void 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); | |||
94 | static inline void iwl_clear_driver_stations(struct iwl_priv *priv) | 77 | static 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 | */ |
133 | static inline int iwl_sta_id_or_broadcast(struct iwl_priv *priv, | 122 | static 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 | ||