diff options
author | Iwo Mergler <iwo@call-direct.com.au> | 2008-07-19 10:17:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-29 16:55:05 -0400 |
commit | 3e0c1abe748a30bc705a55f71bca8e04a83820f1 (patch) | |
tree | 7456478a5ee8f13eb3313324ef187cabcfb54d2e | |
parent | ed0dbeeb92bdb1030bcec67e20b294bd2020cb31 (diff) |
rt2x00: Large vendor requests for rt73usb firmware upload and beacons
Switches rt73usb to use large vendor requests for firmware
and beacons. This also fixes the garbled beacon bug.
Signed-off-by: Iwo Mergler <Iwo@call-direct.com.au>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 40 |
2 files changed, 9 insertions, 32 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.h b/drivers/net/wireless/rt2x00/rt2x00usb.h index 8d5d4272e88f..ee3875f894aa 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.h +++ b/drivers/net/wireless/rt2x00/rt2x00usb.h | |||
@@ -71,7 +71,6 @@ | |||
71 | * Cache size | 71 | * Cache size |
72 | */ | 72 | */ |
73 | #define CSR_CACHE_SIZE 64 | 73 | #define CSR_CACHE_SIZE 64 |
74 | #define CSR_CACHE_SIZE_FIRMWARE 64 | ||
75 | 74 | ||
76 | /* | 75 | /* |
77 | * USB request types. | 76 | * USB request types. |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index b9efa7f76c9e..fc320c0409db 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -890,9 +890,6 @@ static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev, const void *data, | |||
890 | unsigned int i; | 890 | unsigned int i; |
891 | int status; | 891 | int status; |
892 | u32 reg; | 892 | u32 reg; |
893 | const char *ptr = data; | ||
894 | char *cache; | ||
895 | int buflen; | ||
896 | 893 | ||
897 | /* | 894 | /* |
898 | * Wait for stable hardware. | 895 | * Wait for stable hardware. |
@@ -911,31 +908,12 @@ static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev, const void *data, | |||
911 | 908 | ||
912 | /* | 909 | /* |
913 | * Write firmware to device. | 910 | * Write firmware to device. |
914 | * We setup a seperate cache for this action, | ||
915 | * since we are going to write larger chunks of data | ||
916 | * then normally used cache size. | ||
917 | */ | 911 | */ |
918 | cache = kmalloc(CSR_CACHE_SIZE_FIRMWARE, GFP_KERNEL); | 912 | rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, |
919 | if (!cache) { | 913 | USB_VENDOR_REQUEST_OUT, |
920 | ERROR(rt2x00dev, "Failed to allocate firmware cache.\n"); | 914 | FIRMWARE_IMAGE_BASE, |
921 | return -ENOMEM; | 915 | data, len, |
922 | } | 916 | REGISTER_TIMEOUT32(len)); |
923 | |||
924 | for (i = 0; i < len; i += CSR_CACHE_SIZE_FIRMWARE) { | ||
925 | buflen = min_t(int, len - i, CSR_CACHE_SIZE_FIRMWARE); | ||
926 | |||
927 | memcpy(cache, ptr, buflen); | ||
928 | |||
929 | rt2x00usb_vendor_request(rt2x00dev, USB_MULTI_WRITE, | ||
930 | USB_VENDOR_REQUEST_OUT, | ||
931 | FIRMWARE_IMAGE_BASE + i, 0, | ||
932 | cache, buflen, | ||
933 | REGISTER_TIMEOUT32(buflen)); | ||
934 | |||
935 | ptr += buflen; | ||
936 | } | ||
937 | |||
938 | kfree(cache); | ||
939 | 917 | ||
940 | /* | 918 | /* |
941 | * Send firmware request to device to load firmware, | 919 | * Send firmware request to device to load firmware, |
@@ -1374,10 +1352,10 @@ static void rt73usb_write_beacon(struct queue_entry *entry) | |||
1374 | * Write entire beacon with descriptor to register. | 1352 | * Write entire beacon with descriptor to register. |
1375 | */ | 1353 | */ |
1376 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | 1354 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); |
1377 | rt2x00usb_vendor_request(rt2x00dev, USB_MULTI_WRITE, | 1355 | rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE, |
1378 | USB_VENDOR_REQUEST_OUT, beacon_base, 0, | 1356 | USB_VENDOR_REQUEST_OUT, beacon_base, |
1379 | entry->skb->data, entry->skb->len, | 1357 | entry->skb->data, entry->skb->len, |
1380 | REGISTER_TIMEOUT32(entry->skb->len)); | 1358 | REGISTER_TIMEOUT32(entry->skb->len)); |
1381 | 1359 | ||
1382 | /* | 1360 | /* |
1383 | * Clean up the beacon skb. | 1361 | * Clean up the beacon skb. |