diff options
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
| -rw-r--r-- | net/mac80211/ieee80211_i.h | 337 |
1 files changed, 253 insertions, 84 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 91dc8636d644..65e0ed6c2975 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * Copyright 2002-2005, Instant802 Networks, Inc. | 2 | * Copyright 2002-2005, Instant802 Networks, Inc. |
| 3 | * Copyright 2005, Devicescape Software, Inc. | 3 | * Copyright 2005, Devicescape Software, Inc. |
| 4 | * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> | 4 | * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> |
| 5 | * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net> | 5 | * Copyright 2007-2010 Johannes Berg <johannes@sipsolutions.net> |
| 6 | * | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
| @@ -58,6 +58,15 @@ struct ieee80211_local; | |||
| 58 | 58 | ||
| 59 | #define TU_TO_EXP_TIME(x) (jiffies + usecs_to_jiffies((x) * 1024)) | 59 | #define TU_TO_EXP_TIME(x) (jiffies + usecs_to_jiffies((x) * 1024)) |
| 60 | 60 | ||
| 61 | #define IEEE80211_DEFAULT_UAPSD_QUEUES \ | ||
| 62 | (IEEE80211_WMM_IE_STA_QOSINFO_AC_BK | \ | ||
| 63 | IEEE80211_WMM_IE_STA_QOSINFO_AC_BE | \ | ||
| 64 | IEEE80211_WMM_IE_STA_QOSINFO_AC_VI | \ | ||
| 65 | IEEE80211_WMM_IE_STA_QOSINFO_AC_VO) | ||
| 66 | |||
| 67 | #define IEEE80211_DEFAULT_MAX_SP_LEN \ | ||
| 68 | IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL | ||
| 69 | |||
| 61 | struct ieee80211_fragment_entry { | 70 | struct ieee80211_fragment_entry { |
| 62 | unsigned long first_frag_time; | 71 | unsigned long first_frag_time; |
| 63 | unsigned int seq; | 72 | unsigned int seq; |
| @@ -71,9 +80,6 @@ struct ieee80211_fragment_entry { | |||
| 71 | 80 | ||
| 72 | 81 | ||
| 73 | struct ieee80211_bss { | 82 | struct ieee80211_bss { |
| 74 | /* Yes, this is a hack */ | ||
| 75 | struct cfg80211_bss cbss; | ||
| 76 | |||
| 77 | /* don't want to look up all the time */ | 83 | /* don't want to look up all the time */ |
| 78 | size_t ssid_len; | 84 | size_t ssid_len; |
| 79 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 85 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
| @@ -81,6 +87,7 @@ struct ieee80211_bss { | |||
| 81 | u8 dtim_period; | 87 | u8 dtim_period; |
| 82 | 88 | ||
| 83 | bool wmm_used; | 89 | bool wmm_used; |
| 90 | bool uapsd_supported; | ||
| 84 | 91 | ||
| 85 | unsigned long last_probe_resp; | 92 | unsigned long last_probe_resp; |
| 86 | 93 | ||
| @@ -140,7 +147,6 @@ typedef unsigned __bitwise__ ieee80211_tx_result; | |||
| 140 | 147 | ||
| 141 | struct ieee80211_tx_data { | 148 | struct ieee80211_tx_data { |
| 142 | struct sk_buff *skb; | 149 | struct sk_buff *skb; |
| 143 | struct net_device *dev; | ||
| 144 | struct ieee80211_local *local; | 150 | struct ieee80211_local *local; |
| 145 | struct ieee80211_sub_if_data *sdata; | 151 | struct ieee80211_sub_if_data *sdata; |
| 146 | struct sta_info *sta; | 152 | struct sta_info *sta; |
| @@ -228,31 +234,78 @@ struct mesh_preq_queue { | |||
| 228 | u8 flags; | 234 | u8 flags; |
| 229 | }; | 235 | }; |
| 230 | 236 | ||
| 231 | enum ieee80211_mgd_state { | 237 | enum ieee80211_work_type { |
| 232 | IEEE80211_MGD_STATE_IDLE, | 238 | IEEE80211_WORK_ABORT, |
| 233 | IEEE80211_MGD_STATE_PROBE, | 239 | IEEE80211_WORK_DIRECT_PROBE, |
| 234 | IEEE80211_MGD_STATE_AUTH, | 240 | IEEE80211_WORK_AUTH, |
| 235 | IEEE80211_MGD_STATE_ASSOC, | 241 | IEEE80211_WORK_ASSOC_BEACON_WAIT, |
| 242 | IEEE80211_WORK_ASSOC, | ||
| 243 | IEEE80211_WORK_REMAIN_ON_CHANNEL, | ||
| 244 | }; | ||
| 245 | |||
| 246 | /** | ||
| 247 | * enum work_done_result - indicates what to do after work was done | ||
| 248 | * | ||
| 249 | * @WORK_DONE_DESTROY: This work item is no longer needed, destroy. | ||
| 250 | * @WORK_DONE_REQUEUE: This work item was reset to be reused, and | ||
| 251 | * should be requeued. | ||
| 252 | */ | ||
| 253 | enum work_done_result { | ||
| 254 | WORK_DONE_DESTROY, | ||
| 255 | WORK_DONE_REQUEUE, | ||
| 236 | }; | 256 | }; |
| 237 | 257 | ||
| 238 | struct ieee80211_mgd_work { | 258 | struct ieee80211_work { |
| 239 | struct list_head list; | 259 | struct list_head list; |
| 240 | struct ieee80211_bss *bss; | 260 | |
| 241 | int ie_len; | 261 | struct rcu_head rcu_head; |
| 242 | u8 prev_bssid[ETH_ALEN]; | 262 | |
| 243 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 263 | struct ieee80211_sub_if_data *sdata; |
| 244 | u8 ssid_len; | 264 | |
| 265 | enum work_done_result (*done)(struct ieee80211_work *wk, | ||
| 266 | struct sk_buff *skb); | ||
| 267 | |||
| 268 | struct ieee80211_channel *chan; | ||
| 269 | enum nl80211_channel_type chan_type; | ||
| 270 | |||
| 245 | unsigned long timeout; | 271 | unsigned long timeout; |
| 246 | enum ieee80211_mgd_state state; | 272 | enum ieee80211_work_type type; |
| 247 | u16 auth_alg, auth_transaction; | ||
| 248 | 273 | ||
| 249 | int tries; | 274 | u8 filter_ta[ETH_ALEN]; |
| 275 | |||
| 276 | bool started; | ||
| 250 | 277 | ||
| 251 | u8 key[WLAN_KEY_LEN_WEP104]; | 278 | union { |
| 252 | u8 key_len, key_idx; | 279 | struct { |
| 280 | int tries; | ||
| 281 | u16 algorithm, transaction; | ||
| 282 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
| 283 | u8 ssid_len; | ||
| 284 | u8 key[WLAN_KEY_LEN_WEP104]; | ||
| 285 | u8 key_len, key_idx; | ||
| 286 | bool privacy; | ||
| 287 | } probe_auth; | ||
| 288 | struct { | ||
| 289 | struct cfg80211_bss *bss; | ||
| 290 | const u8 *supp_rates; | ||
| 291 | const u8 *ht_information_ie; | ||
| 292 | enum ieee80211_smps_mode smps; | ||
| 293 | int tries; | ||
| 294 | u16 capability; | ||
| 295 | u8 prev_bssid[ETH_ALEN]; | ||
| 296 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
| 297 | u8 ssid_len; | ||
| 298 | u8 supp_rates_len; | ||
| 299 | bool wmm_used, use_11n, uapsd_used; | ||
| 300 | } assoc; | ||
| 301 | struct { | ||
| 302 | u32 duration; | ||
| 303 | } remain; | ||
| 304 | }; | ||
| 253 | 305 | ||
| 306 | int ie_len; | ||
| 254 | /* must be last */ | 307 | /* must be last */ |
| 255 | u8 ie[0]; /* for auth or assoc frame, not probe */ | 308 | u8 ie[0]; |
| 256 | }; | 309 | }; |
| 257 | 310 | ||
| 258 | /* flags used in struct ieee80211_if_managed.flags */ | 311 | /* flags used in struct ieee80211_if_managed.flags */ |
| @@ -260,15 +313,12 @@ enum ieee80211_sta_flags { | |||
| 260 | IEEE80211_STA_BEACON_POLL = BIT(0), | 313 | IEEE80211_STA_BEACON_POLL = BIT(0), |
| 261 | IEEE80211_STA_CONNECTION_POLL = BIT(1), | 314 | IEEE80211_STA_CONNECTION_POLL = BIT(1), |
| 262 | IEEE80211_STA_CONTROL_PORT = BIT(2), | 315 | IEEE80211_STA_CONTROL_PORT = BIT(2), |
| 263 | IEEE80211_STA_WMM_ENABLED = BIT(3), | ||
| 264 | IEEE80211_STA_DISABLE_11N = BIT(4), | 316 | IEEE80211_STA_DISABLE_11N = BIT(4), |
| 265 | IEEE80211_STA_CSA_RECEIVED = BIT(5), | 317 | IEEE80211_STA_CSA_RECEIVED = BIT(5), |
| 266 | IEEE80211_STA_MFP_ENABLED = BIT(6), | 318 | IEEE80211_STA_MFP_ENABLED = BIT(6), |
| 267 | }; | 319 | IEEE80211_STA_UAPSD_ENABLED = BIT(7), |
| 268 | 320 | IEEE80211_STA_NULLFUNC_ACKED = BIT(8), | |
| 269 | /* flags for MLME request */ | 321 | IEEE80211_STA_RESET_SIGNAL_AVE = BIT(9), |
| 270 | enum ieee80211_sta_request { | ||
| 271 | IEEE80211_STA_REQ_SCAN, | ||
| 272 | }; | 322 | }; |
| 273 | 323 | ||
| 274 | struct ieee80211_if_managed { | 324 | struct ieee80211_if_managed { |
| @@ -276,30 +326,24 @@ struct ieee80211_if_managed { | |||
| 276 | struct timer_list conn_mon_timer; | 326 | struct timer_list conn_mon_timer; |
| 277 | struct timer_list bcn_mon_timer; | 327 | struct timer_list bcn_mon_timer; |
| 278 | struct timer_list chswitch_timer; | 328 | struct timer_list chswitch_timer; |
| 279 | struct work_struct work; | ||
| 280 | struct work_struct monitor_work; | 329 | struct work_struct monitor_work; |
| 281 | struct work_struct chswitch_work; | 330 | struct work_struct chswitch_work; |
| 282 | struct work_struct beacon_loss_work; | 331 | struct work_struct beacon_connection_loss_work; |
| 283 | 332 | ||
| 284 | unsigned long probe_timeout; | 333 | unsigned long probe_timeout; |
| 285 | int probe_send_count; | 334 | int probe_send_count; |
| 286 | 335 | ||
| 287 | struct mutex mtx; | 336 | struct mutex mtx; |
| 288 | struct ieee80211_bss *associated; | 337 | struct cfg80211_bss *associated; |
| 289 | struct ieee80211_mgd_work *old_associate_work; | ||
| 290 | struct list_head work_list; | ||
| 291 | 338 | ||
| 292 | u8 bssid[ETH_ALEN]; | 339 | u8 bssid[ETH_ALEN]; |
| 293 | 340 | ||
| 294 | u16 aid; | 341 | u16 aid; |
| 295 | u16 capab; | ||
| 296 | |||
| 297 | struct sk_buff_head skb_queue; | ||
| 298 | 342 | ||
| 299 | unsigned long timers_running; /* used for quiesce/restart */ | 343 | unsigned long timers_running; /* used for quiesce/restart */ |
| 300 | bool powersave; /* powersave requested for this iface */ | 344 | bool powersave; /* powersave requested for this iface */ |
| 301 | 345 | enum ieee80211_smps_mode req_smps, /* requested smps mode */ | |
| 302 | unsigned long request; | 346 | ap_smps; /* smps mode AP thinks we're in */ |
| 303 | 347 | ||
| 304 | unsigned int flags; | 348 | unsigned int flags; |
| 305 | 349 | ||
| @@ -314,21 +358,35 @@ struct ieee80211_if_managed { | |||
| 314 | int wmm_last_param_set; | 358 | int wmm_last_param_set; |
| 315 | 359 | ||
| 316 | u8 use_4addr; | 360 | u8 use_4addr; |
| 317 | }; | ||
| 318 | 361 | ||
| 319 | enum ieee80211_ibss_request { | 362 | /* Signal strength from the last Beacon frame in the current BSS. */ |
| 320 | IEEE80211_IBSS_REQ_RUN = 0, | 363 | int last_beacon_signal; |
| 364 | |||
| 365 | /* | ||
| 366 | * Weighted average of the signal strength from Beacon frames in the | ||
| 367 | * current BSS. This is in units of 1/16 of the signal unit to maintain | ||
| 368 | * accuracy and to speed up calculations, i.e., the value need to be | ||
| 369 | * divided by 16 to get the actual value. | ||
| 370 | */ | ||
| 371 | int ave_beacon_signal; | ||
| 372 | |||
| 373 | /* | ||
| 374 | * Last Beacon frame signal strength average (ave_beacon_signal / 16) | ||
| 375 | * that triggered a cqm event. 0 indicates that no event has been | ||
| 376 | * generated for the current association. | ||
| 377 | */ | ||
| 378 | int last_cqm_event_signal; | ||
| 321 | }; | 379 | }; |
| 322 | 380 | ||
| 323 | struct ieee80211_if_ibss { | 381 | struct ieee80211_if_ibss { |
| 324 | struct timer_list timer; | 382 | struct timer_list timer; |
| 325 | struct work_struct work; | ||
| 326 | 383 | ||
| 327 | struct sk_buff_head skb_queue; | 384 | struct mutex mtx; |
| 328 | 385 | ||
| 329 | unsigned long request; | ||
| 330 | unsigned long last_scan_completed; | 386 | unsigned long last_scan_completed; |
| 331 | 387 | ||
| 388 | u32 basic_rates; | ||
| 389 | |||
| 332 | bool timer_running; | 390 | bool timer_running; |
| 333 | 391 | ||
| 334 | bool fixed_bssid; | 392 | bool fixed_bssid; |
| @@ -352,11 +410,9 @@ struct ieee80211_if_ibss { | |||
| 352 | }; | 410 | }; |
| 353 | 411 | ||
| 354 | struct ieee80211_if_mesh { | 412 | struct ieee80211_if_mesh { |
| 355 | struct work_struct work; | ||
| 356 | struct timer_list housekeeping_timer; | 413 | struct timer_list housekeeping_timer; |
| 357 | struct timer_list mesh_path_timer; | 414 | struct timer_list mesh_path_timer; |
| 358 | struct timer_list mesh_path_root_timer; | 415 | struct timer_list mesh_path_root_timer; |
| 359 | struct sk_buff_head skb_queue; | ||
| 360 | 416 | ||
| 361 | unsigned long timers_running; | 417 | unsigned long timers_running; |
| 362 | 418 | ||
| @@ -433,6 +489,8 @@ struct ieee80211_sub_if_data { | |||
| 433 | 489 | ||
| 434 | int drop_unencrypted; | 490 | int drop_unencrypted; |
| 435 | 491 | ||
| 492 | char name[IFNAMSIZ]; | ||
| 493 | |||
| 436 | /* | 494 | /* |
| 437 | * keep track of whether the HT opmode (stored in | 495 | * keep track of whether the HT opmode (stored in |
| 438 | * vif.bss_info.ht_operation_mode) is valid. | 496 | * vif.bss_info.ht_operation_mode) is valid. |
| @@ -451,6 +509,11 @@ struct ieee80211_sub_if_data { | |||
| 451 | 509 | ||
| 452 | u16 sequence_number; | 510 | u16 sequence_number; |
| 453 | 511 | ||
| 512 | struct work_struct work; | ||
| 513 | struct sk_buff_head skb_queue; | ||
| 514 | |||
| 515 | bool arp_filter_state; | ||
| 516 | |||
| 454 | /* | 517 | /* |
| 455 | * AP this belongs to: self in AP mode and | 518 | * AP this belongs to: self in AP mode and |
| 456 | * corresponding AP in VLAN mode, NULL for | 519 | * corresponding AP in VLAN mode, NULL for |
| @@ -458,8 +521,8 @@ struct ieee80211_sub_if_data { | |||
| 458 | */ | 521 | */ |
| 459 | struct ieee80211_if_ap *bss; | 522 | struct ieee80211_if_ap *bss; |
| 460 | 523 | ||
| 461 | int force_unicast_rateidx; /* forced TX rateidx for unicast frames */ | 524 | /* bitmap of allowed (non-MCS) rate indexes for rate control */ |
| 462 | int max_ratectrl_rateidx; /* max TX rateidx for rate control */ | 525 | u32 rc_rateidx_mask[IEEE80211_NUM_BANDS]; |
| 463 | 526 | ||
| 464 | union { | 527 | union { |
| 465 | struct ieee80211_if_ap ap; | 528 | struct ieee80211_if_ap ap; |
| @@ -503,11 +566,15 @@ ieee80211_sdata_set_mesh_id(struct ieee80211_sub_if_data *sdata, | |||
| 503 | #endif | 566 | #endif |
| 504 | } | 567 | } |
| 505 | 568 | ||
| 569 | enum sdata_queue_type { | ||
| 570 | IEEE80211_SDATA_QUEUE_TYPE_FRAME = 0, | ||
| 571 | IEEE80211_SDATA_QUEUE_AGG_START = 1, | ||
| 572 | IEEE80211_SDATA_QUEUE_AGG_STOP = 2, | ||
| 573 | }; | ||
| 574 | |||
| 506 | enum { | 575 | enum { |
| 507 | IEEE80211_RX_MSG = 1, | 576 | IEEE80211_RX_MSG = 1, |
| 508 | IEEE80211_TX_STATUS_MSG = 2, | 577 | IEEE80211_TX_STATUS_MSG = 2, |
| 509 | IEEE80211_DELBA_MSG = 3, | ||
| 510 | IEEE80211_ADDBA_MSG = 4, | ||
| 511 | }; | 578 | }; |
| 512 | 579 | ||
| 513 | enum queue_stop_reason { | 580 | enum queue_stop_reason { |
| @@ -565,6 +632,15 @@ struct ieee80211_local { | |||
| 565 | const struct ieee80211_ops *ops; | 632 | const struct ieee80211_ops *ops; |
| 566 | 633 | ||
| 567 | /* | 634 | /* |
| 635 | * work stuff, potentially off-channel (in the future) | ||
| 636 | */ | ||
| 637 | struct mutex work_mtx; | ||
| 638 | struct list_head work_list; | ||
| 639 | struct timer_list work_timer; | ||
| 640 | struct work_struct work_work; | ||
| 641 | struct sk_buff_head work_skb_queue; | ||
| 642 | |||
| 643 | /* | ||
| 568 | * private workqueue to mac80211. mac80211 makes this accessible | 644 | * private workqueue to mac80211. mac80211 makes this accessible |
| 569 | * via ieee80211_queue_work() | 645 | * via ieee80211_queue_work() |
| 570 | */ | 646 | */ |
| @@ -586,9 +662,11 @@ struct ieee80211_local { | |||
| 586 | /* used for uploading changed mc list */ | 662 | /* used for uploading changed mc list */ |
| 587 | struct work_struct reconfig_filter; | 663 | struct work_struct reconfig_filter; |
| 588 | 664 | ||
| 665 | /* used to reconfigure hardware SM PS */ | ||
| 666 | struct work_struct recalc_smps; | ||
| 667 | |||
| 589 | /* aggregated multicast list */ | 668 | /* aggregated multicast list */ |
| 590 | struct dev_addr_list *mc_list; | 669 | struct netdev_hw_addr_list mc_list; |
| 591 | int mc_count; | ||
| 592 | 670 | ||
| 593 | bool tim_in_locked_section; /* see ieee80211_beacon_get() */ | 671 | bool tim_in_locked_section; /* see ieee80211_beacon_get() */ |
| 594 | 672 | ||
| @@ -630,27 +708,24 @@ struct ieee80211_local { | |||
| 630 | 708 | ||
| 631 | /* Station data */ | 709 | /* Station data */ |
| 632 | /* | 710 | /* |
| 633 | * The lock only protects the list, hash, timer and counter | 711 | * The mutex only protects the list and counter, |
| 634 | * against manipulation, reads are done in RCU. Additionally, | 712 | * reads are done in RCU. |
| 635 | * the lock protects each BSS's TIM bitmap. | 713 | * Additionally, the lock protects the hash table, |
| 714 | * the pending list and each BSS's TIM bitmap. | ||
| 636 | */ | 715 | */ |
| 716 | struct mutex sta_mtx; | ||
| 637 | spinlock_t sta_lock; | 717 | spinlock_t sta_lock; |
| 638 | unsigned long num_sta; | 718 | unsigned long num_sta; |
| 639 | struct list_head sta_list; | 719 | struct list_head sta_list, sta_pending_list; |
| 640 | struct sta_info *sta_hash[STA_HASH_SIZE]; | 720 | struct sta_info *sta_hash[STA_HASH_SIZE]; |
| 641 | struct timer_list sta_cleanup; | 721 | struct timer_list sta_cleanup; |
| 722 | struct work_struct sta_finish_work; | ||
| 642 | int sta_generation; | 723 | int sta_generation; |
| 643 | 724 | ||
| 644 | struct sk_buff_head pending[IEEE80211_MAX_QUEUES]; | 725 | struct sk_buff_head pending[IEEE80211_MAX_QUEUES]; |
| 645 | struct tasklet_struct tx_pending_tasklet; | 726 | struct tasklet_struct tx_pending_tasklet; |
| 646 | 727 | ||
| 647 | /* | 728 | atomic_t agg_queue_stop[IEEE80211_MAX_QUEUES]; |
| 648 | * This lock is used to prevent concurrent A-MPDU | ||
| 649 | * session start/stop processing, this thus also | ||
| 650 | * synchronises the ->ampdu_action() callback to | ||
| 651 | * drivers and limits it to one at a time. | ||
| 652 | */ | ||
| 653 | spinlock_t ampdu_lock; | ||
| 654 | 729 | ||
| 655 | /* number of interfaces with corresponding IFF_ flags */ | 730 | /* number of interfaces with corresponding IFF_ flags */ |
| 656 | atomic_t iff_allmultis, iff_promiscs; | 731 | atomic_t iff_allmultis, iff_promiscs; |
| @@ -666,10 +741,10 @@ struct ieee80211_local { | |||
| 666 | struct mutex iflist_mtx; | 741 | struct mutex iflist_mtx; |
| 667 | 742 | ||
| 668 | /* | 743 | /* |
| 669 | * Key lock, protects sdata's key_list and sta_info's | 744 | * Key mutex, protects sdata's key_list and sta_info's |
| 670 | * key pointers (write access, they're RCU.) | 745 | * key pointers (write access, they're RCU.) |
| 671 | */ | 746 | */ |
| 672 | spinlock_t key_lock; | 747 | struct mutex key_mtx; |
| 673 | 748 | ||
| 674 | 749 | ||
| 675 | /* Scanning and BSS list */ | 750 | /* Scanning and BSS list */ |
| @@ -683,12 +758,17 @@ struct ieee80211_local { | |||
| 683 | int scan_channel_idx; | 758 | int scan_channel_idx; |
| 684 | int scan_ies_len; | 759 | int scan_ies_len; |
| 685 | 760 | ||
| 761 | unsigned long leave_oper_channel_time; | ||
| 686 | enum mac80211_scan_state next_scan_state; | 762 | enum mac80211_scan_state next_scan_state; |
| 687 | struct delayed_work scan_work; | 763 | struct delayed_work scan_work; |
| 688 | struct ieee80211_sub_if_data *scan_sdata; | 764 | struct ieee80211_sub_if_data *scan_sdata; |
| 689 | enum nl80211_channel_type oper_channel_type; | 765 | enum nl80211_channel_type _oper_channel_type; |
| 690 | struct ieee80211_channel *oper_channel, *csa_channel; | 766 | struct ieee80211_channel *oper_channel, *csa_channel; |
| 691 | 767 | ||
| 768 | /* Temporary remain-on-channel for off-channel operations */ | ||
| 769 | struct ieee80211_channel *tmp_channel; | ||
| 770 | enum nl80211_channel_type tmp_channel_type; | ||
| 771 | |||
| 692 | /* SNMP counters */ | 772 | /* SNMP counters */ |
| 693 | /* dot11CountersTable */ | 773 | /* dot11CountersTable */ |
| 694 | u32 dot11TransmittedFragmentCount; | 774 | u32 dot11TransmittedFragmentCount; |
| @@ -708,10 +788,6 @@ struct ieee80211_local { | |||
| 708 | assoc_led_name[32], radio_led_name[32]; | 788 | assoc_led_name[32], radio_led_name[32]; |
| 709 | #endif | 789 | #endif |
| 710 | 790 | ||
| 711 | #ifdef CONFIG_MAC80211_DEBUGFS | ||
| 712 | struct work_struct sta_debugfs_add; | ||
| 713 | #endif | ||
| 714 | |||
| 715 | #ifdef CONFIG_MAC80211_DEBUG_COUNTERS | 791 | #ifdef CONFIG_MAC80211_DEBUG_COUNTERS |
| 716 | /* TX/RX handler statistics */ | 792 | /* TX/RX handler statistics */ |
| 717 | unsigned int tx_handlers_drop; | 793 | unsigned int tx_handlers_drop; |
| @@ -745,8 +821,22 @@ struct ieee80211_local { | |||
| 745 | int wifi_wme_noack_test; | 821 | int wifi_wme_noack_test; |
| 746 | unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ | 822 | unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ |
| 747 | 823 | ||
| 824 | /* | ||
| 825 | * Bitmask of enabled u-apsd queues, | ||
| 826 | * IEEE80211_WMM_IE_STA_QOSINFO_AC_BE & co. Needs a new association | ||
| 827 | * to take effect. | ||
| 828 | */ | ||
| 829 | unsigned int uapsd_queues; | ||
| 830 | |||
| 831 | /* | ||
| 832 | * Maximum number of buffered frames AP can deliver during a | ||
| 833 | * service period, IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL or similar. | ||
| 834 | * Needs a new association to take effect. | ||
| 835 | */ | ||
| 836 | unsigned int uapsd_max_sp_len; | ||
| 837 | |||
| 748 | bool pspolling; | 838 | bool pspolling; |
| 749 | bool scan_ps_enabled; | 839 | bool offchannel_ps_enabled; |
| 750 | /* | 840 | /* |
| 751 | * PS can only be enabled when we have exactly one managed | 841 | * PS can only be enabled when we have exactly one managed |
| 752 | * interface (and monitors) in PS, this then points there. | 842 | * interface (and monitors) in PS, this then points there. |
| @@ -756,10 +846,21 @@ struct ieee80211_local { | |||
| 756 | struct work_struct dynamic_ps_disable_work; | 846 | struct work_struct dynamic_ps_disable_work; |
| 757 | struct timer_list dynamic_ps_timer; | 847 | struct timer_list dynamic_ps_timer; |
| 758 | struct notifier_block network_latency_notifier; | 848 | struct notifier_block network_latency_notifier; |
| 849 | struct notifier_block ifa_notifier; | ||
| 850 | |||
| 851 | /* | ||
| 852 | * The dynamic ps timeout configured from user space via WEXT - | ||
| 853 | * this will override whatever chosen by mac80211 internally. | ||
| 854 | */ | ||
| 855 | int dynamic_ps_forced_timeout; | ||
| 856 | int dynamic_ps_user_timeout; | ||
| 857 | bool disable_dynamic_ps; | ||
| 759 | 858 | ||
| 760 | int user_power_level; /* in dBm */ | 859 | int user_power_level; /* in dBm */ |
| 761 | int power_constr_level; /* in dBm */ | 860 | int power_constr_level; /* in dBm */ |
| 762 | 861 | ||
| 862 | enum ieee80211_smps_mode smps_mode; | ||
| 863 | |||
| 763 | struct work_struct restart_work; | 864 | struct work_struct restart_work; |
| 764 | 865 | ||
| 765 | #ifdef CONFIG_MAC80211_DEBUGFS | 866 | #ifdef CONFIG_MAC80211_DEBUGFS |
| @@ -777,9 +878,8 @@ IEEE80211_DEV_TO_SUB_IF(struct net_device *dev) | |||
| 777 | return netdev_priv(dev); | 878 | return netdev_priv(dev); |
| 778 | } | 879 | } |
| 779 | 880 | ||
| 780 | /* this struct represents 802.11n's RA/TID combination along with our vif */ | 881 | /* this struct represents 802.11n's RA/TID combination */ |
| 781 | struct ieee80211_ra_tid { | 882 | struct ieee80211_ra_tid { |
| 782 | struct ieee80211_vif *vif; | ||
| 783 | u8 ra[ETH_ALEN]; | 883 | u8 ra[ETH_ALEN]; |
| 784 | u16 tid; | 884 | u16 tid; |
| 785 | }; | 885 | }; |
| @@ -874,6 +974,8 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, | |||
| 874 | void ieee80211_configure_filter(struct ieee80211_local *local); | 974 | void ieee80211_configure_filter(struct ieee80211_local *local); |
| 875 | u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata); | 975 | u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata); |
| 876 | 976 | ||
| 977 | extern bool ieee80211_disable_40mhz_24ghz; | ||
| 978 | |||
| 877 | /* STA code */ | 979 | /* STA code */ |
| 878 | void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata); | 980 | void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata); |
| 879 | int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, | 981 | int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, |
| @@ -886,36 +988,47 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
| 886 | int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, | 988 | int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, |
| 887 | struct cfg80211_disassoc_request *req, | 989 | struct cfg80211_disassoc_request *req, |
| 888 | void *cookie); | 990 | void *cookie); |
| 889 | ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata, | ||
| 890 | struct sk_buff *skb); | ||
| 891 | void ieee80211_send_pspoll(struct ieee80211_local *local, | 991 | void ieee80211_send_pspoll(struct ieee80211_local *local, |
| 892 | struct ieee80211_sub_if_data *sdata); | 992 | struct ieee80211_sub_if_data *sdata); |
| 893 | void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency); | 993 | void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency); |
| 894 | int ieee80211_max_network_latency(struct notifier_block *nb, | 994 | int ieee80211_max_network_latency(struct notifier_block *nb, |
| 895 | unsigned long data, void *dummy); | 995 | unsigned long data, void *dummy); |
| 996 | int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata); | ||
| 896 | void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, | 997 | void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, |
| 897 | struct ieee80211_channel_sw_ie *sw_elem, | 998 | struct ieee80211_channel_sw_ie *sw_elem, |
| 898 | struct ieee80211_bss *bss); | 999 | struct ieee80211_bss *bss, |
| 1000 | u64 timestamp); | ||
| 899 | void ieee80211_sta_quiesce(struct ieee80211_sub_if_data *sdata); | 1001 | void ieee80211_sta_quiesce(struct ieee80211_sub_if_data *sdata); |
| 900 | void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata); | 1002 | void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata); |
| 1003 | void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata); | ||
| 1004 | void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | ||
| 1005 | struct sk_buff *skb); | ||
| 901 | 1006 | ||
| 902 | /* IBSS code */ | 1007 | /* IBSS code */ |
| 903 | void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); | 1008 | void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); |
| 904 | void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata); | 1009 | void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata); |
| 905 | ieee80211_rx_result | ||
| 906 | ieee80211_ibss_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); | ||
| 907 | struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | 1010 | struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, |
| 908 | u8 *bssid, u8 *addr, u32 supp_rates); | 1011 | u8 *bssid, u8 *addr, u32 supp_rates, |
| 1012 | gfp_t gfp); | ||
| 909 | int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata, | 1013 | int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata, |
| 910 | struct cfg80211_ibss_params *params); | 1014 | struct cfg80211_ibss_params *params); |
| 911 | int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata); | 1015 | int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata); |
| 912 | void ieee80211_ibss_quiesce(struct ieee80211_sub_if_data *sdata); | 1016 | void ieee80211_ibss_quiesce(struct ieee80211_sub_if_data *sdata); |
| 913 | void ieee80211_ibss_restart(struct ieee80211_sub_if_data *sdata); | 1017 | void ieee80211_ibss_restart(struct ieee80211_sub_if_data *sdata); |
| 1018 | void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata); | ||
| 1019 | void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | ||
| 1020 | struct sk_buff *skb); | ||
| 1021 | |||
| 1022 | /* mesh code */ | ||
| 1023 | void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata); | ||
| 1024 | void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | ||
| 1025 | struct sk_buff *skb); | ||
| 914 | 1026 | ||
| 915 | /* scan/BSS handling */ | 1027 | /* scan/BSS handling */ |
| 916 | void ieee80211_scan_work(struct work_struct *work); | 1028 | void ieee80211_scan_work(struct work_struct *work); |
| 917 | int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, | 1029 | int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, |
| 918 | const u8 *ssid, u8 ssid_len); | 1030 | const u8 *ssid, u8 ssid_len, |
| 1031 | struct ieee80211_channel *chan); | ||
| 919 | int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, | 1032 | int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, |
| 920 | struct cfg80211_scan_request *req); | 1033 | struct cfg80211_scan_request *req); |
| 921 | void ieee80211_scan_cancel(struct ieee80211_local *local); | 1034 | void ieee80211_scan_cancel(struct ieee80211_local *local); |
| @@ -937,7 +1050,15 @@ ieee80211_rx_bss_get(struct ieee80211_local *local, u8 *bssid, int freq, | |||
| 937 | void ieee80211_rx_bss_put(struct ieee80211_local *local, | 1050 | void ieee80211_rx_bss_put(struct ieee80211_local *local, |
| 938 | struct ieee80211_bss *bss); | 1051 | struct ieee80211_bss *bss); |
| 939 | 1052 | ||
| 1053 | /* off-channel helpers */ | ||
| 1054 | void ieee80211_offchannel_stop_beaconing(struct ieee80211_local *local); | ||
| 1055 | void ieee80211_offchannel_stop_station(struct ieee80211_local *local); | ||
| 1056 | void ieee80211_offchannel_return(struct ieee80211_local *local, | ||
| 1057 | bool enable_beaconing); | ||
| 1058 | |||
| 940 | /* interface handling */ | 1059 | /* interface handling */ |
| 1060 | int ieee80211_iface_init(void); | ||
| 1061 | void ieee80211_iface_exit(void); | ||
| 941 | int ieee80211_if_add(struct ieee80211_local *local, const char *name, | 1062 | int ieee80211_if_add(struct ieee80211_local *local, const char *name, |
| 942 | struct net_device **new_dev, enum nl80211_iftype type, | 1063 | struct net_device **new_dev, enum nl80211_iftype type, |
| 943 | struct vif_params *params); | 1064 | struct vif_params *params); |
| @@ -948,6 +1069,11 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local); | |||
| 948 | u32 __ieee80211_recalc_idle(struct ieee80211_local *local); | 1069 | u32 __ieee80211_recalc_idle(struct ieee80211_local *local); |
| 949 | void ieee80211_recalc_idle(struct ieee80211_local *local); | 1070 | void ieee80211_recalc_idle(struct ieee80211_local *local); |
| 950 | 1071 | ||
| 1072 | static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata) | ||
| 1073 | { | ||
| 1074 | return netif_running(sdata->dev); | ||
| 1075 | } | ||
| 1076 | |||
| 951 | /* tx handling */ | 1077 | /* tx handling */ |
| 952 | void ieee80211_clear_tx_pending(struct ieee80211_local *local); | 1078 | void ieee80211_clear_tx_pending(struct ieee80211_local *local); |
| 953 | void ieee80211_tx_pending(unsigned long data); | 1079 | void ieee80211_tx_pending(unsigned long data); |
| @@ -965,7 +1091,7 @@ struct ieee80211_tx_status_rtap_hdr { | |||
| 965 | u8 padding_for_rate; | 1091 | u8 padding_for_rate; |
| 966 | __le16 tx_flags; | 1092 | __le16 tx_flags; |
| 967 | u8 data_retries; | 1093 | u8 data_retries; |
| 968 | } __attribute__ ((packed)); | 1094 | } __packed; |
| 969 | 1095 | ||
| 970 | 1096 | ||
| 971 | /* HT */ | 1097 | /* HT */ |
| @@ -976,9 +1102,12 @@ void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u1 | |||
| 976 | void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, | 1102 | void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, |
| 977 | const u8 *da, u16 tid, | 1103 | const u8 *da, u16 tid, |
| 978 | u16 initiator, u16 reason_code); | 1104 | u16 initiator, u16 reason_code); |
| 1105 | int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata, | ||
| 1106 | enum ieee80211_smps_mode smps, const u8 *da, | ||
| 1107 | const u8 *bssid); | ||
| 979 | 1108 | ||
| 980 | void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *da, | 1109 | void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, |
| 981 | u16 tid, u16 initiator, u16 reason); | 1110 | u16 initiator, u16 reason); |
| 982 | void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, | 1111 | void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, |
| 983 | u16 initiator, u16 reason); | 1112 | u16 initiator, u16 reason); |
| 984 | void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta); | 1113 | void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta); |
| @@ -998,6 +1127,10 @@ int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | |||
| 998 | enum ieee80211_back_parties initiator); | 1127 | enum ieee80211_back_parties initiator); |
| 999 | int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | 1128 | int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, |
| 1000 | enum ieee80211_back_parties initiator); | 1129 | enum ieee80211_back_parties initiator); |
| 1130 | void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid); | ||
| 1131 | void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); | ||
| 1132 | void ieee80211_ba_session_work(struct work_struct *work); | ||
| 1133 | void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid); | ||
| 1001 | 1134 | ||
| 1002 | /* Spectrum management */ | 1135 | /* Spectrum management */ |
| 1003 | void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, | 1136 | void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, |
| @@ -1054,7 +1187,7 @@ void ieee80211_send_nullfunc(struct ieee80211_local *local, | |||
| 1054 | int powersave); | 1187 | int powersave); |
| 1055 | void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, | 1188 | void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, |
| 1056 | struct ieee80211_hdr *hdr); | 1189 | struct ieee80211_hdr *hdr); |
| 1057 | void ieee80211_beacon_loss_work(struct work_struct *work); | 1190 | void ieee80211_beacon_connection_loss_work(struct work_struct *work); |
| 1058 | 1191 | ||
| 1059 | void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw, | 1192 | void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw, |
| 1060 | enum queue_stop_reason reason); | 1193 | enum queue_stop_reason reason); |
| @@ -1086,6 +1219,42 @@ void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, | |||
| 1086 | u32 ieee80211_sta_get_rates(struct ieee80211_local *local, | 1219 | u32 ieee80211_sta_get_rates(struct ieee80211_local *local, |
| 1087 | struct ieee802_11_elems *elems, | 1220 | struct ieee802_11_elems *elems, |
| 1088 | enum ieee80211_band band); | 1221 | enum ieee80211_band band); |
| 1222 | int __ieee80211_request_smps(struct ieee80211_sub_if_data *sdata, | ||
| 1223 | enum ieee80211_smps_mode smps_mode); | ||
| 1224 | void ieee80211_recalc_smps(struct ieee80211_local *local, | ||
| 1225 | struct ieee80211_sub_if_data *forsdata); | ||
| 1226 | |||
| 1227 | size_t ieee80211_ie_split(const u8 *ies, size_t ielen, | ||
| 1228 | const u8 *ids, int n_ids, size_t offset); | ||
| 1229 | size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset); | ||
| 1230 | |||
| 1231 | /* internal work items */ | ||
| 1232 | void ieee80211_work_init(struct ieee80211_local *local); | ||
| 1233 | void ieee80211_add_work(struct ieee80211_work *wk); | ||
| 1234 | void free_work(struct ieee80211_work *wk); | ||
| 1235 | void ieee80211_work_purge(struct ieee80211_sub_if_data *sdata); | ||
| 1236 | ieee80211_rx_result ieee80211_work_rx_mgmt(struct ieee80211_sub_if_data *sdata, | ||
| 1237 | struct sk_buff *skb); | ||
| 1238 | int ieee80211_wk_remain_on_channel(struct ieee80211_sub_if_data *sdata, | ||
| 1239 | struct ieee80211_channel *chan, | ||
| 1240 | enum nl80211_channel_type channel_type, | ||
| 1241 | unsigned int duration, u64 *cookie); | ||
| 1242 | int ieee80211_wk_cancel_remain_on_channel( | ||
| 1243 | struct ieee80211_sub_if_data *sdata, u64 cookie); | ||
| 1244 | |||
| 1245 | /* channel management */ | ||
| 1246 | enum ieee80211_chan_mode { | ||
| 1247 | CHAN_MODE_UNDEFINED, | ||
| 1248 | CHAN_MODE_HOPPING, | ||
| 1249 | CHAN_MODE_FIXED, | ||
| 1250 | }; | ||
| 1251 | |||
| 1252 | enum ieee80211_chan_mode | ||
| 1253 | ieee80211_get_channel_mode(struct ieee80211_local *local, | ||
| 1254 | struct ieee80211_sub_if_data *ignore); | ||
| 1255 | bool ieee80211_set_channel_type(struct ieee80211_local *local, | ||
| 1256 | struct ieee80211_sub_if_data *sdata, | ||
| 1257 | enum nl80211_channel_type chantype); | ||
| 1089 | 1258 | ||
| 1090 | #ifdef CONFIG_MAC80211_NOINLINE | 1259 | #ifdef CONFIG_MAC80211_NOINLINE |
| 1091 | #define debug_noinline noinline | 1260 | #define debug_noinline noinline |
