Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279453
b: refs/heads/master
c: 616107e
h: refs/heads/master
i:
  279451: 725398f
v: v3
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Jan 4, 2012
1 parent 51e5c28 commit 0d2f757
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 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: a0c1ef3b12f88c0ed7683472395145e491808b4b
refs/heads/master: 616107ed818876076bc482d3a33f89c31297b86e
33 changes: 9 additions & 24 deletions trunk/drivers/net/wireless/iwlegacy/4965-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,12 +819,6 @@ il4965_get_channels_for_scan(struct il_priv *il, struct ieee80211_vif *vif,
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)
{
Expand Down Expand Up @@ -976,9 +970,8 @@ il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
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)) {
Expand Down Expand Up @@ -1530,15 +1523,13 @@ il4965_tx_cmd_build_basic(struct il_priv *il, struct sk_buff *skb,
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;

Expand All @@ -1548,12 +1539,8 @@ il4965_tx_cmd_build_rate(struct il_priv *il, struct il_tx_cmd *tx_cmd,
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 */
Expand Down Expand Up @@ -1589,11 +1576,10 @@ il4965_tx_cmd_build_rate(struct il_priv *il, struct il_tx_cmd *tx_cmd,

/* 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
Expand Down Expand Up @@ -2753,7 +2739,7 @@ il4965_sta_alloc_lq(struct il_priv *il, u8 sta_id)
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;

Expand Down Expand Up @@ -3538,11 +3524,10 @@ il4965_hw_get_beacon_cmd(struct il_priv *il, struct il_frame *frame)
/* 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;
}
Expand Down
6 changes: 0 additions & 6 deletions trunk/drivers/net/wireless/iwlegacy/4965.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,6 @@ il4965_hw_get_rate(__le32 rate_n_flags)
return le32_to_cpu(rate_n_flags) & 0xFF;
}

static inline __le32
il4965_hw_set_rate_n_flags(u8 rate, u32 flags)
{
return cpu_to_le32(flags | (u32) rate);
}

/* eeprom */
void il4965_eeprom_get_mac(const struct il_priv *il, u8 * mac);
int il4965_eeprom_acquire_semaphore(struct il_priv *il);
Expand Down

0 comments on commit 0d2f757

Please sign in to comment.