diff options
author | Mateusz Kulikowski <mateusz.kulikowski@gmail.com> | 2015-10-19 22:00:21 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-24 19:23:13 -0700 |
commit | c0f6479165ed0380e8588f50ff728b76131c4383 (patch) | |
tree | 028bbf8aba09c118c513465eb5c80579fe1d4bf4 /drivers | |
parent | 1e7da09afd129d9b75b561808d5ed9209d6d2f2c (diff) | |
download | blackbird-op-linux-c0f6479165ed0380e8588f50ff728b76131c4383.tar.gz blackbird-op-linux-c0f6479165ed0380e8588f50ff728b76131c4383.zip |
staging: rtl8192e: cmd_pkt: Handle INIT packets
Add support for DESC_PACKET_TYPE_INIT to rtl92e_send_cmd_pkt().
With this generalization, _rtl92e_fw_download_code() may be removed
after slight modification.
Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c index 3de1b25b0155..f9003a28cae2 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c @@ -43,8 +43,11 @@ bool rtl92e_send_cmd_pkt(struct net_device *dev, u32 type, const void *data, bLastIniPkt = 1; } - skb = dev_alloc_skb(frag_length + - priv->rtllib->tx_headroom + 4); + if (type == DESC_PACKET_TYPE_NORMAL) + skb = dev_alloc_skb(frag_length + + priv->rtllib->tx_headroom + 4); + else + skb = dev_alloc_skb(frag_length + 4); if (skb == NULL) { rt_status = false; @@ -56,17 +59,30 @@ bool rtl92e_send_cmd_pkt(struct net_device *dev, u32 type, const void *data, tcb_desc->queue_index = TXCMD_QUEUE; tcb_desc->bCmdOrInit = type; tcb_desc->bLastIniPkt = bLastIniPkt; - tcb_desc->pkt_size = frag_length; - seg_ptr = skb_put(skb, priv->rtllib->tx_headroom); - pTxFwInfo = (struct tx_fwinfo_8190pci *)seg_ptr; - memset(pTxFwInfo, 0, sizeof(struct tx_fwinfo_8190pci)); - memset(pTxFwInfo, 0x12, 8); + if (type == DESC_PACKET_TYPE_NORMAL) { + tcb_desc->pkt_size = frag_length; + + seg_ptr = skb_put(skb, priv->rtllib->tx_headroom); + pTxFwInfo = (struct tx_fwinfo_8190pci *)seg_ptr; + memset(pTxFwInfo, 0, sizeof(struct tx_fwinfo_8190pci)); + memset(pTxFwInfo, 0x12, 8); + } else { + tcb_desc->txbuf_size = (u16)frag_length; + } seg_ptr = skb_put(skb, frag_length); memcpy(seg_ptr, data, (u32)frag_length); - priv->rtllib->softmac_hard_start_xmit(skb, dev); + if (type == DESC_PACKET_TYPE_INIT && + (!priv->rtllib->check_nic_enough_desc(dev, TXCMD_QUEUE) || + (!skb_queue_empty(&priv->rtllib->skb_waitQ[TXCMD_QUEUE])) || + (priv->rtllib->queue_stop))) { + skb_queue_tail(&priv->rtllib->skb_waitQ[TXCMD_QUEUE], + skb); + } else { + priv->rtllib->softmac_hard_start_xmit(skb, dev); + } data += frag_length; frag_offset += frag_length; |