Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368983
b: refs/heads/master
c: 3322354
h: refs/heads/master
i:
  368981: d8c7727
  368979: 82b38f6
  368975: 31e6a64
v: v3
  • Loading branch information
Emmanuel Grumbach authored and Johannes Berg committed Mar 20, 2013
1 parent 11a8ec6 commit c30efb4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d110cb51cf109a6dff0e801d945ea98d2883bd01
refs/heads/master: 332235427a566d8be04b9676a7ac380c8853aa9b
12 changes: 12 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-fw.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,16 @@ struct iwl_fw {
bool mvm_fw;
};

static inline u8 iwl_fw_valid_tx_ant(const struct iwl_fw *fw)
{
return (fw->phy_config & FW_PHY_CFG_TX_CHAIN) >>
FW_PHY_CFG_TX_CHAIN_POS;
}

static inline u8 iwl_fw_valid_rx_ant(const struct iwl_fw *fw)
{
return (fw->phy_config & FW_PHY_CFG_RX_CHAIN) >>
FW_PHY_CFG_RX_CHAIN_POS;
}

#endif /* __iwl_fw_h__ */
8 changes: 4 additions & 4 deletions trunk/drivers/net/wireless/iwlwifi/mvm/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static int iwl_send_tx_ant_cfg(struct iwl_mvm *mvm, u8 valid_tx_ant)
.valid = cpu_to_le32(valid_tx_ant),
};

IWL_DEBUG_HC(mvm, "select valid tx ant: %u\n", valid_tx_ant);
IWL_DEBUG_FW(mvm, "select valid tx ant: %u\n", valid_tx_ant);
return iwl_mvm_send_cmd_pdu(mvm, TX_ANT_CONFIGURATION_CMD, CMD_SYNC,
sizeof(tx_ant_cmd), &tx_ant_cmd);
}
Expand Down Expand Up @@ -327,7 +327,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
WARN_ON(ret);

/* Send TX valid antennas before triggering calibrations */
ret = iwl_send_tx_ant_cfg(mvm, mvm->nvm_data->valid_tx_ant);
ret = iwl_send_tx_ant_cfg(mvm, iwl_fw_valid_tx_ant(mvm->fw));
if (ret)
goto error;

Expand Down Expand Up @@ -413,7 +413,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
goto error;
}

ret = iwl_send_tx_ant_cfg(mvm, mvm->nvm_data->valid_tx_ant);
ret = iwl_send_tx_ant_cfg(mvm, iwl_fw_valid_tx_ant(mvm->fw));
if (ret)
goto error;

Expand Down Expand Up @@ -467,7 +467,7 @@ int iwl_mvm_load_d3_fw(struct iwl_mvm *mvm)
goto error;
}

ret = iwl_send_tx_ant_cfg(mvm, mvm->nvm_data->valid_tx_ant);
ret = iwl_send_tx_ant_cfg(mvm, iwl_fw_valid_tx_ant(mvm->fw));
if (ret)
goto error;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ static int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm,
TX_CMD_FLG_TSF);

mvm->mgmt_last_antenna_idx =
iwl_mvm_next_antenna(mvm, mvm->nvm_data->valid_tx_ant,
iwl_mvm_next_antenna(mvm, iwl_fw_valid_tx_ant(mvm->fw),
mvm->mgmt_last_antenna_idx);

beacon_cmd.tx.rate_n_flags =
Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm,
struct cfg80211_chan_def *chandef,
u8 chains_static, u8 chains_dynamic)
{
u8 valid_rx_chains, active_cnt, idle_cnt;
u8 active_cnt, idle_cnt;

/* Set the channel info data */
cmd->ci.band = (chandef->chan->band == IEEE80211_BAND_2GHZ ?
Expand All @@ -158,17 +158,16 @@ static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm,
* Need to add on chain noise calibration limitations, and
* BT coex considerations.
*/
valid_rx_chains = mvm->nvm_data->valid_rx_ant;
idle_cnt = chains_static;
active_cnt = chains_dynamic;

cmd->rxchain_info = cpu_to_le32(valid_rx_chains <<
cmd->rxchain_info = cpu_to_le32(iwl_fw_valid_rx_ant(mvm->fw) <<
PHY_RX_CHAIN_VALID_POS);
cmd->rxchain_info |= cpu_to_le32(idle_cnt << PHY_RX_CHAIN_CNT_POS);
cmd->rxchain_info |= cpu_to_le32(active_cnt <<
PHY_RX_CHAIN_MIMO_CNT_POS);

cmd->txchain_info = cpu_to_le32(mvm->nvm_data->valid_tx_ant);
cmd->txchain_info = cpu_to_le32(iwl_fw_valid_tx_ant(mvm->fw));
}

/*
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/mvm/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
static inline __le16 iwl_mvm_scan_rx_chain(struct iwl_mvm *mvm)
{
u16 rx_chain;
u8 rx_ant = mvm->nvm_data->valid_rx_ant;
u8 rx_ant = iwl_fw_valid_rx_ant(mvm->fw);

rx_chain = rx_ant << PHY_RX_CHAIN_VALID_POS;
rx_chain |= rx_ant << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS;
Expand Down Expand Up @@ -115,7 +115,7 @@ iwl_mvm_scan_rate_n_flags(struct iwl_mvm *mvm, enum ieee80211_band band,
u32 tx_ant;

mvm->scan_last_antenna_idx =
iwl_mvm_next_antenna(mvm, mvm->nvm_data->valid_tx_ant,
iwl_mvm_next_antenna(mvm, iwl_fw_valid_tx_ant(mvm->fw),
mvm->scan_last_antenna_idx);
tx_ant = BIT(mvm->scan_last_antenna_idx) << RATE_MCS_ANT_POS;

Expand Down

0 comments on commit c30efb4

Please sign in to comment.