diff options
author | Daniel Drake <dsd@gentoo.org> | 2006-05-01 17:45:50 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-05-05 17:10:41 -0400 |
commit | 8462fe3cd9ec8951871a20a4dfe36321ab075964 (patch) | |
tree | 8b3c6db6091ee99b4791a911734229181ef6f473 /net/ieee80211/softmac/ieee80211softmac_assoc.c | |
parent | 461c078c9cdfc1d24a436a87daed90f18c3b0d0d (diff) |
[PATCH] softmac: suggest per-frame-type TX rate
This patch is the first step towards rate control inside softmac.
The txrates substructure has been extended to provide
different fields for different types of packets (management/data,
unicast/multicast). These fields are updated on association to values
compatible with the access point we are associating to.
Drivers can then use the new ieee80211softmac_suggest_txrate() function
call when deciding which rate to transmit each frame at. This is
immensely useful for ZD1211, and bcm can use it too.
The user can still specify a rate through iwconfig, which is matched
for all transmissions (assuming the rate they have specified is in
the rate set required by the AP).
At a later date, we can incorporate automatic rate management into
the ieee80211softmac_recalc_txrates() function.
This patch also removes the mcast_fallback field. Sam Leffler pointed
out that this field is meaningless, because no driver will ever be
retransmitting mcast frames (they are not acked).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_assoc.c')
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_assoc.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c index 01f21334767c..5d90b9a6ee50 100644 --- a/net/ieee80211/softmac/ieee80211softmac_assoc.c +++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c | |||
@@ -96,6 +96,7 @@ ieee80211softmac_disassoc(struct ieee80211softmac_device *mac) | |||
96 | mac->associated = 0; | 96 | mac->associated = 0; |
97 | mac->associnfo.bssvalid = 0; | 97 | mac->associnfo.bssvalid = 0; |
98 | mac->associnfo.associating = 0; | 98 | mac->associnfo.associating = 0; |
99 | ieee80211softmac_init_txrates(mac); | ||
99 | ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_DISASSOCIATED, NULL); | 100 | ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_DISASSOCIATED, NULL); |
100 | spin_unlock_irqrestore(&mac->lock, flags); | 101 | spin_unlock_irqrestore(&mac->lock, flags); |
101 | } | 102 | } |
@@ -118,24 +119,15 @@ ieee80211softmac_send_disassoc_req(struct ieee80211softmac_device *mac, u16 reas | |||
118 | static inline int | 119 | static inline int |
119 | we_support_all_basic_rates(struct ieee80211softmac_device *mac, u8 *from, u8 from_len) | 120 | we_support_all_basic_rates(struct ieee80211softmac_device *mac, u8 *from, u8 from_len) |
120 | { | 121 | { |
121 | int idx, search, found; | 122 | int idx; |
122 | u8 rate, search_rate; | 123 | u8 rate; |
123 | 124 | ||
124 | for (idx = 0; idx < (from_len); idx++) { | 125 | for (idx = 0; idx < (from_len); idx++) { |
125 | rate = (from)[idx]; | 126 | rate = (from)[idx]; |
126 | if (!(rate & IEEE80211_BASIC_RATE_MASK)) | 127 | if (!(rate & IEEE80211_BASIC_RATE_MASK)) |
127 | continue; | 128 | continue; |
128 | found = 0; | ||
129 | rate &= ~IEEE80211_BASIC_RATE_MASK; | 129 | rate &= ~IEEE80211_BASIC_RATE_MASK; |
130 | for (search = 0; search < mac->ratesinfo.count; search++) { | 130 | if (!ieee80211softmac_ratesinfo_rate_supported(&mac->ratesinfo, rate)) |
131 | search_rate = mac->ratesinfo.rates[search]; | ||
132 | search_rate &= ~IEEE80211_BASIC_RATE_MASK; | ||
133 | if (rate == search_rate) { | ||
134 | found = 1; | ||
135 | break; | ||
136 | } | ||
137 | } | ||
138 | if (!found) | ||
139 | return 0; | 131 | return 0; |
140 | } | 132 | } |
141 | return 1; | 133 | return 1; |
@@ -310,6 +302,9 @@ ieee80211softmac_associated(struct ieee80211softmac_device *mac, | |||
310 | struct ieee80211softmac_network *net) | 302 | struct ieee80211softmac_network *net) |
311 | { | 303 | { |
312 | mac->associnfo.associating = 0; | 304 | mac->associnfo.associating = 0; |
305 | mac->associnfo.supported_rates = net->supported_rates; | ||
306 | ieee80211softmac_recalc_txrates(mac); | ||
307 | |||
313 | mac->associated = 1; | 308 | mac->associated = 1; |
314 | if (mac->set_bssid_filter) | 309 | if (mac->set_bssid_filter) |
315 | mac->set_bssid_filter(mac->dev, net->bssid); | 310 | mac->set_bssid_filter(mac->dev, net->bssid); |