wifi: rtlwifi: simplify TX command fill callbacks
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 11 Oct 2023 15:44:37 +0000 (18:44 +0300)
committerKalle Valo <kvalo@kernel.org>
Sat, 14 Oct 2023 06:42:24 +0000 (09:42 +0300)
Since 'rtlpriv->cfg->ops->fill_tx_cmddesc()' is always called
with 'firstseg' and 'lastseg' set to 1 (and the latter is
never actually used), all of the relevant chip-specific
routines may be simplified. Compile tested only.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231011154442.52457-2-dmantipov@yandex.ru
23 files changed:
drivers/net/wireless/realtek/rtlwifi/core.c
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.h
drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.h
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h
drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.h
drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.h
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.h
drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.h
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.h
drivers/net/wireless/realtek/rtlwifi/wifi.h

index 3835b639d453fcedd145b00b37e869acff047d10..cc9b2a459386f1aba236fbe098a6e003bc7fa07d 100644 (file)
@@ -1897,7 +1897,7 @@ bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb)
        /*this is wrong, fill_tx_cmddesc needs update*/
        pdesc = &ring->desc[0];
 
-       rtlpriv->cfg->ops->fill_tx_cmddesc(hw, (u8 *)pdesc, 1, 1, skb);
+       rtlpriv->cfg->ops->fill_tx_cmddesc(hw, (u8 *)pdesc, skb);
 
        __skb_queue_tail(&ring->queue, skb);
 
index 65ebe52883d3f5c399f039daad66be05d9ef54e1..d094163a9a71b1cf5f5c08e758bf57230eb2f02e 100644 (file)
@@ -665,9 +665,8 @@ void rtl88ee_tx_fill_desc(struct ieee80211_hw *hw,
        rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
 }
 
-void rtl88ee_tx_fill_cmddesc(struct ieee80211_hw *hw,
-                            u8 *pdesc8, bool firstseg,
-                            bool lastseg, struct sk_buff *skb)
+void rtl88ee_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc8,
+                            struct sk_buff *skb)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
@@ -687,8 +686,7 @@ void rtl88ee_tx_fill_cmddesc(struct ieee80211_hw *hw,
        }
        clear_pci_tx_desc_content(pdesc, TX_DESC_SIZE);
 
-       if (firstseg)
-               set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN);
+       set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN);
 
        set_tx_desc_tx_rate(pdesc, DESC92C_RATE1M);
 
index e17f70b4d19916b86a6b065e73d7ed47d8338abb..aae654b0e3ba5bde29052092dc96a37080a4a9ac 100644 (file)
@@ -797,6 +797,5 @@ bool rtl88ee_is_tx_desc_closed(struct ieee80211_hw *hw,
                               u8 hw_queue, u16 index);
 void rtl88ee_tx_polling(struct ieee80211_hw *hw, u8 hw_queue);
 void rtl88ee_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
-                            bool firstseg, bool lastseg,
                             struct sk_buff *skb);
 #endif
index 5376bb34251f7c5a29e43f78693f27836a4d8df5..50e139186a938874105b0cbc52f8520260bba150 100644 (file)
@@ -518,9 +518,8 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
        rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
 }
 
-void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
-                            u8 *pdesc8, bool firstseg,
-                            bool lastseg, struct sk_buff *skb)
+void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc8,
+                            struct sk_buff *skb)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
@@ -540,9 +539,7 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
        }
        clear_pci_tx_desc_content(pdesc, TX_DESC_SIZE);
 
-       if (firstseg)
-               set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN);
-
+       set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN);
        set_tx_desc_tx_rate(pdesc, DESC_RATE1M);
 
        set_tx_desc_seq(pdesc, 0);
index b45b05a6a52341800d711fc1e8a97c2056f03596..f3ffe3d9883cd6a49f4d8f225e65ab33e5906a59 100644 (file)
@@ -527,6 +527,5 @@ bool rtl92ce_is_tx_desc_closed(struct ieee80211_hw *hw,
                               u8 hw_queue, u16 index);
 void rtl92ce_tx_polling(struct ieee80211_hw *hw, u8 hw_queue);
 void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
