rtlwifi: Add Support VHT to spec_ver
authorPing-Ke Shih <pkshih@realtek.com>
Mon, 29 Jan 2018 03:26:33 +0000 (11:26 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 27 Feb 2018 16:15:16 +0000 (18:15 +0200)
We are going to add 8822be, which is a VHT 2x2 wifi chip, so add VHT flag
to replace enumeration of chips.

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

index e461eed..a2da057 100644 (file)
@@ -244,6 +244,9 @@ static void _rtl_init_hw_vht_capab(struct ieee80211_hw *hw,
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
 
+       if (!(rtlpriv->cfg->spec_ver & RTL_SPEC_SUPPORT_VHT))
+               return;
+
        if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE ||
            rtlhal->hw_type == HARDWARE_TYPE_RTL8822BE) {
                u16 mcs_map;
@@ -887,8 +890,7 @@ static void _rtl_query_bandwidth_mode(struct ieee80211_hw *hw,
 
        tcb_desc->packet_bw = HT_CHANNEL_WIDTH_20_40;
 
-       if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8812AE ||
-           rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8821AE) {
+       if (rtlpriv->cfg->spec_ver & RTL_SPEC_SUPPORT_VHT) {
                if (mac->opmode == NL80211_IFTYPE_AP ||
                    mac->opmode == NL80211_IFTYPE_ADHOC ||
                    mac->opmode == NL80211_IFTYPE_MESH_POINT) {
index ab5d462..9bb3d9d 100644 (file)
@@ -328,6 +328,7 @@ static const struct rtl_hal_cfg rtl8821ae_hal_cfg = {
        .alt_fw_name = "rtlwifi/rtl8821aefw.bin",
        .ops = &rtl8821ae_hal_ops,
        .mod_params = &rtl8821ae_mod_params,
+       .spec_ver = RTL_SPEC_SUPPORT_VHT,
        .maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL,
        .maps[SYS_FUNC_EN] = REG_SYS_FUNC_EN,
        .maps[SYS_CLK] = REG_SYS_CLKR,
index 46dcb7f..f6fe7ca 100644 (file)
@@ -952,6 +952,7 @@ enum package_type {
 
 enum rtl_spec_ver {
        RTL_SPEC_NEW_RATEID = BIT(0),   /* use ratr_table_mode_new */
+       RTL_SPEC_SUPPORT_VHT = BIT(1),  /* support VHT */
 };
 
 struct octet_string {