Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159258
b: refs/heads/master
c: e3139fe
h: refs/heads/master
v: v3
  • Loading branch information
Wey-Yi Guy authored and John W. Linville committed Jul 27, 2009
1 parent 394aa0b commit b1ef826
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 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: 21f5fc75deca63bc41c9d13007d35981d4485622
refs/heads/master: e3139fe741b25a0f8a27fd2cdf2ad11734c3d4d3
37 changes: 32 additions & 5 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,25 @@ static void rs_stay_in_table(struct iwl_lq_sta *lq_sta)
}
}

/*
* setup rate table in uCode
* return rate_n_flags as used in the table
*/
static u32 rs_update_rate_tbl(struct iwl_priv *priv,
struct iwl_lq_sta *lq_sta,
struct iwl_scale_tbl_info *tbl,
int index, u8 is_green)
{
u32 rate;

/* Update uCode's rate table. */
rate = rate_n_flags_from_tbl(priv, tbl, index, is_green);
rs_fill_link_cmd(priv, lq_sta, rate);
iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC);

return rate;
}

/*
* Do rate scaling and search for new modulation mode.
*/
Expand Down Expand Up @@ -2098,6 +2117,16 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,

if (!((1 << index) & rate_scale_index_msk)) {
IWL_ERR(priv, "Current Rate is not valid\n");
if (lq_sta->search_better_tbl) {
/* revert to active table if search table is not valid*/
tbl->lq_type = LQ_NONE;
lq_sta->search_better_tbl = 0;
tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
/* get "active" rate info */
index = iwl_hwrate_to_plcp_idx(tbl->current_rate);
rate = rs_update_rate_tbl(priv, lq_sta,
tbl, index, is_green);
}
return;
}

Expand Down Expand Up @@ -2308,11 +2337,9 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,

lq_update:
/* Replace uCode's rate table for the destination station. */
if (update_lq) {
rate = rate_n_flags_from_tbl(priv, tbl, index, is_green);
rs_fill_link_cmd(priv, lq_sta, rate);
iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC);
}
if (update_lq)
rate = rs_update_rate_tbl(priv, lq_sta,
tbl, index, is_green);

/* Should we stay with this modulation mode, or search for a new one? */
rs_stay_in_table(lq_sta);
Expand Down

0 comments on commit b1ef826

Please sign in to comment.