Commit 3306ef64 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by John W. Linville

rt2800usb: use rt2x00usb_register_multiwrite() to set key entries

Since struct hw_key_entry is 32-bytes large and is smaller than
CSR cache size (which is 64-bytes large) we can use the standard
rt2x00usb_register_multiwrite() helper to set key entries.

This cleanup is a part of preparations for later code unification.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 02a39c20
...@@ -392,7 +392,6 @@ static int rt2800usb_config_shared_key(struct rt2x00_dev *rt2x00dev, ...@@ -392,7 +392,6 @@ static int rt2800usb_config_shared_key(struct rt2x00_dev *rt2x00dev,
{ {
struct hw_key_entry key_entry; struct hw_key_entry key_entry;
struct rt2x00_field32 field; struct rt2x00_field32 field;
int timeout;
u32 offset; u32 offset;
u32 reg; u32 reg;
...@@ -407,12 +406,8 @@ static int rt2800usb_config_shared_key(struct rt2x00_dev *rt2x00dev, ...@@ -407,12 +406,8 @@ static int rt2800usb_config_shared_key(struct rt2x00_dev *rt2x00dev,
sizeof(key_entry.rx_mic)); sizeof(key_entry.rx_mic));
offset = SHARED_KEY_ENTRY(key->hw_key_idx); offset = SHARED_KEY_ENTRY(key->hw_key_idx);
timeout = REGISTER_TIMEOUT32(sizeof(key_entry)); rt2x00usb_register_multiwrite(rt2x00dev, offset,
rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, &key_entry, sizeof(key_entry));
USB_VENDOR_REQUEST_OUT,
offset, &key_entry,
sizeof(key_entry),
timeout);
} }
/* /*
...@@ -445,7 +440,6 @@ static int rt2800usb_config_pairwise_key(struct rt2x00_dev *rt2x00dev, ...@@ -445,7 +440,6 @@ static int rt2800usb_config_pairwise_key(struct rt2x00_dev *rt2x00dev,
struct ieee80211_key_conf *key) struct ieee80211_key_conf *key)
{ {
struct hw_key_entry key_entry; struct hw_key_entry key_entry;
int timeout;
u32 offset; u32 offset;
if (crypto->cmd == SET_KEY) { if (crypto->cmd == SET_KEY) {
...@@ -467,12 +461,8 @@ static int rt2800usb_config_pairwise_key(struct rt2x00_dev *rt2x00dev, ...@@ -467,12 +461,8 @@ static int rt2800usb_config_pairwise_key(struct rt2x00_dev *rt2x00dev,
sizeof(key_entry.rx_mic)); sizeof(key_entry.rx_mic));
offset = PAIRWISE_KEY_ENTRY(key->hw_key_idx); offset = PAIRWISE_KEY_ENTRY(key->hw_key_idx);
timeout = REGISTER_TIMEOUT32(sizeof(key_entry)); rt2x00usb_register_multiwrite(rt2x00dev, offset,
rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, &key_entry, sizeof(key_entry));
USB_VENDOR_REQUEST_OUT,
offset, &key_entry,
sizeof(key_entry),
timeout);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment