1f0706e82SJiri Benc /* 2f0706e82SJiri Benc * Copyright 2002-2005, Instant802 Networks, Inc. 3f0706e82SJiri Benc * Copyright 2005, Devicescape Software, Inc. 4f0706e82SJiri Benc * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 5e039fa4aSJohannes Berg * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net> 6f0706e82SJiri Benc * 7f0706e82SJiri Benc * This program is free software; you can redistribute it and/or modify 8f0706e82SJiri Benc * it under the terms of the GNU General Public License version 2 as 9f0706e82SJiri Benc * published by the Free Software Foundation. 10f0706e82SJiri Benc */ 11f0706e82SJiri Benc 12f0706e82SJiri Benc #ifndef IEEE80211_I_H 13f0706e82SJiri Benc #define IEEE80211_I_H 14f0706e82SJiri Benc 15f0706e82SJiri Benc #include <linux/kernel.h> 16f0706e82SJiri Benc #include <linux/device.h> 17f0706e82SJiri Benc #include <linux/if_ether.h> 18f0706e82SJiri Benc #include <linux/interrupt.h> 19f0706e82SJiri Benc #include <linux/list.h> 20f0706e82SJiri Benc #include <linux/netdevice.h> 21f0706e82SJiri Benc #include <linux/skbuff.h> 22f0706e82SJiri Benc #include <linux/workqueue.h> 23f0706e82SJiri Benc #include <linux/types.h> 24f0706e82SJiri Benc #include <linux/spinlock.h> 25571ecf67SJohannes Berg #include <linux/etherdevice.h> 26fe7a5d5cSJohannes Berg #include <net/ieee80211_radiotap.h> 2793da9cc1Scolin@cozybit.com #include <net/cfg80211.h> 2851cb6db0SDavid S. Miller #include <net/mac80211.h> 292c8dccc7SJohannes Berg #include "key.h" 30f0706e82SJiri Benc #include "sta_info.h" 31f0706e82SJiri Benc 329cfb0009SJohannes Berg struct ieee80211_local; 33f0706e82SJiri Benc 34f0706e82SJiri Benc /* Maximum number of broadcast/multicast frames to buffer when some of the 35f0706e82SJiri Benc * associated stations are using power saving. */ 36f0706e82SJiri Benc #define AP_MAX_BC_BUFFER 128 37f0706e82SJiri Benc 38f0706e82SJiri Benc /* Maximum number of frames buffered to all STAs, including multicast frames. 39f0706e82SJiri Benc * Note: increasing this limit increases the potential memory requirement. Each 40f0706e82SJiri Benc * frame can be up to about 2 kB long. */ 41f0706e82SJiri Benc #define TOTAL_MAX_TX_BUFFER 512 42f0706e82SJiri Benc 43f0706e82SJiri Benc /* Required encryption head and tailroom */ 44f0706e82SJiri Benc #define IEEE80211_ENCRYPT_HEADROOM 8 45765cb46aSJouni Malinen #define IEEE80211_ENCRYPT_TAILROOM 18 46f0706e82SJiri Benc 47f0706e82SJiri Benc /* IEEE 802.11 (Ch. 9.5 Defragmentation) requires support for concurrent 48f0706e82SJiri Benc * reception of at least three fragmented frames. This limit can be increased 49f0706e82SJiri Benc * by changing this define, at the cost of slower frame reassembly and 50f0706e82SJiri Benc * increased memory use (about 2 kB of RAM per entry). */ 51f0706e82SJiri Benc #define IEEE80211_FRAGMENT_MAX 4 52f0706e82SJiri Benc 530a51b27eSJohannes Berg /* 540a51b27eSJohannes Berg * Time after which we ignore scan results and no longer report/use 550a51b27eSJohannes Berg * them in any way. 560a51b27eSJohannes Berg */ 570a51b27eSJohannes Berg #define IEEE80211_SCAN_RESULT_EXPIRE (10 * HZ) 580a51b27eSJohannes Berg 5920ad19d0SJohannes Berg #define TU_TO_EXP_TIME(x) (jiffies + usecs_to_jiffies((x) * 1024)) 6020ad19d0SJohannes Berg 61f0706e82SJiri Benc struct ieee80211_fragment_entry { 62f0706e82SJiri Benc unsigned long first_frag_time; 63f0706e82SJiri Benc unsigned int seq; 64f0706e82SJiri Benc unsigned int rx_queue; 65f0706e82SJiri Benc unsigned int last_frag; 66f0706e82SJiri Benc unsigned int extra_len; 67f0706e82SJiri Benc struct sk_buff_head skb_list; 68f0706e82SJiri Benc int ccmp; /* Whether fragments were encrypted with CCMP */ 69f0706e82SJiri Benc u8 last_pn[6]; /* PN of the last fragment if CCMP was used */ 70f0706e82SJiri Benc }; 71f0706e82SJiri Benc 72f0706e82SJiri Benc 73c2b13452SJohannes Berg struct ieee80211_bss { 7400d3f14cSJohannes Berg /* Yes, this is a hack */ 7500d3f14cSJohannes Berg struct cfg80211_bss cbss; 7600d3f14cSJohannes Berg 7700d3f14cSJohannes Berg /* don't want to look up all the time */ 78056cdd59SJohannes Berg size_t ssid_len; 79f0706e82SJiri Benc u8 ssid[IEEE80211_MAX_SSID_LEN]; 8000d3f14cSJohannes Berg 8198f7dfd8SEmmanuel Grumbach u8 dtim_period; 8200d3f14cSJohannes Berg 8343ac2ca3SJouni Malinen bool wmm_used; 8400d3f14cSJohannes Berg 8500d3f14cSJohannes Berg unsigned long last_probe_resp; 8600d3f14cSJohannes Berg 87ee385855SLuis Carlos Cobo #ifdef CONFIG_MAC80211_MESH 88ee385855SLuis Carlos Cobo u8 *mesh_id; 89ee385855SLuis Carlos Cobo size_t mesh_id_len; 9024736701SJohn W. Linville u8 *mesh_cfg; 91902acc78SJohannes Berg #endif 9200d3f14cSJohannes Berg 93f0706e82SJiri Benc #define IEEE80211_MAX_SUPP_RATES 32 94f0706e82SJiri Benc u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; 95f0706e82SJiri Benc size_t supp_rates_len; 96f0706e82SJiri Benc 9700d3f14cSJohannes Berg /* 9800d3f14cSJohannes Berg * During assocation, we save an ERP value from a probe response so 995628221cSDaniel Drake * that we can feed ERP info to the driver when handling the 1005628221cSDaniel Drake * association completes. these fields probably won't be up-to-date 10100d3f14cSJohannes Berg * otherwise, you probably don't want to use them. 10200d3f14cSJohannes Berg */ 10300d3f14cSJohannes Berg bool has_erp_value; 1045628221cSDaniel Drake u8 erp_value; 105f0706e82SJiri Benc }; 106f0706e82SJiri Benc 107c2b13452SJohannes Berg static inline u8 *bss_mesh_cfg(struct ieee80211_bss *bss) 108902acc78SJohannes Berg { 109902acc78SJohannes Berg #ifdef CONFIG_MAC80211_MESH 110902acc78SJohannes Berg return bss->mesh_cfg; 111902acc78SJohannes Berg #endif 112902acc78SJohannes Berg return NULL; 113902acc78SJohannes Berg } 114902acc78SJohannes Berg 115c2b13452SJohannes Berg static inline u8 *bss_mesh_id(struct ieee80211_bss *bss) 116902acc78SJohannes Berg { 117902acc78SJohannes Berg #ifdef CONFIG_MAC80211_MESH 118902acc78SJohannes Berg return bss->mesh_id; 119902acc78SJohannes Berg #endif 120902acc78SJohannes Berg return NULL; 121902acc78SJohannes Berg } 122902acc78SJohannes Berg 123c2b13452SJohannes Berg static inline u8 bss_mesh_id_len(struct ieee80211_bss *bss) 124902acc78SJohannes Berg { 125902acc78SJohannes Berg #ifdef CONFIG_MAC80211_MESH 126902acc78SJohannes Berg return bss->mesh_id_len; 127902acc78SJohannes Berg #endif 128902acc78SJohannes Berg return 0; 129902acc78SJohannes Berg } 130902acc78SJohannes Berg 131f0706e82SJiri Benc 1329ae54c84SJohannes Berg typedef unsigned __bitwise__ ieee80211_tx_result; 1339ae54c84SJohannes Berg #define TX_CONTINUE ((__force ieee80211_tx_result) 0u) 1349ae54c84SJohannes Berg #define TX_DROP ((__force ieee80211_tx_result) 1u) 1359ae54c84SJohannes Berg #define TX_QUEUED ((__force ieee80211_tx_result) 2u) 1369ae54c84SJohannes Berg 1375cf121c3SJohannes Berg #define IEEE80211_TX_FRAGMENTED BIT(0) 1385cf121c3SJohannes Berg #define IEEE80211_TX_UNICAST BIT(1) 1395cf121c3SJohannes Berg #define IEEE80211_TX_PS_BUFFERED BIT(2) 1409ae54c84SJohannes Berg 1415cf121c3SJohannes Berg struct ieee80211_tx_data { 142f0706e82SJiri Benc struct sk_buff *skb; 143f0706e82SJiri Benc struct net_device *dev; 144f0706e82SJiri Benc struct ieee80211_local *local; 145f0706e82SJiri Benc struct ieee80211_sub_if_data *sdata; 146f0706e82SJiri Benc struct sta_info *sta; 147f0706e82SJiri Benc struct ieee80211_key *key; 1485cf121c3SJohannes Berg 1498318d78aSJohannes Berg struct ieee80211_channel *channel; 150f0706e82SJiri Benc 151a4b7d7bdSHarvey Harrison u16 ethertype; 152056cdd59SJohannes Berg unsigned int flags; 1535cf121c3SJohannes Berg }; 1545cf121c3SJohannes Berg 1555cf121c3SJohannes Berg 1565cf121c3SJohannes Berg typedef unsigned __bitwise__ ieee80211_rx_result; 1575cf121c3SJohannes Berg #define RX_CONTINUE ((__force ieee80211_rx_result) 0u) 1585cf121c3SJohannes Berg #define RX_DROP_UNUSABLE ((__force ieee80211_rx_result) 1u) 1595cf121c3SJohannes Berg #define RX_DROP_MONITOR ((__force ieee80211_rx_result) 2u) 1605cf121c3SJohannes Berg #define RX_QUEUED ((__force ieee80211_rx_result) 3u) 1615cf121c3SJohannes Berg 1625cf121c3SJohannes Berg #define IEEE80211_RX_IN_SCAN BIT(0) 1635cf121c3SJohannes Berg /* frame is destined to interface currently processed (incl. multicast frames) */ 1645cf121c3SJohannes Berg #define IEEE80211_RX_RA_MATCH BIT(1) 1655cf121c3SJohannes Berg #define IEEE80211_RX_AMSDU BIT(2) 166*8c0c709eSJohannes Berg #define IEEE80211_RX_FRAGMENTED BIT(3) 1675cf121c3SJohannes Berg 1685cf121c3SJohannes Berg struct ieee80211_rx_data { 1695cf121c3SJohannes Berg struct sk_buff *skb; 1705cf121c3SJohannes Berg struct ieee80211_local *local; 1715cf121c3SJohannes Berg struct ieee80211_sub_if_data *sdata; 1725cf121c3SJohannes Berg struct sta_info *sta; 1735cf121c3SJohannes Berg struct ieee80211_key *key; 174056cdd59SJohannes Berg 175056cdd59SJohannes Berg unsigned int flags; 176f0706e82SJiri Benc int queue; 17750741ae0SJohannes Berg u32 tkip_iv32; 17850741ae0SJohannes Berg u16 tkip_iv16; 179f0706e82SJiri Benc }; 180f0706e82SJiri Benc 1815dfdaf58SJohannes Berg struct beacon_data { 1825dfdaf58SJohannes Berg u8 *head, *tail; 1835dfdaf58SJohannes Berg int head_len, tail_len; 1845dfdaf58SJohannes Berg int dtim_period; 1855dfdaf58SJohannes Berg }; 1865dfdaf58SJohannes Berg 187f0706e82SJiri Benc struct ieee80211_if_ap { 1885dfdaf58SJohannes Berg struct beacon_data *beacon; 189f0706e82SJiri Benc 1900ec3ca44SJohannes Berg struct list_head vlans; 1910ec3ca44SJohannes Berg 192f0706e82SJiri Benc /* yes, this looks ugly, but guarantees that we can later use 193f0706e82SJiri Benc * bitmap_empty :) 194004c872eSJohannes Berg * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */ 195f0706e82SJiri Benc u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)]; 196f0706e82SJiri Benc struct sk_buff_head ps_bc_buf; 197056cdd59SJohannes Berg atomic_t num_sta_ps; /* number of stations in PS mode */ 1985dfdaf58SJohannes Berg int dtim_count; 199f0706e82SJiri Benc }; 200f0706e82SJiri Benc 201f0706e82SJiri Benc struct ieee80211_if_wds { 202f0706e82SJiri Benc struct sta_info *sta; 203056cdd59SJohannes Berg u8 remote_addr[ETH_ALEN]; 204f0706e82SJiri Benc }; 205f0706e82SJiri Benc 206f0706e82SJiri Benc struct ieee80211_if_vlan { 2070ec3ca44SJohannes Berg struct list_head list; 208f14543eeSFelix Fietkau 209f14543eeSFelix Fietkau /* used for all tx if the VLAN is configured to 4-addr mode */ 210f14543eeSFelix Fietkau struct sta_info *sta; 211f0706e82SJiri Benc }; 212f0706e82SJiri Benc 213ee385855SLuis Carlos Cobo struct mesh_stats { 214c8a61a7dSDaniel Walker __u32 fwded_mcast; /* Mesh forwarded multicast frames */ 215c8a61a7dSDaniel Walker __u32 fwded_unicast; /* Mesh forwarded unicast frames */ 216c8a61a7dSDaniel Walker __u32 fwded_frames; /* Mesh total forwarded frames */ 217ee385855SLuis Carlos Cobo __u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/ 218ee385855SLuis Carlos Cobo __u32 dropped_frames_no_route; /* Not transmitted, no route found */ 219ee385855SLuis Carlos Cobo atomic_t estab_plinks; 220ee385855SLuis Carlos Cobo }; 221ee385855SLuis Carlos Cobo 222ee385855SLuis Carlos Cobo #define PREQ_Q_F_START 0x1 223ee385855SLuis Carlos Cobo #define PREQ_Q_F_REFRESH 0x2 224ee385855SLuis Carlos Cobo struct mesh_preq_queue { 225ee385855SLuis Carlos Cobo struct list_head list; 226ee385855SLuis Carlos Cobo u8 dst[ETH_ALEN]; 227ee385855SLuis Carlos Cobo u8 flags; 228ee385855SLuis Carlos Cobo }; 229ee385855SLuis Carlos Cobo 23077fdaa12SJohannes Berg enum ieee80211_mgd_state { 23177fdaa12SJohannes Berg IEEE80211_MGD_STATE_IDLE, 23277fdaa12SJohannes Berg IEEE80211_MGD_STATE_PROBE, 23377fdaa12SJohannes Berg IEEE80211_MGD_STATE_AUTH, 23477fdaa12SJohannes Berg IEEE80211_MGD_STATE_ASSOC, 23577fdaa12SJohannes Berg }; 23677fdaa12SJohannes Berg 23777fdaa12SJohannes Berg struct ieee80211_mgd_work { 23877fdaa12SJohannes Berg struct list_head list; 23977fdaa12SJohannes Berg struct ieee80211_bss *bss; 24077fdaa12SJohannes Berg int ie_len; 24177fdaa12SJohannes Berg u8 prev_bssid[ETH_ALEN]; 24277fdaa12SJohannes Berg u8 ssid[IEEE80211_MAX_SSID_LEN]; 24377fdaa12SJohannes Berg u8 ssid_len; 24477fdaa12SJohannes Berg unsigned long timeout; 24577fdaa12SJohannes Berg enum ieee80211_mgd_state state; 24677fdaa12SJohannes Berg u16 auth_alg, auth_transaction; 24777fdaa12SJohannes Berg 24877fdaa12SJohannes Berg int tries; 24977fdaa12SJohannes Berg 250fffd0934SJohannes Berg u8 key[WLAN_KEY_LEN_WEP104]; 251fffd0934SJohannes Berg u8 key_len, key_idx; 252fffd0934SJohannes Berg 25377fdaa12SJohannes Berg /* must be last */ 25477fdaa12SJohannes Berg u8 ie[0]; /* for auth or assoc frame, not probe */ 25577fdaa12SJohannes Berg }; 25677fdaa12SJohannes Berg 25746900298SJohannes Berg /* flags used in struct ieee80211_if_managed.flags */ 258ab1faeadSJohannes Berg enum ieee80211_sta_flags { 259b291ba11SJohannes Berg IEEE80211_STA_BEACON_POLL = BIT(0), 260b291ba11SJohannes Berg IEEE80211_STA_CONNECTION_POLL = BIT(1), 261b291ba11SJohannes Berg IEEE80211_STA_CONTROL_PORT = BIT(2), 262b291ba11SJohannes Berg IEEE80211_STA_WMM_ENABLED = BIT(3), 263b291ba11SJohannes Berg IEEE80211_STA_DISABLE_11N = BIT(4), 264b291ba11SJohannes Berg IEEE80211_STA_CSA_RECEIVED = BIT(5), 265b291ba11SJohannes Berg IEEE80211_STA_MFP_ENABLED = BIT(6), 266ab1faeadSJohannes Berg }; 267ab1faeadSJohannes Berg 26848c2fc59STomas Winkler /* flags for MLME request */ 269ab1faeadSJohannes Berg enum ieee80211_sta_request { 270ab1faeadSJohannes Berg IEEE80211_STA_REQ_SCAN, 271ab1faeadSJohannes Berg }; 27248c2fc59STomas Winkler 27346900298SJohannes Berg struct ieee80211_if_managed { 274056cdd59SJohannes Berg struct timer_list timer; 275b291ba11SJohannes Berg struct timer_list conn_mon_timer; 276b291ba11SJohannes Berg struct timer_list bcn_mon_timer; 277c481ec97SSujith struct timer_list chswitch_timer; 278056cdd59SJohannes Berg struct work_struct work; 279b291ba11SJohannes Berg struct work_struct monitor_work; 280c481ec97SSujith struct work_struct chswitch_work; 28104de8381SKalle Valo struct work_struct beacon_loss_work; 28246900298SJohannes Berg 283b291ba11SJohannes Berg unsigned long probe_timeout; 284a43abf29SMaxim Levitsky int probe_send_count; 285b291ba11SJohannes Berg 28677fdaa12SJohannes Berg struct mutex mtx; 28777fdaa12SJohannes Berg struct ieee80211_bss *associated; 288e21546a2SJohannes Berg struct ieee80211_mgd_work *old_associate_work; 28977fdaa12SJohannes Berg struct list_head work_list; 29046900298SJohannes Berg 29177fdaa12SJohannes Berg u8 bssid[ETH_ALEN]; 29246900298SJohannes Berg 293f0706e82SJiri Benc u16 aid; 294a7c1cfc9SJohannes Berg u16 capab; 295f0706e82SJiri Benc 296056cdd59SJohannes Berg struct sk_buff_head skb_queue; 297056cdd59SJohannes Berg 2985bb644a0SJohannes Berg unsigned long timers_running; /* used for quiesce/restart */ 299965bedadSJohannes Berg bool powersave; /* powersave requested for this iface */ 300965bedadSJohannes Berg 301056cdd59SJohannes Berg unsigned long request; 302056cdd59SJohannes Berg 303d6f2da5bSJiri Slaby unsigned int flags; 304f0706e82SJiri Benc 305d91f36dbSJohannes Berg u32 beacon_crc; 306d91f36dbSJohannes Berg 307fdfacf0aSJouni Malinen enum { 308fdfacf0aSJouni Malinen IEEE80211_MFP_DISABLED, 309fdfacf0aSJouni Malinen IEEE80211_MFP_OPTIONAL, 310fdfacf0aSJouni Malinen IEEE80211_MFP_REQUIRED 311fdfacf0aSJouni Malinen } mfp; /* management frame protection */ 312fdfacf0aSJouni Malinen 313f0706e82SJiri Benc int wmm_last_param_set; 3149bc383deSJohannes Berg 3159bc383deSJohannes Berg u8 use_4addr; 316f0706e82SJiri Benc }; 317f0706e82SJiri Benc 31846900298SJohannes Berg enum ieee80211_ibss_request { 31946900298SJohannes Berg IEEE80211_IBSS_REQ_RUN = 0, 32046900298SJohannes Berg }; 32146900298SJohannes Berg 32246900298SJohannes Berg struct ieee80211_if_ibss { 32346900298SJohannes Berg struct timer_list timer; 32446900298SJohannes Berg struct work_struct work; 32546900298SJohannes Berg 32646900298SJohannes Berg struct sk_buff_head skb_queue; 32746900298SJohannes Berg 328af8cdcd8SJohannes Berg unsigned long request; 329af8cdcd8SJohannes Berg unsigned long last_scan_completed; 3305bb644a0SJohannes Berg 3315bb644a0SJohannes Berg bool timer_running; 3325bb644a0SJohannes Berg 333af8cdcd8SJohannes Berg bool fixed_bssid; 334af8cdcd8SJohannes Berg bool fixed_channel; 335fffd0934SJohannes Berg bool privacy; 33646900298SJohannes Berg 33746900298SJohannes Berg u8 bssid[ETH_ALEN]; 338af8cdcd8SJohannes Berg u8 ssid[IEEE80211_MAX_SSID_LEN]; 339af8cdcd8SJohannes Berg u8 ssid_len, ie_len; 340af8cdcd8SJohannes Berg u8 *ie; 341af8cdcd8SJohannes Berg struct ieee80211_channel *channel; 34246900298SJohannes Berg 34346900298SJohannes Berg unsigned long ibss_join_req; 344af8cdcd8SJohannes Berg /* probe response/beacon for IBSS */ 345af8cdcd8SJohannes Berg struct sk_buff *presp, *skb; 34646900298SJohannes Berg 34746900298SJohannes Berg enum { 34846900298SJohannes Berg IEEE80211_IBSS_MLME_SEARCH, 34946900298SJohannes Berg IEEE80211_IBSS_MLME_JOINED, 35046900298SJohannes Berg } state; 35146900298SJohannes Berg }; 35246900298SJohannes Berg 353472dbc45SJohannes Berg struct ieee80211_if_mesh { 354472dbc45SJohannes Berg struct work_struct work; 355472dbc45SJohannes Berg struct timer_list housekeeping_timer; 356472dbc45SJohannes Berg struct timer_list mesh_path_timer; 357e304bfd3SRui Paulo struct timer_list mesh_path_root_timer; 358472dbc45SJohannes Berg struct sk_buff_head skb_queue; 359472dbc45SJohannes Berg 3605bb644a0SJohannes Berg unsigned long timers_running; 3615bb644a0SJohannes Berg 36218889231SJavier Cardona unsigned long wrkq_flags; 363472dbc45SJohannes Berg 364472dbc45SJohannes Berg u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN]; 365472dbc45SJohannes Berg size_t mesh_id_len; 366472dbc45SJohannes Berg /* Active Path Selection Protocol Identifier */ 3673491707aSRui Paulo u8 mesh_pp_id; 368472dbc45SJohannes Berg /* Active Path Selection Metric Identifier */ 3693491707aSRui Paulo u8 mesh_pm_id; 370472dbc45SJohannes Berg /* Congestion Control Mode Identifier */ 3713491707aSRui Paulo u8 mesh_cc_id; 3729e03fdfdSJavier Cardona /* Synchronization Protocol Identifier */ 3733491707aSRui Paulo u8 mesh_sp_id; 3749e03fdfdSJavier Cardona /* Authentication Protocol Identifier */ 3753491707aSRui Paulo u8 mesh_auth_id; 376d19b3bf6SRui Paulo /* Local mesh Sequence Number */ 377d19b3bf6SRui Paulo u32 sn; 378472dbc45SJohannes Berg /* Last used PREQ ID */ 379472dbc45SJohannes Berg u32 preq_id; 380472dbc45SJohannes Berg atomic_t mpaths; 381d19b3bf6SRui Paulo /* Timestamp of last SN update */ 382d19b3bf6SRui Paulo unsigned long last_sn_update; 383d19b3bf6SRui Paulo /* Timestamp of last SN sent */ 384472dbc45SJohannes Berg unsigned long last_preq; 385472dbc45SJohannes Berg struct mesh_rmc *rmc; 386472dbc45SJohannes Berg spinlock_t mesh_preq_queue_lock; 387472dbc45SJohannes Berg struct mesh_preq_queue preq_queue; 388472dbc45SJohannes Berg int preq_queue_len; 389472dbc45SJohannes Berg struct mesh_stats mshstats; 390472dbc45SJohannes Berg struct mesh_config mshcfg; 391472dbc45SJohannes Berg u32 mesh_seqnum; 392472dbc45SJohannes Berg bool accepting_plinks; 393472dbc45SJohannes Berg }; 394902acc78SJohannes Berg 395902acc78SJohannes Berg #ifdef CONFIG_MAC80211_MESH 396472dbc45SJohannes Berg #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name) \ 397472dbc45SJohannes Berg do { (msh)->mshstats.name++; } while (0) 398902acc78SJohannes Berg #else 399472dbc45SJohannes Berg #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name) \ 400902acc78SJohannes Berg do { } while (0) 401902acc78SJohannes Berg #endif 402f0706e82SJiri Benc 403213cd118SJohannes Berg /** 404213cd118SJohannes Berg * enum ieee80211_sub_if_data_flags - virtual interface flags 405213cd118SJohannes Berg * 406213cd118SJohannes Berg * @IEEE80211_SDATA_ALLMULTI: interface wants all multicast packets 407213cd118SJohannes Berg * @IEEE80211_SDATA_PROMISC: interface is promisc 408213cd118SJohannes Berg * @IEEE80211_SDATA_OPERATING_GMODE: operating in G-only mode 409213cd118SJohannes Berg * @IEEE80211_SDATA_DONT_BRIDGE_PACKETS: bridge packets between 410213cd118SJohannes Berg * associated stations and deliver multicast frames both 411213cd118SJohannes Berg * back to wireless media and to the local net stack. 412213cd118SJohannes Berg */ 413213cd118SJohannes Berg enum ieee80211_sub_if_data_flags { 414213cd118SJohannes Berg IEEE80211_SDATA_ALLMULTI = BIT(0), 415213cd118SJohannes Berg IEEE80211_SDATA_PROMISC = BIT(1), 4167986cf95SJohannes Berg IEEE80211_SDATA_OPERATING_GMODE = BIT(2), 4177986cf95SJohannes Berg IEEE80211_SDATA_DONT_BRIDGE_PACKETS = BIT(3), 418213cd118SJohannes Berg }; 419213cd118SJohannes Berg 420f0706e82SJiri Benc struct ieee80211_sub_if_data { 421f0706e82SJiri Benc struct list_head list; 422f0706e82SJiri Benc 423f0706e82SJiri Benc struct wireless_dev wdev; 424f0706e82SJiri Benc 42511a843b7SJohannes Berg /* keys */ 42611a843b7SJohannes Berg struct list_head key_list; 42711a843b7SJohannes Berg 428f0706e82SJiri Benc struct net_device *dev; 429f0706e82SJiri Benc struct ieee80211_local *local; 430f0706e82SJiri Benc 43113262ffdSJiri Slaby unsigned int flags; 4327e9ed188SDaniel Drake 433f0706e82SJiri Benc int drop_unencrypted; 434f0706e82SJiri Benc 435413ad50aSJohannes Berg /* 436413ad50aSJohannes Berg * keep track of whether the HT opmode (stored in 437413ad50aSJohannes Berg * vif.bss_info.ht_operation_mode) is valid. 438413ad50aSJohannes Berg */ 439413ad50aSJohannes Berg bool ht_opmode_valid; 440413ad50aSJohannes Berg 441f0706e82SJiri Benc /* Fragment table for host-based reassembly */ 442f0706e82SJiri Benc struct ieee80211_fragment_entry fragments[IEEE80211_FRAGMENT_MAX]; 443f0706e82SJiri Benc unsigned int fragment_next; 444f0706e82SJiri Benc 445f0706e82SJiri Benc #define NUM_DEFAULT_KEYS 4 4463cfcf6acSJouni Malinen #define NUM_DEFAULT_MGMT_KEYS 2 4473cfcf6acSJouni Malinen struct ieee80211_key *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS]; 448f0706e82SJiri Benc struct ieee80211_key *default_key; 4493cfcf6acSJouni Malinen struct ieee80211_key *default_mgmt_key; 450f0706e82SJiri Benc 45194778280SJohannes Berg u16 sequence_number; 45294778280SJohannes Berg 4533e122be0SJohannes Berg /* 4543e122be0SJohannes Berg * AP this belongs to: self in AP mode and 4553e122be0SJohannes Berg * corresponding AP in VLAN mode, NULL for 4563e122be0SJohannes Berg * all others (might be needed later in IBSS) 4573e122be0SJohannes Berg */ 4583e122be0SJohannes Berg struct ieee80211_if_ap *bss; 4593e122be0SJohannes Berg 4603e122be0SJohannes Berg int force_unicast_rateidx; /* forced TX rateidx for unicast frames */ 4613e122be0SJohannes Berg int max_ratectrl_rateidx; /* max TX rateidx for rate control */ 462f0706e82SJiri Benc 463f0706e82SJiri Benc union { 464f0706e82SJiri Benc struct ieee80211_if_ap ap; 465f0706e82SJiri Benc struct ieee80211_if_wds wds; 466f0706e82SJiri Benc struct ieee80211_if_vlan vlan; 46746900298SJohannes Berg struct ieee80211_if_managed mgd; 46846900298SJohannes Berg struct ieee80211_if_ibss ibss; 469472dbc45SJohannes Berg #ifdef CONFIG_MAC80211_MESH 470472dbc45SJohannes Berg struct ieee80211_if_mesh mesh; 471472dbc45SJohannes Berg #endif 4728cc9a739SMichael Wu u32 mntr_flags; 473f0706e82SJiri Benc } u; 474e9f207f0SJiri Benc 475e9f207f0SJiri Benc #ifdef CONFIG_MAC80211_DEBUGFS 476e9f207f0SJiri Benc struct { 4777bcfaf2fSJohannes Berg struct dentry *dir; 4782b58b209SJouni Malinen struct dentry *default_key; 4793cfcf6acSJouni Malinen struct dentry *default_mgmt_key; 4807bcfaf2fSJohannes Berg } debugfs; 481e9f207f0SJiri Benc #endif 48232bfd35dSJohannes Berg /* must be last, dynamically sized area in this! */ 48332bfd35dSJohannes Berg struct ieee80211_vif vif; 484f0706e82SJiri Benc }; 485f0706e82SJiri Benc 48632bfd35dSJohannes Berg static inline 48732bfd35dSJohannes Berg struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p) 48832bfd35dSJohannes Berg { 48932bfd35dSJohannes Berg return container_of(p, struct ieee80211_sub_if_data, vif); 49032bfd35dSJohannes Berg } 49132bfd35dSJohannes Berg 492472dbc45SJohannes Berg static inline void 493472dbc45SJohannes Berg ieee80211_sdata_set_mesh_id(struct ieee80211_sub_if_data *sdata, 494472dbc45SJohannes Berg u8 mesh_id_len, u8 *mesh_id) 495472dbc45SJohannes Berg { 496472dbc45SJohannes Berg #ifdef CONFIG_MAC80211_MESH 497472dbc45SJohannes Berg struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 498472dbc45SJohannes Berg ifmsh->mesh_id_len = mesh_id_len; 499472dbc45SJohannes Berg memcpy(ifmsh->mesh_id, mesh_id, mesh_id_len); 500472dbc45SJohannes Berg #else 501472dbc45SJohannes Berg WARN_ON(1); 502472dbc45SJohannes Berg #endif 503472dbc45SJohannes Berg } 504472dbc45SJohannes Berg 505f0706e82SJiri Benc enum { 506f0706e82SJiri Benc IEEE80211_RX_MSG = 1, 507f0706e82SJiri Benc IEEE80211_TX_STATUS_MSG = 2, 508eadc8d9eSRon Rindjunsky IEEE80211_DELBA_MSG = 3, 509eadc8d9eSRon Rindjunsky IEEE80211_ADDBA_MSG = 4, 510f0706e82SJiri Benc }; 511f0706e82SJiri Benc 512ce7c9111SKalle Valo enum queue_stop_reason { 513ce7c9111SKalle Valo IEEE80211_QUEUE_STOP_REASON_DRIVER, 514520eb820SKalle Valo IEEE80211_QUEUE_STOP_REASON_PS, 51596f5e66eSJohannes Berg IEEE80211_QUEUE_STOP_REASON_CSA, 51696f5e66eSJohannes Berg IEEE80211_QUEUE_STOP_REASON_AGGREGATION, 51725420604SJohannes Berg IEEE80211_QUEUE_STOP_REASON_SUSPEND, 5188f77f384SJohannes Berg IEEE80211_QUEUE_STOP_REASON_SKB_ADD, 519ce7c9111SKalle Valo }; 520ce7c9111SKalle Valo 521142b9f50SHelmut Schaa /** 522142b9f50SHelmut Schaa * mac80211 scan flags - currently active scan mode 523142b9f50SHelmut Schaa * 524142b9f50SHelmut Schaa * @SCAN_SW_SCANNING: We're currently in the process of scanning but may as 525142b9f50SHelmut Schaa * well be on the operating channel 526142b9f50SHelmut Schaa * @SCAN_HW_SCANNING: The hardware is scanning for us, we have no way to 527142b9f50SHelmut Schaa * determine if we are on the operating channel or not 528142b9f50SHelmut Schaa * @SCAN_OFF_CHANNEL: We're off our operating channel for scanning, 529142b9f50SHelmut Schaa * gets only set in conjunction with SCAN_SW_SCANNING 530142b9f50SHelmut Schaa */ 531fbe9c429SHelmut Schaa enum { 532fbe9c429SHelmut Schaa SCAN_SW_SCANNING, 533142b9f50SHelmut Schaa SCAN_HW_SCANNING, 534142b9f50SHelmut Schaa SCAN_OFF_CHANNEL, 535142b9f50SHelmut Schaa }; 536142b9f50SHelmut Schaa 537142b9f50SHelmut Schaa /** 538142b9f50SHelmut Schaa * enum mac80211_scan_state - scan state machine states 539142b9f50SHelmut Schaa * 540142b9f50SHelmut Schaa * @SCAN_DECISION: Main entry point to the scan state machine, this state 541142b9f50SHelmut Schaa * determines if we should keep on scanning or switch back to the 542142b9f50SHelmut Schaa * operating channel 543142b9f50SHelmut Schaa * @SCAN_SET_CHANNEL: Set the next channel to be scanned 544142b9f50SHelmut Schaa * @SCAN_SEND_PROBE: Send probe requests and wait for probe responses 545142b9f50SHelmut Schaa * @SCAN_LEAVE_OPER_CHANNEL: Leave the operating channel, notify the AP 546142b9f50SHelmut Schaa * about us leaving the channel and stop all associated STA interfaces 547142b9f50SHelmut Schaa * @SCAN_ENTER_OPER_CHANNEL: Enter the operating channel again, notify the 548142b9f50SHelmut Schaa * AP about us being back and restart all associated STA interfaces 549142b9f50SHelmut Schaa */ 550142b9f50SHelmut Schaa enum mac80211_scan_state { 551142b9f50SHelmut Schaa SCAN_DECISION, 552142b9f50SHelmut Schaa SCAN_SET_CHANNEL, 553142b9f50SHelmut Schaa SCAN_SEND_PROBE, 554142b9f50SHelmut Schaa SCAN_LEAVE_OPER_CHANNEL, 555142b9f50SHelmut Schaa SCAN_ENTER_OPER_CHANNEL, 556fbe9c429SHelmut Schaa }; 557fbe9c429SHelmut Schaa 558f0706e82SJiri Benc struct ieee80211_local { 559f0706e82SJiri Benc /* embed the driver visible part. 560f0706e82SJiri Benc * don't cast (use the static inlines below), but we keep 561f0706e82SJiri Benc * it first anyway so they become a no-op */ 562f0706e82SJiri Benc struct ieee80211_hw hw; 563f0706e82SJiri Benc 564f0706e82SJiri Benc const struct ieee80211_ops *ops; 565f0706e82SJiri Benc 56642935ecaSLuis R. Rodriguez /* 56742935ecaSLuis R. Rodriguez * private workqueue to mac80211. mac80211 makes this accessible 56842935ecaSLuis R. Rodriguez * via ieee80211_queue_work() 56942935ecaSLuis R. Rodriguez */ 57042935ecaSLuis R. Rodriguez struct workqueue_struct *workqueue; 57142935ecaSLuis R. Rodriguez 572e4e72fb4SJohannes Berg unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES]; 57396f5e66eSJohannes Berg /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */ 574ce7c9111SKalle Valo spinlock_t queue_stop_reason_lock; 57596f5e66eSJohannes Berg 576f0706e82SJiri Benc int open_count; 5773d30d949SMichael Wu int monitors, cooked_mntrs; 5788cc9a739SMichael Wu /* number of interfaces with corresponding FIF_ flags */ 579e3b90ca2SIgor Perminov int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll; 5804150c572SJohannes Berg unsigned int filter_flags; /* FIF_* */ 5813b8d81e0SJohannes Berg 5823b8d81e0SJohannes Berg /* protects the aggregated multicast list and filter calls */ 5833b8d81e0SJohannes Berg spinlock_t filter_lock; 5843b8d81e0SJohannes Berg 5853ac64beeSJohannes Berg /* used for uploading changed mc list */ 5863ac64beeSJohannes Berg struct work_struct reconfig_filter; 5873ac64beeSJohannes Berg 5883b8d81e0SJohannes Berg /* aggregated multicast list */ 5893b8d81e0SJohannes Berg struct dev_addr_list *mc_list; 5903b8d81e0SJohannes Berg int mc_count; 5913b8d81e0SJohannes Berg 592d0709a65SJohannes Berg bool tim_in_locked_section; /* see ieee80211_beacon_get() */ 5935bb644a0SJohannes Berg 5945bb644a0SJohannes Berg /* 5955bb644a0SJohannes Berg * suspended is true if we finished all the suspend _and_ we have 5965bb644a0SJohannes Berg * not yet come up from resume. This is to be used by mac80211 5975bb644a0SJohannes Berg * to ensure driver sanity during suspend and mac80211's own 5985bb644a0SJohannes Berg * sanity. It can eventually be used for WoW as well. 5995bb644a0SJohannes Berg */ 6005bb644a0SJohannes Berg bool suspended; 6015bb644a0SJohannes Berg 6025bb644a0SJohannes Berg /* 6035bb644a0SJohannes Berg * quiescing is true during the suspend process _only_ to 6045bb644a0SJohannes Berg * ease timer cancelling etc. 6055bb644a0SJohannes Berg */ 6065bb644a0SJohannes Berg bool quiescing; 6075bb644a0SJohannes Berg 608ea77f12fSJohannes Berg /* device is started */ 609ea77f12fSJohannes Berg bool started; 610ea77f12fSJohannes Berg 611b306f453SJohannes Berg int tx_headroom; /* required headroom for hardware/radiotap */ 612f0706e82SJiri Benc 613f0706e82SJiri Benc /* Tasklet and skb queue to process calls from IRQ mode. All frames 614f0706e82SJiri Benc * added to skb_queue will be processed, but frames in 615f0706e82SJiri Benc * skb_queue_unreliable may be dropped if the total length of these 616f0706e82SJiri Benc * queues increases over the limit. */ 617f0706e82SJiri Benc #define IEEE80211_IRQSAFE_QUEUE_LIMIT 128 618f0706e82SJiri Benc struct tasklet_struct tasklet; 619f0706e82SJiri Benc struct sk_buff_head skb_queue; 620f0706e82SJiri Benc struct sk_buff_head skb_queue_unreliable; 621f0706e82SJiri Benc 622d0709a65SJohannes Berg /* Station data */ 623d0709a65SJohannes Berg /* 624d0709a65SJohannes Berg * The lock only protects the list, hash, timer and counter 625d0709a65SJohannes Berg * against manipulation, reads are done in RCU. Additionally, 626b16bd15cSJohannes Berg * the lock protects each BSS's TIM bitmap. 627d0709a65SJohannes Berg */ 628d0709a65SJohannes Berg spinlock_t sta_lock; 629d0709a65SJohannes Berg unsigned long num_sta; 630f0706e82SJiri Benc struct list_head sta_list; 631f0706e82SJiri Benc struct sta_info *sta_hash[STA_HASH_SIZE]; 632f0706e82SJiri Benc struct timer_list sta_cleanup; 633f5ea9120SJohannes Berg int sta_generation; 634f0706e82SJiri Benc 6352a577d98SJohannes Berg struct sk_buff_head pending[IEEE80211_MAX_QUEUES]; 636f0706e82SJiri Benc struct tasklet_struct tx_pending_tasklet; 637f0706e82SJiri Benc 638cd8ffc80SJohannes Berg /* 639cd8ffc80SJohannes Berg * This lock is used to prevent concurrent A-MPDU 640cd8ffc80SJohannes Berg * session start/stop processing, this thus also 641cd8ffc80SJohannes Berg * synchronises the ->ampdu_action() callback to 642cd8ffc80SJohannes Berg * drivers and limits it to one at a time. 643cd8ffc80SJohannes Berg */ 644cd8ffc80SJohannes Berg spinlock_t ampdu_lock; 645cd8ffc80SJohannes Berg 646f0706e82SJiri Benc /* number of interfaces with corresponding IFF_ flags */ 64753918994SJohannes Berg atomic_t iff_allmultis, iff_promiscs; 648f0706e82SJiri Benc 649f0706e82SJiri Benc struct rate_control_ref *rate_ctrl; 650f0706e82SJiri Benc 651f0706e82SJiri Benc struct crypto_blkcipher *wep_tx_tfm; 652f0706e82SJiri Benc struct crypto_blkcipher *wep_rx_tfm; 653f0706e82SJiri Benc u32 wep_iv; 654f0706e82SJiri Benc 655c771c9d8SJohannes Berg /* see iface.c */ 65679010420SJohannes Berg struct list_head interfaces; 657c771c9d8SJohannes Berg struct mutex iflist_mtx; 65879010420SJohannes Berg 659b16bd15cSJohannes Berg /* 660b16bd15cSJohannes Berg * Key lock, protects sdata's key_list and sta_info's 661b16bd15cSJohannes Berg * key pointers (write access, they're RCU.) 662b16bd15cSJohannes Berg */ 663b16bd15cSJohannes Berg spinlock_t key_lock; 664b16bd15cSJohannes Berg 665b16bd15cSJohannes Berg 666c2b13452SJohannes Berg /* Scanning and BSS list */ 667f3b85252SJohannes Berg struct mutex scan_mtx; 668fbe9c429SHelmut Schaa unsigned long scanning; 6692a519311SJohannes Berg struct cfg80211_ssid scan_ssid; 6705ba63533SJohannes Berg struct cfg80211_scan_request *int_scan_req; 6714d36ec58SJohannes Berg struct cfg80211_scan_request *scan_req, *hw_scan_req; 6722a519311SJohannes Berg struct ieee80211_channel *scan_channel; 6734d36ec58SJohannes Berg enum ieee80211_band hw_scan_band; 674f0706e82SJiri Benc int scan_channel_idx; 675de95a54bSJohannes Berg int scan_ies_len; 6768318d78aSJohannes Berg 677977923b0SHelmut Schaa enum mac80211_scan_state next_scan_state; 678f0706e82SJiri Benc struct delayed_work scan_work; 679491775a5SJohannes Berg struct ieee80211_sub_if_data *scan_sdata; 680094d05dcSSujith enum nl80211_channel_type oper_channel_type; 6812a519311SJohannes Berg struct ieee80211_channel *oper_channel, *csa_channel; 682f0706e82SJiri Benc 683f0706e82SJiri Benc /* SNMP counters */ 684f0706e82SJiri Benc /* dot11CountersTable */ 685f0706e82SJiri Benc u32 dot11TransmittedFragmentCount; 686f0706e82SJiri Benc u32 dot11MulticastTransmittedFrameCount; 687f0706e82SJiri Benc u32 dot11FailedCount; 688f0706e82SJiri Benc u32 dot11RetryCount; 689f0706e82SJiri Benc u32 dot11MultipleRetryCount; 690f0706e82SJiri Benc u32 dot11FrameDuplicateCount; 691f0706e82SJiri Benc u32 dot11ReceivedFragmentCount; 692f0706e82SJiri Benc u32 dot11MulticastReceivedFrameCount; 693f0706e82SJiri Benc u32 dot11TransmittedFrameCount; 694f0706e82SJiri Benc 695f0706e82SJiri Benc #ifdef CONFIG_MAC80211_LEDS 696f0706e82SJiri Benc int tx_led_counter, rx_led_counter; 697cdcb006fSIvo van Doorn struct led_trigger *tx_led, *rx_led, *assoc_led, *radio_led; 698cdcb006fSIvo van Doorn char tx_led_name[32], rx_led_name[32], 699cdcb006fSIvo van Doorn assoc_led_name[32], radio_led_name[32]; 700f0706e82SJiri Benc #endif 701f0706e82SJiri Benc 702e9f207f0SJiri Benc #ifdef CONFIG_MAC80211_DEBUGFS 703e9f207f0SJiri Benc struct work_struct sta_debugfs_add; 704e9f207f0SJiri Benc #endif 705e9f207f0SJiri Benc 706f0706e82SJiri Benc #ifdef CONFIG_MAC80211_DEBUG_COUNTERS 707f0706e82SJiri Benc /* TX/RX handler statistics */ 708f0706e82SJiri Benc unsigned int tx_handlers_drop; 709f0706e82SJiri Benc unsigned int tx_handlers_queued; 710f0706e82SJiri Benc unsigned int tx_handlers_drop_unencrypted; 711f0706e82SJiri Benc unsigned int tx_handlers_drop_fragment; 712f0706e82SJiri Benc unsigned int tx_handlers_drop_wep; 713f0706e82SJiri Benc unsigned int tx_handlers_drop_not_assoc; 714f0706e82SJiri Benc unsigned int tx_handlers_drop_unauth_port; 715f0706e82SJiri Benc unsigned int rx_handlers_drop; 716f0706e82SJiri Benc unsigned int rx_handlers_queued; 717f0706e82SJiri Benc unsigned int rx_handlers_drop_nullfunc; 718f0706e82SJiri Benc unsigned int rx_handlers_drop_defrag; 719f0706e82SJiri Benc unsigned int rx_handlers_drop_short; 720f0706e82SJiri Benc unsigned int rx_handlers_drop_passive_scan; 721f0706e82SJiri Benc unsigned int tx_expand_skb_head; 722f0706e82SJiri Benc unsigned int tx_expand_skb_head_cloned; 723f0706e82SJiri Benc unsigned int rx_expand_skb_head; 724f0706e82SJiri Benc unsigned int rx_expand_skb_head2; 725f0706e82SJiri Benc unsigned int rx_handlers_fragments; 726f0706e82SJiri Benc unsigned int tx_status_drop; 727f0706e82SJiri Benc #define I802_DEBUG_INC(c) (c)++ 728f0706e82SJiri Benc #else /* CONFIG_MAC80211_DEBUG_COUNTERS */ 729f0706e82SJiri Benc #define I802_DEBUG_INC(c) do { } while (0) 730f0706e82SJiri Benc #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */ 731f0706e82SJiri Benc 732f0706e82SJiri Benc 733f0706e82SJiri Benc int total_ps_buffered; /* total number of all buffered unicast and 734f0706e82SJiri Benc * multicast packets for power saving stations 735f0706e82SJiri Benc */ 736f0706e82SJiri Benc int wifi_wme_noack_test; 737f0706e82SJiri Benc unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ 738520eb820SKalle Valo 739572e0012SKalle Valo bool pspolling; 740965bedadSJohannes Berg /* 741965bedadSJohannes Berg * PS can only be enabled when we have exactly one managed 742965bedadSJohannes Berg * interface (and monitors) in PS, this then points there. 743965bedadSJohannes Berg */ 744965bedadSJohannes Berg struct ieee80211_sub_if_data *ps_sdata; 745520eb820SKalle Valo struct work_struct dynamic_ps_enable_work; 746520eb820SKalle Valo struct work_struct dynamic_ps_disable_work; 747520eb820SKalle Valo struct timer_list dynamic_ps_timer; 74810f644a4SJohannes Berg struct notifier_block network_latency_notifier; 749f0706e82SJiri Benc 7502bf30fabSJohannes Berg int user_power_level; /* in dBm */ 751a8302de9SVasanthakumar Thiagarajan int power_constr_level; /* in dBm */ 7522bf30fabSJohannes Berg 753f2753ddbSJohannes Berg struct work_struct restart_work; 754f2753ddbSJohannes Berg 755e9f207f0SJiri Benc #ifdef CONFIG_MAC80211_DEBUGFS 756e9f207f0SJiri Benc struct local_debugfsdentries { 7574b7679a5SJohannes Berg struct dentry *rcdir; 758e9f207f0SJiri Benc struct dentry *stations; 759e9f207f0SJiri Benc struct dentry *keys; 760e9f207f0SJiri Benc } debugfs; 761e9f207f0SJiri Benc #endif 762f0706e82SJiri Benc }; 763f0706e82SJiri Benc 7643e122be0SJohannes Berg static inline struct ieee80211_sub_if_data * 7653e122be0SJohannes Berg IEEE80211_DEV_TO_SUB_IF(struct net_device *dev) 7663e122be0SJohannes Berg { 7673e122be0SJohannes Berg return netdev_priv(dev); 7683e122be0SJohannes Berg } 7693e122be0SJohannes Berg 770c951ad35SJohannes Berg /* this struct represents 802.11n's RA/TID combination along with our vif */ 771eadc8d9eSRon Rindjunsky struct ieee80211_ra_tid { 772c951ad35SJohannes Berg struct ieee80211_vif *vif; 773eadc8d9eSRon Rindjunsky u8 ra[ETH_ALEN]; 774eadc8d9eSRon Rindjunsky u16 tid; 775eadc8d9eSRon Rindjunsky }; 776eadc8d9eSRon Rindjunsky 777ee385855SLuis Carlos Cobo /* Parsed Information Elements */ 778ee385855SLuis Carlos Cobo struct ieee802_11_elems { 77943ac2ca3SJouni Malinen u8 *ie_start; 78043ac2ca3SJouni Malinen size_t total_len; 78143ac2ca3SJouni Malinen 782ee385855SLuis Carlos Cobo /* pointers to IEs */ 783ee385855SLuis Carlos Cobo u8 *ssid; 784ee385855SLuis Carlos Cobo u8 *supp_rates; 785ee385855SLuis Carlos Cobo u8 *fh_params; 786ee385855SLuis Carlos Cobo u8 *ds_params; 787ee385855SLuis Carlos Cobo u8 *cf_params; 788e7ec86f5SJohannes Berg struct ieee80211_tim_ie *tim; 789ee385855SLuis Carlos Cobo u8 *ibss_params; 790ee385855SLuis Carlos Cobo u8 *challenge; 791ee385855SLuis Carlos Cobo u8 *wpa; 792ee385855SLuis Carlos Cobo u8 *rsn; 793ee385855SLuis Carlos Cobo u8 *erp_info; 794ee385855SLuis Carlos Cobo u8 *ext_supp_rates; 795ee385855SLuis Carlos Cobo u8 *wmm_info; 796ee385855SLuis Carlos Cobo u8 *wmm_param; 79709914813SJohannes Berg struct ieee80211_ht_cap *ht_cap_elem; 798d9fe60deSJohannes Berg struct ieee80211_ht_info *ht_info_elem; 799136cfa28SRui Paulo struct ieee80211_meshconf_ie *mesh_config; 800ee385855SLuis Carlos Cobo u8 *mesh_id; 801ee385855SLuis Carlos Cobo u8 *peer_link; 802ee385855SLuis Carlos Cobo u8 *preq; 803ee385855SLuis Carlos Cobo u8 *prep; 804ee385855SLuis Carlos Cobo u8 *perr; 80590a5e169SRui Paulo struct ieee80211_rann_ie *rann; 806f2df3859SAssaf Krauss u8 *ch_switch_elem; 807f2df3859SAssaf Krauss u8 *country_elem; 808f2df3859SAssaf Krauss u8 *pwr_constr_elem; 809f2df3859SAssaf Krauss u8 *quiet_elem; /* first quite element */ 810f797eb7eSJouni Malinen u8 *timeout_int; 811ee385855SLuis Carlos Cobo 812ee385855SLuis Carlos Cobo /* length of them, respectively */ 813ee385855SLuis Carlos Cobo u8 ssid_len; 814ee385855SLuis Carlos Cobo u8 supp_rates_len; 815ee385855SLuis Carlos Cobo u8 fh_params_len; 816ee385855SLuis Carlos Cobo u8 ds_params_len; 817ee385855SLuis Carlos Cobo u8 cf_params_len; 818ee385855SLuis Carlos Cobo u8 tim_len; 819ee385855SLuis Carlos Cobo u8 ibss_params_len; 820ee385855SLuis Carlos Cobo u8 challenge_len; 821ee385855SLuis Carlos Cobo u8 wpa_len; 822ee385855SLuis Carlos Cobo u8 rsn_len; 823ee385855SLuis Carlos Cobo u8 erp_info_len; 824ee385855SLuis Carlos Cobo u8 ext_supp_rates_len; 825ee385855SLuis Carlos Cobo u8 wmm_info_len; 826ee385855SLuis Carlos Cobo u8 wmm_param_len; 827ee385855SLuis Carlos Cobo u8 mesh_id_len; 828ee385855SLuis Carlos Cobo u8 peer_link_len; 829ee385855SLuis Carlos Cobo u8 preq_len; 830ee385855SLuis Carlos Cobo u8 prep_len; 831ee385855SLuis Carlos Cobo u8 perr_len; 832f2df3859SAssaf Krauss u8 ch_switch_elem_len; 833f2df3859SAssaf Krauss u8 country_elem_len; 834f2df3859SAssaf Krauss u8 pwr_constr_elem_len; 835f2df3859SAssaf Krauss u8 quiet_elem_len; 836f2df3859SAssaf Krauss u8 num_of_quiet_elem; /* can be more the one */ 837f797eb7eSJouni Malinen u8 timeout_int_len; 838ee385855SLuis Carlos Cobo }; 839ee385855SLuis Carlos Cobo 840f0706e82SJiri Benc static inline struct ieee80211_local *hw_to_local( 841f0706e82SJiri Benc struct ieee80211_hw *hw) 842f0706e82SJiri Benc { 843f0706e82SJiri Benc return container_of(hw, struct ieee80211_local, hw); 844f0706e82SJiri Benc } 845f0706e82SJiri Benc 846f0706e82SJiri Benc static inline struct ieee80211_hw *local_to_hw( 847f0706e82SJiri Benc struct ieee80211_local *local) 848f0706e82SJiri Benc { 849f0706e82SJiri Benc return &local->hw; 850f0706e82SJiri Benc } 851f0706e82SJiri Benc 852f0706e82SJiri Benc 853571ecf67SJohannes Berg static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr) 854571ecf67SJohannes Berg { 855571ecf67SJohannes Berg return compare_ether_addr(raddr, addr) == 0 || 856571ecf67SJohannes Berg is_broadcast_ether_addr(raddr); 857571ecf67SJohannes Berg } 858571ecf67SJohannes Berg 859571ecf67SJohannes Berg 860e8975581SJohannes Berg int ieee80211_hw_config(struct ieee80211_local *local, u32 changed); 8615cf121c3SJohannes Berg void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx); 8629c6bd790SJohannes Berg void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, 8639c6bd790SJohannes Berg u32 changed); 8640d143fe1SJohannes Berg void ieee80211_configure_filter(struct ieee80211_local *local); 86546900298SJohannes Berg u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata); 866f0706e82SJiri Benc 86746900298SJohannes Berg /* STA code */ 8689c6bd790SJohannes Berg void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata); 86977fdaa12SJohannes Berg int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, 87077fdaa12SJohannes Berg struct cfg80211_auth_request *req); 87177fdaa12SJohannes Berg int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, 87277fdaa12SJohannes Berg struct cfg80211_assoc_request *req); 87377fdaa12SJohannes Berg int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, 874667503ddSJohannes Berg struct cfg80211_deauth_request *req, 875667503ddSJohannes Berg void *cookie); 87677fdaa12SJohannes Berg int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, 877667503ddSJohannes Berg struct cfg80211_disassoc_request *req, 878667503ddSJohannes Berg void *cookie); 87946900298SJohannes Berg ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata, 880f1d58c25SJohannes Berg struct sk_buff *skb); 881572e0012SKalle Valo void ieee80211_send_pspoll(struct ieee80211_local *local, 882572e0012SKalle Valo struct ieee80211_sub_if_data *sdata); 88310f644a4SJohannes Berg void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency); 88410f644a4SJohannes Berg int ieee80211_max_network_latency(struct notifier_block *nb, 88510f644a4SJohannes Berg unsigned long data, void *dummy); 886cc32abd4SJohannes Berg void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, 887cc32abd4SJohannes Berg struct ieee80211_channel_sw_ie *sw_elem, 888cc32abd4SJohannes Berg struct ieee80211_bss *bss); 8895bb644a0SJohannes Berg void ieee80211_sta_quiesce(struct ieee80211_sub_if_data *sdata); 8905bb644a0SJohannes Berg void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata); 8919c6bd790SJohannes Berg 89246900298SJohannes Berg /* IBSS code */ 89346900298SJohannes Berg void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); 89446900298SJohannes Berg void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata); 89546900298SJohannes Berg ieee80211_rx_result 896f1d58c25SJohannes Berg ieee80211_ibss_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); 89746900298SJohannes Berg struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, 89846900298SJohannes Berg u8 *bssid, u8 *addr, u32 supp_rates); 899af8cdcd8SJohannes Berg int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata, 900af8cdcd8SJohannes Berg struct cfg80211_ibss_params *params); 901af8cdcd8SJohannes Berg int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata); 9025bb644a0SJohannes Berg void ieee80211_ibss_quiesce(struct ieee80211_sub_if_data *sdata); 9035bb644a0SJohannes Berg void ieee80211_ibss_restart(struct ieee80211_sub_if_data *sdata); 90446900298SJohannes Berg 9059c6bd790SJohannes Berg /* scan/BSS handling */ 90646900298SJohannes Berg void ieee80211_scan_work(struct work_struct *work); 907f3b85252SJohannes Berg int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, 908f3b85252SJohannes Berg const u8 *ssid, u8 ssid_len); 909c2b13452SJohannes Berg int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, 9102a519311SJohannes Berg struct cfg80211_scan_request *req); 9115bb644a0SJohannes Berg void ieee80211_scan_cancel(struct ieee80211_local *local); 912c2b13452SJohannes Berg ieee80211_rx_result 913f1d58c25SJohannes Berg ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); 9149c6bd790SJohannes Berg 9150a51b27eSJohannes Berg void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local); 916c2b13452SJohannes Berg struct ieee80211_bss * 91798c8fccfSJohannes Berg ieee80211_bss_info_update(struct ieee80211_local *local, 91898c8fccfSJohannes Berg struct ieee80211_rx_status *rx_status, 91998c8fccfSJohannes Berg struct ieee80211_mgmt *mgmt, 92098c8fccfSJohannes Berg size_t len, 92198c8fccfSJohannes Berg struct ieee802_11_elems *elems, 9222a519311SJohannes Berg struct ieee80211_channel *channel, 9232a519311SJohannes Berg bool beacon); 924c2b13452SJohannes Berg struct ieee80211_bss * 9255484e237SJohannes Berg ieee80211_rx_bss_get(struct ieee80211_local *local, u8 *bssid, int freq, 9265484e237SJohannes Berg u8 *ssid, u8 ssid_len); 92798c8fccfSJohannes Berg void ieee80211_rx_bss_put(struct ieee80211_local *local, 928c2b13452SJohannes Berg struct ieee80211_bss *bss); 929ee385855SLuis Carlos Cobo 9303e122be0SJohannes Berg /* interface handling */ 9313e122be0SJohannes Berg int ieee80211_if_add(struct ieee80211_local *local, const char *name, 93205c914feSJohannes Berg struct net_device **new_dev, enum nl80211_iftype type, 933ee385855SLuis Carlos Cobo struct vif_params *params); 934f3947e2dSJohannes Berg int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, 93505c914feSJohannes Berg enum nl80211_iftype type); 936f698d856SJasper Bryant-Greene void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata); 93775636525SJohannes Berg void ieee80211_remove_interfaces(struct ieee80211_local *local); 9385cff20e6SJohannes Berg u32 __ieee80211_recalc_idle(struct ieee80211_local *local); 9395cff20e6SJohannes Berg void ieee80211_recalc_idle(struct ieee80211_local *local); 940f0706e82SJiri Benc 941e2ebc74dSJohannes Berg /* tx handling */ 942e2ebc74dSJohannes Berg void ieee80211_clear_tx_pending(struct ieee80211_local *local); 943e2ebc74dSJohannes Berg void ieee80211_tx_pending(unsigned long data); 944d0cf9c0dSStephen Hemminger netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, 945d0cf9c0dSStephen Hemminger struct net_device *dev); 946d0cf9c0dSStephen Hemminger netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, 947d0cf9c0dSStephen Hemminger struct net_device *dev); 948e2ebc74dSJohannes Berg 949fe7a5d5cSJohannes Berg /* 950fe7a5d5cSJohannes Berg * radiotap header for status frames 951fe7a5d5cSJohannes Berg */ 952fe7a5d5cSJohannes Berg struct ieee80211_tx_status_rtap_hdr { 953fe7a5d5cSJohannes Berg struct ieee80211_radiotap_header hdr; 954fe7a5d5cSJohannes Berg u8 rate; 955fe7a5d5cSJohannes Berg u8 padding_for_rate; 956fe7a5d5cSJohannes Berg __le16 tx_flags; 957fe7a5d5cSJohannes Berg u8 data_retries; 958fe7a5d5cSJohannes Berg } __attribute__ ((packed)); 959fe7a5d5cSJohannes Berg 960fe7a5d5cSJohannes Berg 961de1ede7aSJohannes Berg /* HT */ 962ae5eb026SJohannes Berg void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband, 963ae5eb026SJohannes Berg struct ieee80211_ht_cap *ht_cap_ie, 964d9fe60deSJohannes Berg struct ieee80211_sta_ht_cap *ht_cap); 965de1ede7aSJohannes Berg void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u16 ssn); 966b8695a8fSJohannes Berg void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, 967b8695a8fSJohannes Berg const u8 *da, u16 tid, 968b8695a8fSJohannes Berg u16 initiator, u16 reason_code); 969de1ede7aSJohannes Berg 970de1ede7aSJohannes Berg void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *da, 971de1ede7aSJohannes Berg u16 tid, u16 initiator, u16 reason); 972849b7967SJohannes Berg void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, 973849b7967SJohannes Berg u16 initiator, u16 reason); 9742dace10eSJohannes Berg void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta); 975de1ede7aSJohannes Berg void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata, 976de1ede7aSJohannes Berg struct sta_info *sta, 977de1ede7aSJohannes Berg struct ieee80211_mgmt *mgmt, size_t len); 978de1ede7aSJohannes Berg void ieee80211_process_addba_resp(struct ieee80211_local *local, 979de1ede7aSJohannes Berg struct sta_info *sta, 980de1ede7aSJohannes Berg struct ieee80211_mgmt *mgmt, 981de1ede7aSJohannes Berg size_t len); 982de1ede7aSJohannes Berg void ieee80211_process_addba_request(struct ieee80211_local *local, 983de1ede7aSJohannes Berg struct sta_info *sta, 984de1ede7aSJohannes Berg struct ieee80211_mgmt *mgmt, 985de1ede7aSJohannes Berg size_t len); 986de1ede7aSJohannes Berg 987849b7967SJohannes Berg int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, 988849b7967SJohannes Berg enum ieee80211_back_parties initiator); 989849b7967SJohannes Berg 99039192c0bSJohannes Berg /* Spectrum management */ 99139192c0bSJohannes Berg void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, 99239192c0bSJohannes Berg struct ieee80211_mgmt *mgmt, 99339192c0bSJohannes Berg size_t len); 99439192c0bSJohannes Berg 995f2753ddbSJohannes Berg /* Suspend/resume and hw reconfiguration */ 996f2753ddbSJohannes Berg int ieee80211_reconfig(struct ieee80211_local *local); 99784f6a01cSJohannes Berg void ieee80211_stop_device(struct ieee80211_local *local); 998f2753ddbSJohannes Berg 999827b1fb4SJohannes Berg #ifdef CONFIG_PM 1000665af4fcSBob Copeland int __ieee80211_suspend(struct ieee80211_hw *hw); 1001f2753ddbSJohannes Berg 1002f2753ddbSJohannes Berg static inline int __ieee80211_resume(struct ieee80211_hw *hw) 1003f2753ddbSJohannes Berg { 1004f2753ddbSJohannes Berg return ieee80211_reconfig(hw_to_local(hw)); 1005f2753ddbSJohannes Berg } 1006827b1fb4SJohannes Berg #else 1007827b1fb4SJohannes Berg static inline int __ieee80211_suspend(struct ieee80211_hw *hw) 1008827b1fb4SJohannes Berg { 1009827b1fb4SJohannes Berg return 0; 1010827b1fb4SJohannes Berg } 1011f2753ddbSJohannes Berg 1012827b1fb4SJohannes Berg static inline int __ieee80211_resume(struct ieee80211_hw *hw) 1013827b1fb4SJohannes Berg { 1014827b1fb4SJohannes Berg return 0; 1015827b1fb4SJohannes Berg } 1016827b1fb4SJohannes Berg #endif 1017665af4fcSBob Copeland 1018c2d1560aSJohannes Berg /* utility functions/constants */ 1019c2d1560aSJohannes Berg extern void *mac80211_wiphy_privid; /* for wiphy privid */ 102071364716SRon Rindjunsky u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, 102105c914feSJohannes Berg enum nl80211_iftype type); 1022c2d1560aSJohannes Berg int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, 1023c2d1560aSJohannes Berg int rate, int erp, int short_preamble); 1024f698d856SJasper Bryant-Greene void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, 1025e6d6e342SJohannes Berg struct ieee80211_hdr *hdr, const u8 *tsc, 1026e6d6e342SJohannes Berg gfp_t gfp); 10275825fe10SJohannes Berg void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata); 102862ae67beSJohannes Berg void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); 10299c6bd790SJohannes Berg void ieee802_11_parse_elems(u8 *start, size_t len, 10309c6bd790SJohannes Berg struct ieee802_11_elems *elems); 1031d91f36dbSJohannes Berg u32 ieee802_11_parse_elems_crc(u8 *start, size_t len, 1032d91f36dbSJohannes Berg struct ieee802_11_elems *elems, 1033d91f36dbSJohannes Berg u64 filter, u32 crc); 1034881d948cSJohannes Berg u32 ieee80211_mandatory_rates(struct ieee80211_local *local, 103596dd22acSJohannes Berg enum ieee80211_band band); 1036f0706e82SJiri Benc 1037520eb820SKalle Valo void ieee80211_dynamic_ps_enable_work(struct work_struct *work); 1038520eb820SKalle Valo void ieee80211_dynamic_ps_disable_work(struct work_struct *work); 1039520eb820SKalle Valo void ieee80211_dynamic_ps_timer(unsigned long data); 1040a97b77b9SVivek Natarajan void ieee80211_send_nullfunc(struct ieee80211_local *local, 1041a97b77b9SVivek Natarajan struct ieee80211_sub_if_data *sdata, 1042a97b77b9SVivek Natarajan int powersave); 10433cf335d5SKalle Valo void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, 10443cf335d5SKalle Valo struct ieee80211_hdr *hdr); 104504de8381SKalle Valo void ieee80211_beacon_loss_work(struct work_struct *work); 1046520eb820SKalle Valo 1047ce7c9111SKalle Valo void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw, 1048ce7c9111SKalle Valo enum queue_stop_reason reason); 1049ce7c9111SKalle Valo void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw, 1050ce7c9111SKalle Valo enum queue_stop_reason reason); 105196f5e66eSJohannes Berg void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, 105296f5e66eSJohannes Berg enum queue_stop_reason reason); 105396f5e66eSJohannes Berg void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue, 105496f5e66eSJohannes Berg enum queue_stop_reason reason); 10558f77f384SJohannes Berg void ieee80211_add_pending_skb(struct ieee80211_local *local, 10568f77f384SJohannes Berg struct sk_buff *skb); 10578f77f384SJohannes Berg int ieee80211_add_pending_skbs(struct ieee80211_local *local, 10588f77f384SJohannes Berg struct sk_buff_head *skbs); 1059ce7c9111SKalle Valo 106046900298SJohannes Berg void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, 106146900298SJohannes Berg u16 transaction, u16 auth_alg, 1062fffd0934SJohannes Berg u8 *extra, size_t extra_len, const u8 *bssid, 1063fffd0934SJohannes Berg const u8 *key, u8 key_len, u8 key_idx); 1064de95a54bSJohannes Berg int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, 10654d36ec58SJohannes Berg const u8 *ie, size_t ie_len, 10664d36ec58SJohannes Berg enum ieee80211_band band); 106746900298SJohannes Berg void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1068de95a54bSJohannes Berg const u8 *ssid, size_t ssid_len, 1069de95a54bSJohannes Berg const u8 *ie, size_t ie_len); 107046900298SJohannes Berg 107146900298SJohannes Berg void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 107246900298SJohannes Berg const size_t supp_rates_len, 107346900298SJohannes Berg const u8 *supp_rates); 107446900298SJohannes Berg u32 ieee80211_sta_get_rates(struct ieee80211_local *local, 107546900298SJohannes Berg struct ieee802_11_elems *elems, 107646900298SJohannes Berg enum ieee80211_band band); 107746900298SJohannes Berg 1078f4ea83ddSJohannes Berg #ifdef CONFIG_MAC80211_NOINLINE 1079d9e8a70fSJohannes Berg #define debug_noinline noinline 1080d9e8a70fSJohannes Berg #else 1081d9e8a70fSJohannes Berg #define debug_noinline 1082d9e8a70fSJohannes Berg #endif 1083d9e8a70fSJohannes Berg 1084f0706e82SJiri Benc #endif /* IEEE80211_I_H */ 1085