iwlwifi: support different num of tx and rx antennas
authorTomas Winkler <tomas.winkler@intel.com>
Tue, 15 Apr 2008 23:01:39 +0000 (16:01 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 Apr 2008 20:00:00 +0000 (16:00 -0400)
This patch adds infrastructure for supporting different
number of tx and rx antennas

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-4965-commands.h
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-4965.h

index 65cd8ae363b4099957de7e87cc75746b731642c1..7aa7f0be896326b3ed6c93c6b37ab6f451644cf3 100644 (file)
@@ -269,11 +269,10 @@ struct iwl_cmd_header {
  *          10 B active, A inactive
  *          11 Both active
  */
-#define RATE_MCS_ANT_A_POS     14
-#define RATE_MCS_ANT_B_POS     15
-#define RATE_MCS_ANT_A_MSK     0x4000
-#define RATE_MCS_ANT_B_MSK     0x8000
-#define RATE_MCS_ANT_AB_MSK    0xc000
+#define RATE_MCS_ANT_POS       14
+#define RATE_MCS_ANT_A_MSK     0x04000
+#define RATE_MCS_ANT_B_MSK     0x08000
+#define RATE_MCS_ANT_AB_MSK    0x0C000
 
 
 /**
index a1e91dbb92bb084a4af71384d12e84c0404c21da..e647be7608fc1b82d97f9e961768108ea69c4678 100644 (file)
@@ -410,7 +410,7 @@ void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv, u32 rate_n_flags,
        int rate_index;
 
        control->antenna_sel_tx =
-               ((rate_n_flags & RATE_MCS_ANT_AB_MSK) >> RATE_MCS_ANT_A_POS);
+               ((rate_n_flags & RATE_MCS_ANT_AB_MSK) >> RATE_MCS_ANT_POS);
        if (rate_n_flags & RATE_MCS_HT_MSK)
                control->flags |= IEEE80211_TXCTL_OFDM_HT;
        if (rate_n_flags & RATE_MCS_GF_MSK)
@@ -2040,7 +2040,10 @@ int iwl4965_hw_set_hw_params(struct iwl_priv *priv)
        priv->hw_params.max_stations = IWL4965_STATION_COUNT;
        priv->hw_params.bcast_sta_id = IWL4965_BROADCAST_ID;
 
-       priv->hw_params.tx_ant_num = 2;
+       priv->hw_params.tx_chains_num = 2;
+       priv->hw_params.rx_chains_num = 2;
+       priv->hw_params.valid_tx_ant = (IWL_ANTENNA_MAIN | IWL_ANTENNA_AUX);
+       priv->hw_params.valid_rx_ant = (IWL_ANTENNA_MAIN | IWL_ANTENNA_AUX);
 
        return 0;
 }
index c127c91010b40972adbf13e2ff5f8c0079f8541b..cf909e86ed29894b3b9e6975df2c79357b5be457 100644 (file)
@@ -580,11 +580,14 @@ struct iwl4965_ibss_seq {
 struct iwl_hw_params {
        u16 max_txq_num;
        u16 tx_cmd_len;
-       u16 tx_ant_num;
+       u8  tx_chains_num;
+       u8  rx_chains_num;
+       u8  valid_tx_ant;
+       u8  valid_rx_ant;
        u16 max_rxq_size;
+       u16 max_rxq_log;
        u32 rx_buf_size;
        u32 max_pkt_size;
-       u16 max_rxq_log;
        u8  max_stations;
        u8  bcast_sta_id;
 };