rtlwifi: remove hal_op rx_command_packet
authorPing-Ke Shih <pkshih@realtek.com>
Fri, 18 May 2018 09:30:03 +0000 (17:30 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 29 May 2018 07:17:00 +0000 (10:17 +0300)
Because the hal_op rx_command_packet does C2H handler if rx packet type
is C2H, and the handler have been moved to base.c so we can call the
handler directly.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/pci.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.h
drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.h
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.h
drivers/net/wireless/realtek/rtlwifi/wifi.h

index d0c509ef790ea62a84e6b7d9a44c4c0669b13f75..dd51c67c09fa628324cc8b5f96c212572ff50120 100644 (file)
@@ -830,8 +830,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
                        goto new_trx_end;
                }
                /* handle command packet here */
-               if (rtlpriv->cfg->ops->rx_command_packet &&
-                   rtlpriv->cfg->ops->rx_command_packet(hw, &stats, skb)) {
+               if (stats.packet_report_type == C2H_PACKET) {
+                       rtl_c2h_packet_handler(hw, skb->data, (u8)skb->len);
                        dev_kfree_skb_any(skb);
                        goto new_trx_end;
                }
index fd028274c59364a336f846a3402393980beac44b..5b67ad748d67241166a3939c11ac6b02e9a47d00 100644 (file)
@@ -250,7 +250,6 @@ static struct rtl_hal_ops rtl8192ee_hal_ops = {
        .set_rfreg = rtl92ee_phy_set_rf_reg,
        .fill_h2c_cmd = rtl92ee_fill_h2c_cmd,
        .get_btc_status = rtl92ee_get_btc_status,
-       .rx_command_packet = rtl92ee_rx_command_packet,
        .c2h_content_parsing = rtl_c2h_content_parsing,
        .c2h_ra_report_handler = rtl92ee_c2h_ra_report_handler,
 };
index e525c2bb44572140d9493b7e61b18404215ec1fc..14d6e3fc5767c885ea4358af127576e2c768e005 100644 (file)
@@ -1072,27 +1072,3 @@ 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)
 {
 }
-
-u32 rtl92ee_rx_command_packet(struct ieee80211_hw *hw,
-                             const struct rtl_stats *status,
-                             struct sk_buff *skb)
-{
-       u32 result = 0;
-       struct rtl_priv *rtlpriv = rtl_priv(hw);
-
-       switch (status->packet_report_type) {
-       case NORMAL_RX:
-               result = 0;
-               break;
-       case C2H_PACKET:
-               rtl_c2h_packet_handler(hw, skb->data, (u8)skb->len);
-               result = 1;
-               break;
-       default:
-               RT_TRACE(rtlpriv, COMP_RECV, DBG_TRACE,
-                        "Unknown packet type %d\n", status->packet_report_type);
-               break;
-       }
-
-       return result;
-}
index 48c16fff20c6e677fd2e156cbe951d9811d375f8..45df3e79f490febf377bfa5d263d377574a46b4b 100644 (file)
@@ -762,7 +762,4 @@ 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);
-u32 rtl92ee_rx_command_packet(struct ieee80211_hw *hw,
-                             const struct rtl_stats *status,
-                             struct sk_buff *skb);
 #endif
index 9df994965c4af193c984226aa0ea0bb7d60be020..a41e67b3f38b3f4a36936b7c4ed88126d3a60b83 100644 (file)
@@ -261,7 +261,6 @@ static struct rtl_hal_ops rtl8723be_hal_ops = {
        .set_rfreg = rtl8723be_phy_set_rf_reg,
        .fill_h2c_cmd = rtl8723be_fill_h2c_cmd,
        .get_btc_status = rtl8723be_get_btc_status,
-       .rx_command_packet = rtl8723be_rx_command_packet,
        .is_fw_header = is_fw_header,
        .c2h_content_parsing = rtl_c2h_content_parsing,
 };
index 0c0cece9d5f9d3dbf4824078e56ce9a1b6ea1c9c..9f8dfb5af77429c0917247d3b4b4a4c5c9777a69 100644 (file)
@@ -761,27 +761,3 @@ void rtl8723be_tx_polling(struct ieee80211_hw *hw, u8 hw_queue)
                               BIT(0) << (hw_queue));
        }
 }
