Commit 5d0bef90 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville

iwlegacy: random 3945-rs.c cleanups

Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5bf0dac4
...@@ -112,12 +112,10 @@ il3945_get_rate_idx_by_rssi(s32 rssi, enum ieee80211_band band) ...@@ -112,12 +112,10 @@ il3945_get_rate_idx_by_rssi(s32 rssi, enum ieee80211_band band)
tpt_table = il3945_tpt_table_g; tpt_table = il3945_tpt_table_g;
table_size = ARRAY_SIZE(il3945_tpt_table_g); table_size = ARRAY_SIZE(il3945_tpt_table_g);
break; break;
case IEEE80211_BAND_5GHZ: case IEEE80211_BAND_5GHZ:
tpt_table = il3945_tpt_table_a; tpt_table = il3945_tpt_table_a;
table_size = ARRAY_SIZE(il3945_tpt_table_a); table_size = ARRAY_SIZE(il3945_tpt_table_a);
break; break;
default: default:
BUG(); BUG();
break; break;
...@@ -126,7 +124,7 @@ il3945_get_rate_idx_by_rssi(s32 rssi, enum ieee80211_band band) ...@@ -126,7 +124,7 @@ il3945_get_rate_idx_by_rssi(s32 rssi, enum ieee80211_band band)
while (idx < table_size && rssi < tpt_table[idx].min_rssi) while (idx < table_size && rssi < tpt_table[idx].min_rssi)
idx++; idx++;
idx = min(idx, (table_size - 1)); idx = min(idx, table_size - 1);
return tpt_table[idx].idx; return tpt_table[idx].idx;
} }
...@@ -328,7 +326,6 @@ il3945_collect_tx_data(struct il3945_rs_sta *rs_sta, ...@@ -328,7 +326,6 @@ il3945_collect_tx_data(struct il3945_rs_sta *rs_sta,
win->stamp = jiffies; win->stamp = jiffies;
spin_unlock_irqrestore(&rs_sta->lock, flags); spin_unlock_irqrestore(&rs_sta->lock, flags);
} }
/* /*
...@@ -386,8 +383,7 @@ il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id) ...@@ -386,8 +383,7 @@ il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id)
/* For 5 GHz band it start at IL_FIRST_OFDM_RATE */ /* For 5 GHz band it start at IL_FIRST_OFDM_RATE */
if (sband->band == IEEE80211_BAND_5GHZ) { if (sband->band == IEEE80211_BAND_5GHZ) {
rs_sta->last_txrate_idx += IL_FIRST_OFDM_RATE; rs_sta->last_txrate_idx += IL_FIRST_OFDM_RATE;
il->_3945.sta_supp_rates = il->_3945.sta_supp_rates <<= IL_FIRST_OFDM_RATE;
il->_3945.sta_supp_rates << IL_FIRST_OFDM_RATE;
} }
out: out:
...@@ -406,7 +402,6 @@ il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) ...@@ -406,7 +402,6 @@ il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
static void static void
il3945_rs_free(void *il) il3945_rs_free(void *il)
{ {
return;
} }
static void * static void *
...@@ -791,19 +786,16 @@ il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta, void *il_sta, ...@@ -791,19 +786,16 @@ il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta, void *il_sta,
switch (scale_action) { switch (scale_action) {
case -1: case -1:
/* Decrese rate */ /* Decrese rate */
if (low != RATE_INVALID) if (low != RATE_INVALID)
idx = low; idx = low;
break; break;
case 1: case 1:
/* Increase rate */ /* Increase rate */
if (high != RATE_INVALID) if (high != RATE_INVALID)
idx = high; idx = high;
break; break;
case 0: case 0:
default: default:
/* No change */ /* No change */
...@@ -958,7 +950,6 @@ il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) ...@@ -958,7 +950,6 @@ il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
} else } else
rs_sta->expected_tpt = il3945_expected_tpt_g; rs_sta->expected_tpt = il3945_expected_tpt_g;
break; break;
case IEEE80211_BAND_5GHZ: case IEEE80211_BAND_5GHZ:
rs_sta->expected_tpt = il3945_expected_tpt_a; rs_sta->expected_tpt = il3945_expected_tpt_a;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment