rtlwifi: rtl8192ee: Fix adhoc fail
authorTroy Tan <troy_tan@realsil.com.cn>
Tue, 20 Jan 2015 17:01:22 +0000 (11:01 -0600)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 3 Feb 2015 13:10:15 +0000 (15:10 +0200)
When the buffer descriptor index exceeds 2, then a TX HANG condition
will result.

Signed-off-by: Troy Tan <troy_tan@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [V3.18]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/rtlwifi/rtl8192ee/fw.c
drivers/net/wireless/rtlwifi/rtl8192ee/hw.c

index 45c128b91f7fecb0d6ff07bfa7edc72f3a69847e..c5d4b8013cdefe4cdec015c2c1c2819c5b8e8321 100644 (file)
@@ -666,7 +666,6 @@ void rtl92ee_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
        struct sk_buff *skb = NULL;
 
        u32 totalpacketlen;
-       bool rtstatus;
        u8 u1rsvdpageloc[5] = { 0 };
        bool b_dlok = false;
 
@@ -728,10 +727,7 @@ void rtl92ee_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
        memcpy((u8 *)skb_put(skb, totalpacketlen),
               &reserved_page_packet, totalpacketlen);
 
-       rtstatus = rtl_cmd_send_packet(hw, skb);
-
-       if (rtstatus)
-               b_dlok = true;
+       b_dlok = true;
 
        if (b_dlok) {
                RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD ,
index 1a87edca2c3f36a1d540eabc4c3247da5b1959d6..3c27ec2c7b5a821a1cc0c3242602ff2dcf8cc0f0 100644 (file)
@@ -85,29 +85,6 @@ static void _rtl92ee_enable_bcn_sub_func(struct ieee80211_hw *hw)
        _rtl92ee_set_bcn_ctrl_reg(hw, 0, BIT(1));
 }
 
-static void _rtl92ee_return_beacon_queue_skb(struct ieee80211_hw *hw)
-{
-       struct rtl_priv *rtlpriv = rtl_priv(hw);
-       struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
-       struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[BEACON_QUEUE];
-       unsigned long flags;
-
-       spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
-       while (skb_queue_len(&ring->queue)) {
-               struct rtl_tx_buffer_desc *entry =
-                                               &ring->buffer_desc[ring->idx];
-               struct sk_buff *skb = __skb_dequeue(&ring->queue);
-
-               pci_unmap_single(rtlpci->pdev,
-                                rtlpriv->cfg->ops->get_desc(
-                                (u8 *)entry, true, HW_DESC_TXBUFF_ADDR),
-                                skb->len, PCI_DMA_TODEVICE);
-               kfree_skb(skb);
-               ring->idx = (ring->idx + 1) % ring->entries;
-       }
-       spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);
-}
-
 static void _rtl92ee_disable_bcn_sub_func(struct ieee80211_hw *hw)
 {
        _rtl92ee_set_bcn_ctrl_reg(hw, BIT(1), 0);
@@ -403,9 +380,6 @@ static void _rtl92ee_download_rsvd_page(struct ieee80211_hw *hw)
                rtl_write_byte(rtlpriv, REG_DWBCN0_CTRL + 2,
                               bcnvalid_reg | BIT(0));
 
-               /* Return Beacon TCB */
-               _rtl92ee_return_beacon_queue_skb(hw);
-
                /* download rsvd page */
                rtl92ee_set_fw_rsvdpagepkt(hw, false);