-                            bool b_firstseg, bool b_lastseg,
                             struct sk_buff *skb);
 #endif
index a040c07791d1b52bcd464d148bbef6e1dd5b9965..5ec0eb8773a558e1232e7b35e2da6465bfd38009 100644 (file)
@@ -1539,7 +1539,7 @@ static bool usb_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb)
    * if its "here".
    *
    * This is maybe necessary:
-   * rtlpriv->cfg->ops->fill_tx_cmddesc(hw, buffer, 1, 1, skb);
+   * rtlpriv->cfg->ops->fill_tx_cmddesc(hw, buffer, skb);
    */
        dev_kfree_skb(skb);
 
index b70767e72f3d9b151e00b71f6863d7e58007e96a..9969e9d1fc4bfd4704eb743dc41ca670d36586d1 100644 (file)
@@ -626,9 +626,8 @@ void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 *pdesc8,
        _rtl_tx_desc_checksum(pdesc);
 }
 
-void rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw,
-                            u8 *pdesc8, bool firstseg,
-                            bool lastseg, struct sk_buff *skb)
+void rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc8,
+                            struct sk_buff *skb)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        u8 fw_queue = QSLT_BEACON;
@@ -637,8 +636,7 @@ void rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw,
        __le32 *pdesc = (__le32 *)pdesc8;
 
        memset((void *)pdesc, 0, RTL_TX_HEADER_SIZE);
-       if (firstseg)
-               set_tx_desc_offset(pdesc, RTL_TX_HEADER_SIZE);
+       set_tx_desc_offset(pdesc, RTL_TX_HEADER_SIZE);
        set_tx_desc_tx_rate(pdesc, DESC_RATE1M);
        set_tx_desc_seq(pdesc, 0);
        set_tx_desc_linip(pdesc, 0);
index 171fe39dfb0c0dd7b8a6725f68495d946960fe12..cc4ef2bfd2e76ced67cc672c0d1cdff48ca65b08 100644 (file)
@@ -396,8 +396,7 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw,
                          struct rtl_tcb_desc *tcb_desc);
 void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 *pdesc,
                               u32 buffer_len, bool ispspoll);
-void rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw,
-                            u8 *pdesc, bool b_firstseg,
-                            bool b_lastseg, struct sk_buff *skb);
+void rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
+                            struct sk_buff *skb);
 
 #endif
index 9ddb8478784bf70ec5b066c567563ca5b507adce..e1fb299628012db95160e758098b370c39a4720a 100644 (file)
@@ -469,7 +469,7 @@ static bool _rtl92d_cmd_send_packet(struct ieee80211_hw *hw,
        pdesc = &ring->desc[idx];
        /* discard output from call below */
        rtlpriv->cfg->ops->get_desc(hw, (u8 *)pdesc, true, HW_DESC_OWN);
-       rtlpriv->cfg->ops->fill_tx_cmddesc(hw, (u8 *) pdesc, 1, 1, skb);
+       rtlpriv->cfg->ops->fill_tx_cmddesc(hw, (u8 *)pdesc, skb);
        __skb_queue_tail(&ring->queue, skb);
        spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);
        rtlpriv->cfg->ops->tx_polling(hw, BEACON_QUEUE);
index c09c0c3126658a16dd7dd25b0e04631305a61f13..02ac69c08ed3739da4479759dffe2606f356c193 100644 (file)
@@ -655,9 +655,8 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
        rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
 }
 
-void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw,
-                            u8 *pdesc8, bool firstseg,
-                            bool lastseg, struct sk_buff *skb)
+void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc8,
+                            struct sk_buff *skb)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
@@ -678,8 +677,7 @@ void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw,
                return;
        }
        clear_pci_tx_desc_content(pdesc, TX_DESC_SIZE);
