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> 26*fe7a5d5cSJohannes 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) 1665cf121c3SJohannes Berg #define IEEE80211_RX_CMNTR_REPORTED BIT(3) 1675cf121c3SJohannes Berg #define IEEE80211_RX_FRAGMENTED BIT(4) 1685cf121c3SJohannes Berg 1695cf121c3SJohannes Berg struct ieee80211_rx_data { 1705cf121c3SJohannes Berg struct sk_buff *skb; 1715cf121c3SJohannes Berg struct ieee80211_local *local; 1725cf121c3SJohannes Berg struct ieee80211_sub_if_data *sdata; 1735cf121c3SJohannes Berg struct sta_info *sta; 1745cf121c3SJohannes Berg struct ieee80211_key *key; 175056cdd59SJohannes Berg 176056cdd59SJohannes Berg unsigned int flags; 177f0706e82SJiri Benc int queue; 17850741ae0SJohannes Berg u32 tkip_iv32; 17950741ae0SJohannes Berg u16 tkip_iv16; 180f0706e82SJiri Benc }; 181f0706e82SJiri Benc 1825dfdaf58SJohannes Berg struct beacon_data { 1835dfdaf58SJohannes Berg u8 *head, *tail; 1845dfdaf58SJohannes Berg int head_len, tail_len; 1855dfdaf58SJohannes Berg int dtim_period; 1865dfdaf58SJohannes Berg }; 1875dfdaf58SJohannes Berg 188f0706e82SJiri Benc struct ieee80211_if_ap { 1895dfdaf58SJohannes Berg struct beacon_data *beacon; 190f0706e82SJiri Benc 1910ec3ca44SJohannes Berg struct list_head vlans; 1920ec3ca44SJohannes Berg 193f0706e82SJiri Benc /* yes, this looks ugly, but guarantees that we can later use 194f0706e82SJiri Benc * bitmap_empty :) 195004c872eSJohannes Berg * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */ 196f0706e82SJiri Benc u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)]; 197f0706e82SJiri Benc struct sk_buff_head ps_bc_buf; 198056cdd59SJohannes Berg atomic_t num_sta_ps; /* number of stations in PS mode */ 1995dfdaf58SJohannes Berg int dtim_count; 200f0706e82SJiri Benc }; 201f0706e82SJiri Benc 202f0706e82SJiri Benc struct ieee80211_if_wds { 203f0706e82SJiri Benc struct sta_info *sta; 204056cdd59SJohannes Berg u8 remote_addr[ETH_ALEN]; 205f0706e82SJiri Benc }; 206f0706e82SJiri Benc 207f0706e82SJiri Benc struct ieee80211_if_vlan { 2080ec3ca44SJohannes Berg struct list_head list; 209f14543eeSFelix Fietkau 210f14543eeSFelix Fietkau /* used for all tx if the VLAN is configured to 4-addr mode */ 211f14543eeSFelix Fietkau struct sta_info *sta; 212f0706e82SJiri Benc }; 213f0706e82SJiri Benc 214ee385855SLuis Carlos Cobo struct mesh_stats { 215c8a61a7dSDaniel Walker __u32 fwded_mcast; /* Mesh forwarded multicast frames */ 216c8a61a7dSDaniel Walker __u32 fwded_unicast; /* Mesh forwarded unicast frames */ 217c8a61a7dSDaniel Walker __u32 fwded_frames; /* Mesh total forwarded frames */ 218ee385855SLuis Carlos Cobo __u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/ 219ee385855SLuis Carlos Cobo __u32 dropped_frames_no_route; /* Not transmitted, no route found */ 220ee385855SLuis Carlos Cobo atomic_t estab_plinks; 221ee385855SLuis Carlos Cobo }; 222ee385855SLuis Carlos Cobo 223ee385855SLuis Carlos Cobo #define PREQ_Q_F_START 0x1 224ee385855SLuis Carlos Cobo #define PREQ_Q_F_REFRESH 0x2 225ee385855SLuis Carlos Cobo struct mesh_preq_queue { 226ee385855SLuis Carlos Cobo struct list_head list; 227ee385855SLuis Carlos Cobo u8 dst[ETH_ALEN]; 228ee385855SLuis Carlos Cobo u8 flags; 229ee385855SLuis Carlos Cobo }; 230ee385855SLuis Carlos Cobo 23177fdaa12SJohannes Berg enum ieee80211_mgd_state { 23277fdaa12SJohannes Berg IEEE80211_MGD_STATE_IDLE, 23377fdaa12SJohannes Berg IEEE80211_MGD_STATE_PROBE, 23477fdaa12SJohannes Berg IEEE80211_MGD_STATE_AUTH, 23577fdaa12SJohannes Berg IEEE80211_MGD_STATE_ASSOC, 23677fdaa12SJohannes Berg }; 23777fdaa12SJohannes Berg 23877fdaa12SJohannes Berg struct ieee80211_mgd_work { 23977fdaa12SJohannes Berg struct list_head list; 24077fdaa12SJohannes Berg struct ieee80211_bss *bss; 24177fdaa12SJohannes Berg int ie_len; 24277fdaa12SJohannes Berg u8 prev_bssid[ETH_ALEN]; 24377fdaa12SJohannes Berg u8 ssid[IEEE80211_MAX_SSID_LEN]; 24477fdaa12SJohannes Berg u8 ssid_len; 24577fdaa12SJohannes Berg unsigned long timeout; 24677fdaa12SJohannes Berg enum ieee80211_mgd_state state; 24777fdaa12SJohannes Berg u16 auth_alg, auth_transaction; 24877fdaa12SJohannes Berg 24977fdaa12SJohannes Berg int tries; 25077fdaa12SJohannes Berg 251fffd0934SJohannes Berg u8 key[WLAN_KEY_LEN_WEP104]; 252fffd0934SJohannes Berg u8 key_len, key_idx; 253fffd0934SJohannes Berg 25477fdaa12SJohannes Berg /* must be last */ 25577fdaa12SJohannes Berg u8 ie[0]; /* for auth or assoc frame, not probe */ 25677fdaa12SJohannes Berg }; 25777fdaa12SJohannes Berg 25846900298SJohannes Berg /* flags used in struct ieee80211_if_managed.flags */ 259ab1faeadSJohannes Berg enum ieee80211_sta_flags { 260b291ba11SJohannes Berg IEEE80211_STA_BEACON_POLL = BIT(0), 261b291ba11SJohannes Berg IEEE80211_STA_CONNECTION_POLL = BIT(1), 262b291ba11SJohannes Berg IEEE80211_STA_CONTROL_PORT = BIT(2), 263b291ba11SJohannes Berg IEEE80211_STA_WMM_ENABLED = BIT(3), 264b291ba11SJohannes Berg IEEE80211_STA_DISABLE_11N = BIT(4), 265b291ba11SJohannes Berg IEEE80211_STA_CSA_RECEIVED = BIT(5), 266b291ba11SJohannes Berg IEEE80211_STA_MFP_ENABLED = BIT(6), 267ab1faeadSJohannes Berg }; 268ab1faeadSJohannes Berg 26948c2fc59STomas Winkler /* flags for MLME request */ 270ab1faeadSJohannes Berg enum ieee80211_sta_request { 271ab1faeadSJohannes Berg IEEE80211_STA_REQ_SCAN, 272ab1faeadSJohannes Berg }; 27348c2fc59STomas Winkler 27446900298SJohannes Berg struct ieee80211_if_managed { 275056cdd59SJohannes Berg struct timer_list timer; 276b291ba11SJohannes Berg struct timer_list conn_mon_timer; 277b291ba11SJohannes Berg struct timer_list bcn_mon_timer; 278c481ec97SSujith struct timer_list chswitch_timer; 279056cdd59SJohannes Berg struct work_struct work; 280b291ba11SJohannes Berg struct work_struct monitor_work; 281c481ec97SSujith struct work_struct chswitch_work; 28204de8381SKalle Valo struct work_struct beacon_loss_work; 28346900298SJohannes Berg 284b291ba11SJohannes Berg unsigned long probe_timeout; 285a43abf29SMaxim Levitsky int probe_send_count; 286b291ba11SJohannes Berg 28777fdaa12SJohannes Berg struct mutex mtx; 28877fdaa12SJohannes Berg struct ieee80211_bss *associated; 289e21546a2SJohannes Berg struct ieee80211_mgd_work *old_associate_work; 29077fdaa12SJohannes Berg struct list_head work_list; 29146900298SJohannes Berg 29277fdaa12SJohannes Berg u8 bssid[ETH_ALEN]; 29346900298SJohannes Berg 294f0706e82SJiri Benc u16 aid; 295a7c1cfc9SJohannes Berg u16 capab; 296f0706e82SJiri Benc 297056cdd59SJohannes Berg struct sk_buff_head skb_queue; 298056cdd59SJohannes Berg 2995bb644a0SJohannes Berg unsigned long timers_running; /* used for quiesce/restart */ 300965bedadSJohannes Berg bool powersave; /* powersave requested for this iface */ 301965bedadSJohannes Berg 302056cdd59SJohannes Berg unsigned long request; 303056cdd59SJohannes Berg 304d6f2da5bSJiri Slaby unsigned int flags; 305f0706e82SJiri Benc 306d91f36dbSJohannes Berg u32 beacon_crc; 307d91f36dbSJohannes Berg 308fdfacf0aSJouni Malinen enum { 309fdfacf0aSJouni Malinen IEEE80211_MFP_DISABLED, 310fdfacf0aSJouni Malinen IEEE80211_MFP_OPTIONAL, 311fdfacf0aSJouni Malinen IEEE80211_MFP_REQUIRED 312fdfacf0aSJouni Malinen } mfp; /* management frame protection */ 313fdfacf0aSJouni Malinen 314f0706e82SJiri Benc int wmm_last_param_set; 315f0706e82SJiri Benc }; 316f0706e82SJiri Benc 31746900298SJohannes Berg enum ieee80211_ibss_request { 31846900298SJohannes Berg IEEE80211_IBSS_REQ_RUN = 0, 31946900298SJohannes Berg }; 32046900298SJohannes Berg 32146900298SJohannes Berg struct ieee80211_if_ibss { 32246900298SJohannes Berg struct timer_list timer; 32346900298SJohannes Berg struct work_struct work; 32446900298SJohannes Berg 32546900298SJohannes Berg struct sk_buff_head skb_queue; 32646900298SJohannes Berg 327af8cdcd8SJohannes Berg unsigned long request; 328af8cdcd8SJohannes Berg unsigned long last_scan_completed; 3295bb644a0SJohannes Berg 3305bb644a0SJohannes Berg bool timer_running; 3315bb644a0SJohannes Berg 332af8cdcd8SJohannes Berg bool fixed_bssid; 333af8cdcd8SJohannes Berg bool fixed_channel; 334fffd0934SJohannes Berg bool privacy; 33546900298SJohannes Berg 33646900298SJohannes Berg u8 bssid[ETH_ALEN]; 337af8cdcd8SJohannes Berg u8 ssid[IEEE80211_MAX_SSID_LEN]; 338af8cdcd8SJohannes Berg u8 ssid_len, ie_len; 339af8cdcd8SJohannes Berg u8 *ie; 340af8cdcd8SJohannes Berg struct ieee80211_channel *channel; 34146900298SJohannes Berg 34246900298SJohannes Berg unsigned long ibss_join_req; 343af8cdcd8SJohannes Berg /* probe response/beacon for IBSS */ 344af8cdcd8SJohannes Berg struct sk_buff *presp, *skb; 34546900298SJohannes Berg 34646900298SJohannes Berg enum { 34746900298SJohannes Berg IEEE80211_IBSS_MLME_SEARCH, 34846900298SJohannes Berg IEEE80211_IBSS_MLME_JOINED, 34946900298SJohannes Berg } state; 35046900298SJohannes Berg }; 35146900298SJohannes Berg 352472dbc45SJohannes Berg struct ieee80211_if_mesh { 353472dbc45SJohannes Berg struct work_struct work; 354472dbc45SJohannes Berg struct timer_list housekeeping_timer; 355472dbc45SJohannes Berg struct timer_list mesh_path_timer; 356e304bfd3SRui Paulo struct timer_list mesh_path_root_timer; 357472dbc45SJohannes Berg struct sk_buff_head skb_queue; 358472dbc45SJohannes Berg 3595bb644a0SJohannes Berg unsigned long timers_running; 3605bb644a0SJohannes Berg 36118889231SJavier Cardona unsigned long wrkq_flags; 362472dbc45SJohannes Berg 363472dbc45SJohannes Berg u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN]; 364472dbc45SJohannes Berg size_t mesh_id_len; 365472dbc45SJohannes Berg /* Active Path Selection Protocol Identifier */ 3663491707aSRui Paulo u8 mesh_pp_id; 367472dbc45SJohannes Berg /* Active Path Selection Metric Identifier */ 3683491707aSRui Paulo u8 mesh_pm_id; 369472dbc45SJohannes Berg /* Congestion Control Mode Identifier */ 3703491707aSRui Paulo u8 mesh_cc_id; 3719e03fdfdSJavier Cardona /* Synchronization Protocol Identifier */ 3723491707aSRui Paulo u8 mesh_sp_id; 3739e03fdfdSJavier Cardona /* Authentication Protocol Identifier */ 3743491707aSRui Paulo u8 mesh_auth_id; 375d19b3bf6SRui Paulo /* Local mesh Sequence Number */ 376d19b3bf6SRui Paulo u32 sn; 377472dbc45SJohannes Berg /* Last used PREQ ID */ 378472dbc45SJohannes Berg u32 preq_id; 379472dbc45SJohannes Berg atomic_t mpaths; 380d19b3bf6SRui Paulo /* Timestamp of last SN update */ 381d19b3bf6SRui Paulo unsigned long last_sn_update; 382d19b3bf6SRui Paulo /* Timestamp of last SN sent */ 383472dbc45SJohannes Berg unsigned long last_preq; 384472dbc45SJohannes Berg struct mesh_rmc *rmc; 385472dbc45SJohannes Berg spinlock_t mesh_preq_queue_lock; 386472dbc45SJohannes Berg struct mesh_preq_queue preq_queue; 387472dbc45SJohannes Berg int preq_queue_len; 388472dbc45SJohannes Berg struct mesh_stats mshstats; 389472dbc45SJohannes Berg struct mesh_config mshcfg; 390472dbc45SJohannes Berg u32 mesh_seqnum; 391472dbc45SJohannes Berg bool accepting_plinks; 392472dbc45SJohannes Berg }; 393902acc78SJohannes Berg 394902acc78SJohannes Berg #ifdef CONFIG_MAC80211_MESH 395472dbc45SJohannes Berg #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name) \ 396472dbc45SJohannes Berg do { (msh)->mshstats.name++; } while (0) 397902acc78SJohannes Berg #else 398472dbc45SJohannes Berg #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name) \ 399902acc78SJohannes Berg do { } while (0) 400902acc78SJohannes Berg #endif 401f0706e82SJiri Benc 402213cd118SJohannes Berg /** 403213cd118SJohannes Berg * enum ieee80211_sub_if_data_flags - virtual interface flags 404213cd118SJohannes Berg * 405213cd118SJohannes Berg * @IEEE80211_SDATA_ALLMULTI: interface wants all multicast packets 406213cd118SJohannes Berg * @IEEE80211_SDATA_PROMISC: interface is promisc 407213cd118SJohannes Berg * @IEEE80211_SDATA_OPERATING_GMODE: operating in G-only mode 408213cd118SJohannes Berg * @IEEE80211_SDATA_DONT_BRIDGE_PACKETS: bridge packets between 409213cd118SJohannes Berg * associated stations and deliver multicast frames both 410213cd118SJohannes Berg * back to wireless media and to the local net stack. 411213cd118SJohannes Berg */ 412213cd118SJohannes Berg enum ieee80211_sub_if_data_flags { 413213cd118SJohannes Berg IEEE80211_SDATA_ALLMULTI = BIT(0), 414213cd118SJohannes Berg IEEE80211_SDATA_PROMISC = BIT(1), 4157986cf95SJohannes Berg IEEE80211_SDATA_OPERATING_GMODE = BIT(2), 4167986cf95SJohannes Berg IEEE80211_SDATA_DONT_BRIDGE_PACKETS = BIT(3), 417213cd118SJohannes Berg }; 418213cd118SJohannes Berg 419f0706e82SJiri Benc struct ieee80211_sub_if_data { 420f0706e82SJiri Benc struct list_head list; 421f0706e82SJiri Benc 422f0706e82SJiri Benc struct wireless_dev wdev; 423f0706e82SJiri Benc 42411a843b7SJohannes Berg /* keys */ 42511a843b7SJohannes Berg struct list_head key_list; 42611a843b7SJohannes Berg 427f0706e82SJiri Benc struct net_device *dev; 428f0706e82SJiri Benc struct ieee80211_local *local; 429f0706e82SJiri Benc 43013262ffdSJiri Slaby unsigned int flags; 4317e9ed188SDaniel Drake 432f0706e82SJiri Benc int drop_unencrypted; 433f0706e82SJiri Benc 434413ad50aSJohannes Berg /* 435413ad50aSJohannes Berg * keep track of whether the HT opmode (stored in 436413ad50aSJohannes Berg * vif.bss_info.ht_operation_mode) is valid. 437413ad50aSJohannes Berg */ 438413ad50aSJohannes Berg bool ht_opmode_valid; 439413ad50aSJohannes Berg 440f0706e82SJiri Benc /* Fragment table for host-based reassembly */ 441f0706e82SJiri Benc struct ieee80211_fragment_entry fragments[IEEE80211_FRAGMENT_MAX]; 442f0706e82SJiri Benc unsigned int fragment_next; 443f0706e82SJiri Benc 444f0706e82SJiri Benc #define NUM_DEFAULT_KEYS 4 4453cfcf6acSJouni Malinen #define NUM_DEFAULT_MGMT_KEYS 2 4463cfcf6acSJouni Malinen struct ieee80211_key *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS]; 447f0706e82SJiri Benc struct ieee80211_key *default_key; 4483cfcf6acSJouni Malinen struct ieee80211_key *default_mgmt_key; 449f0706e82SJiri Benc 45094778280SJohannes Berg u16 sequence_number; 45194778280SJohannes Berg 4523e122be0SJohannes Berg /* 4533e122be0SJohannes Berg * AP this belongs to: self in AP mode and 4543e122be0SJohannes Berg * corresponding AP in VLAN mode, NULL for 4553e122be0SJohannes Berg * all others (might be needed later in IBSS) 4563e122be0SJohannes Berg */ 4573e122be0SJohannes Berg struct ieee80211_if_ap *bss; 4583e122be0SJohannes Berg 4593e122be0SJohannes Berg int force_unicast_rateidx; /* forced TX rateidx for unicast frames */ 4603e122be0SJohannes Berg int max_ratectrl_rateidx; /* max TX rateidx for rate control */ 461f0706e82SJiri Benc 462f14543eeSFelix Fietkau bool use_4addr; /* use 4-address frames */ 463f14543eeSFelix Fietkau 464f0706e82SJiri Benc union { 465f0706e82SJiri Benc struct ieee80211_if_ap ap; 466f0706e82SJiri Benc struct ieee80211_if_wds wds; 467f0706e82SJiri Benc struct ieee80211_if_vlan vlan; 46846900298SJohannes Berg struct ieee80211_if_managed mgd; 46946900298SJohannes Berg struct ieee80211_if_ibss ibss; 470472dbc45SJohannes Berg #ifdef CONFIG_MAC80211_MESH 471472dbc45SJohannes Berg struct ieee80211_if_mesh mesh; 472472dbc45SJohannes Berg #endif 4738cc9a739SMichael Wu u32 mntr_flags; 474f0706e82SJiri Benc } u; 475e9f207f0SJiri Benc 476e9f207f0SJiri Benc #ifdef CONFIG_MAC80211_DEBUGFS 477e9f207f0SJiri Benc struct { 4787bcfaf2fSJohannes Berg struct dentry *dir; 4792b58b209SJouni Malinen struct dentry *default_key; 4803cfcf6acSJouni Malinen struct dentry *default_mgmt_key; 4817bcfaf2fSJohannes Berg } debugfs; 482e9f207f0SJiri Benc #endif 48332bfd35dSJohannes Berg /* must be last, dynamically sized area in this! */ 48432bfd35dSJohannes Berg struct ieee80211_vif vif; 485f0706e82SJiri Benc }; 486f0706e82SJiri Benc 48732bfd35dSJohannes Berg static inline 48832bfd35dSJohannes Berg struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p) 48932bfd35dSJohannes Berg { 49032bfd35dSJohannes Berg return container_of(p, struct ieee80211_sub_if_data, vif); 49132bfd35dSJohannes Berg } 49232bfd35dSJohannes Berg 493472dbc45SJohannes Berg static inline void 494472dbc45SJohannes Berg ieee80211_sdata_set_mesh_id(struct ieee80211_sub_if_data *sdata, 495472dbc45SJohannes Berg u8 mesh_id_len, u8 *mesh_id) 496472dbc45SJohannes Berg { 497472dbc45SJohannes Berg #ifdef CONFIG_MAC80211_MESH 498472dbc45SJohannes Berg struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 499472dbc45SJohannes Berg ifmsh->mesh_id_len = mesh_id_len; 500472dbc45SJohannes Berg memcpy(ifmsh->mesh_id, mesh_id, mesh_id_len); 501472dbc45SJohannes Berg #else 502472dbc45SJohannes Berg WARN_ON(1); 503472dbc45SJohannes Berg #endif 504472dbc45SJohannes Berg } 505472dbc45SJohannes Berg 506f0706e82SJiri Benc enum { 507f0706e82SJiri Benc IEEE80211_RX_MSG = 1, 508f0706e82SJiri Benc IEEE80211_TX_STATUS_MSG = 2, 509eadc8d9eSRon Rindjunsky IEEE80211_DELBA_MSG = 3, 510eadc8d9eSRon Rindjunsky IEEE80211_ADDBA_MSG = 4, 511f0706e82SJiri Benc }; 512f0706e82SJiri Benc 513ce7c9111SKalle Valo enum queue_stop_reason { 514ce7c9111SKalle Valo IEEE80211_QUEUE_STOP_REASON_DRIVER, 515520eb820SKalle Valo IEEE80211_QUEUE_STOP_REASON_PS, 51696f5e66eSJohannes Berg IEEE80211_QUEUE_STOP_REASON_CSA, 51796f5e66eSJohannes Berg IEEE80211_QUEUE_STOP_REASON_AGGREGATION, 51825420604SJohannes Berg IEEE80211_QUEUE_STOP_REASON_SUSPEND, 5198f77f384SJohannes Berg IEEE80211_QUEUE_STOP_REASON_SKB_ADD, 520ce7c9111SKalle Valo }; 521ce7c9111SKalle Valo 522142b9f50SHelmut Schaa /** 523142b9f50SHelmut Schaa * mac80211 scan flags - currently active scan mode 524142b9f50SHelmut Schaa * 525142b9f50SHelmut Schaa * @SCAN_SW_SCANNING: We're currently in the process of scanning but may as 526142b9f50SHelmut Schaa * well be on the operating channel 527142b9f50SHelmut Schaa * @SCAN_HW_SCANNING: The hardware is scanning for us, we have no way to 528142b9f50SHelmut Schaa * determine if we are on the operating channel or not 529142b9f50SHelmut Schaa * @SCAN_OFF_CHANNEL: We're off our operating channel for scanning, 530142b9f50SHelmut Schaa * gets only set in conjunction with SCAN_SW_SCANNING 531142b9f50SHelmut Schaa */ 532fbe9c429SHelmut Schaa enum { 533fbe9c429SHelmut Schaa SCAN_SW_SCANNING, 534142b9f50SHelmut Schaa SCAN_HW_SCANNING, 535142b9f50SHelmut Schaa SCAN_OFF_CHANNEL, 536142b9f50SHelmut Schaa }; 537142b9f50SHelmut Schaa 538142b9f50SHelmut Schaa /** 539142b9f50SHelmut Schaa * enum mac80211_scan_state - scan state machine states 540142b9f50SHelmut Schaa * 541142b9f50SHelmut Schaa * @SCAN_DECISION: Main entry point to the scan state machine, this state 542142b9f50SHelmut Schaa * determines if we should keep on scanning or switch back to the 543142b9f50SHelmut Schaa * operating channel 544142b9f50SHelmut Schaa * @SCAN_SET_CHANNEL: Set the next channel to be scanned 545142b9f50SHelmut Schaa * @SCAN_SEND_PROBE: Send probe requests and wait for probe responses 546142b9f50SHelmut Schaa * @SCAN_LEAVE_OPER_CHANNEL: Leave the operating channel, notify the AP 547142b9f50SHelmut Schaa * about us leaving the channel and stop all associated STA interfaces 548142b9f50SHelmut Schaa * @SCAN_ENTER_OPER_CHANNEL: Enter the operating channel again, notify the 549142b9f50SHelmut Schaa * AP about us being back and restart all associated STA interfaces 550142b9f50SHelmut Schaa */ 551142b9f50SHelmut Schaa enum mac80211_scan_state { 552142b9f50SHelmut Schaa SCAN_DECISION, 553142b9f50SHelmut Schaa SCAN_SET_CHANNEL, 554142b9f50SHelmut Schaa SCAN_SEND_PROBE, 555142b9f50SHelmut Schaa SCAN_LEAVE_OPER_CHANNEL, 556142b9f50SHelmut Schaa SCAN_ENTER_OPER_CHANNEL, 557fbe9c429SHelmut Schaa }; 558fbe9c429SHelmut Schaa 559f0706e82SJiri Benc struct ieee80211_local { 560f0706e82SJiri Benc /* embed the driver visible part. 561f0706e82SJiri Benc * don't cast (use the static inlines below), but we keep 562f0706e82SJiri Benc * it first anyway so they become a no-op */ 563f0706e82SJiri Benc struct ieee80211_hw hw; 564f0706e82SJiri Benc 565f0706e82SJiri Benc const struct ieee80211_ops *ops; 566f0706e82SJiri Benc 56742935ecaSLuis R. Rodriguez /* 56842935ecaSLuis R. Rodriguez * private workqueue to mac80211. mac80211 makes this accessible 56942935ecaSLuis R. Rodriguez * via ieee80211_queue_work() 57042935ecaSLuis R. Rodriguez */ 57142935ecaSLuis R. Rodriguez struct workqueue_struct *workqueue; 57242935ecaSLuis R. Rodriguez 573e4e72fb4SJohannes Berg unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES]; 57496f5e66eSJohannes Berg /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */ 575ce7c9111SKalle Valo spinlock_t queue_stop_reason_lock; 57696f5e66eSJohannes Berg 577f0706e82SJiri Benc int open_count; 5783d30d949SMichael Wu int monitors, cooked_mntrs; 5798cc9a739SMichael Wu /* number of interfaces with corresponding FIF_ flags */ 580e3b90ca2SIgor Perminov int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll; 5814150c572SJohannes Berg unsigned int filter_flags; /* FIF_* */ 582f0706e82SJiri Benc struct iw_statistics wstats; 5833b8d81e0SJohannes Berg 5843b8d81e0SJohannes Berg /* protects the aggregated multicast list and filter calls */ 5853b8d81e0SJohannes Berg spinlock_t filter_lock; 5863b8d81e0SJohannes Berg 5873ac64beeSJohannes Berg /* used for uploading changed mc list */ 5883ac64beeSJohannes Berg struct work_struct reconfig_filter; 5893ac64beeSJohannes Berg 5903b8d81e0SJohannes Berg /* aggregated multicast list */ 5913b8d81e0SJohannes Berg struct dev_addr_list *mc_list; 5923b8d81e0SJohannes Berg int mc_count; 5933b8d81e0SJohannes Berg 594d0709a65SJohannes Berg bool tim_in_locked_section; /* see ieee80211_beacon_get() */ 5955bb644a0SJohannes Berg 5965bb644a0SJohannes Berg /* 5975bb644a0SJohannes Berg * suspended is true if we finished all the suspend _and_ we have 5985bb644a0SJohannes Berg * not yet come up from resume. This is to be used by mac80211 5995bb644a0SJohannes Berg * to ensure driver sanity during suspend and mac80211's own 6005bb644a0SJohannes Berg * sanity. It can eventually be used for WoW as well. 6015bb644a0SJohannes Berg */ 6025bb644a0SJohannes Berg bool suspended; 6035bb644a0SJohannes Berg 6045bb644a0SJohannes Berg /* 6055bb644a0SJohannes Berg * quiescing is true during the suspend process _only_ to 6065bb644a0SJohannes Berg * ease timer cancelling etc. 6075bb644a0SJohannes Berg */ 6085bb644a0SJohannes Berg bool quiescing; 6095bb644a0SJohannes Berg 610ea77f12fSJohannes Berg /* device is started */ 611ea77f12fSJohannes Berg bool started; 612ea77f12fSJohannes Berg 613b306f453SJohannes Berg int tx_headroom; /* required headroom for hardware/radiotap */ 614f0706e82SJiri Benc 615f0706e82SJiri Benc /* Tasklet and skb queue to process calls from IRQ mode. All frames 616f0706e82SJiri Benc * added to skb_queue will be processed, but frames in 617f0706e82SJiri Benc * skb_queue_unreliable may be dropped if the total length of these 618f0706e82SJiri Benc * queues increases over the limit. */ 619f0706e82SJiri Benc #define IEEE80211_IRQSAFE_QUEUE_LIMIT 128 620f0706e82SJiri Benc struct tasklet_struct tasklet; 621f0706e82SJiri Benc struct sk_buff_head skb_queue; 622f0706e82SJiri Benc struct sk_buff_head skb_queue_unreliable; 623f0706e82SJiri Benc 624d0709a65SJohannes Berg /* Station data */ 625d0709a65SJohannes Berg /* 626d0709a65SJohannes Berg * The lock only protects the list, hash, timer and counter 627d0709a65SJohannes Berg * against manipulation, reads are done in RCU. Additionally, 628b16bd15cSJohannes Berg * the lock protects each BSS's TIM bitmap. 629d0709a65SJohannes Berg */ 630d0709a65SJohannes Berg spinlock_t sta_lock; 631d0709a65SJohannes Berg unsigned long num_sta; 632f0706e82SJiri Benc struct list_head sta_list; 633f0706e82SJiri Benc struct sta_info *sta_hash[STA_HASH_SIZE]; 634f0706e82SJiri Benc struct timer_list sta_cleanup; 635f5ea9120SJohannes Berg int sta_generation; 636f0706e82SJiri Benc 6372a577d98SJohannes Berg struct sk_buff_head pending[IEEE80211_MAX_QUEUES]; 638f0706e82SJiri Benc struct tasklet_struct tx_pending_tasklet; 639f0706e82SJiri Benc 640cd8ffc80SJohannes Berg /* 641cd8ffc80SJohannes Berg * This lock is used to prevent concurrent A-MPDU 642cd8ffc80SJohannes Berg * session start/stop processing, this thus also 643cd8ffc80SJohannes Berg * synchronises the ->ampdu_action() callback to 644cd8ffc80SJohannes Berg * drivers and limits it to one at a time. 645cd8ffc80SJohannes Berg */ 646cd8ffc80SJohannes Berg spinlock_t ampdu_lock; 647cd8ffc80SJohannes Berg 648f0706e82SJiri Benc /* number of interfaces with corresponding IFF_ flags */ 64953918994SJohannes Berg atomic_t iff_allmultis, iff_promiscs; 650f0706e82SJiri Benc 651f0706e82SJiri Benc struct rate_control_ref *rate_ctrl; 652f0706e82SJiri Benc 653f0706e82SJiri Benc struct crypto_blkcipher *wep_tx_tfm; 654f0706e82SJiri Benc struct crypto_blkcipher *wep_rx_tfm; 655f0706e82SJiri Benc u32 wep_iv; 656f0706e82SJiri Benc 657c771c9d8SJohannes Berg /* see iface.c */ 65879010420SJohannes Berg struct list_head interfaces; 659c771c9d8SJohannes Berg struct mutex iflist_mtx; 66079010420SJohannes Berg 661b16bd15cSJohannes Berg /* 662b16bd15cSJohannes Berg * Key lock, protects sdata's key_list and sta_info's 663b16bd15cSJohannes Berg * key pointers (write access, they're RCU.) 664b16bd15cSJohannes Berg */ 665b16bd15cSJohannes Berg spinlock_t key_lock; 666b16bd15cSJohannes Berg 667b16bd15cSJohannes Berg 668c2b13452SJohannes Berg /* Scanning and BSS list */ 669f3b85252SJohannes Berg struct mutex scan_mtx; 670fbe9c429SHelmut Schaa unsigned long scanning; 6712a519311SJohannes Berg struct cfg80211_ssid scan_ssid; 6725ba63533SJohannes Berg struct cfg80211_scan_request *int_scan_req; 6734d36ec58SJohannes Berg struct cfg80211_scan_request *scan_req, *hw_scan_req; 6742a519311SJohannes Berg struct ieee80211_channel *scan_channel; 6754d36ec58SJohannes Berg enum ieee80211_band hw_scan_band; 676f0706e82SJiri Benc int scan_channel_idx; 677de95a54bSJohannes Berg int scan_ies_len; 6788318d78aSJohannes Berg 679977923b0SHelmut Schaa enum mac80211_scan_state next_scan_state; 680f0706e82SJiri Benc struct delayed_work scan_work; 681491775a5SJohannes Berg struct ieee80211_sub_if_data *scan_sdata; 682094d05dcSSujith enum nl80211_channel_type oper_channel_type; 6832a519311SJohannes Berg struct ieee80211_channel *oper_channel, *csa_channel; 684f0706e82SJiri Benc 685f0706e82SJiri Benc /* SNMP counters */ 686f0706e82SJiri Benc /* dot11CountersTable */ 687f0706e82SJiri Benc u32 dot11TransmittedFragmentCount; 688f0706e82SJiri Benc u32 dot11MulticastTransmittedFrameCount; 689f0706e82SJiri Benc u32 dot11FailedCount; 690f0706e82SJiri Benc u32 dot11RetryCount; 691f0706e82SJiri Benc u32 dot11MultipleRetryCount; 692f0706e82SJiri Benc u32 dot11FrameDuplicateCount; 693f0706e82SJiri Benc u32 dot11ReceivedFragmentCount; 694f0706e82SJiri Benc u32 dot11MulticastReceivedFrameCount; 695f0706e82SJiri Benc u32 dot11TransmittedFrameCount; 696f0706e82SJiri Benc 697f0706e82SJiri Benc #ifdef CONFIG_MAC80211_LEDS 698f0706e82SJiri Benc int tx_led_counter, rx_led_counter; 699cdcb006fSIvo van Doorn struct led_trigger *tx_led, *rx_led, *assoc_led, *radio_led; 700cdcb006fSIvo van Doorn char tx_led_name[32], rx_led_name[32], 701cdcb006fSIvo van Doorn assoc_led_name[32], radio_led_name[32]; 702f0706e82SJiri Benc #endif 703f0706e82SJiri Benc 704e9f207f0SJiri Benc #ifdef CONFIG_MAC80211_DEBUGFS 705e9f207f0SJiri Benc struct work_struct sta_debugfs_add; 706e9f207f0SJiri Benc #endif 707e9f207f0SJiri Benc 708f0706e82SJiri Benc #ifdef CONFIG_MAC80211_DEBUG_COUNTERS 709f0706e82SJiri Benc /* TX/RX handler statistics */ 710f0706e82SJiri Benc unsigned int tx_handlers_drop; 711f0706e82SJiri Benc unsigned int tx_handlers_queued; 712f0706e82SJiri Benc unsigned int tx_handlers_drop_unencrypted; 713f0706e82SJiri Benc unsigned int tx_handlers_drop_fragment; 714f0706e82SJiri Benc unsigned int tx_handlers_drop_wep; 715f0706e82SJiri Benc unsigned int tx_handlers_drop_not_assoc; 716f0706e82SJiri Benc unsigned int tx_handlers_drop_unauth_port; 717f0706e82SJiri Benc unsigned int rx_handlers_drop; 718f0706e82SJiri Benc unsigned int rx_handlers_queued; 719f0706e82SJiri Benc unsigned int rx_handlers_drop_nullfunc; 720f0706e82SJiri Benc unsigned int rx_handlers_drop_defrag; 721f0706e82SJiri Benc unsigned int rx_handlers_drop_short; 722f0706e82SJiri Benc unsigned int rx_handlers_drop_passive_scan; 723f0706e82SJiri Benc unsigned int tx_expand_skb_head; 724f0706e82SJiri Benc unsigned int tx_expand_skb_head_cloned; 725f0706e82SJiri Benc unsigned int rx_expand_skb_head; 726f0706e82SJiri Benc unsigned int rx_expand_skb_head2; 727f0706e82SJiri Benc unsigned int rx_handlers_fragments; 728f0706e82SJiri Benc unsigned int tx_status_drop; 729f0706e82SJiri Benc #define I802_DEBUG_INC(c) (c)++ 730f0706e82SJiri Benc #else /* CONFIG_MAC80211_DEBUG_COUNTERS */ 731f0706e82SJiri Benc #define I802_DEBUG_INC(c) do { } while (0) 732f0706e82SJiri Benc #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */ 733f0706e82SJiri Benc 734f0706e82SJiri Benc 735f0706e82SJiri Benc int total_ps_buffered; /* total number of all buffered unicast and 736f0706e82SJiri Benc * multicast packets for power saving stations 737f0706e82SJiri Benc */ 738f0706e82SJiri Benc int wifi_wme_noack_test; 739f0706e82SJiri Benc unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ 740520eb820SKalle Valo 741572e0012SKalle Valo bool pspolling; 742965bedadSJohannes Berg /* 743965bedadSJohannes Berg * PS can only be enabled when we have exactly one managed 744965bedadSJohannes Berg * interface (and monitors) in PS, this then points there. 745965bedadSJohannes Berg */ 746965bedadSJohannes Berg struct ieee80211_sub_if_data *ps_sdata; 747520eb820SKalle Valo struct work_struct dynamic_ps_enable_work; 748520eb820SKalle Valo struct work_struct dynamic_ps_disable_work; 749520eb820SKalle Valo struct timer_list dynamic_ps_timer; 75010f644a4SJohannes Berg struct notifier_block network_latency_notifier; 751f0706e82SJiri Benc 7522bf30fabSJohannes Berg int user_power_level; /* in dBm */ 753a8302de9SVasanthakumar Thiagarajan int power_constr_level; /* in dBm */ 7542bf30fabSJohannes Berg 755f2753ddbSJohannes Berg struct work_struct restart_work; 756f2753ddbSJohannes Berg 757e9f207f0SJiri Benc #ifdef CONFIG_MAC80211_DEBUGFS 758e9f207f0SJiri Benc struct local_debugfsdentries { 7594b7679a5SJohannes Berg struct dentry *rcdir; 760e9f207f0SJiri Benc struct dentry *stations; 761e9f207f0SJiri Benc struct dentry *keys; 762e9f207f0SJiri Benc } debugfs; 763e9f207f0SJiri Benc #endif 764f0706e82SJiri Benc }; 765f0706e82SJiri Benc 7663e122be0SJohannes Berg static inline struct ieee80211_sub_if_data * 7673e122be0SJohannes Berg IEEE80211_DEV_TO_SUB_IF(struct net_device *dev) 7683e122be0SJohannes Berg { 7693e122be0SJohannes Berg return netdev_priv(dev); 7703e122be0SJohannes Berg } 7713e122be0SJohannes Berg 772c951ad35SJohannes Berg /* this struct represents 802.11n's RA/TID combination along with our vif */ 773eadc8d9eSRon Rindjunsky struct ieee80211_ra_tid { 774c951ad35SJohannes Berg struct ieee80211_vif *vif; 775eadc8d9eSRon Rindjunsky u8 ra[ETH_ALEN]; 776eadc8d9eSRon Rindjunsky u16 tid; 777eadc8d9eSRon Rindjunsky }; 778eadc8d9eSRon Rindjunsky 779ee385855SLuis Carlos Cobo /* Parsed Information Elements */ 780ee385855SLuis Carlos Cobo struct ieee802_11_elems { 78143ac2ca3SJouni Malinen u8 *ie_start; 78243ac2ca3SJouni Malinen size_t total_len; 78343ac2ca3SJouni Malinen 784ee385855SLuis Carlos Cobo /* pointers to IEs */ 785ee385855SLuis Carlos Cobo u8 *ssid; 786ee385855SLuis Carlos Cobo u8 *supp_rates; 787ee385855SLuis Carlos Cobo u8 *fh_params; 788ee385855SLuis Carlos Cobo u8 *ds_params; 789ee385855SLuis Carlos Cobo u8 *cf_params; 790e7ec86f5SJohannes Berg struct ieee80211_tim_ie *tim; 791ee385855SLuis Carlos Cobo u8 *ibss_params; 792ee385855SLuis Carlos Cobo u8 *challenge; 793ee385855SLuis Carlos Cobo u8 *wpa; 794ee385855SLuis Carlos Cobo u8 *rsn; 795ee385855SLuis Carlos Cobo u8 *erp_info; 796ee385855SLuis Carlos Cobo u8 *ext_supp_rates; 797ee385855SLuis Carlos Cobo u8 *wmm_info; 798ee385855SLuis Carlos Cobo u8 *wmm_param; 79909914813SJohannes Berg struct ieee80211_ht_cap *ht_cap_elem; 800d9fe60deSJohannes Berg struct ieee80211_ht_info *ht_info_elem; 801ee385855SLuis Carlos Cobo u8 *mesh_config; 802ee385855SLuis Carlos Cobo u8 *mesh_id; 803ee385855SLuis Carlos Cobo u8 *peer_link; 804ee385855SLuis Carlos Cobo u8 *preq; 805ee385855SLuis Carlos Cobo u8 *prep; 806ee385855SLuis Carlos Cobo u8 *perr; 80790a5e169SRui Paulo struct ieee80211_rann_ie *rann; 808f2df3859SAssaf Krauss u8 *ch_switch_elem; 809f2df3859SAssaf Krauss u8 *country_elem; 810f2df3859SAssaf Krauss u8 *pwr_constr_elem; 811f2df3859SAssaf Krauss u8 *quiet_elem; /* first quite element */ 812f797eb7eSJouni Malinen u8 *timeout_int; 813ee385855SLuis Carlos Cobo 814ee385855SLuis Carlos Cobo /* length of them, respectively */ 815ee385855SLuis Carlos Cobo u8 ssid_len; 816ee385855SLuis Carlos Cobo u8 supp_rates_len; 817ee385855SLuis Carlos Cobo u8 fh_params_len; 818ee385855SLuis Carlos Cobo u8 ds_params_len; 819ee385855SLuis Carlos Cobo u8 cf_params_len; 820ee385855SLuis Carlos Cobo u8 tim_len; 821ee385855SLuis Carlos Cobo u8 ibss_params_len; 822ee385855SLuis Carlos Cobo u8 challenge_len; 823ee385855SLuis Carlos Cobo u8 wpa_len; 824ee385855SLuis Carlos Cobo u8 rsn_len; 825ee385855SLuis Carlos Cobo u8 erp_info_len; 826ee385855SLuis Carlos Cobo u8 ext_supp_rates_len; 827ee385855SLuis Carlos Cobo u8 wmm_info_len; 828ee385855SLuis Carlos Cobo u8 wmm_param_len; 829ee385855SLuis Carlos Cobo u8 mesh_config_len; 830ee385855SLuis Carlos Cobo u8 mesh_id_len; 831ee385855SLuis Carlos Cobo u8 peer_link_len; 832ee385855SLuis Carlos Cobo u8 preq_len; 833ee385855SLuis Carlos Cobo u8 prep_len; 834ee385855SLuis Carlos Cobo u8 perr_len; 835f2df3859SAssaf Krauss u8 ch_switch_elem_len; 836f2df3859SAssaf Krauss u8 country_elem_len; 837f2df3859SAssaf Krauss u8 pwr_constr_elem_len; 838f2df3859SAssaf Krauss u8 quiet_elem_len; 839f2df3859SAssaf Krauss u8 num_of_quiet_elem; /* can be more the one */ 840f797eb7eSJouni Malinen u8 timeout_int_len; 841ee385855SLuis Carlos Cobo }; 842ee385855SLuis Carlos Cobo 843f0706e82SJiri Benc static inline struct ieee80211_local *hw_to_local( 844f0706e82SJiri Benc struct ieee80211_hw *hw) 845f0706e82SJiri Benc { 846f0706e82SJiri Benc return container_of(hw, struct ieee80211_local, hw); 847f0706e82SJiri Benc } 848f0706e82SJiri Benc 849f0706e82SJiri Benc static inline struct ieee80211_hw *local_to_hw( 850f0706e82SJiri Benc struct ieee80211_local *local) 851f0706e82SJiri Benc { 852f0706e82SJiri Benc return &local->hw; 853f0706e82SJiri Benc } 854f0706e82SJiri Benc 855f0706e82SJiri Benc 856571ecf67SJohannes Berg static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr) 857571ecf67SJohannes Berg { 858571ecf67SJohannes Berg return compare_ether_addr(raddr, addr) == 0 || 859571ecf67SJohannes Berg is_broadcast_ether_addr(raddr); 860571ecf67SJohannes Berg } 861571ecf67SJohannes Berg 862571ecf67SJohannes Berg 863e8975581SJohannes Berg int ieee80211_hw_config(struct ieee80211_local *local, u32 changed); 8645cf121c3SJohannes Berg void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx); 8659c6bd790SJohannes Berg void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, 8669c6bd790SJohannes Berg u32 changed); 8670d143fe1SJohannes Berg void ieee80211_configure_filter(struct ieee80211_local *local); 86846900298SJohannes Berg u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata); 869f0706e82SJiri Benc 87046900298SJohannes Berg /* STA code */ 8719c6bd790SJohannes Berg void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata); 87277fdaa12SJohannes Berg int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, 87377fdaa12SJohannes Berg struct cfg80211_auth_request *req); 87477fdaa12SJohannes Berg int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, 87577fdaa12SJohannes Berg struct cfg80211_assoc_request *req); 87677fdaa12SJohannes Berg int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, 877667503ddSJohannes Berg struct cfg80211_deauth_request *req, 878667503ddSJohannes Berg void *cookie); 87977fdaa12SJohannes Berg int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, 880667503ddSJohannes Berg struct cfg80211_disassoc_request *req, 881667503ddSJohannes Berg void *cookie); 88246900298SJohannes Berg ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata, 883f1d58c25SJohannes Berg struct sk_buff *skb); 884572e0012SKalle Valo void ieee80211_send_pspoll(struct ieee80211_local *local, 885572e0012SKalle Valo struct ieee80211_sub_if_data *sdata); 88610f644a4SJohannes Berg void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency); 88710f644a4SJohannes Berg int ieee80211_max_network_latency(struct notifier_block *nb, 88810f644a4SJohannes Berg unsigned long data, void *dummy); 889cc32abd4SJohannes Berg void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, 890cc32abd4SJohannes Berg struct ieee80211_channel_sw_ie *sw_elem, 891cc32abd4SJohannes Berg struct ieee80211_bss *bss); 8925bb644a0SJohannes Berg void ieee80211_sta_quiesce(struct ieee80211_sub_if_data *sdata); 8935bb644a0SJohannes Berg void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata); 8949c6bd790SJohannes Berg 89546900298SJohannes Berg /* IBSS code */ 89646900298SJohannes Berg void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); 89746900298SJohannes Berg void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata); 89846900298SJohannes Berg ieee80211_rx_result 899f1d58c25SJohannes Berg ieee80211_ibss_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); 90046900298SJohannes Berg struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, 90146900298SJohannes Berg u8 *bssid, u8 *addr, u32 supp_rates); 902af8cdcd8SJohannes Berg int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata, 903af8cdcd8SJohannes Berg struct cfg80211_ibss_params *params); 904af8cdcd8SJohannes Berg int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata); 9055bb644a0SJohannes Berg void ieee80211_ibss_quiesce(struct ieee80211_sub_if_data *sdata); 9065bb644a0SJohannes Berg void ieee80211_ibss_restart(struct ieee80211_sub_if_data *sdata); 90746900298SJohannes Berg 9089c6bd790SJohannes Berg /* scan/BSS handling */ 90946900298SJohannes Berg void ieee80211_scan_work(struct work_struct *work); 910f3b85252SJohannes Berg int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, 911f3b85252SJohannes Berg const u8 *ssid, u8 ssid_len); 912c2b13452SJohannes Berg int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, 9132a519311SJohannes Berg struct cfg80211_scan_request *req); 9145bb644a0SJohannes Berg void ieee80211_scan_cancel(struct ieee80211_local *local); 915c2b13452SJohannes Berg ieee80211_rx_result 916f1d58c25SJohannes Berg ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); 9179c6bd790SJohannes Berg 9180a51b27eSJohannes Berg void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local); 919c2b13452SJohannes Berg struct ieee80211_bss * 92098c8fccfSJohannes Berg ieee80211_bss_info_update(struct ieee80211_local *local, 92198c8fccfSJohannes Berg struct ieee80211_rx_status *rx_status, 92298c8fccfSJohannes Berg struct ieee80211_mgmt *mgmt, 92398c8fccfSJohannes Berg size_t len, 92498c8fccfSJohannes Berg struct ieee802_11_elems *elems, 9252a519311SJohannes Berg struct ieee80211_channel *channel, 9262a519311SJohannes Berg bool beacon); 927c2b13452SJohannes Berg struct ieee80211_bss * 9285484e237SJohannes Berg ieee80211_rx_bss_get(struct ieee80211_local *local, u8 *bssid, int freq, 9295484e237SJohannes Berg u8 *ssid, u8 ssid_len); 93098c8fccfSJohannes Berg void ieee80211_rx_bss_put(struct ieee80211_local *local, 931c2b13452SJohannes Berg struct ieee80211_bss *bss); 932ee385855SLuis Carlos Cobo 9333e122be0SJohannes Berg /* interface handling */ 9343e122be0SJohannes Berg int ieee80211_if_add(struct ieee80211_local *local, const char *name, 93505c914feSJohannes Berg struct net_device **new_dev, enum nl80211_iftype type, 936ee385855SLuis Carlos Cobo struct vif_params *params); 937f3947e2dSJohannes Berg int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, 93805c914feSJohannes Berg enum nl80211_iftype type); 939f698d856SJasper Bryant-Greene void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata); 94075636525SJohannes Berg void ieee80211_remove_interfaces(struct ieee80211_local *local); 9415cff20e6SJohannes Berg u32 __ieee80211_recalc_idle(struct ieee80211_local *local); 9425cff20e6SJohannes Berg void ieee80211_recalc_idle(struct ieee80211_local *local); 943f0706e82SJiri Benc 944e2ebc74dSJohannes Berg /* tx handling */ 945e2ebc74dSJohannes Berg void ieee80211_clear_tx_pending(struct ieee80211_local *local); 946e2ebc74dSJohannes Berg void ieee80211_tx_pending(unsigned long data); 947d0cf9c0dSStephen Hemminger netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, 948d0cf9c0dSStephen Hemminger struct net_device *dev); 949d0cf9c0dSStephen Hemminger netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, 950d0cf9c0dSStephen Hemminger struct net_device *dev); 951e2ebc74dSJohannes Berg 952*fe7a5d5cSJohannes Berg /* 953*fe7a5d5cSJohannes Berg * radiotap header for status frames 954*fe7a5d5cSJohannes Berg */ 955*fe7a5d5cSJohannes Berg struct ieee80211_tx_status_rtap_hdr { 956*fe7a5d5cSJohannes Berg struct ieee80211_radiotap_header hdr; 957*fe7a5d5cSJohannes Berg u8 rate; 958*fe7a5d5cSJohannes Berg u8 padding_for_rate; 959*fe7a5d5cSJohannes Berg __le16 tx_flags; 960*fe7a5d5cSJohannes Berg u8 data_retries; 961*fe7a5d5cSJohannes Berg } __attribute__ ((packed)); 962*fe7a5d5cSJohannes Berg 963*fe7a5d5cSJohannes Berg 964de1ede7aSJohannes Berg /* HT */ 965ae5eb026SJohannes Berg void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband, 966ae5eb026SJohannes Berg struct ieee80211_ht_cap *ht_cap_ie, 967d9fe60deSJohannes Berg struct ieee80211_sta_ht_cap *ht_cap); 968de1ede7aSJohannes Berg void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u16 ssn); 969b8695a8fSJohannes Berg void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, 970b8695a8fSJohannes Berg const u8 *da, u16 tid, 971b8695a8fSJohannes Berg u16 initiator, u16 reason_code); 972de1ede7aSJohannes Berg 973de1ede7aSJohannes Berg void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *da, 974de1ede7aSJohannes Berg u16 tid, u16 initiator, u16 reason); 975849b7967SJohannes Berg void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, 976849b7967SJohannes Berg u16 initiator, u16 reason); 9772dace10eSJohannes Berg void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta); 978de1ede7aSJohannes Berg void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata, 979de1ede7aSJohannes Berg struct sta_info *sta, 980de1ede7aSJohannes Berg struct ieee80211_mgmt *mgmt, size_t len); 981de1ede7aSJohannes Berg void ieee80211_process_addba_resp(struct ieee80211_local *local, 982de1ede7aSJohannes Berg struct sta_info *sta, 983de1ede7aSJohannes Berg struct ieee80211_mgmt *mgmt, 984de1ede7aSJohannes Berg size_t len); 985de1ede7aSJohannes Berg void ieee80211_process_addba_request(struct ieee80211_local *local, 986de1ede7aSJohannes Berg struct sta_info *sta, 987de1ede7aSJohannes Berg struct ieee80211_mgmt *mgmt, 988de1ede7aSJohannes Berg size_t len); 989de1ede7aSJohannes Berg 990849b7967SJohannes Berg int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, 991849b7967SJohannes Berg enum ieee80211_back_parties initiator); 992849b7967SJohannes Berg 99339192c0bSJohannes Berg /* Spectrum management */ 99439192c0bSJohannes Berg void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, 99539192c0bSJohannes Berg struct ieee80211_mgmt *mgmt, 99639192c0bSJohannes Berg size_t len); 99739192c0bSJohannes Berg 998f2753ddbSJohannes Berg /* Suspend/resume and hw reconfiguration */ 999f2753ddbSJohannes Berg int ieee80211_reconfig(struct ieee80211_local *local); 100084f6a01cSJohannes Berg void ieee80211_stop_device(struct ieee80211_local *local); 1001f2753ddbSJohannes Berg 1002827b1fb4SJohannes Berg #ifdef CONFIG_PM 1003665af4fcSBob Copeland int __ieee80211_suspend(struct ieee80211_hw *hw); 1004f2753ddbSJohannes Berg 1005f2753ddbSJohannes Berg static inline int __ieee80211_resume(struct ieee80211_hw *hw) 1006f2753ddbSJohannes Berg { 1007f2753ddbSJohannes Berg return ieee80211_reconfig(hw_to_local(hw)); 1008f2753ddbSJohannes Berg } 1009827b1fb4SJohannes Berg #else 1010827b1fb4SJohannes Berg static inline int __ieee80211_suspend(struct ieee80211_hw *hw) 1011827b1fb4SJohannes Berg { 1012827b1fb4SJohannes Berg return 0; 1013827b1fb4SJohannes Berg } 1014f2753ddbSJohannes Berg 1015827b1fb4SJohannes Berg static inline int __ieee80211_resume(struct ieee80211_hw *hw) 1016827b1fb4SJohannes Berg { 1017827b1fb4SJohannes Berg return 0; 1018827b1fb4SJohannes Berg } 1019827b1fb4SJohannes Berg #endif 1020665af4fcSBob Copeland 1021c2d1560aSJohannes Berg /* utility functions/constants */ 1022c2d1560aSJohannes Berg extern void *mac80211_wiphy_privid; /* for wiphy privid */ 102371364716SRon Rindjunsky u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, 102405c914feSJohannes Berg enum nl80211_iftype type); 1025c2d1560aSJohannes Berg int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, 1026c2d1560aSJohannes Berg int rate, int erp, int short_preamble); 1027f698d856SJasper Bryant-Greene void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, 1028e6d6e342SJohannes Berg struct ieee80211_hdr *hdr, const u8 *tsc, 1029e6d6e342SJohannes Berg gfp_t gfp); 10305825fe10SJohannes Berg void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata); 103162ae67beSJohannes Berg void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); 10329c6bd790SJohannes Berg void ieee802_11_parse_elems(u8 *start, size_t len, 10339c6bd790SJohannes Berg struct ieee802_11_elems *elems); 1034d91f36dbSJohannes Berg u32 ieee802_11_parse_elems_crc(u8 *start, size_t len, 1035d91f36dbSJohannes Berg struct ieee802_11_elems *elems, 1036d91f36dbSJohannes Berg u64 filter, u32 crc); 1037881d948cSJohannes Berg u32 ieee80211_mandatory_rates(struct ieee80211_local *local, 103896dd22acSJohannes Berg enum ieee80211_band band); 1039f0706e82SJiri Benc 1040520eb820SKalle Valo void ieee80211_dynamic_ps_enable_work(struct work_struct *work); 1041520eb820SKalle Valo void ieee80211_dynamic_ps_disable_work(struct work_struct *work); 1042520eb820SKalle Valo void ieee80211_dynamic_ps_timer(unsigned long data); 1043a97b77b9SVivek Natarajan void ieee80211_send_nullfunc(struct ieee80211_local *local, 1044a97b77b9SVivek Natarajan struct ieee80211_sub_if_data *sdata, 1045a97b77b9SVivek Natarajan int powersave); 10463cf335d5SKalle Valo void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, 10473cf335d5SKalle Valo struct ieee80211_hdr *hdr); 104804de8381SKalle Valo void ieee80211_beacon_loss_work(struct work_struct *work); 1049520eb820SKalle Valo 1050ce7c9111SKalle Valo void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw, 1051ce7c9111SKalle Valo enum queue_stop_reason reason); 1052ce7c9111SKalle Valo void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw, 1053ce7c9111SKalle Valo enum queue_stop_reason reason); 105496f5e66eSJohannes Berg void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, 105596f5e66eSJohannes Berg enum queue_stop_reason reason); 105696f5e66eSJohannes Berg void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue, 105796f5e66eSJohannes Berg enum queue_stop_reason reason); 10588f77f384SJohannes Berg void ieee80211_add_pending_skb(struct ieee80211_local *local, 10598f77f384SJohannes Berg struct sk_buff *skb); 10608f77f384SJohannes Berg int ieee80211_add_pending_skbs(struct ieee80211_local *local, 10618f77f384SJohannes Berg struct sk_buff_head *skbs); 1062ce7c9111SKalle Valo 106346900298SJohannes Berg void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, 106446900298SJohannes Berg u16 transaction, u16 auth_alg, 1065fffd0934SJohannes Berg u8 *extra, size_t extra_len, const u8 *bssid, 1066fffd0934SJohannes Berg const u8 *key, u8 key_len, u8 key_idx); 1067de95a54bSJohannes Berg int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, 10684d36ec58SJohannes Berg const u8 *ie, size_t ie_len, 10694d36ec58SJohannes Berg enum ieee80211_band band); 107046900298SJohannes Berg void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1071de95a54bSJohannes Berg const u8 *ssid, size_t ssid_len, 1072de95a54bSJohannes Berg const u8 *ie, size_t ie_len); 107346900298SJohannes Berg 107446900298SJohannes Berg void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 107546900298SJohannes Berg const size_t supp_rates_len, 107646900298SJohannes Berg const u8 *supp_rates); 107746900298SJohannes Berg u32 ieee80211_sta_get_rates(struct ieee80211_local *local, 107846900298SJohannes Berg struct ieee802_11_elems *elems, 107946900298SJohannes Berg enum ieee80211_band band); 108046900298SJohannes Berg 1081f4ea83ddSJohannes Berg #ifdef CONFIG_MAC80211_NOINLINE 1082d9e8a70fSJohannes Berg #define debug_noinline noinline 1083d9e8a70fSJohannes Berg #else 1084d9e8a70fSJohannes Berg #define debug_noinline 1085d9e8a70fSJohannes Berg #endif 1086d9e8a70fSJohannes Berg 1087f0706e82SJiri Benc #endif /* IEEE80211_I_H */ 1088