diff options
| -rw-r--r-- | include/linux/ieee80211.h | 13 | ||||
| -rw-r--r-- | include/net/mac80211.h | 4 | ||||
| -rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
| -rw-r--r-- | net/mac80211/mlme.c | 11 |
4 files changed, 28 insertions, 1 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index a1630ba0b87c..7f4df7c7659d 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -506,6 +506,19 @@ struct ieee80211_channel_sw_ie { | |||
| 506 | u8 count; | 506 | u8 count; |
| 507 | } __attribute__ ((packed)); | 507 | } __attribute__ ((packed)); |
| 508 | 508 | ||
| 509 | /** | ||
| 510 | * struct ieee80211_tim | ||
| 511 | * | ||
| 512 | * This structure refers to "Traffic Indication Map information element" | ||
| 513 | */ | ||
| 514 | struct ieee80211_tim_ie { | ||
| 515 | u8 dtim_count; | ||
| 516 | u8 dtim_period; | ||
| 517 | u8 bitmap_ctrl; | ||
| 518 | /* variable size: 1 - 251 bytes */ | ||
| 519 | u8 virtual_map[0]; | ||
| 520 | } __attribute__ ((packed)); | ||
| 521 | |||
| 509 | struct ieee80211_mgmt { | 522 | struct ieee80211_mgmt { |
| 510 | __le16 frame_control; | 523 | __le16 frame_control; |
| 511 | __le16 duration; | 524 | __le16 duration; |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b52721008be8..9d99f2e0a204 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -177,9 +177,10 @@ enum ieee80211_bss_change { | |||
| 177 | * @aid: association ID number, valid only when @assoc is true | 177 | * @aid: association ID number, valid only when @assoc is true |
| 178 | * @use_cts_prot: use CTS protection | 178 | * @use_cts_prot: use CTS protection |
| 179 | * @use_short_preamble: use 802.11b short preamble | 179 | * @use_short_preamble: use 802.11b short preamble |
| 180 | * @dtim_period: num of beacons before the next DTIM, for PSM | ||
| 180 | * @timestamp: beacon timestamp | 181 | * @timestamp: beacon timestamp |
| 181 | * @beacon_int: beacon interval | 182 | * @beacon_int: beacon interval |
| 182 | * @assoc_capability: capabbilities taken from assoc resp | 183 | * @assoc_capability: capabilities taken from assoc resp |
| 183 | * @assoc_ht: association in HT mode | 184 | * @assoc_ht: association in HT mode |
| 184 | * @ht_conf: ht capabilities | 185 | * @ht_conf: ht capabilities |
| 185 | * @ht_bss_conf: ht extended capabilities | 186 | * @ht_bss_conf: ht extended capabilities |
| @@ -191,6 +192,7 @@ struct ieee80211_bss_conf { | |||
| 191 | /* erp related data */ | 192 | /* erp related data */ |
| 192 | bool use_cts_prot; | 193 | bool use_cts_prot; |
| 193 | bool use_short_preamble; | 194 | bool use_short_preamble; |
| 195 | u8 dtim_period; | ||
| 194 | u16 beacon_int; | 196 | u16 beacon_int; |
| 195 | u16 assoc_capability; | 197 | u16 assoc_capability; |
| 196 | u64 timestamp; | 198 | u64 timestamp; |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index a2e200f9811e..ec59345af65b 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
| @@ -82,6 +82,7 @@ struct ieee80211_sta_bss { | |||
| 82 | 82 | ||
| 83 | u8 bssid[ETH_ALEN]; | 83 | u8 bssid[ETH_ALEN]; |
| 84 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 84 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
| 85 | u8 dtim_period; | ||
| 85 | u16 capability; /* host byte order */ | 86 | u16 capability; /* host byte order */ |
| 86 | enum ieee80211_band band; | 87 | enum ieee80211_band band; |
| 87 | int freq; | 88 | int freq; |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index acb04133a95d..591e6331c427 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
| @@ -551,6 +551,7 @@ static void ieee80211_set_associated(struct net_device *dev, | |||
| 551 | /* set timing information */ | 551 | /* set timing information */ |
| 552 | sdata->bss_conf.beacon_int = bss->beacon_int; | 552 | sdata->bss_conf.beacon_int = bss->beacon_int; |
| 553 | sdata->bss_conf.timestamp = bss->timestamp; | 553 | sdata->bss_conf.timestamp = bss->timestamp; |
| 554 | sdata->bss_conf.dtim_period = bss->dtim_period; | ||
| 554 | 555 | ||
| 555 | changed |= ieee80211_handle_bss_capability(sdata, bss); | 556 | changed |= ieee80211_handle_bss_capability(sdata, bss); |
| 556 | 557 | ||
| @@ -2688,6 +2689,16 @@ static void ieee80211_rx_bss_info(struct net_device *dev, | |||
| 2688 | bss->beacon_int = le16_to_cpu(mgmt->u.beacon.beacon_int); | 2689 | bss->beacon_int = le16_to_cpu(mgmt->u.beacon.beacon_int); |
| 2689 | bss->capability = le16_to_cpu(mgmt->u.beacon.capab_info); | 2690 | bss->capability = le16_to_cpu(mgmt->u.beacon.capab_info); |
| 2690 | 2691 | ||
| 2692 | if (elems->tim) { | ||
| 2693 | struct ieee80211_tim_ie *tim_ie = | ||
| 2694 | (struct ieee80211_tim_ie *)elems->tim; | ||
| 2695 | bss->dtim_period = tim_ie->dtim_period; | ||
| 2696 | } | ||
| 2697 | |||
| 2698 | /* set default value for buggy APs */ | ||
| 2699 | if (!elems->tim || bss->dtim_period == 0) | ||
| 2700 | bss->dtim_period = 1; | ||
| 2701 | |||
| 2691 | bss->supp_rates_len = 0; | 2702 | bss->supp_rates_len = 0; |
| 2692 | if (elems->supp_rates) { | 2703 | if (elems->supp_rates) { |
| 2693 | clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; | 2704 | clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; |
