From: Ping-Ke Shih <[email protected]>

The in_4way can be filled by wpa_cli's VENDOR command.

Signed-off-by: Ping-Ke Shih <[email protected]>
Signed-off-by: Larry Finger <[email protected]>
Cc: Yan-Hsuan Chuang <[email protected]>
Cc: Birming Chiu <[email protected]>
Cc: Shaofu <[email protected]>
Cc: Steven Ting <[email protected]>
---
 drivers/net/wireless/realtek/rtlwifi/base.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c 
b/drivers/net/wireless/realtek/rtlwifi/base.c
index 574f9943d70e..1b81bfa083ed 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -319,6 +319,7 @@ static void _rtl_init_hw_vht_capab(struct ieee80211_hw *hw,
 
 enum {
        RTL_VENDOR_SCMD_COEX_AP_NUM     = 2000,
+       RTL_VENDOR_SCMD_COEX_4WAY       = 2001,
 };
 
 static u32 rtl_data_to_int(struct rtl_priv *rtlpriv, const void *data, int len)
@@ -364,6 +365,24 @@ static int rtl_cfgvendor_coex_ap_num(struct wiphy *wiphy,
        return 0;
 }
 
+static int rtl_cfgvendor_coex_4way(struct wiphy *wiphy,
+                                  struct wireless_dev *wdev,
+                                  const void *data, int len)
+{
+       struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
+       struct rtl_priv *rtlpriv = rtl_priv(hw);
+       bool tmp;
+
+       tmp = (rtl_data_to_int(rtlpriv, data, len) ? true : false);
+
+       rtlpriv->btcoexist.btc_info.in_4way = tmp;
+
+       RT_TRACE(rtlpriv, COMP_VENDOR_CMD, DBG_DMESG,
+                "cfgvendor 4way is %d\n", rtlpriv->btcoexist.btc_info.in_4way);
+
+       return 0;
+}
+
 static const struct wiphy_vendor_command rtl_vendor_cmds[] = {
        {
                {
@@ -374,6 +393,15 @@ static const struct wiphy_vendor_command rtl_vendor_cmds[] 
= {
                         WIPHY_VENDOR_CMD_NEED_NETDEV,
                .doit = rtl_cfgvendor_coex_ap_num,
        },
+       {
+               {
+                       .vendor_id = OUI_REALTEK,
+                       .subcmd = RTL_VENDOR_SCMD_COEX_4WAY
+               },
+               .flags = WIPHY_VENDOR_CMD_NEED_WDEV |
+                        WIPHY_VENDOR_CMD_NEED_NETDEV,
+               .doit = rtl_cfgvendor_coex_4way,
+       },
 };
 
 static void _rtl_init_mac80211(struct ieee80211_hw *hw)
-- 
2.12.3

Reply via email to