]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
rt2x00: Large vendor requests for rt73usb firmware upload and beacons
authorIwo Mergler <iwo@call-direct.com.au>
Sat, 19 Jul 2008 14:17:16 +0000 (16:17 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 29 Jul 2008 20:55:05 +0000 (16:55 -0400)
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>
drivers/net/wireless/rt2x00/rt2x00usb.h
drivers/net/wireless/rt2x00/rt73usb.c

index 8d5d4272e88f8f7528b8101c9bd4614496d2544c..ee3875f894aa9ba1d37a430e7a2e0da870a4dc11 100644 (file)
@@ -71,7 +71,6 @@
  * Cache size
  */
 #define CSR_CACHE_SIZE                 64
-#define CSR_CACHE_SIZE_FIRMWARE                64
 
 /*
  * USB request types.
index b9efa7f76c9e43fee79438782bb6d54f3640c062..fc320c0409dba47c0dba0cb8f0a3e2f959458f9c 100644 (file)
@@ -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.
@@ -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,
@@ -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.