Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159399
b: refs/heads/master
c: 847c1e1
h: refs/heads/master
i:
  159397: a079ec2
  159395: 02365a0
  159391: 800e3ac
v: v3
  • Loading branch information
Zhu Yi authored and John W. Linville committed Aug 4, 2009
1 parent 89a33ae commit 4c26c09
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 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: beda278d987cf7091302cf730c5b226d88e01c5b
refs/heads/master: 847c1e130092240c225a7be08607a7bf4e296fbd
39 changes: 26 additions & 13 deletions trunk/drivers/net/wireless/iwmc3200wifi/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,19 +526,6 @@ int iwm_read_mac(struct iwm_priv *iwm, u8 *mac)
return 0;
}

int iwm_set_tx_key(struct iwm_priv *iwm, u8 key_idx)
{
struct iwm_umac_tx_key_id tx_key_id;

tx_key_id.hdr.oid = UMAC_WIFI_IF_CMD_GLOBAL_TX_KEY_ID;
tx_key_id.hdr.buf_size = cpu_to_le16(sizeof(struct iwm_umac_tx_key_id) -
sizeof(struct iwm_umac_wifi_if));

tx_key_id.key_idx = key_idx;

return iwm_send_wifi_if_cmd(iwm, &tx_key_id, sizeof(tx_key_id), 1);
}

static int iwm_check_profile(struct iwm_priv *iwm)
{
if (!iwm->umac_profile_active)
Expand Down Expand Up @@ -572,6 +559,32 @@ static int iwm_check_profile(struct iwm_priv *iwm)
return 0;
}

int iwm_set_tx_key(struct iwm_priv *iwm, u8 key_idx)
{
struct iwm_umac_tx_key_id tx_key_id;
int ret;

ret = iwm_check_profile(iwm);
if (ret < 0)
return ret;

/* UMAC only allows to set default key for WEP and auth type is
* NOT 802.1X or RSNA. */
if ((iwm->umac_profile->sec.ucast_cipher != UMAC_CIPHER_TYPE_WEP_40 &&
iwm->umac_profile->sec.ucast_cipher != UMAC_CIPHER_TYPE_WEP_104) ||
iwm->umac_profile->sec.auth_type == UMAC_AUTH_TYPE_8021X ||
iwm->umac_profile->sec.auth_type == UMAC_AUTH_TYPE_RSNA_PSK)
return 0;

tx_key_id.hdr.oid = UMAC_WIFI_IF_CMD_GLOBAL_TX_KEY_ID;
tx_key_id.hdr.buf_size = cpu_to_le16(sizeof(struct iwm_umac_tx_key_id) -
sizeof(struct iwm_umac_wifi_if));

tx_key_id.key_idx = key_idx;

return iwm_send_wifi_if_cmd(iwm, &tx_key_id, sizeof(tx_key_id), 1);
}

int iwm_set_key(struct iwm_priv *iwm, bool remove, struct iwm_key *key)
{
int ret = 0;
Expand Down

0 comments on commit 4c26c09

Please sign in to comment.