diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-08-28 17:01:54 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:48:50 -0400 |
commit | 13262ffd4902805acad2618c12b41fcaa6c50791 (patch) | |
tree | 2c5c250435c8464aa4c36253b3a86804e3a54814 | |
parent | d6f2da5b33911a31eb61e1790ef8e555e9605837 (diff) |
[MAC80211]: Remove bitfields from struct ieee80211_sub_if_data
mac80211, remove bitfields from struct ieee80211_sub_if_data
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 2 | ||||
-rw-r--r-- | net/mac80211/ieee80211.c | 30 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 18 | ||||
-rw-r--r-- | net/mac80211/ieee80211_ioctl.c | 20 | ||||
-rw-r--r-- | net/mac80211/ieee80211_sta.c | 19 | ||||
-rw-r--r-- | net/mac80211/rx.c | 4 | ||||
-rw-r--r-- | net/mac80211/tx.c | 18 | ||||
-rw-r--r-- | net/mac80211/util.c | 6 |
8 files changed, 67 insertions, 50 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 099dac95b09b..8ceda33efc12 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -118,7 +118,7 @@ static ssize_t ieee80211_if_fmt_flags( | |||
118 | sdata->u.sta.flags & IEEE80211_STA_AUTHENTICATED ? "AUTH\n" : "", | 118 | sdata->u.sta.flags & IEEE80211_STA_AUTHENTICATED ? "AUTH\n" : "", |
119 | sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED ? "ASSOC\n" : "", | 119 | sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED ? "ASSOC\n" : "", |
120 | sdata->u.sta.flags & IEEE80211_STA_PROBEREQ_POLL ? "PROBEREQ POLL\n" : "", | 120 | sdata->u.sta.flags & IEEE80211_STA_PROBEREQ_POLL ? "PROBEREQ POLL\n" : "", |
121 | sdata->use_protection ? "CTS prot\n" : ""); | 121 | sdata->flags & IEEE80211_SDATA_USE_PROTECTION ? "CTS prot\n" : ""); |
122 | } | 122 | } |
123 | __IEEE80211_IF_FILE(flags); | 123 | __IEEE80211_IF_FILE(flags); |
124 | 124 | ||
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index be678c61afa5..50d7af3018ea 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
@@ -555,23 +555,21 @@ static void ieee80211_set_multicast_list(struct net_device *dev) | |||
555 | unsigned short flags; | 555 | unsigned short flags; |
556 | 556 | ||
557 | netif_tx_lock_nested(local->mdev, TX_LOCK_MASTER); | 557 | netif_tx_lock_nested(local->mdev, TX_LOCK_MASTER); |
558 | if (((dev->flags & IFF_ALLMULTI) != 0) ^ (sdata->allmulti != 0)) { | 558 | if (((dev->flags & IFF_ALLMULTI) != 0) ^ |
559 | if (sdata->allmulti) { | 559 | ((sdata->flags & IEEE80211_SDATA_ALLMULTI) != 0)) { |
560 | sdata->allmulti = 0; | 560 | if (sdata->flags & IEEE80211_SDATA_ALLMULTI) |
561 | local->iff_allmultis--; | 561 | local->iff_allmultis--; |
562 | } else { | 562 | else |
563 | sdata->allmulti = 1; | ||
564 | local->iff_allmultis++; | 563 | local->iff_allmultis++; |
565 | } | 564 | sdata->flags ^= IEEE80211_SDATA_ALLMULTI; |
566 | } | 565 | } |
567 | if (((dev->flags & IFF_PROMISC) != 0) ^ (sdata->promisc != 0)) { | 566 | if (((dev->flags & IFF_PROMISC) != 0) ^ |
568 | if (sdata->promisc) { | 567 | ((sdata->flags & IEEE80211_SDATA_PROMISC) != 0)) { |
569 | sdata->promisc = 0; | 568 | if (sdata->flags & IEEE80211_SDATA_PROMISC) |
570 | local->iff_promiscs--; | 569 | local->iff_promiscs--; |
571 | } else { | 570 | else |
572 | sdata->promisc = 1; | ||
573 | local->iff_promiscs++; | 571 | local->iff_promiscs++; |
574 | } | 572 | sdata->flags ^= IEEE80211_SDATA_PROMISC; |
575 | } | 573 | } |
576 | if (dev->mc_count != sdata->mc_count) { | 574 | if (dev->mc_count != sdata->mc_count) { |
577 | local->mc_count = local->mc_count - sdata->mc_count + | 575 | local->mc_count = local->mc_count - sdata->mc_count + |
@@ -740,16 +738,16 @@ void ieee80211_erp_info_change_notify(struct net_device *dev, u8 changes) | |||
740 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 738 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
741 | if (local->ops->erp_ie_changed) | 739 | if (local->ops->erp_ie_changed) |
742 | local->ops->erp_ie_changed(local_to_hw(local), changes, | 740 | local->ops->erp_ie_changed(local_to_hw(local), changes, |
743 | sdata->use_protection, | 741 | !!(sdata->flags & IEEE80211_SDATA_USE_PROTECTION), |
744 | !sdata->short_preamble); | 742 | !(sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE)); |
745 | } | 743 | } |
746 | 744 | ||
747 | void ieee80211_reset_erp_info(struct net_device *dev) | 745 | void ieee80211_reset_erp_info(struct net_device *dev) |
748 | { | 746 | { |
749 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 747 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
750 | 748 | ||
751 | sdata->short_preamble = 0; | 749 | sdata->flags &= ~(IEEE80211_SDATA_USE_PROTECTION | |
752 | sdata->use_protection = 0; | 750 | IEEE80211_SDATA_SHORT_PREAMBLE); |
753 | ieee80211_erp_info_change_notify(dev, | 751 | ieee80211_erp_info_change_notify(dev, |
754 | IEEE80211_ERP_CHANGE_PROTECTION | | 752 | IEEE80211_ERP_CHANGE_PROTECTION | |
755 | IEEE80211_ERP_CHANGE_PREAMBLE); | 753 | IEEE80211_ERP_CHANGE_PREAMBLE); |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 28c5d514e6d5..ef633a041dab 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -277,6 +277,14 @@ struct ieee80211_if_sta { | |||
277 | }; | 277 | }; |
278 | 278 | ||
279 | 279 | ||
280 | /* flags used in struct ieee80211_sub_if_data.flags */ | ||
281 | #define IEEE80211_SDATA_ALLMULTI BIT(0) | ||
282 | #define IEEE80211_SDATA_PROMISC BIT(1) | ||
283 | #define IEEE80211_SDATA_USE_PROTECTION BIT(2) /* CTS protect ERP frames */ | ||
284 | /* use short preamble with IEEE 802.11b: this flag is set when the AP or beacon | ||
285 | * generator reports that there are no present stations that cannot support short | ||
286 | * preambles */ | ||
287 | #define IEEE80211_SDATA_SHORT_PREAMBLE BIT(3) | ||
280 | struct ieee80211_sub_if_data { | 288 | struct ieee80211_sub_if_data { |
281 | struct list_head list; | 289 | struct list_head list; |
282 | unsigned int type; | 290 | unsigned int type; |
@@ -287,14 +295,8 @@ struct ieee80211_sub_if_data { | |||
287 | struct ieee80211_local *local; | 295 | struct ieee80211_local *local; |
288 | 296 | ||
289 | int mc_count; | 297 | int mc_count; |
290 | unsigned int allmulti:1; | 298 | |
291 | unsigned int promisc:1; | 299 | unsigned int flags; |
292 | unsigned int use_protection:1; /* CTS protect ERP frames */ | ||
293 | |||
294 | /* use short preamble with IEEE 802.11b: this flag is set when the AP | ||
295 | * or beacon generator reports that there are no present stations that | ||
296 | * cannot support short preambles */ | ||
297 | unsigned int short_preamble:1; | ||
298 | 300 | ||
299 | struct net_device_stats stats; | 301 | struct net_device_stats stats; |
300 | int drop_unencrypted; | 302 | int drop_unencrypted; |
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index ea2e0f958ac3..9964f057bcef 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c | |||
@@ -1063,8 +1063,12 @@ static int ieee80211_ioctl_prism2_param(struct net_device *dev, | |||
1063 | 1063 | ||
1064 | case PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES: | 1064 | case PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES: |
1065 | if (sdata->type == IEEE80211_IF_TYPE_AP) { | 1065 | if (sdata->type == IEEE80211_IF_TYPE_AP) { |
1066 | sdata->use_protection = !!value; | 1066 | if (value) |
1067 | ieee80211_erp_info_change_notify(dev, IEEE80211_ERP_CHANGE_PROTECTION); | 1067 | sdata->flags |= IEEE80211_SDATA_USE_PROTECTION; |
1068 | else | ||
1069 | sdata->flags &= ~IEEE80211_SDATA_USE_PROTECTION; | ||
1070 | ieee80211_erp_info_change_notify(dev, | ||
1071 | IEEE80211_ERP_CHANGE_PROTECTION); | ||
1068 | } else { | 1072 | } else { |
1069 | ret = -ENOENT; | 1073 | ret = -ENOENT; |
1070 | } | 1074 | } |
@@ -1072,8 +1076,12 @@ static int ieee80211_ioctl_prism2_param(struct net_device *dev, | |||
1072 | 1076 | ||
1073 | case PRISM2_PARAM_PREAMBLE: | 1077 | case PRISM2_PARAM_PREAMBLE: |
1074 | if (sdata->type != IEEE80211_IF_TYPE_AP) { | 1078 | if (sdata->type != IEEE80211_IF_TYPE_AP) { |
1075 | sdata->short_preamble = !!value; | 1079 | if (value) |
1076 | ieee80211_erp_info_change_notify(dev, IEEE80211_ERP_CHANGE_PREAMBLE); | 1080 | sdata->flags |= IEEE80211_SDATA_SHORT_PREAMBLE; |
1081 | else | ||
1082 | sdata->flags &= ~IEEE80211_SDATA_SHORT_PREAMBLE; | ||
1083 | ieee80211_erp_info_change_notify(dev, | ||
1084 | IEEE80211_ERP_CHANGE_PREAMBLE); | ||
1077 | } else { | 1085 | } else { |
1078 | ret = -ENOENT; | 1086 | ret = -ENOENT; |
1079 | } | 1087 | } |
@@ -1167,11 +1175,11 @@ static int ieee80211_ioctl_get_prism2_param(struct net_device *dev, | |||
1167 | break; | 1175 | break; |
1168 | 1176 | ||
1169 | case PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES: | 1177 | case PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES: |
1170 | *param = sdata->use_protection; | 1178 | *param = !!(sdata->flags & IEEE80211_SDATA_USE_PROTECTION); |
1171 | break; | 1179 | break; |
1172 | 1180 | ||
1173 | case PRISM2_PARAM_PREAMBLE: | 1181 | case PRISM2_PARAM_PREAMBLE: |
1174 | *param = sdata->short_preamble; | 1182 | *param = !!(sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE); |
1175 | break; | 1183 | break; |
1176 | 1184 | ||
1177 | case PRISM2_PARAM_SHORT_SLOT_TIME: | 1185 | case PRISM2_PARAM_SHORT_SLOT_TIME: |
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index 6a57333dc75c..fe94ebfcb157 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
@@ -321,7 +321,7 @@ static void ieee80211_handle_erp_ie(struct net_device *dev, u8 erp_value) | |||
321 | int preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0; | 321 | int preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0; |
322 | u8 changes = 0; | 322 | u8 changes = 0; |
323 | 323 | ||
324 | if (use_protection != sdata->use_protection) { | 324 | if (use_protection != !!(sdata->flags & IEEE80211_SDATA_USE_PROTECTION)) { |
325 | if (net_ratelimit()) { | 325 | if (net_ratelimit()) { |
326 | printk(KERN_DEBUG "%s: CTS protection %s (BSSID=" | 326 | printk(KERN_DEBUG "%s: CTS protection %s (BSSID=" |
327 | MAC_FMT ")\n", | 327 | MAC_FMT ")\n", |
@@ -329,11 +329,14 @@ static void ieee80211_handle_erp_ie(struct net_device *dev, u8 erp_value) | |||
329 | use_protection ? "enabled" : "disabled", | 329 | use_protection ? "enabled" : "disabled", |
330 | MAC_ARG(ifsta->bssid)); | 330 | MAC_ARG(ifsta->bssid)); |
331 | } | 331 | } |
332 | sdata->use_protection = use_protection; | 332 | if (use_protection) |
333 | sdata->flags |= IEEE80211_SDATA_USE_PROTECTION; | ||
334 | else | ||
335 | sdata->flags &= ~IEEE80211_SDATA_USE_PROTECTION; | ||
333 | changes |= IEEE80211_ERP_CHANGE_PROTECTION; | 336 | changes |= IEEE80211_ERP_CHANGE_PROTECTION; |
334 | } | 337 | } |
335 | 338 | ||
336 | if (!preamble_mode != sdata->short_preamble) { | 339 | if (preamble_mode != !(sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE)) { |
337 | if (net_ratelimit()) { | 340 | if (net_ratelimit()) { |
338 | printk(KERN_DEBUG "%s: switched to %s barker preamble" | 341 | printk(KERN_DEBUG "%s: switched to %s barker preamble" |
339 | " (BSSID=" MAC_FMT ")\n", | 342 | " (BSSID=" MAC_FMT ")\n", |
@@ -342,7 +345,10 @@ static void ieee80211_handle_erp_ie(struct net_device *dev, u8 erp_value) | |||
342 | "short" : "long", | 345 | "short" : "long", |
343 | MAC_ARG(ifsta->bssid)); | 346 | MAC_ARG(ifsta->bssid)); |
344 | } | 347 | } |
345 | sdata->short_preamble = !preamble_mode; | 348 | if (preamble_mode) |
349 | sdata->flags &= ~IEEE80211_SDATA_SHORT_PREAMBLE; | ||
350 | else | ||
351 | sdata->flags |= IEEE80211_SDATA_SHORT_PREAMBLE; | ||
346 | changes |= IEEE80211_ERP_CHANGE_PREAMBLE; | 352 | changes |= IEEE80211_ERP_CHANGE_PREAMBLE; |
347 | } | 353 | } |
348 | 354 | ||
@@ -2307,8 +2313,9 @@ static int ieee80211_sta_join_ibss(struct net_device *dev, | |||
2307 | "for IBSS beacon\n", dev->name); | 2313 | "for IBSS beacon\n", dev->name); |
2308 | break; | 2314 | break; |
2309 | } | 2315 | } |
2310 | control.tx_rate = (sdata->short_preamble && | 2316 | control.tx_rate = |
2311 | (rate->flags & IEEE80211_RATE_PREAMBLE2)) ? | 2317 | ((sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE) && |
2318 | (rate->flags & IEEE80211_RATE_PREAMBLE2)) ? | ||
2312 | rate->val2 : rate->val; | 2319 | rate->val2 : rate->val; |
2313 | control.antenna_sel_tx = local->hw.conf.antenna_sel_tx; | 2320 | control.antenna_sel_tx = local->hw.conf.antenna_sel_tx; |
2314 | control.power_level = local->hw.conf.power_level; | 2321 | control.power_level = local->hw.conf.power_level; |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index af94fb597415..b52e3305a8f8 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1288,7 +1288,7 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, | |||
1288 | } else if (!multicast && | 1288 | } else if (!multicast && |
1289 | compare_ether_addr(sdata->dev->dev_addr, | 1289 | compare_ether_addr(sdata->dev->dev_addr, |
1290 | hdr->addr1) != 0) { | 1290 | hdr->addr1) != 0) { |
1291 | if (!sdata->promisc) | 1291 | if (!(sdata->flags & IEEE80211_SDATA_PROMISC)) |
1292 | return 0; | 1292 | return 0; |
1293 | rx->flags &= ~IEEE80211_TXRXD_RXRA_MATCH; | 1293 | rx->flags &= ~IEEE80211_TXRXD_RXRA_MATCH; |
1294 | } | 1294 | } |
@@ -1303,7 +1303,7 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, | |||
1303 | } else if (!multicast && | 1303 | } else if (!multicast && |
1304 | compare_ether_addr(sdata->dev->dev_addr, | 1304 | compare_ether_addr(sdata->dev->dev_addr, |
1305 | hdr->addr1) != 0) { | 1305 | hdr->addr1) != 0) { |
1306 | if (!sdata->promisc) | 1306 | if (!(sdata->flags & IEEE80211_SDATA_PROMISC)) |
1307 | return 0; | 1307 | return 0; |
1308 | rx->flags &= ~IEEE80211_TXRXD_RXRA_MATCH; | 1308 | rx->flags &= ~IEEE80211_TXRXD_RXRA_MATCH; |
1309 | } else if (!rx->sta) | 1309 | } else if (!rx->sta) |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 01e7a734f867..ddb104a70161 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -173,7 +173,7 @@ static u16 ieee80211_duration(struct ieee80211_txrx_data *tx, int group_addr, | |||
173 | * to closest integer */ | 173 | * to closest integer */ |
174 | 174 | ||
175 | dur = ieee80211_frame_duration(local, 10, rate, erp, | 175 | dur = ieee80211_frame_duration(local, 10, rate, erp, |
176 | tx->sdata->short_preamble); | 176 | tx->sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE); |
177 | 177 | ||
178 | if (next_frag_len) { | 178 | if (next_frag_len) { |
179 | /* Frame is fragmented: duration increases with time needed to | 179 | /* Frame is fragmented: duration increases with time needed to |
@@ -181,8 +181,9 @@ static u16 ieee80211_duration(struct ieee80211_txrx_data *tx, int group_addr, | |||
181 | dur *= 2; /* ACK + SIFS */ | 181 | dur *= 2; /* ACK + SIFS */ |
182 | /* next fragment */ | 182 | /* next fragment */ |
183 | dur += ieee80211_frame_duration(local, next_frag_len, | 183 | dur += ieee80211_frame_duration(local, next_frag_len, |
184 | txrate->rate, erp, | 184 | txrate->rate, erp, |
185 | tx->sdata->short_preamble); | 185 | tx->sdata->flags & |
186 | IEEE80211_SDATA_SHORT_PREAMBLE); | ||
186 | } | 187 | } |
187 | 188 | ||
188 | return dur; | 189 | return dur; |
@@ -613,7 +614,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_txrx_data *tx) | |||
613 | if (!tx->u.tx.rate) | 614 | if (!tx->u.tx.rate) |
614 | return TXRX_DROP; | 615 | return TXRX_DROP; |
615 | if (tx->u.tx.mode->mode == MODE_IEEE80211G && | 616 | if (tx->u.tx.mode->mode == MODE_IEEE80211G && |
616 | tx->sdata->use_protection && | 617 | (tx->sdata->flags & IEEE80211_SDATA_USE_PROTECTION) && |
617 | (tx->flags & IEEE80211_TXRXD_FRAGMENTED) && extra.nonerp) { | 618 | (tx->flags & IEEE80211_TXRXD_FRAGMENTED) && extra.nonerp) { |
618 | tx->u.tx.last_frag_rate = tx->u.tx.rate; | 619 | tx->u.tx.last_frag_rate = tx->u.tx.rate; |
619 | if (extra.probe) | 620 | if (extra.probe) |
@@ -670,7 +671,7 @@ ieee80211_tx_h_misc(struct ieee80211_txrx_data *tx) | |||
670 | if (mode->mode == MODE_IEEE80211G && | 671 | if (mode->mode == MODE_IEEE80211G && |
671 | (tx->u.tx.rate->flags & IEEE80211_RATE_ERP) && | 672 | (tx->u.tx.rate->flags & IEEE80211_RATE_ERP) && |
672 | (tx->flags & IEEE80211_TXRXD_TXUNICAST) && | 673 | (tx->flags & IEEE80211_TXRXD_TXUNICAST) && |
673 | tx->sdata->use_protection && | 674 | (tx->sdata->flags & IEEE80211_SDATA_USE_PROTECTION) && |
674 | !(control->flags & IEEE80211_TXCTL_USE_RTS_CTS)) | 675 | !(control->flags & IEEE80211_TXCTL_USE_RTS_CTS)) |
675 | control->flags |= IEEE80211_TXCTL_USE_CTS_PROTECT; | 676 | control->flags |= IEEE80211_TXCTL_USE_CTS_PROTECT; |
676 | 677 | ||
@@ -679,7 +680,7 @@ ieee80211_tx_h_misc(struct ieee80211_txrx_data *tx) | |||
679 | * available on the network at the current point in time. */ | 680 | * available on the network at the current point in time. */ |
680 | if (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) && | 681 | if (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) && |
681 | (tx->u.tx.rate->flags & IEEE80211_RATE_PREAMBLE2) && | 682 | (tx->u.tx.rate->flags & IEEE80211_RATE_PREAMBLE2) && |
682 | tx->sdata->short_preamble && | 683 | (tx->sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE) && |
683 | (!tx->sta || (tx->sta->flags & WLAN_STA_SHORT_PREAMBLE))) { | 684 | (!tx->sta || (tx->sta->flags & WLAN_STA_SHORT_PREAMBLE))) { |
684 | tx->u.tx.control->tx_rate = tx->u.tx.rate->val2; | 685 | tx->u.tx.control->tx_rate = tx->u.tx.rate->val2; |
685 | } | 686 | } |
@@ -1777,8 +1778,9 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, int if_id, | |||
1777 | return NULL; | 1778 | return NULL; |
1778 | } | 1779 | } |
1779 | 1780 | ||
1780 | control->tx_rate = (sdata->short_preamble && | 1781 | control->tx_rate = |
1781 | (rate->flags & IEEE80211_RATE_PREAMBLE2)) ? | 1782 | ((sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE) && |
1783 | (rate->flags & IEEE80211_RATE_PREAMBLE2)) ? | ||
1782 | rate->val2 : rate->val; | 1784 | rate->val2 : rate->val; |
1783 | control->antenna_sel_tx = local->hw.conf.antenna_sel_tx; | 1785 | control->antenna_sel_tx = local->hw.conf.antenna_sel_tx; |
1784 | control->power_level = local->hw.conf.power_level; | 1786 | control->power_level = local->hw.conf.power_level; |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 091ac0d634a5..07686bda26cd 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -329,7 +329,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, int if_id, | |||
329 | sdata = IEEE80211_DEV_TO_SUB_IF(bdev); | 329 | sdata = IEEE80211_DEV_TO_SUB_IF(bdev); |
330 | erp = ieee80211_is_erp_rate(hw->conf.phymode, rate); | 330 | erp = ieee80211_is_erp_rate(hw->conf.phymode, rate); |
331 | dur = ieee80211_frame_duration(local, frame_len, rate, | 331 | dur = ieee80211_frame_duration(local, frame_len, rate, |
332 | erp, sdata->short_preamble); | 332 | erp, sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE); |
333 | 333 | ||
334 | dev_put(bdev); | 334 | dev_put(bdev); |
335 | return cpu_to_le16(dur); | 335 | return cpu_to_le16(dur); |
@@ -352,7 +352,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, int if_id, | |||
352 | return 0; | 352 | return 0; |
353 | 353 | ||
354 | sdata = IEEE80211_DEV_TO_SUB_IF(bdev); | 354 | sdata = IEEE80211_DEV_TO_SUB_IF(bdev); |
355 | short_preamble = sdata->short_preamble; | 355 | short_preamble = sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE; |
356 | 356 | ||
357 | rate = frame_txctl->rts_rate; | 357 | rate = frame_txctl->rts_rate; |
358 | erp = !!(rate->flags & IEEE80211_RATE_ERP); | 358 | erp = !!(rate->flags & IEEE80211_RATE_ERP); |
@@ -388,7 +388,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, int if_id, | |||
388 | return 0; | 388 | return 0; |
389 | 389 | ||
390 | sdata = IEEE80211_DEV_TO_SUB_IF(bdev); | 390 | sdata = IEEE80211_DEV_TO_SUB_IF(bdev); |
391 | short_preamble = sdata->short_preamble; | 391 | short_preamble = sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE; |
392 | 392 | ||
393 | rate = frame_txctl->rts_rate; | 393 | rate = frame_txctl->rts_rate; |
394 | erp = !!(rate->flags & IEEE80211_RATE_ERP); | 394 | erp = !!(rate->flags & IEEE80211_RATE_ERP); |