]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
rtlwifi: Add hal_op c2h_ra_report_handler for special process
authorPing-Ke Shih <pkshih@realtek.com>
Fri, 18 May 2018 09:30:01 +0000 (17:30 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 29 May 2018 07:16:55 +0000 (10:16 +0300)
We're going to merge C2H handler into one, but one special case is to
handle RA_REPORT that implements in individual IC folder. So this commit
adds a hal_op for caller in common code.

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

index 25d6c32f66c364ef98a6ff9735af878a6eedad5a..a2d9e217bc65578895f6bdf47ab499eabede0ccb 100644 (file)
@@ -876,8 +876,8 @@ void rtl92ee_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state)
                             (u8 *)p2p_ps_offload);
 }
 
-static void _rtl92ee_c2h_ra_report_handler(struct ieee80211_hw *hw,
-                                          u8 *cmd_buf, u8 cmd_len)
+void rtl92ee_c2h_ra_report_handler(struct ieee80211_hw *hw,
+                                  u8 *cmd_buf, u8 cmd_len)
 {
        u8 rate = cmd_buf[0] & 0x3F;
        bool collision_state = cmd_buf[3] & BIT(0);
@@ -889,6 +889,7 @@ void rtl92ee_c2h_content_parsing(struct ieee80211_hw *hw, u8 c2h_cmd_id,
                                 u8 c2h_cmd_len, u8 *tmp_buf)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
+       struct rtl_hal_ops *hal_ops = rtlpriv->cfg->ops;
        struct rtl_btc_ops *btc_ops = rtlpriv->btcoexist.btc_ops;
 
        switch (c2h_cmd_id) {
@@ -920,7 +921,7 @@ void rtl92ee_c2h_content_parsing(struct ieee80211_hw *hw, u8 c2h_cmd_id,
                                                     c2h_cmd_len);
                break;
        case C2H_RA_RPT:
-               _rtl92ee_c2h_ra_report_handler(hw, tmp_buf, c2h_cmd_len);
+               hal_ops->c2h_ra_report_handler(hw, tmp_buf, c2h_cmd_len);
                break;
        default:
                RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
index 8325adaa96639bcb29e55dadd74d740b16718983..e5fae0a86a2756a5cbb00e51ece75693b9c47363 100644 (file)
@@ -182,4 +182,6 @@ void rtl92ee_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state);
 void rtl92ee_c2h_packet_handler(struct ieee80211_hw *hw, u8 *buffer, u8 len);
 void rtl92ee_c2h_content_parsing(struct ieee80211_hw *hw, u8 c2h_cmd_id,
                                 u8 c2h_cmd_len, u8 *tmp_buf);
+void rtl92ee_c2h_ra_report_handler(struct ieee80211_hw *hw,
+                                  u8 *cmd_buf, u8 cmd_len);
 #endif
index ef92a789871dacdf1ea9ba9378653126f4ab43db..c5c26b537cd2ca60d9b0c8e2d485869a1b485914 100644 (file)
@@ -252,6 +252,7 @@ static struct rtl_hal_ops rtl8192ee_hal_ops = {
        .get_btc_status = rtl92ee_get_btc_status,
        .rx_command_packet = rtl92ee_rx_command_packet,
        .c2h_content_parsing = rtl92ee_c2h_content_parsing,
+       .c2h_ra_report_handler = rtl92ee_c2h_ra_report_handler,
 };
 
 static struct rtl_mod_params rtl92ee_mod_params = {
index 5c7e58fbc07e2058ed9ee22a0c4e31efa11b2b95..bf37c428c682241129f1db96022b73a2caedc41b 100644 (file)
@@ -1907,7 +1907,7 @@ void rtl8821ae_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state)
                        H2C_8821AE_P2P_PS_OFFLOAD, 1, (u8 *)p2p_ps_offload);
 }
 
-static void rtl8821ae_c2h_ra_report_handler(struct ieee80211_hw *hw,
+void rtl8821ae_c2h_ra_report_handler(struct ieee80211_hw *hw,
                                     u8 *cmd_buf, u8 cmd_len)
 {
        struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
@@ -1923,6 +1923,7 @@ void rtl8821ae_c2h_content_parsing(struct ieee80211_hw *hw,
                                   u8 *tmp_buf)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
+       struct rtl_hal_ops *hal_ops = rtlpriv->cfg->ops;
        struct rtl_btc_ops *btc_ops = rtlpriv->btcoexist.btc_ops;
 
        switch (c2h_cmd_id) {
@@ -1933,7 +1934,7 @@ void rtl8821ae_c2h_content_parsing(struct ieee80211_hw *hw,
                rtl_tx_report_handler(hw, tmp_buf, c2h_cmd_len);
                break;
        case C2H_RA_RPT:
-               rtl8821ae_c2h_ra_report_handler(hw, tmp_buf, c2h_cmd_len);
+               hal_ops->c2h_ra_report_handler(hw, tmp_buf, c2h_cmd_len);
                break;
        case C2H_BT_INFO:
                RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
index 48c72a26c7e8b3eda22dae0a904f08eda4e4c62b..a69448be7c266a9fdc23522399751bef58417889 100644 (file)
@@ -322,4 +322,6 @@ void rtl8821ae_c2h_packet_handler(struct ieee80211_hw *hw,
 void rtl8821ae_c2h_content_parsing(struct ieee80211_hw *hw,
                                   u8 c2h_cmd_id, u8 c2h_cmd_len,
                                   u8 *tmp_buf);
+void rtl8821ae_c2h_ra_report_handler(struct ieee80211_hw *hw,
+                                    u8 *cmd_buf, u8 cmd_len);
 #endif
index 9bb3d9dfce791d7d9dcb73ac9c6c41567cbec41f..4b2cb6bda4f1944870b78274211ac86dbe1097b3 100644 (file)
@@ -305,6 +305,7 @@ static struct rtl_hal_ops rtl8821ae_hal_ops = {
        .get_btc_status = rtl8821ae_get_btc_status,
        .rx_command_packet = rtl8821ae_rx_command_packet,
        .c2h_content_parsing = rtl8821ae_c2h_content_parsing,
+       .c2h_ra_report_handler = rtl8821ae_c2h_ra_report_handler,
        .add_wowlan_pattern = rtl8821ae_add_wowlan_pattern,
 };
 
index 3da8e2a6084ab1f5c60ab38f5cd86457a424dc22..392b3e84db7e97c6f44a621ada392d547c9a68ad 100644 (file)
@@ -2348,6 +2348,8 @@ struct rtl_hal_ops {
        u16 (*get_available_desc)(struct ieee80211_hw *hw, u8 q_idx);
        void (*c2h_content_parsing)(struct ieee80211_hw *hw, u8 tag, u8 len,
                                    u8 *val);
+       void (*c2h_ra_report_handler)(struct ieee80211_hw *hw,
+                                     u8 *cmd_buf, u8 cmd_len);
 };
 
 struct rtl_intf_ops {