]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
mwifiex: Command 7 handling for USB chipsets
authorGanapathi Bhat <gbhat@marvell.com>
Mon, 12 Sep 2016 13:25:27 +0000 (18:55 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 14 Sep 2016 17:02:13 +0000 (20:02 +0300)
Firmware image for newer USB chipsets starts with a command 7 block
(special command). It doesn't contain data length field. This patch adds
necessary handling.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/usb.c
drivers/net/wireless/marvell/mwifiex/usb.h

index 92135167a8220df377875b61cda4ebab725ae20f..8a20620fa119da57a23d28181f20f1a562b46f38 100644 (file)
@@ -1026,6 +1026,10 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
                        dnld_cmd = le32_to_cpu(fwdata->fw_hdr.dnld_cmd);
                        tlen += sizeof(struct fw_header);
 
+                       /* Command 7 doesn't have data length field */
+                       if (dnld_cmd == FW_CMD_7)
+                               dlen = 0;
+
                        memcpy(fwdata->data, &firmware[tlen], dlen);
 
                        fwdata->seq_num = cpu_to_le32(fw_seqnum);
index b4e9246bbcdc9080d3b9bddec7e0f3aab1d16fa1..1b49c520782a35662e27a1c94d9a5d5e608e9d46 100644 (file)
@@ -51,6 +51,7 @@
 #define FW_DNLD_TX_BUF_SIZE    620
 #define FW_DNLD_RX_BUF_SIZE    2048
 #define FW_HAS_LAST_BLOCK      0x00000004
+#define FW_CMD_7               0x00000007
 
 #define FW_DATA_XMIT_SIZE \
        (sizeof(struct fw_header) + dlen + sizeof(u32))