Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107098
b: refs/heads/master
c: 3e0c1ab
h: refs/heads/master
v: v3
  • Loading branch information
Iwo Mergler authored and John W. Linville committed Jul 29, 2008
1 parent a956e93 commit 3a582b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 33 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: ed0dbeeb92bdb1030bcec67e20b294bd2020cb31
refs/heads/master: 3e0c1abe748a30bc705a55f71bca8e04a83820f1
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/rt2x00/rt2x00usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
* Cache size
*/
#define CSR_CACHE_SIZE 64
#define CSR_CACHE_SIZE_FIRMWARE 64

/*
* USB request types.
Expand Down
40 changes: 9 additions & 31 deletions trunk/drivers/net/wireless/rt2x00/rt73usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,6 @@ static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev, const void *data,
unsigned int i;
int status;
u32 reg;
const char *ptr = data;
char *cache;
int buflen;

/*
* Wait for stable hardware.
Expand All @@ -911,31 +908,12 @@ static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev, const void *data,

/*
* Write firmware to device.
* We setup a seperate cache for this action,
* since we are going to write larger chunks of data
* then normally used cache size.
*/
cache = kmalloc(CSR_CACHE_SIZE_FIRMWARE, GFP_KERNEL);
if (!cache) {
ERROR(rt2x00dev, "Failed to allocate firmware cache.\n");
return -ENOMEM;
}

for (i = 0; i < len; i += CSR_CACHE_SIZE_FIRMWARE) {
buflen = min_t(int, len - i, CSR_CACHE_SIZE_FIRMWARE);

memcpy(cache, ptr, buflen);

rt2x00usb_vendor_request(rt2x00dev, USB_MULTI_WRITE,
USB_VENDOR_REQUEST_OUT,
FIRMWARE_IMAGE_BASE + i, 0,
cache, buflen,
REGISTER_TIMEOUT32(buflen));

ptr += buflen;
}

kfree(cache);
rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE,
USB_VENDOR_REQUEST_OUT,
FIRMWARE_IMAGE_BASE,
data, len,
REGISTER_TIMEOUT32(len));

/*
* Send firmware request to device to load firmware,
Expand Down Expand Up @@ -1374,10 +1352,10 @@ 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(rt2x00dev, USB_MULTI_WRITE,
USB_VENDOR_REQUEST_OUT, beacon_base, 0,
entry->skb->data, entry->skb->len,
REGISTER_TIMEOUT32(entry->skb->len));
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));

/*
* Clean up the beacon skb.
Expand Down

0 comments on commit 3a582b4

Please sign in to comment.