Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202794
b: refs/heads/master
c: 96b61ba
h: refs/heads/master
v: v3
  • Loading branch information
Gertjan van Wingerde authored and Ivo van Doorn committed Jun 3, 2010
1 parent 9fab704 commit fd54b24
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 88 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: a903ae004a766a675ff063b88b168bd411e7760c
refs/heads/master: 96b61bafe22b2f2abcc833d651739edb977f1b1e
15 changes: 2 additions & 13 deletions trunk/drivers/net/wireless/rt2x00/rt2500usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
struct rt2x00lib_crypto *crypto,
struct ieee80211_key_conf *key)
{
int timeout;
u32 mask;
u16 reg;

Expand All @@ -367,18 +366,8 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,

key->hw_key_idx += reg ? ffz(reg) : 0;

/*
* The encryption key doesn't fit within the CSR cache,
* this means we should allocate it separately and use
* rt2x00usb_vendor_request() to send the key to the hardware.
*/
reg = KEY_ENTRY(key->hw_key_idx);
timeout = REGISTER_TIMEOUT32(sizeof(crypto->key));
rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE,
USB_VENDOR_REQUEST_OUT, reg,
crypto->key,
sizeof(crypto->key),
timeout);
rt2500usb_register_multiwrite(rt2x00dev, reg,
crypto->key, sizeof(crypto->key));

/*
* The driver does not support the IV/EIV generation
Expand Down
13 changes: 4 additions & 9 deletions trunk/drivers/net/wireless/rt2x00/rt2800usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,8 @@ static int rt2800usb_load_firmware(struct rt2x00_dev *rt2x00dev,
/*
* Write firmware to device.
*/
rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE,
USB_VENDOR_REQUEST_OUT,
FIRMWARE_IMAGE_BASE,
data + offset, length,
REGISTER_TIMEOUT32(length));
rt2800_register_multiwrite(rt2x00dev, FIRMWARE_IMAGE_BASE,
data + offset, length);

rt2800_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
rt2800_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
Expand Down Expand Up @@ -478,10 +475,8 @@ static void rt2800usb_write_beacon(struct queue_entry *entry,
* Write entire beacon with descriptor to register.
*/
beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE,
USB_VENDOR_REQUEST_OUT, beacon_base,
entry->skb->data, entry->skb->len,
REGISTER_TIMEOUT32(entry->skb->len));
rt2800_register_multiwrite(rt2x00dev, beacon_base,
entry->skb->data, entry->skb->len);

/*
* Enable beaconing again.
Expand Down
22 changes: 1 addition & 21 deletions trunk/drivers/net/wireless/rt2x00/rt2x00usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,6 @@ int rt2x00usb_vendor_request_buff(struct rt2x00_dev *rt2x00dev,
const u8 request, const u8 requesttype,
const u16 offset, void *buffer,
const u16 buffer_length, const int timeout)
{
int status;

mutex_lock(&rt2x00dev->csr_mutex);

status = rt2x00usb_vendor_req_buff_lock(rt2x00dev, request,
requesttype, offset, buffer,
buffer_length, timeout);

mutex_unlock(&rt2x00dev->csr_mutex);

return status;
}
EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request_buff);

int rt2x00usb_vendor_request_large_buff(struct rt2x00_dev *rt2x00dev,
const u8 request, const u8 requesttype,
const u16 offset, const void *buffer,
const u16 buffer_length,
const int timeout)
{
int status = 0;
unsigned char *tb;
Expand All @@ -157,7 +137,7 @@ int rt2x00usb_vendor_request_large_buff(struct rt2x00_dev *rt2x00dev,

return status;
}
EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request_large_buff);
EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request_buff);

int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev,
const unsigned int offset,
Expand Down
19 changes: 0 additions & 19 deletions trunk/drivers/net/wireless/rt2x00/rt2x00usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,25 +166,6 @@ int rt2x00usb_vendor_req_buff_lock(struct rt2x00_dev *rt2x00dev,
const u16 offset, void *buffer,
const u16 buffer_length, const int timeout);

/**
* rt2x00usb_vendor_request_large_buff - Send register command to device (buffered)
* @rt2x00dev: Pointer to &struct rt2x00_dev
* @request: USB vendor command (See &enum rt2x00usb_vendor_request)
* @requesttype: Request type &USB_VENDOR_REQUEST_*
* @offset: Register start offset to perform action on
* @buffer: Buffer where information will be read/written to by device
* @buffer_length: Size of &buffer
* @timeout: Operation timeout
*
* This function is used to transfer register data in blocks larger
* then CSR_CACHE_SIZE. Use for firmware upload, keys and beacons.
*/
int rt2x00usb_vendor_request_large_buff(struct rt2x00_dev *rt2x00dev,
const u8 request, const u8 requesttype,
const u16 offset, const void *buffer,
const u16 buffer_length,
const int timeout);

