Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90309
b: refs/heads/master
c: ab885f8
h: refs/heads/master
i:
  90307: e7f9096
v: v3
  • Loading branch information
Emmanuel Grumbach authored and John W. Linville committed Mar 25, 2008
1 parent cbec788 commit a6ee4b4
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2bc750899f2b1da010625d064ad46dc3a8e9a372
refs/heads/master: ab885f8c45373dfaaa3ad251f38b4240c40b2eae
51 changes: 51 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -7187,6 +7187,56 @@ static int iwl4965_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
return rc;
}

static void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw,
struct ieee80211_key_conf *keyconf, const u8 *addr,
u32 iv32, u16 *phase1key)
{
struct iwl_priv *priv = hw->priv;
u8 sta_id = IWL_INVALID_STATION;
unsigned long flags;
__le16 key_flags = 0;
int i;
DECLARE_MAC_BUF(mac);

IWL_DEBUG_MAC80211("enter\n");

sta_id = iwl4965_hw_find_station(priv, addr);
if (sta_id == IWL_INVALID_STATION) {
IWL_DEBUG_MAC80211("leave - %s not in station map.\n",
print_mac(mac, addr));
return;
}

iwl4965_scan_cancel_timeout(priv, 100);

key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK);
key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
key_flags &= ~STA_KEY_FLG_INVALID;

if (sta_id == priv->hw_setting.bcast_sta_id)
key_flags |= STA_KEY_MULTICAST_MSK;

spin_lock_irqsave(&priv->sta_lock, flags);

priv->stations[sta_id].sta.key.key_offset =
(sta_id % STA_KEY_MAX_NUM);/* FIXME */
priv->stations[sta_id].sta.key.key_flags = key_flags;
priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32;

for (i = 0; i < 5; i++)
priv->stations[sta_id].sta.key.tkip_rx_ttak[i] =
cpu_to_le16(phase1key[i]);

priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;

iwl4965_send_add_station(priv, &priv->stations[sta_id].sta, CMD_ASYNC);

spin_unlock_irqrestore(&priv->sta_lock, flags);

IWL_DEBUG_MAC80211("leave\n");
}

static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
const u8 *local_addr, const u8 *addr,
struct ieee80211_key_conf *key)
Expand Down Expand Up @@ -8128,6 +8178,7 @@ static struct ieee80211_ops iwl4965_hw_ops = {
.config_interface = iwl4965_mac_config_interface,
.configure_filter = iwl4965_configure_filter,
.set_key = iwl4965_mac_set_key,
.update_tkip_key = iwl4965_mac_update_tkip_key,
.get_stats = iwl4965_mac_get_stats,
.get_tx_stats = iwl4965_mac_get_tx_stats,
.conf_tx = iwl4965_mac_conf_tx,
Expand Down

0 comments on commit a6ee4b4

Please sign in to comment.