diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2012-02-03 11:31:57 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-06 14:56:11 -0500 |
commit | 83007196037cc2d0bffd9f7afbe56d675779a6cb (patch) | |
tree | b123ce53f42ea20eb0ea53803bf9f259f019823d /drivers/net/wireless/iwlegacy/4965-rs.c | |
parent | 20c47eba7001680e62878c5b20e487a8b0b873ad (diff) |
iwlegacy: get rid of ctx structure
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/4965-rs.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/4965-rs.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/drivers/net/wireless/iwlegacy/4965-rs.c b/drivers/net/wireless/iwlegacy/4965-rs.c index ad186d9a598f..d7e2856e41d3 100644 --- a/drivers/net/wireless/iwlegacy/4965-rs.c +++ b/drivers/net/wireless/iwlegacy/4965-rs.c | |||
@@ -820,8 +820,6 @@ il4965_rs_tx_status(void *il_r, struct ieee80211_supported_band *sband, | |||
820 | u32 tx_rate; | 820 | u32 tx_rate; |
821 | struct il_scale_tbl_info tbl_type; | 821 | struct il_scale_tbl_info tbl_type; |
822 | struct il_scale_tbl_info *curr_tbl, *other_tbl, *tmp_tbl; | 822 | struct il_scale_tbl_info *curr_tbl, *other_tbl, *tmp_tbl; |
823 | struct il_station_priv *sta_priv = (void *)sta->drv_priv; | ||
824 | struct il_rxon_context *ctx = sta_priv->common.ctx; | ||
825 | 823 | ||
826 | D_RATE("get frame ack response, update rate scale win\n"); | 824 | D_RATE("get frame ack response, update rate scale win\n"); |
827 | 825 | ||
@@ -889,7 +887,7 @@ il4965_rs_tx_status(void *il_r, struct ieee80211_supported_band *sband, | |||
889 | lq_sta->missed_rate_counter++; | 887 | lq_sta->missed_rate_counter++; |
890 | if (lq_sta->missed_rate_counter > IL_MISSED_RATE_MAX) { | 888 | if (lq_sta->missed_rate_counter > IL_MISSED_RATE_MAX) { |
891 | lq_sta->missed_rate_counter = 0; | 889 | lq_sta->missed_rate_counter = 0; |
892 | il_send_lq_cmd(il, ctx, &lq_sta->lq, CMD_ASYNC, false); | 890 | il_send_lq_cmd(il, &lq_sta->lq, CMD_ASYNC, false); |
893 | } | 891 | } |
894 | /* Regardless, ignore this status info for outdated rate */ | 892 | /* Regardless, ignore this status info for outdated rate */ |
895 | return; | 893 | return; |
@@ -1181,8 +1179,6 @@ il4965_rs_switch_to_mimo2(struct il_priv *il, struct il_lq_sta *lq_sta, | |||
1181 | u16 rate_mask; | 1179 | u16 rate_mask; |
1182 | s32 rate; | 1180 | s32 rate; |
1183 | s8 is_green = lq_sta->is_green; | 1181 | s8 is_green = lq_sta->is_green; |
1184 | struct il_station_priv *sta_priv = (void *)sta->drv_priv; | ||
1185 | struct il_rxon_context *ctx = sta_priv->common.ctx; | ||
1186 | 1182 | ||
1187 | if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported) | 1183 | if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported) |
1188 | return -1; | 1184 | return -1; |
@@ -1203,7 +1199,7 @@ il4965_rs_switch_to_mimo2(struct il_priv *il, struct il_lq_sta *lq_sta, | |||
1203 | tbl->max_search = IL_MAX_SEARCH; | 1199 | tbl->max_search = IL_MAX_SEARCH; |
1204 | rate_mask = lq_sta->active_mimo2_rate; | 1200 | rate_mask = lq_sta->active_mimo2_rate; |
1205 | 1201 | ||
1206 | if (il_is_ht40_tx_allowed(il, ctx, &sta->ht_cap)) | 1202 | if (il_is_ht40_tx_allowed(il, &sta->ht_cap)) |
1207 | tbl->is_ht40 = 1; | 1203 | tbl->is_ht40 = 1; |
1208 | else | 1204 | else |
1209 | tbl->is_ht40 = 0; | 1205 | tbl->is_ht40 = 0; |
@@ -1237,8 +1233,6 @@ il4965_rs_switch_to_siso(struct il_priv *il, struct il_lq_sta *lq_sta, | |||
1237 | u16 rate_mask; | 1233 | u16 rate_mask; |
1238 | u8 is_green = lq_sta->is_green; | 1234 | u8 is_green = lq_sta->is_green; |
1239 | s32 rate; | 1235 | s32 rate; |
1240 | struct il_station_priv *sta_priv = (void *)sta->drv_priv; | ||
1241 | struct il_rxon_context *ctx = sta_priv->common.ctx; | ||
1242 | 1236 | ||
1243 | if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported) | 1237 | if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported) |
1244 | return -1; | 1238 | return -1; |
@@ -1251,7 +1245,7 @@ il4965_rs_switch_to_siso(struct il_priv *il, struct il_lq_sta *lq_sta, | |||
1251 | tbl->max_search = IL_MAX_SEARCH; | 1245 | tbl->max_search = IL_MAX_SEARCH; |
1252 | rate_mask = lq_sta->active_siso_rate; | 1246 | rate_mask = lq_sta->active_siso_rate; |
1253 | 1247 | ||
1254 | if (il_is_ht40_tx_allowed(il, ctx, &sta->ht_cap)) | 1248 | if (il_is_ht40_tx_allowed(il, &sta->ht_cap)) |
1255 | tbl->is_ht40 = 1; | 1249 | tbl->is_ht40 = 1; |
1256 | else | 1250 | else |
1257 | tbl->is_ht40 = 0; | 1251 | tbl->is_ht40 = 0; |
@@ -1730,8 +1724,7 @@ il4965_rs_stay_in_table(struct il_lq_sta *lq_sta, bool force_search) | |||
1730 | * setup rate table in uCode | 1724 | * setup rate table in uCode |
1731 | */ | 1725 | */ |
1732 | static void | 1726 | static void |
1733 | il4965_rs_update_rate_tbl(struct il_priv *il, struct il_rxon_context *ctx, | 1727 | il4965_rs_update_rate_tbl(struct il_priv *il, struct il_lq_sta *lq_sta, |
1734 | struct il_lq_sta *lq_sta, | ||
1735 | struct il_scale_tbl_info *tbl, int idx, u8 is_green) | 1728 | struct il_scale_tbl_info *tbl, int idx, u8 is_green) |
1736 | { | 1729 | { |
1737 | u32 rate; | 1730 | u32 rate; |
@@ -1739,7 +1732,7 @@ il4965_rs_update_rate_tbl(struct il_priv *il, struct il_rxon_context *ctx, | |||
1739 | /* Update uCode's rate table. */ | 1732 | /* Update uCode's rate table. */ |
1740 | rate = il4965_rate_n_flags_from_tbl(il, tbl, idx, is_green); | 1733 | rate = il4965_rate_n_flags_from_tbl(il, tbl, idx, is_green); |
1741 | il4965_rs_fill_link_cmd(il, lq_sta, rate); | 1734 | il4965_rs_fill_link_cmd(il, lq_sta, rate); |
1742 | il_send_lq_cmd(il, ctx, &lq_sta->lq, CMD_ASYNC, false); | 1735 | il_send_lq_cmd(il, &lq_sta->lq, CMD_ASYNC, false); |
1743 | } | 1736 | } |
1744 | 1737 | ||
1745 | /* | 1738 | /* |
@@ -1775,8 +1768,6 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb, | |||
1775 | s32 sr; | 1768 | s32 sr; |
1776 | u8 tid = MAX_TID_COUNT; | 1769 | u8 tid = MAX_TID_COUNT; |
1777 | struct il_tid_data *tid_data; | 1770 | struct il_tid_data *tid_data; |
1778 | struct il_station_priv *sta_priv = (void *)sta->drv_priv; | ||
1779 | struct il_rxon_context *ctx = sta_priv->common.ctx; | ||
1780 | 1771 | ||
1781 | D_RATE("rate scale calculate new rate for skb\n"); | 1772 | D_RATE("rate scale calculate new rate for skb\n"); |
1782 | 1773 | ||
@@ -1851,7 +1842,7 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb, | |||
1851 | tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); | 1842 | tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); |
1852 | /* get "active" rate info */ | 1843 | /* get "active" rate info */ |
1853 | idx = il4965_hwrate_to_plcp_idx(tbl->current_rate); | 1844 | idx = il4965_hwrate_to_plcp_idx(tbl->current_rate); |
1854 | il4965_rs_update_rate_tbl(il, ctx, lq_sta, tbl, idx, | 1845 | il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx, |
1855 | is_green); | 1846 | is_green); |
1856 | } | 1847 | } |
1857 | return; | 1848 | return; |
@@ -2054,8 +2045,7 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb, | |||
2054 | lq_update: | 2045 | lq_update: |
2055 | /* Replace uCode's rate table for the destination station. */ | 2046 | /* Replace uCode's rate table for the destination station. */ |
2056 | if (update_lq) | 2047 | if (update_lq) |
2057 | il4965_rs_update_rate_tbl(il, ctx, lq_sta, tbl, idx, | 2048 | il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx, is_green); |
2058 | is_green); | ||
2059 | 2049 | ||
2060 | /* Should we stay with this modulation mode, | 2050 | /* Should we stay with this modulation mode, |
2061 | * or search for a new one? */ | 2051 | * or search for a new one? */ |
@@ -2095,7 +2085,7 @@ lq_update: | |||
2095 | D_RATE("Switch current mcs: %X idx: %d\n", | 2085 | D_RATE("Switch current mcs: %X idx: %d\n", |
2096 | tbl->current_rate, idx); | 2086 | tbl->current_rate, idx); |
2097 | il4965_rs_fill_link_cmd(il, lq_sta, tbl->current_rate); | 2087 | il4965_rs_fill_link_cmd(il, lq_sta, tbl->current_rate); |
2098 | il_send_lq_cmd(il, ctx, &lq_sta->lq, CMD_ASYNC, false); | 2088 | il_send_lq_cmd(il, &lq_sta->lq, CMD_ASYNC, false); |
2099 | } else | 2089 | } else |
2100 | done_search = 1; | 2090 | done_search = 1; |
2101 | } | 2091 | } |
@@ -2167,13 +2157,11 @@ il4965_rs_initialize_lq(struct il_priv *il, struct ieee80211_conf *conf, | |||
2167 | u8 active_tbl = 0; | 2157 | u8 active_tbl = 0; |
2168 | u8 valid_tx_ant; | 2158 | u8 valid_tx_ant; |
2169 | struct il_station_priv *sta_priv; | 2159 | struct il_station_priv *sta_priv; |
2170 | struct il_rxon_context *ctx; | ||
2171 | 2160 | ||
2172 | if (!sta || !lq_sta) | 2161 | if (!sta || !lq_sta) |
2173 | return; | 2162 | return; |
2174 | 2163 | ||
2175 | sta_priv = (void *)sta->drv_priv; | 2164 | sta_priv = (void *)sta->drv_priv; |
2176 | ctx = sta_priv->common.ctx; | ||
2177 | 2165 | ||
2178 | i = lq_sta->last_txrate_idx; | 2166 | i = lq_sta->last_txrate_idx; |
2179 | 2167 | ||
@@ -2205,7 +2193,7 @@ il4965_rs_initialize_lq(struct il_priv *il, struct ieee80211_conf *conf, | |||
2205 | il4965_rs_set_expected_tpt_table(lq_sta, tbl); | 2193 | il4965_rs_set_expected_tpt_table(lq_sta, tbl); |
2206 | il4965_rs_fill_link_cmd(NULL, lq_sta, rate); | 2194 | il4965_rs_fill_link_cmd(NULL, lq_sta, rate); |
2207 | il->stations[lq_sta->lq.sta_id].lq = &lq_sta->lq; | 2195 | il->stations[lq_sta->lq.sta_id].lq = &lq_sta->lq; |
2208 | il_send_lq_cmd(il, ctx, &lq_sta->lq, CMD_SYNC, true); | 2196 | il_send_lq_cmd(il, &lq_sta->lq, CMD_SYNC, true); |
2209 | } | 2197 | } |
2210 | 2198 | ||
2211 | static void | 2199 | static void |
@@ -2576,9 +2564,6 @@ il4965_rs_sta_dbgfs_scale_table_write(struct file *file, | |||
2576 | char buf[64]; | 2564 | char buf[64]; |
2577 | size_t buf_size; | 2565 | size_t buf_size; |
2578 | u32 parsed_rate; | 2566 | u32 parsed_rate; |
2579 | struct il_station_priv *sta_priv = | ||
2580 | container_of(lq_sta, struct il_station_priv, lq_sta); | ||
2581 | struct il_rxon_context *ctx = sta_priv->common.ctx; | ||
2582 | 2567 | ||
2583 | il = lq_sta->drv; | 2568 | il = lq_sta->drv; |
2584 | memset(buf, 0, sizeof(buf)); | 2569 | memset(buf, 0, sizeof(buf)); |
@@ -2600,7 +2585,7 @@ il4965_rs_sta_dbgfs_scale_table_write(struct file *file, | |||
2600 | 2585 | ||
2601 | if (lq_sta->dbg_fixed_rate) { | 2586 | if (lq_sta->dbg_fixed_rate) { |
2602 | il4965_rs_fill_link_cmd(NULL, lq_sta, lq_sta->dbg_fixed_rate); | 2587 | il4965_rs_fill_link_cmd(NULL, lq_sta, lq_sta->dbg_fixed_rate); |
2603 | il_send_lq_cmd(lq_sta->drv, ctx, &lq_sta->lq, CMD_ASYNC, false); | 2588 | il_send_lq_cmd(lq_sta->drv, &lq_sta->lq, CMD_ASYNC, false); |
2604 | } | 2589 | } |
2605 | 2590 | ||
2606 | return count; | 2591 | return count; |