-       if (firstseg)
-               set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN);
+       set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN);
        /* 5G have no CCK rate
         * Caution: The macros below are multi-line expansions.
         * The braces are needed no matter what checkpatch says
index d01578875cd5ff9cdc6127716292238ba5974fea..2992668c156c6ea1a0a5cb53e17adb86ac2f4be1 100644 (file)
@@ -564,7 +564,6 @@ 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,
                             struct sk_buff *skb);
 
 #endif
index a182cdeb58e2bd1274565a192f90a6b495273ec9..67388e0b3fa0eec69fd11500b03f0ef658886365 100644 (file)
@@ -827,9 +827,8 @@ void rtl92ee_tx_fill_desc(struct ieee80211_hw *hw,
        rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
 }
 
-void rtl92ee_tx_fill_cmddesc(struct ieee80211_hw *hw,
-                            u8 *pdesc8, bool firstseg,
-                            bool lastseg, struct sk_buff *skb)
+void rtl92ee_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc8,
+                            struct sk_buff *skb)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
@@ -846,8 +845,7 @@ void rtl92ee_tx_fill_cmddesc(struct ieee80211_hw *hw,
        }
        clear_pci_tx_desc_content(pdesc, txdesc_len);
 
-       if (firstseg)
-               set_tx_desc_offset(pdesc, txdesc_len);
+       set_tx_desc_offset(pdesc, txdesc_len);
 
        set_tx_desc_tx_rate(pdesc, DESC_RATE1M);
 
index 967cef3a9cbf12cdaa97f033fea964eb13d0f854..3852a50a688bb528345255211cd1ee0405c914b5 100644 (file)
@@ -743,6 +743,5 @@ u64 rtl92ee_get_desc(struct ieee80211_hw *hw,
 bool rtl92ee_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue, u16 index);
 void rtl92ee_tx_polling(struct ieee80211_hw *hw, u8 hw_queue);
 void rtl92ee_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
-                            bool firstseg, bool lastseg,
                             struct sk_buff *skb);
 #endif
index f570495af0440ca9e236e831ccdeb824dc1f1ff6..579b1789d6d1ff086d98e5ad96140420636e1bd7 100644 (file)
@@ -122,7 +122,7 @@ static bool _rtl92s_cmd_send_packet(struct ieee80211_hw *hw,
 
        idx = (ring->idx + skb_queue_len(&ring->queue)) % ring->entries;
        pdesc = &ring->desc[idx];
-       rtlpriv->cfg->ops->fill_tx_cmddesc(hw, (u8 *)pdesc, 1, 1, skb);
+       rtlpriv->cfg->ops->fill_tx_cmddesc(hw, (u8 *)pdesc, skb);
        __skb_queue_tail(&ring->queue, skb);
 
        spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);
index a5853a170b583024d8aebbc2937506260823d9d9..f104cdb649f8d62c80e7fd9320eacc9acaf2e427 100644 (file)
@@ -492,7 +492,7 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
 }
 
 void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc8,
-                            bool firstseg, bool lastseg, struct sk_buff *skb)
+                            struct sk_buff *skb)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
index 90aa12fc6a7f97e9dc7803f4e1aebf7190d176c2..40291a6a15d05fe02ccfaf03333c07c7490ff45c 100644 (file)
@@ -10,8 +10,8 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
                          struct ieee80211_sta *sta,
                          struct sk_buff *skb, u8 hw_queue,
                          struct rtl_tcb_desc *ptcb_desc);
-void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, bool firstseg,
-                            bool lastseg, struct sk_buff *skb);
+void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
+                            struct sk_buff *skb);
 bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
                           struct ieee80211_rx_status *rx_status, u8 *pdesc,
                           struct sk_buff *skb);
index 7f294e698994792f60534f1b15573d8594b1f5ad..d9823ddab7becb87786f342a4d0d860b737774e8 100644 (file)
@@ -519,9 +519,8 @@ void rtl8723e_tx_fill_desc(struct ieee80211_hw *hw,
        rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
 }
 
-void rtl8723e_tx_fill_cmddesc(struct ieee80211_hw *hw,
-                             u8 *pdesc8, bool firstseg,
-                             bool lastseg, struct sk_buff *skb)
+void rtl8723e_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc8,
+                             struct sk_buff *skb)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
@@ -541,8 +540,7 @@ void rtl8723e_tx_fill_cmddesc(struct ieee80211_hw *hw,
        }
        clear_pci_tx_desc_content(pdesc, TX_DESC_SIZE);
 
-       if (firstseg)
-               set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN);
+       set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN);
 
        set_tx_desc_tx_rate(pdesc, DESC92C_RATE1M);
 
index 2d25f62a4d529039db867c47d79327158ded5f8c..f352fddfff322d84eb191790a66d5cbc1ef6e017 100644 (file)
@@ -530,6 +530,5 @@ bool rtl8723e_is_tx_desc_closed(struct ieee80211_hw *hw,
                                u8 hw_queue, u16 index);
 void rtl8723e_tx_polling(struct ieee80211_hw *hw, u8 hw_queue);
 void rtl8723e_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
-                             bool firstseg, bool lastseg,
                              struct sk_buff *skb);
 #endif
index 24ef7cc52e995b11e7107e18a02585cc008f2e89..8b6352f7f93b9489c09dccb00f1c892d44592d8d 100644 (file)
@@ -585,7 +585,6 @@ void rtl8723be_tx_fill_desc(struct ieee80211_hw *hw,
 }
 
 void rtl8723be_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc8,
-                              bool firstseg, bool lastseg,
                               struct sk_buff *skb)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
index 174aca20c7e1a0241165448d0225a57ea2bb2933..da027f915cf4f2f81d12a2c261776e74fd3c59bb 100644 (file)
@@ -642,6 +642,5 @@ bool rtl8723be_is_tx_desc_closed(struct ieee80211_hw *hw,
                                 u8 hw_queue, u16 index);
 void rtl8723be_tx_polling(struct ieee80211_hw *hw, u8 hw_queue);
 void rtl8723be_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
-                              bool firstseg, bool lastseg,
                               struct sk_buff *skb);
 #endif
index d7cb3319d8851e9f795e3c14f1ffaf3d7fb9e4c1..bd71592fe26a6f3313f1411adee571d79c6e99e0 100644 (file)
@@ -828,9 +828,8 @@ void rtl8821ae_tx_fill_desc(struct ieee80211_hw *hw,
        rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
 }
 
-void rtl8821ae_tx_fill_cmddesc(struct ieee80211_hw *hw,
-                              u8 *pdesc8, bool firstseg,
-                              bool lastseg, struct sk_buff *skb)
+void rtl8821ae_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc8,
+                              struct sk_buff *skb)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
index a9ed6fd41089d8360aa13a667d6f66ee999054b1..1155365348f32a802e747b05629cf18a14601396 100644 (file)
@@ -648,6 +648,5 @@ bool rtl8821ae_is_tx_desc_closed(struct ieee80211_hw *hw,
                                 u8 hw_queue, u16 index);
 void rtl8821ae_tx_polling(struct ieee80211_hw *hw, u8 hw_queue);
 void rtl8821ae_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
-                              bool firstseg, bool lastseg,
                               struct sk_buff *skb);
 #endif
index 47b4685b6d24b6f5429209660bf0e3c0c68ba846..b60169196eab3fdc157d49f0503bc0e87f097b0a 100644 (file)
@@ -2249,7 +2249,6 @@ struct rtl_hal_ops {
        void (*fill_fake_txdesc)(struct ieee80211_hw *hw, u8 *pdesc,
                                 u32 buffer_len, bool bsspspoll);
        void (*fill_tx_cmddesc)(struct ieee80211_hw *hw, u8 *pdesc,
-                               bool firstseg, bool lastseg,
                                struct sk_buff *skb);
        void (*fill_tx_special_desc)(struct ieee80211_hw *hw,
                                     u8 *pdesc, u8 *pbd_desc,