-
-u32 rtl8723be_rx_command_packet(struct ieee80211_hw *hw,
-                               const struct rtl_stats *status,
-                               struct sk_buff *skb)
-{
-       u32 result = 0;
-       struct rtl_priv *rtlpriv = rtl_priv(hw);
-
-       switch (status->packet_report_type) {
-       case NORMAL_RX:
-                       result = 0;
-                       break;
-       case C2H_PACKET:
-                       rtl_c2h_packet_handler(hw, skb->data, (u8)skb->len);
-                       result = 1;
-                       break;
-       default:
-                       RT_TRACE(rtlpriv, COMP_RECV, DBG_TRACE,
-                                "No this packet type!!\n");
-                       break;
-       }
-
-       return result;
-}
index 988bf05866741f229db00d65940265555ba23a68..609f7ad7f787430eaaa19e5070cf93e1eb2f3c99 100644 (file)
@@ -632,7 +632,4 @@ 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);
-u32 rtl8723be_rx_command_packet(struct ieee80211_hw *hw,
-                               const struct rtl_stats *status,
-                               struct sk_buff *skb);
 #endif
index bcabf4dc6353e734abff1c1f4980acad1d499602..8ff8a406db524f749c69aed58937454fe7f28289 100644 (file)
@@ -303,7 +303,6 @@ static struct rtl_hal_ops rtl8821ae_hal_ops = {
        .set_rfreg = rtl8821ae_phy_set_rf_reg,
        .fill_h2c_cmd = rtl8821ae_fill_h2c_cmd,
        .get_btc_status = rtl8821ae_get_btc_status,
-       .rx_command_packet = rtl8821ae_rx_command_packet,
        .c2h_content_parsing = rtl_c2h_content_parsing,
        .c2h_ra_report_handler = rtl8821ae_c2h_ra_report_handler,
        .add_wowlan_pattern = rtl8821ae_add_wowlan_pattern,
index a93d8569c1862a95167d4c6f5055d699559bb6e5..d7960dd5bf1adf2f8d1e4cd5f40f5271c97b768e 100644 (file)
@@ -1005,29 +1005,3 @@ void rtl8821ae_tx_polling(struct ieee80211_hw *hw, u8 hw_queue)
                               BIT(0) << (hw_queue));
        }
 }
-
-u32 rtl8821ae_rx_command_packet(struct ieee80211_hw *hw,
-                               const struct rtl_stats *status,
-                               struct sk_buff *skb)
-{
-       u32 result = 0;
-       struct rtl_priv *rtlpriv = rtl_priv(hw);
-
-       switch (status->packet_report_type) {
-       case NORMAL_RX:
-               result = 0;
-               break;
-       case C2H_PACKET:
-               rtl_c2h_packet_handler(hw, skb->data, (u8)skb->len);
-               result = 1;
-               RT_TRACE(rtlpriv, COMP_RECV, DBG_LOUD,
-                        "skb->len=%d\n\n", skb->len);
-               break;
-       default:
-               RT_TRACE(rtlpriv, COMP_RECV, DBG_LOUD,
-                        "No this packet type!!\n");
-               break;
-       }
-
-       return result;
-}
index 221dd2b29d3bb237338c4fb3e6d1ef15ea3f431d..4ff0968dba81695b4a20516d5d6baad7a3296869 100644 (file)
@@ -628,7 +628,4 @@ 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);
-u32 rtl8821ae_rx_command_packet(struct ieee80211_hw *hw,
-                               const struct rtl_stats *status,
-                               struct sk_buff *skb);
 #endif
index 392b3e84db7e97c6f44a621ada392d547c9a68ad..b40d8f5bbdce6b8284d8fad7c213576a9a83591f 100644 (file)
@@ -2340,8 +2340,6 @@ struct rtl_hal_ops {
        void (*set_default_port_id_cmd)(struct ieee80211_hw *hw);
        bool (*get_btc_status) (void);
        bool (*is_fw_header)(struct rtlwifi_firmware_header *hdr);
-       u32 (*rx_command_packet)(struct ieee80211_hw *hw,
-                                const struct rtl_stats *status, struct sk_buff *skb);
        void (*add_wowlan_pattern)(struct ieee80211_hw *hw,
                                   struct rtl_wow_pattern *rtl_pattern,
                                   u8 index);