aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-05-15 06:55:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:48:09 -0400
commit2e92e6f2c50b4baf85cca968f0e6f1b5c0df7d39 (patch)
treee845c2f3af6d29c807c540366b97b1d886b92c91 /drivers/net/wireless/iwlwifi/iwl-4965-rs.c
parent36d6825b91bc492b65b6333c369cd96a2fc8c903 (diff)
mac80211: use rate index in TX control
This patch modifies struct ieee80211_tx_control to give band info and the rate index (instead of rate pointers) to drivers. This mostly serves to reduce the TX control structure size to make it fit into skb->cb so that the fragmentation code can put it there and we can think about passing it to drivers that way in the future. The rt2x00 driver update was done by Ivo, thanks. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 2adc2281c77c..7993a1d83025 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -862,7 +862,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
862 if (priv->band == IEEE80211_BAND_5GHZ) 862 if (priv->band == IEEE80211_BAND_5GHZ)
863 rs_index -= IWL_FIRST_OFDM_RATE; 863 rs_index -= IWL_FIRST_OFDM_RATE;
864 864
865 if ((tx_resp->control.tx_rate == NULL) || 865 if ((tx_resp->control.tx_rate_idx < 0) ||
866 (tbl_type.is_SGI ^ 866 (tbl_type.is_SGI ^
867 !!(tx_resp->control.flags & IEEE80211_TXCTL_SHORT_GI)) || 867 !!(tx_resp->control.flags & IEEE80211_TXCTL_SHORT_GI)) ||
868 (tbl_type.is_fat ^ 868 (tbl_type.is_fat ^
@@ -875,7 +875,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
875 (!!(tx_rate & RATE_MCS_GF_MSK) ^ 875 (!!(tx_rate & RATE_MCS_GF_MSK) ^
876 !!(tx_resp->control.flags & IEEE80211_TXCTL_GREEN_FIELD)) || 876 !!(tx_resp->control.flags & IEEE80211_TXCTL_GREEN_FIELD)) ||
877 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate != 877 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate !=
878 tx_resp->control.tx_rate->bitrate)) { 878 hw->wiphy->bands[tx_resp->control.band]->bitrates[tx_resp->control.tx_rate_idx].bitrate)) {
879 IWL_DEBUG_RATE("initial rate does not match 0x%x\n", tx_rate); 879 IWL_DEBUG_RATE("initial rate does not match 0x%x\n", tx_rate);
880 goto out; 880 goto out;
881 } 881 }
@@ -2154,7 +2154,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
2154 fc = le16_to_cpu(hdr->frame_control); 2154 fc = le16_to_cpu(hdr->frame_control);
2155 if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) || 2155 if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) ||
2156 !sta || !sta->rate_ctrl_priv) { 2156 !sta || !sta->rate_ctrl_priv) {
2157 sel->rate = rate_lowest(local, sband, sta); 2157 sel->rate_idx = rate_lowest_index(local, sband, sta);
2158 goto out; 2158 goto out;
2159 } 2159 }
2160 2160
@@ -2184,11 +2184,13 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
2184 2184
2185done: 2185done:
2186 if ((i < 0) || (i > IWL_RATE_COUNT)) { 2186 if ((i < 0) || (i > IWL_RATE_COUNT)) {
2187 sel->rate = rate_lowest(local, sband, sta); 2187 sel->rate_idx = rate_lowest_index(local, sband, sta);
2188 goto out; 2188 goto out;
2189 } 2189 }
2190 2190
2191 sel->rate = &priv->ieee_rates[i]; 2191 if (sband->band == IEEE80211_BAND_5GHZ)
2192 i -= IWL_FIRST_OFDM_RATE;
2193 sel->rate_idx = i;
2192out: 2194out:
2193 rcu_read_unlock(); 2195 rcu_read_unlock();
2194} 2196}