/**
* rt2x00usb_vendor_request_sw - Send single register command to device
* @rt2x00dev: Pointer to &struct rt2x00_dev
Expand Down
32 changes: 7 additions & 25 deletions trunk/drivers/net/wireless/rt2x00/rt73usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ static int rt73usb_config_shared_key(struct rt2x00_dev *rt2x00dev,
{
struct hw_key_entry key_entry;
struct rt2x00_field32 field;
int timeout;
u32 mask;
u32 reg;

Expand Down Expand Up @@ -306,12 +305,8 @@ static int rt73usb_config_shared_key(struct rt2x00_dev *rt2x00dev,
sizeof(key_entry.rx_mic));

reg = SHARED_KEY_ENTRY(key->hw_key_idx);
timeout = REGISTER_TIMEOUT32(sizeof(key_entry));
rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE,
USB_VENDOR_REQUEST_OUT, reg,
&key_entry,
sizeof(key_entry),
timeout);
rt2x00usb_register_multiwrite(rt2x00dev, reg,
&key_entry, sizeof(key_entry));

/*
* The cipher types are stored over 2 registers.
Expand Down Expand Up @@ -372,7 +367,6 @@ static int rt73usb_config_pairwise_key(struct rt2x00_dev *rt2x00dev,
{
struct hw_pairwise_ta_entry addr_entry;
struct hw_key_entry key_entry;
int timeout;
u32 mask;
u32 reg;

Expand Down Expand Up @@ -407,17 +401,11 @@ static int rt73usb_config_pairwise_key(struct rt2x00_dev *rt2x00dev,
sizeof(key_entry.rx_mic));

reg = PAIRWISE_KEY_ENTRY(key->hw_key_idx);
timeout = REGISTER_TIMEOUT32(sizeof(key_entry));
rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE,
USB_VENDOR_REQUEST_OUT, reg,
&key_entry,
sizeof(key_entry),
timeout);
rt2x00usb_register_multiwrite(rt2x00dev, reg,
&key_entry, sizeof(key_entry));

/*
* Send the address and cipher type to the hardware register.
* This data fits within the CSR cache size, so we can use
* rt2x00usb_register_multiwrite() directly.
*/
memset(&addr_entry, 0, sizeof(addr_entry));
memcpy(&addr_entry, crypto->address, ETH_ALEN);
Expand Down Expand Up @@ -1092,11 +1080,7 @@ static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev,
/*
* Write firmware to device.
*/
rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE,
USB_VENDOR_REQUEST_OUT,
FIRMWARE_IMAGE_BASE,
data, len,
REGISTER_TIMEOUT32(len));
rt2x00usb_register_multiwrite(rt2x00dev, FIRMWARE_IMAGE_BASE, data, len);

/*
* Send firmware request to device to load firmware,
Expand Down Expand Up @@ -1548,10 +1532,8 @@ static void rt73usb_write_beacon(struct queue_entry *entry,
* Write entire beacon with descriptor to register.
*/
beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE,
USB_VENDOR_REQUEST_OUT, beacon_base,
entry->skb->data, entry->skb->len,
REGISTER_TIMEOUT32(entry->skb->len));
rt2x00usb_register_multiwrite(rt2x00dev, beacon_base,
entry->skb->data, entry->skb->len);

/*
* Enable beaconing again.
Expand Down

0 comments on commit fd54b24

Please sign in to comment.