diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index ae8fc8cb4d18..bd5375984045 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -7187,6 +7187,56 @@ out_unlock: | |||
7187 | return rc; | 7187 | return rc; |
7188 | } | 7188 | } |
7189 | 7189 | ||
7190 | static void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw, | ||
7191 | struct ieee80211_key_conf *keyconf, const u8 *addr, | ||
7192 | u32 iv32, u16 *phase1key) | ||
7193 | { | ||
7194 | struct iwl_priv *priv = hw->priv; | ||
7195 | u8 sta_id = IWL_INVALID_STATION; | ||
7196 | unsigned long flags; | ||
7197 | __le16 key_flags = 0; | ||
7198 | int i; | ||
7199 | DECLARE_MAC_BUF(mac); | ||
7200 | |||
7201 | IWL_DEBUG_MAC80211("enter\n"); | ||
7202 | |||
7203 | sta_id = iwl4965_hw_find_station(priv, addr); | ||
7204 | if (sta_id == IWL_INVALID_STATION) { | ||
7205 | IWL_DEBUG_MAC80211("leave - %s not in station map.\n", | ||
7206 | print_mac(mac, addr)); | ||
7207 | return; | ||
7208 | } | ||
7209 | |||
7210 | iwl4965_scan_cancel_timeout(priv, 100); | ||
7211 | |||
7212 | key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK); | ||
7213 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); | ||
7214 | key_flags &= ~STA_KEY_FLG_INVALID; | ||
7215 | |||
7216 | if (sta_id == priv->hw_setting.bcast_sta_id) | ||
7217 | key_flags |= STA_KEY_MULTICAST_MSK; | ||
7218 | |||
7219 | spin_lock_irqsave(&priv->sta_lock, flags); | ||
7220 | |||
7221 | priv->stations[sta_id].sta.key.key_offset = | ||
7222 | (sta_id % STA_KEY_MAX_NUM);/* FIXME */ | ||
7223 | priv->stations[sta_id].sta.key.key_flags = key_flags; | ||
7224 | priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32; | ||
7225 | |||
7226 | for (i = 0; i < 5; i++) | ||
7227 | priv->stations[sta_id].sta.key.tkip_rx_ttak[i] = | ||
7228 | cpu_to_le16(phase1key[i]); | ||
7229 | |||
7230 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; | ||
7231 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | ||
7232 | |||
7233 | iwl4965_send_add_station(priv, &priv->stations[sta_id].sta, CMD_ASYNC); | ||
7234 | |||
7235 | spin_unlock_irqrestore(&priv->sta_lock, flags); | ||
7236 | |||
7237 | IWL_DEBUG_MAC80211("leave\n"); | ||
7238 | } | ||
7239 | |||
7190 | static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 7240 | static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
7191 | const u8 *local_addr, const u8 *addr, | 7241 | const u8 *local_addr, const u8 *addr, |
7192 | struct ieee80211_key_conf *key) | 7242 | struct ieee80211_key_conf *key) |
@@ -8128,6 +8178,7 @@ static struct ieee80211_ops iwl4965_hw_ops = { | |||
8128 | .config_interface = iwl4965_mac_config_interface, | 8178 | .config_interface = iwl4965_mac_config_interface, |
8129 | .configure_filter = iwl4965_configure_filter, | 8179 | .configure_filter = iwl4965_configure_filter, |
8130 | .set_key = iwl4965_mac_set_key, | 8180 | .set_key = iwl4965_mac_set_key, |
8181 | .update_tkip_key = iwl4965_mac_update_tkip_key, | ||
8131 | .get_stats = iwl4965_mac_get_stats, | 8182 | .get_stats = iwl4965_mac_get_stats, |
8132 | .get_tx_stats = iwl4965_mac_get_tx_stats, | 8183 | .get_tx_stats = iwl4965_mac_get_tx_stats, |
8133 | .conf_tx = iwl4965_mac_conf_tx, | 8184 | .conf_tx = iwl4965_mac_conf_tx, |