iwlwifi: mvm: add support for single antenna diversity
authorHaim Dreyfuss <haim.dreyfuss@intel.com>
Mon, 22 Jul 2019 13:45:21 +0000 (16:45 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 6 Sep 2019 12:52:05 +0000 (15:52 +0300)
There are products which have a single chain with 2 antennas.
In these products, we need to inform the FW that the device has the
single antenna diversity(SAD) feature. In the future, we will read
the active antenna from a BIOS configuration. Currently, we use a
default configuration which means that the FW decides which antenna to use.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/cfg/22000.c
drivers/net/wireless/intel/iwlwifi/fw/file.h
drivers/net/wireless/intel/iwlwifi/iwl-config.h

index db09ca9..5e355c4 100644 (file)
@@ -240,6 +240,7 @@ const struct iwl_cfg iwl_ax101_cfg_qu_hr = {
         * HT size; mac80211 would otherwise pick the HE max (256) by default.
         */
        .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
+       .tx_with_siso_diversity = true,
 };
 
 const struct iwl_cfg iwl_ax201_cfg_qu_hr = {
index 00db394..329b00e 100644 (file)
@@ -524,6 +524,10 @@ enum iwl_fw_phy_cfg {
        FW_PHY_CFG_TX_CHAIN = 0xf << FW_PHY_CFG_TX_CHAIN_POS,
        FW_PHY_CFG_RX_CHAIN_POS = 20,
        FW_PHY_CFG_RX_CHAIN = 0xf << FW_PHY_CFG_RX_CHAIN_POS,
+       FW_PHY_CFG_CHAIN_SAD_POS = 23,
+       FW_PHY_CFG_CHAIN_SAD_ENABLED = 0x1 << FW_PHY_CFG_CHAIN_SAD_POS,
+       FW_PHY_CFG_CHAIN_SAD_ANT_A = 0x2 << FW_PHY_CFG_CHAIN_SAD_POS,
+       FW_PHY_CFG_CHAIN_SAD_ANT_B = 0x4 << FW_PHY_CFG_CHAIN_SAD_POS,
        FW_PHY_CFG_SHARED_CLK = BIT(31),
 };
 
index 284352d..214495a 100644 (file)
@@ -379,6 +379,7 @@ struct iwl_cfg_trans_params {
  * @ht_params: point to ht parameters
  * @led_mode: 0=blinking, 1=On(RF On)/Off(RF Off)
  * @rx_with_siso_diversity: 1x1 device with rx antenna diversity
+ * @tx_with_siso_diversity: 1x1 device with tx antenna diversity
  * @internal_wimax_coex: internal wifi/wimax combo device
  * @high_temp: Is this NIC is designated to be in high temperature.
  * @host_interrupt_operation_mode: device needs host interrupt operation
@@ -441,6 +442,7 @@ struct iwl_cfg {
        u16 nvm_ver;
        u16 nvm_calib_ver;
        u32 rx_with_siso_diversity:1,
+           tx_with_siso_diversity:1,
            bt_shared_single_ant:1,
            internal_wimax_coex:1,
            host_interrupt_operation_mode:1,