Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203290
b: refs/heads/master
c: 75f64dd
h: refs/heads/master
v: v3
  • Loading branch information
Ondrej Zary authored and John W. Linville committed Jun 24, 2010
1 parent d08c433 commit a3d1ed0
Show file tree
Hide file tree
Showing 2 changed files with 11 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: 98d2ff8bec82fc35fe2008a187a5fef9241dab10
refs/heads/master: 75f64dd54a185150ebfc45e99351c890d4a2252f
10 changes: 10 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2500usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
{
u32 mask;
u16 reg;
enum cipher curr_cipher;

if (crypto->cmd == SET_KEY) {
/*
Expand All @@ -357,6 +358,7 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
mask = TXRX_CSR0_KEY_ID.bit_mask;

rt2500usb_register_read(rt2x00dev, TXRX_CSR0, &reg);
curr_cipher = rt2x00_get_field16(reg, TXRX_CSR0_ALGORITHM);
reg &= mask;

if (reg && reg == mask)
Expand All @@ -365,6 +367,14 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
reg = rt2x00_get_field16(reg, TXRX_CSR0_KEY_ID);

key->hw_key_idx += reg ? ffz(reg) : 0;
/*
* Hardware requires that all keys use the same cipher
* (e.g. TKIP-only, AES-only, but not TKIP+AES).
* If this is not the first key, compare the cipher with the
* first one and fall back to SW crypto if not the same.
*/
if (key->hw_key_idx > 0 && crypto->cipher != curr_cipher)
return -EOPNOTSUPP;

rt2500usb_register_multiwrite(rt2x00dev, reg,
crypto->key, sizeof(crypto->key));
Expand Down

0 comments on commit a3d1ed0

Please sign in to comment.