]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rtlwifi: rtl8192de: Fix missing callback that tests for hw release of buffer
authorLarry Finger <Larry.Finger@lwfinger.net>
Mon, 11 Nov 2019 19:40:45 +0000 (13:40 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 19:34:50 +0000 (20:34 +0100)
commit 3155db7613edea8fb943624062baf1e4f9cfbfd6 upstream.

In commit 38506ecefab9 ("rtlwifi: rtl_pci: Start modification for
new drivers"), a callback needed to check if the hardware has released
a buffer indicating that a DMA operation is completed was not added.

Fixes: 38506ecefab9 ("rtlwifi: rtl_pci: Start modification for new drivers")
Cc: Stable <stable@vger.kernel.org> # v3.18+
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h

index d5ba2bace79bb480bd9285b8cf0d146b01c82c24..2b0c0308d2817ba0951527d50e1534a5f22cfa4f 100644 (file)
@@ -238,6 +238,7 @@ static struct rtl_hal_ops rtl8192de_hal_ops = {
        .led_control = rtl92de_led_control,
        .set_desc = rtl92de_set_desc,
        .get_desc = rtl92de_get_desc,
+       .is_tx_desc_closed = rtl92de_is_tx_desc_closed,
        .tx_polling = rtl92de_tx_polling,
        .enable_hw_sec = rtl92de_enable_hw_security_config,
        .set_key = rtl92de_set_key,
index 9cf1f59d5137f71beaefe53abcb563b847082ceb..76f12247184aa4ddd94d229f7ad2815cb2120a0c 100644 (file)
@@ -859,6 +859,23 @@ u64 rtl92de_get_desc(struct ieee80211_hw *hw,
        return ret;
 }
 
+bool rtl92de_is_tx_desc_closed(struct ieee80211_hw *hw,
+                              u8 hw_queue, u16 index)
+{
+       struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
+       struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue];
+       u8 *entry = (u8 *)(&ring->desc[ring->idx]);
+       u8 own = (u8)rtl92de_get_desc(hw, entry, true, HW_DESC_OWN);
+
+       /* a beacon packet will only use the first
+        * descriptor by defaut, and the own bit may not
+        * be cleared by the hardware
+        */
+       if (own)
+               return false;
+       return true;
+}
+
 void rtl92de_tx_polling(struct ieee80211_hw *hw, u8 hw_queue)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
index f7f776539438942e50a2f2e2b3dcbd8601818f27..3d026e518c02572cdb1f82978046124d7962812a 100644 (file)
@@ -737,6 +737,8 @@ void rtl92de_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
                      u8 desc_name, u8 *val);
 u64 rtl92de_get_desc(struct ieee80211_hw *hw,
                     u8 *p_desc, bool istx, u8 desc_name);
+bool rtl92de_is_tx_desc_closed(struct ieee80211_hw *hw,
+                              u8 hw_queue, u16 index);
 void rtl92de_tx_polling(struct ieee80211_hw *hw, u8 hw_queue);
 void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
                             bool b_firstseg, bool b_lastseg,