]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mwifiex: fix usb tx data payload offset issue
authorZhaoyang Liu <liuzy@marvell.com>
Fri, 13 Feb 2015 15:08:16 +0000 (20:38 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 27 Feb 2015 08:14:02 +0000 (10:14 +0200)
Commit 84b313b35f8158d7 ("mwifiex: make tx packet 64 byte DMA aligned")
induced payload offset issue for USB interface.

There is no USB interface header for tx packets, so there's no need to
pull interface length while processing tx skb.

This patch fixes this issue.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/txrx.c

index ac93557cbdc96ec951fd91f2f4d581b8cd9a7a5b..ea4549f0e0b931b449c4a13879a81d3a4025c77e 100644 (file)
@@ -80,11 +80,13 @@ EXPORT_SYMBOL_GPL(mwifiex_handle_rx_packet);
 int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
                       struct mwifiex_tx_param *tx_param)
 {
-       int ret = -1;
+       int hroom, ret = -1;
        struct mwifiex_adapter *adapter = priv->adapter;
        u8 *head_ptr;
        struct txpd *local_tx_pd = NULL;
 
+       hroom = (adapter->iface_type == MWIFIEX_USB) ? 0 : INTF_HEADER_LEN;
+
        if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
                head_ptr = mwifiex_process_uap_txpd(priv, skb);
        else
@@ -92,11 +94,9 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
 
        if (head_ptr) {
                if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA)
-                       local_tx_pd =
-                               (struct txpd *) (head_ptr + INTF_HEADER_LEN);
+                       local_tx_pd = (struct txpd *)(head_ptr + hroom);
                if (adapter->iface_type == MWIFIEX_USB) {
                        adapter->data_sent = true;
-                       skb_pull(skb, INTF_HEADER_LEN);
                        ret = adapter->if_ops.host_to_card(adapter,
                                                           MWIFIEX_USB_EP_DATA,
                                                           skb, NULL);