diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-10 20:45:11 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-15 16:48:24 -0400 |
commit | 323ce79a9cdbf838ea577677b1ddace8e0b4d4c6 (patch) | |
tree | f14a67ec7927865dc1537b2c3a4fb20c0325f517 /net/mac80211 | |
parent | b7e35008815a1c39123f4dd53b430788e2e18da4 (diff) |
mac80211: share sta->supp_rates
As more preparation for a saner rate control algorithm API,
share the supported rates bitmap in the public API.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/cfg.c | 2 | ||||
-rw-r--r-- | net/mac80211/mesh_plink.c | 4 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 12 | ||||
-rw-r--r-- | net/mac80211/rate.h | 2 | ||||
-rw-r--r-- | net/mac80211/sta_info.h | 2 |
5 files changed, 10 insertions, 12 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index ed5e77ce627b..47988d2eb15c 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -667,7 +667,7 @@ static void sta_apply_parameters(struct ieee80211_local *local, | |||
667 | rates |= BIT(j); | 667 | rates |= BIT(j); |
668 | } | 668 | } |
669 | } | 669 | } |
670 | sta->supp_rates[local->oper_channel->band] = rates; | 670 | sta->sta.supp_rates[local->oper_channel->band] = rates; |
671 | } | 671 | } |
672 | 672 | ||
673 | if (params->ht_capa) { | 673 | if (params->ht_capa) { |
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index debf7834dbc6..faac101c0f85 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -106,7 +106,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata, | |||
106 | return NULL; | 106 | return NULL; |
107 | 107 | ||
108 | sta->flags = WLAN_STA_AUTHORIZED; | 108 | sta->flags = WLAN_STA_AUTHORIZED; |
109 | sta->supp_rates[local->hw.conf.channel->band] = rates; | 109 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; |
110 | 110 | ||
111 | return sta; | 111 | return sta; |
112 | } | 112 | } |
@@ -243,7 +243,7 @@ void mesh_neighbour_update(u8 *hw_addr, u64 rates, struct ieee80211_sub_if_data | |||
243 | } | 243 | } |
244 | 244 | ||
245 | sta->last_rx = jiffies; | 245 | sta->last_rx = jiffies; |
246 | sta->supp_rates[local->hw.conf.channel->band] = rates; | 246 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; |
247 | if (peer_accepting_plinks && sta->plink_state == PLINK_LISTEN && | 247 | if (peer_accepting_plinks && sta->plink_state == PLINK_LISTEN && |
248 | sdata->u.mesh.accepting_plinks && | 248 | sdata->u.mesh.accepting_plinks && |
249 | sdata->u.mesh.mshcfg.auto_open_plinks) | 249 | sdata->u.mesh.mshcfg.auto_open_plinks) |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 35c421b89dd2..c049f336e58a 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1301,7 +1301,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
1301 | } | 1301 | } |
1302 | } | 1302 | } |
1303 | 1303 | ||
1304 | sta->supp_rates[local->hw.conf.channel->band] = rates; | 1304 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; |
1305 | sdata->bss_conf.basic_rates = basic_rates; | 1305 | sdata->bss_conf.basic_rates = basic_rates; |
1306 | 1306 | ||
1307 | /* cf. IEEE 802.11 9.2.12 */ | 1307 | /* cf. IEEE 802.11 9.2.12 */ |
@@ -1497,13 +1497,13 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
1497 | if (sta) { | 1497 | if (sta) { |
1498 | u64 prev_rates; | 1498 | u64 prev_rates; |
1499 | 1499 | ||
1500 | prev_rates = sta->supp_rates[band]; | 1500 | prev_rates = sta->sta.supp_rates[band]; |
1501 | /* make sure mandatory rates are always added */ | 1501 | /* make sure mandatory rates are always added */ |
1502 | sta->supp_rates[band] = supp_rates | | 1502 | sta->sta.supp_rates[band] = supp_rates | |
1503 | ieee80211_mandatory_rates(local, band); | 1503 | ieee80211_mandatory_rates(local, band); |
1504 | 1504 | ||
1505 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 1505 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
1506 | if (sta->supp_rates[band] != prev_rates) | 1506 | if (sta->sta.supp_rates[band] != prev_rates) |
1507 | printk(KERN_DEBUG "%s: updated supp_rates set " | 1507 | printk(KERN_DEBUG "%s: updated supp_rates set " |
1508 | "for %s based on beacon info (0x%llx | " | 1508 | "for %s based on beacon info (0x%llx | " |
1509 | "0x%llx -> 0x%llx)\n", | 1509 | "0x%llx -> 0x%llx)\n", |
@@ -1511,7 +1511,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
1511 | print_mac(mac, sta->sta.addr), | 1511 | print_mac(mac, sta->sta.addr), |
1512 | (unsigned long long) prev_rates, | 1512 | (unsigned long long) prev_rates, |
1513 | (unsigned long long) supp_rates, | 1513 | (unsigned long long) supp_rates, |
1514 | (unsigned long long) sta->supp_rates[band]); | 1514 | (unsigned long long) sta->sta.supp_rates[band]); |
1515 | #endif | 1515 | #endif |
1516 | } else { | 1516 | } else { |
1517 | ieee80211_ibss_add_sta(sdata, NULL, mgmt->bssid, | 1517 | ieee80211_ibss_add_sta(sdata, NULL, mgmt->bssid, |
@@ -2339,7 +2339,7 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | |||
2339 | set_sta_flags(sta, WLAN_STA_AUTHORIZED); | 2339 | set_sta_flags(sta, WLAN_STA_AUTHORIZED); |
2340 | 2340 | ||
2341 | /* make sure mandatory rates are always added */ | 2341 | /* make sure mandatory rates are always added */ |
2342 | sta->supp_rates[band] = supp_rates | | 2342 | sta->sta.supp_rates[band] = supp_rates | |
2343 | ieee80211_mandatory_rates(local, band); | 2343 | ieee80211_mandatory_rates(local, band); |
2344 | 2344 | ||
2345 | rate_control_rate_init(sta, local); | 2345 | rate_control_rate_init(sta, local); |
diff --git a/net/mac80211/rate.h b/net/mac80211/rate.h index ede7ab56f65b..5f18c27eb900 100644 --- a/net/mac80211/rate.h +++ b/net/mac80211/rate.h | |||
@@ -134,7 +134,7 @@ static inline int rate_supported(struct sta_info *sta, | |||
134 | enum ieee80211_band band, | 134 | enum ieee80211_band band, |
135 | int index) | 135 | int index) |
136 | { | 136 | { |
137 | return (sta == NULL || sta->supp_rates[band] & BIT(index)); | 137 | return (sta == NULL || sta->sta.supp_rates[band] & BIT(index)); |
138 | } | 138 | } |
139 | 139 | ||
140 | static inline s8 | 140 | static inline s8 |
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index df42d1815458..4dafa044b2f2 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -168,7 +168,6 @@ struct sta_ampdu_mlme { | |||
168 | * in the header file. | 168 | * in the header file. |
169 | * @flaglock: spinlock for flags accesses | 169 | * @flaglock: spinlock for flags accesses |
170 | * @ht_info: HT capabilities of this STA | 170 | * @ht_info: HT capabilities of this STA |
171 | * @supp_rates: Bitmap of supported rates (per band) | ||
172 | * @addr: MAC address of this STA | 171 | * @addr: MAC address of this STA |
173 | * @aid: STA's unique AID (1..2007, 0 = not assigned yet), | 172 | * @aid: STA's unique AID (1..2007, 0 = not assigned yet), |
174 | * only used in AP (and IBSS?) mode | 173 | * only used in AP (and IBSS?) mode |
@@ -228,7 +227,6 @@ struct sta_info { | |||
228 | spinlock_t lock; | 227 | spinlock_t lock; |
229 | spinlock_t flaglock; | 228 | spinlock_t flaglock; |
230 | struct ieee80211_ht_info ht_info; | 229 | struct ieee80211_ht_info ht_info; |
231 | u64 supp_rates[IEEE80211_NUM_BANDS]; | ||
232 | 230 | ||
233 | u16 listen_interval; | 231 | u16 listen_interval; |
234 | 232 | ||