]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
mwifiex: set txpd when send a mgmt frame for AP and GO mode
authorStone Piao <piaoyun@marvell.com>
Wed, 26 Sep 2012 03:23:44 +0000 (20:23 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 28 Sep 2012 17:54:06 +0000 (13:54 -0400)
Set packet type and packet offset in txpd when send a mgmt frame
in AP and GO mode.

Signed-off-by: Stone Piao <piaoyun@marvell.com>
Signed-off-by: Kevin Gan <ganhy@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/uap_txrx.c

index 012c1433d126915d5d376902b6e3636a9a558e2e..0966ac24b3b422a83b31792c006752776f271344 100644 (file)
@@ -284,6 +284,7 @@ void *mwifiex_process_uap_txpd(struct mwifiex_private *priv,
        struct uap_txpd *txpd;
        struct mwifiex_txinfo *tx_info = MWIFIEX_SKB_TXCB(skb);
        int pad, len;
+       u16 pkt_type;
 
        if (!skb->len) {
                dev_err(adapter->dev, "Tx: bad packet length: %d\n", skb->len);
@@ -291,6 +292,8 @@ void *mwifiex_process_uap_txpd(struct mwifiex_private *priv,
                return skb->data;
        }
 
+       pkt_type = mwifiex_is_skb_mgmt_frame(skb) ? PKT_TYPE_MGMT : 0;
+
        /* If skb->data is not aligned, add padding */
        pad = (4 - (((void *)skb->data - NULL) & 0x3)) % 4;
 
@@ -318,6 +321,12 @@ void *mwifiex_process_uap_txpd(struct mwifiex_private *priv,
                    cpu_to_le32(priv->wmm.user_pri_pkt_tx_ctrl[txpd->priority]);
 
        /* Offset of actual data */
+       if (pkt_type == PKT_TYPE_MGMT) {
+               /* Set the packet type and add header for management frame */
+               txpd->tx_pkt_type = cpu_to_le16(pkt_type);
+               len += MWIFIEX_MGMT_FRAME_HEADER_SIZE;
+       }
+
        txpd->tx_pkt_offset = cpu_to_le16(len);
 
        /* make space for INTF_HEADER_LEN */