Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203258
b: refs/heads/master
c: e666674
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and Reinette Chatre committed Jun 21, 2010
1 parent 974d566 commit 718263f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4620fefa59d8aeae400b21d60d9a86aa11ebffa7
refs/heads/master: e666674eec98752d82388ae009e9039a62e744e7
29 changes: 18 additions & 11 deletions trunk/drivers/net/wireless/iwlwifi/iwl-sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,9 @@ static int iwl_set_wep_dynamic_key_info(struct iwl_priv *priv,
{
unsigned long flags;
__le16 key_flags = 0;
int ret;
struct iwl_addsta_cmd sta_cmd;

lockdep_assert_held(&priv->mutex);

keyconf->flags &= ~IEEE80211_KEY_FLAG_GENERATE_IV;

Expand Down Expand Up @@ -874,11 +876,10 @@ static int iwl_set_wep_dynamic_key_info(struct iwl_priv *priv,
priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;

ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);

memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd));
spin_unlock_irqrestore(&priv->sta_lock, flags);

return ret;
return iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC);
}

static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv,
Expand All @@ -887,7 +888,9 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv,
{
unsigned long flags;
__le16 key_flags = 0;
int ret;
struct iwl_addsta_cmd sta_cmd;

lockdep_assert_held(&priv->mutex);

key_flags |= (STA_KEY_FLG_CCMP | STA_KEY_FLG_MAP_KEY_MSK);
key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
Expand Down Expand Up @@ -922,11 +925,10 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv,
priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;

ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);

memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd));
spin_unlock_irqrestore(&priv->sta_lock, flags);

return ret;
return iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC);
}

static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
Expand Down Expand Up @@ -1016,9 +1018,11 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
u8 sta_id)
{
unsigned long flags;
int ret = 0;
u16 key_flags;
u8 keyidx;
struct iwl_addsta_cmd sta_cmd;

lockdep_assert_held(&priv->mutex);

priv->key_mapping_key--;

Expand Down Expand Up @@ -1065,9 +1069,10 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
spin_unlock_irqrestore(&priv->sta_lock, flags);
return 0;
}
ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd));
spin_unlock_irqrestore(&priv->sta_lock, flags);
return ret;

return iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC);
}
EXPORT_SYMBOL(iwl_remove_dynamic_key);

Expand All @@ -1076,6 +1081,8 @@ int iwl_set_dynamic_key(struct iwl_priv *priv,
{
int ret;

lockdep_assert_held(&priv->mutex);

priv->key_mapping_key++;
keyconf->hw_key_idx = HW_KEY_DYNAMIC;

Expand Down

0 comments on commit 718263f

Please sign in to comment.