mwifiex: Add USB8766 support
authorKristian Evensen <kristian.evensen@gmail.com>
Thu, 20 Nov 2014 15:52:58 +0000 (16:52 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 20 Nov 2014 21:14:39 +0000 (16:14 -0500)
Adds new VID/PID for the Marvell 88W8766. The kernel currently only supports
the device as PCI, but it is also available using USB. An example of a device
delivered with the 88W8766 as USB is the Globalscale Mirabox.

TX buffer size is set to driver default (2K), as we do not know the firmware
requirement.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/Kconfig
drivers/net/wireless/mwifiex/usb.c
drivers/net/wireless/mwifiex/usb.h

index e70d0df9b0da4449c58efa03a8a047eeae9d173b..aa01c9bc77f916db68de7c51f8f848d45dc8fa26 100644 (file)
@@ -31,7 +31,7 @@ config MWIFIEX_PCIE
          mwifiex_pcie.
 
 config MWIFIEX_USB
-       tristate "Marvell WiFi-Ex Driver for USB8797/8897"
+       tristate "Marvell WiFi-Ex Driver for USB8766/8797/8897"
        depends on MWIFIEX && USB
        select FW_LOADER
        ---help---
index 6cc8519c0f4084c05272a50c7394a5c993be4650..1b56495ec8724e55b8c1161b8f5ff900fee0040f 100644 (file)
@@ -27,6 +27,11 @@ static struct mwifiex_if_ops usb_ops;
 static struct semaphore add_remove_card_sem;
 
 static struct usb_device_id mwifiex_usb_table[] = {
+       /* 8766 */
+       {USB_DEVICE(USB8XXX_VID, USB8766_PID_1)},
+       {USB_DEVICE_AND_INTERFACE_INFO(USB8XXX_VID, USB8766_PID_2,
+                                      USB_CLASS_VENDOR_SPEC,
+                                      USB_SUBCLASS_VENDOR_SPEC, 0xff)},
        /* 8797 */
        {USB_DEVICE(USB8XXX_VID, USB8797_PID_1)},
        {USB_DEVICE_AND_INTERFACE_INFO(USB8XXX_VID, USB8797_PID_2,
@@ -354,10 +359,12 @@ static int mwifiex_usb_probe(struct usb_interface *intf,
 
        /* PID_1 is used for firmware downloading only */
        switch (id_product) {
+       case USB8766_PID_1:
        case USB8797_PID_1:
        case USB8897_PID_1:
                card->usb_boot_state = USB8XXX_FW_DNLD;
                break;
+       case USB8766_PID_2:
        case USB8797_PID_2:
        case USB8897_PID_2:
                card->usb_boot_state = USB8XXX_FW_READY;
@@ -786,6 +793,11 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
                adapter->tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K;
                strcpy(adapter->fw_name, USB8897_DEFAULT_FW_NAME);
                break;
+       case USB8766_PID_1:
+       case USB8766_PID_2:
+               adapter->tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K;
+               strcpy(adapter->fw_name, USB8766_DEFAULT_FW_NAME);
+               break;
        case USB8797_PID_1:
        case USB8797_PID_2:
        default:
@@ -1060,5 +1072,6 @@ MODULE_AUTHOR("Marvell International Ltd.");
 MODULE_DESCRIPTION("Marvell WiFi-Ex USB Driver version" USB_VERSION);
 MODULE_VERSION(USB_VERSION);
 MODULE_LICENSE("GPL v2");
+MODULE_FIRMWARE(USB8766_DEFAULT_FW_NAME);
 MODULE_FIRMWARE(USB8797_DEFAULT_FW_NAME);
 MODULE_FIRMWARE(USB8897_DEFAULT_FW_NAME);
index 4c41c2a193c553106f61010574a0e656c49cfc2f..a7cbba1355af7df25d9d3f899022884809aad3e6 100644 (file)
@@ -24,6 +24,8 @@
 
 #define USB8XXX_VID            0x1286
 
+#define USB8766_PID_1          0x2041
+#define USB8766_PID_2          0x2042
 #define USB8797_PID_1          0x2043
 #define USB8797_PID_2          0x2044
 #define USB8897_PID_1          0x2045
@@ -37,6 +39,7 @@
 #define MWIFIEX_RX_DATA_URB    6
 #define MWIFIEX_USB_TIMEOUT    100
 
+#define USB8766_DEFAULT_FW_NAME        "mrvl/usb8766_uapsta.bin"
 #define USB8797_DEFAULT_FW_NAME        "mrvl/usb8797_uapsta.bin"
 #define USB8897_DEFAULT_FW_NAME        "mrvl/usb8897_uapsta.bin"