summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192e
diff options
context:
space:
mode:
authorMateusz Kulikowski <mateusz.kulikowski@gmail.com>2015-10-19 22:00:28 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-24 19:23:13 -0700
commit15d140664c94f56e67e4cf3107c000471ae72a9c (patch)
tree0ce7d2489c91563b4cad4a10e54e7fb0e1dcc2ed /drivers/staging/rtl8192e
parentf4c807d6d5fa653dc060a75e963cb2834f697ed4 (diff)
staging: rtl8192e: Remove _rtl92e_fw_download_code()
Reuse rtl92e_send_cmd_pkt() instead. Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r--drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c56
1 files changed, 3 insertions, 53 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
index 7c7c195bb7d2..cbd23c0c9dea 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
@@ -17,6 +17,7 @@
#include "r8192E_hw.h"
#include "r8192E_hwimg.h"
#include "r8192E_firmware.h"
+#include "r8192E_cmdpkt.h"
#include <linux/firmware.h>
static bool _rtl92e_wait_for_fw(struct net_device *dev, u32 mask, u32 timeout)
@@ -31,57 +32,6 @@ static bool _rtl92e_wait_for_fw(struct net_device *dev, u32 mask, u32 timeout)
return false;
}
-static bool _rtl92e_fw_download_code(struct net_device *dev,
- u8 *code_virtual_address, u32 buffer_len)
-{
- struct r8192_priv *priv = rtllib_priv(dev);
- u16 frag_length, frag_offset = 0;
- struct sk_buff *skb;
- struct cb_desc *tcb_desc;
- u8 bLastIniPkt;
-
- do {
- if ((buffer_len - frag_offset) > CMDPACKET_FRAG_SIZE) {
- frag_length = CMDPACKET_FRAG_SIZE;
- bLastIniPkt = 0;
-
- } else {
- frag_length = buffer_len - frag_offset;
- bLastIniPkt = 1;
-
- }
-
- skb = dev_alloc_skb(frag_length + 4);
- memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
- tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
- tcb_desc->queue_index = TXCMD_QUEUE;
- tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT;
- tcb_desc->bLastIniPkt = bLastIniPkt;
- tcb_desc->txbuf_size = (u16)frag_length;
- memcpy(skb->data, code_virtual_address, frag_length);
- skb_put(skb, frag_length);
-
- if (!priv->rtllib->check_nic_enough_desc(dev, tcb_desc->queue_index) ||
- (!skb_queue_empty(&priv->rtllib->skb_waitQ[tcb_desc->queue_index])) ||
- (priv->rtllib->queue_stop)) {
- RT_TRACE(COMP_FIRMWARE,
- "===================> tx full!\n");
- skb_queue_tail(&priv->rtllib->skb_waitQ
- [tcb_desc->queue_index], skb);
- } else {
- priv->rtllib->softmac_hard_start_xmit(skb, dev);
- }
-
- code_virtual_address += frag_length;
- frag_offset += frag_length;
-
- } while (frag_offset < buffer_len);
-
- rtl92e_writeb(dev, TPPoll, TPPoll_CQ);
-
- return true;
-}
-
static bool _rtl92e_fw_boot_cpu(struct net_device *dev)
{
u32 CPU_status = 0;
@@ -241,8 +191,8 @@ bool rtl92e_init_fw(struct net_device *dev)
mapped_file = pfirmware->blobs[i].data;
file_length = pfirmware->blobs[i].size;
- rt_status = _rtl92e_fw_download_code(dev, mapped_file,
- file_length);
+ rt_status = rtl92e_send_cmd_pkt(dev, DESC_PACKET_TYPE_INIT,
+ mapped_file, file_length);
if (!rt_status)
goto download_firmware_fail;