return added;
}
-static inline u32
-il4965_ant_idx_to_flags(u8 ant_idx)
-{
- return BIT(ant_idx) << RATE_MCS_ANT_POS;
-}
-
static void
il4965_toggle_tx_ant(struct il_priv *il, u8 *ant, u8 valid)
{
rx_ant = il->cfg->scan_rx_antennas[band];
il4965_toggle_tx_ant(il, &il->scan_tx_ant[band], scan_tx_antennas);
- rate_flags |= il4965_ant_idx_to_flags(il->scan_tx_ant[band]);
- scan->tx_cmd.rate_n_flags =
- il4965_hw_set_rate_n_flags(rate, rate_flags);
+ rate_flags |= BIT(il->scan_tx_ant[band]) << RATE_MCS_ANT_POS;
+ scan->tx_cmd.rate_n_flags = cpu_to_le32(rate | rate_flags);
/* In power save mode use one chain, otherwise use all chains */
if (test_bit(S_POWER_PMI, &il->status)) {
tx_cmd->next_frame_len = 0;
}
-#define RTS_DFAULT_RETRY_LIMIT 60
-
static void
il4965_tx_cmd_build_rate(struct il_priv *il, struct il_tx_cmd *tx_cmd,
struct ieee80211_tx_info *info, __le16 fc)
{
+ const u8 rts_retry_limit = 60;
u32 rate_flags;
int rate_idx;
- u8 rts_retry_limit;
u8 data_retry_limit;
u8 rate_plcp;
else
data_retry_limit = IL4965_DEFAULT_TX_RETRY;
tx_cmd->data_retry_limit = data_retry_limit;
-
/* Set retry limit on RTS packets */
- rts_retry_limit = RTS_DFAULT_RETRY_LIMIT;
- if (data_retry_limit < rts_retry_limit)
- rts_retry_limit = data_retry_limit;
- tx_cmd->rts_retry_limit = rts_retry_limit;
+ tx_cmd->rts_retry_limit = min(data_retry_limit, rts_retry_limit);
/* DATA packets will use the uCode station table for rate/antenna
* selection */
/* Set up antennas */
il4965_toggle_tx_ant(il, &il->mgmt_tx_ant, il->hw_params.valid_tx_ant);
- rate_flags |= il4965_ant_idx_to_flags(il->mgmt_tx_ant);
+ rate_flags |= BIT(il->mgmt_tx_ant) << RATE_MCS_ANT_POS;
/* Set the rate in the TX cmd */
- tx_cmd->rate_n_flags =
- il4965_hw_set_rate_n_flags(rate_plcp, rate_flags);
+ tx_cmd->rate_n_flags = cpu_to_le32(rate_plcp | rate_flags);
}
static void
rate_flags |=
il4965_first_antenna(il->hw_params.
valid_tx_ant) << RATE_MCS_ANT_POS;
- rate_n_flags = il4965_hw_set_rate_n_flags(il_rates[r].plcp, rate_flags);
+ rate_n_flags = cpu_to_le32(il_rates[r].plcp | rate_flags);
for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++)
link_cmd->rs_table[i].rate_n_flags = rate_n_flags;
/* Set up packet rate and flags */
rate = il_get_lowest_plcp(il, il->beacon_ctx);
il4965_toggle_tx_ant(il, &il->mgmt_tx_ant, il->hw_params.valid_tx_ant);
- rate_flags = il4965_ant_idx_to_flags(il->mgmt_tx_ant);
+ rate_flags = BIT(il->mgmt_tx_ant) << RATE_MCS_ANT_POS;
if ((rate >= IL_FIRST_CCK_RATE) && (rate <= IL_LAST_CCK_RATE))
rate_flags |= RATE_MCS_CCK_MSK;
- tx_beacon_cmd->tx.rate_n_flags =
- il4965_hw_set_rate_n_flags(rate, rate_flags);
+ tx_beacon_cmd->tx.rate_n_flags = cpu_to_le32(rate | rate_flags);
return sizeof(*tx_beacon_cmd) + frame_size;
}