aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h146
1 files changed, 122 insertions, 24 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index ea10a51babda..2f0642d9e154 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -24,6 +24,7 @@
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/etherdevice.h> 25#include <linux/etherdevice.h>
26#include <linux/leds.h> 26#include <linux/leds.h>
27#include <linux/idr.h>
27#include <net/ieee80211_radiotap.h> 28#include <net/ieee80211_radiotap.h>
28#include <net/cfg80211.h> 29#include <net/cfg80211.h>
29#include <net/mac80211.h> 30#include <net/mac80211.h>
@@ -141,6 +142,7 @@ typedef unsigned __bitwise__ ieee80211_tx_result;
141 142
142struct ieee80211_tx_data { 143struct ieee80211_tx_data {
143 struct sk_buff *skb; 144 struct sk_buff *skb;
145 struct sk_buff_head skbs;
144 struct ieee80211_local *local; 146 struct ieee80211_local *local;
145 struct ieee80211_sub_if_data *sdata; 147 struct ieee80211_sub_if_data *sdata;
146 struct sta_info *sta; 148 struct sta_info *sta;
@@ -184,12 +186,15 @@ enum ieee80211_packet_rx_flags {
184 * enum ieee80211_rx_flags - RX data flags 186 * enum ieee80211_rx_flags - RX data flags
185 * 187 *
186 * @IEEE80211_RX_CMNTR: received on cooked monitor already 188 * @IEEE80211_RX_CMNTR: received on cooked monitor already
189 * @IEEE80211_RX_BEACON_REPORTED: This frame was already reported
190 * to cfg80211_report_obss_beacon().
187 * 191 *
188 * These flags are used across handling multiple interfaces 192 * These flags are used across handling multiple interfaces
189 * for a single frame. 193 * for a single frame.
190 */ 194 */
191enum ieee80211_rx_flags { 195enum ieee80211_rx_flags {
192 IEEE80211_RX_CMNTR = BIT(0), 196 IEEE80211_RX_CMNTR = BIT(0),
197 IEEE80211_RX_BEACON_REPORTED = BIT(1),
193}; 198};
194 199
195struct ieee80211_rx_data { 200struct ieee80211_rx_data {
@@ -228,6 +233,7 @@ struct beacon_data {
228 233
229struct ieee80211_if_ap { 234struct ieee80211_if_ap {
230 struct beacon_data __rcu *beacon; 235 struct beacon_data __rcu *beacon;
236 struct sk_buff __rcu *probe_resp;
231 237
232 struct list_head vlans; 238 struct list_head vlans;
233 239
@@ -237,6 +243,7 @@ struct ieee80211_if_ap {
237 u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)]; 243 u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)];
238 struct sk_buff_head ps_bc_buf; 244 struct sk_buff_head ps_bc_buf;
239 atomic_t num_sta_ps; /* number of stations in PS mode */ 245 atomic_t num_sta_ps; /* number of stations in PS mode */
246 atomic_t num_sta_authorized; /* number of authorized stations */
240 int dtim_count; 247 int dtim_count;
241 bool dtim_bc_mc; 248 bool dtim_bc_mc;
242}; 249};
@@ -443,6 +450,9 @@ struct ieee80211_if_managed {
443 */ 450 */
444 int rssi_min_thold, rssi_max_thold; 451 int rssi_min_thold, rssi_max_thold;
445 int last_ave_beacon_signal; 452 int last_ave_beacon_signal;
453
454 struct ieee80211_ht_cap ht_capa; /* configured ht-cap over-rides */
455 struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */
446}; 456};
447 457
448struct ieee80211_if_ibss { 458struct ieee80211_if_ibss {
@@ -465,12 +475,16 @@ struct ieee80211_if_ibss {
465 u8 ssid_len, ie_len; 475 u8 ssid_len, ie_len;
466 u8 *ie; 476 u8 *ie;
467 struct ieee80211_channel *channel; 477 struct ieee80211_channel *channel;
478 enum nl80211_channel_type channel_type;
468 479
469 unsigned long ibss_join_req; 480 unsigned long ibss_join_req;
470 /* probe response/beacon for IBSS */ 481 /* probe response/beacon for IBSS */
471 struct sk_buff __rcu *presp; 482 struct sk_buff __rcu *presp;
472 struct sk_buff *skb; 483 struct sk_buff *skb;
473 484
485 spinlock_t incomplete_lock;
486 struct list_head incomplete_stations;
487
474 enum { 488 enum {
475 IEEE80211_IBSS_MLME_SEARCH, 489 IEEE80211_IBSS_MLME_SEARCH,
476 IEEE80211_IBSS_MLME_JOINED, 490 IEEE80211_IBSS_MLME_JOINED,
@@ -505,7 +519,9 @@ struct ieee80211_if_mesh {
505 atomic_t mpaths; 519 atomic_t mpaths;
506 /* Timestamp of last SN update */ 520 /* Timestamp of last SN update */
507 unsigned long last_sn_update; 521 unsigned long last_sn_update;
508 /* Timestamp of last SN sent */ 522 /* Time when it's ok to send next PERR */
523 unsigned long next_perr;
524 /* Timestamp of last PREQ sent */
509 unsigned long last_preq; 525 unsigned long last_preq;
510 struct mesh_rmc *rmc; 526 struct mesh_rmc *rmc;
511 spinlock_t mesh_preq_queue_lock; 527 spinlock_t mesh_preq_queue_lock;
@@ -543,6 +559,7 @@ struct ieee80211_if_mesh {
543 * associated stations and deliver multicast frames both 559 * associated stations and deliver multicast frames both
544 * back to wireless media and to the local net stack. 560 * back to wireless media and to the local net stack.
545 * @IEEE80211_SDATA_DISCONNECT_RESUME: Disconnect after resume. 561 * @IEEE80211_SDATA_DISCONNECT_RESUME: Disconnect after resume.
562 * @IEEE80211_SDATA_IN_DRIVER: indicates interface was added to driver
546 */ 563 */
547enum ieee80211_sub_if_data_flags { 564enum ieee80211_sub_if_data_flags {
548 IEEE80211_SDATA_ALLMULTI = BIT(0), 565 IEEE80211_SDATA_ALLMULTI = BIT(0),
@@ -550,6 +567,7 @@ enum ieee80211_sub_if_data_flags {
550 IEEE80211_SDATA_OPERATING_GMODE = BIT(2), 567 IEEE80211_SDATA_OPERATING_GMODE = BIT(2),
551 IEEE80211_SDATA_DONT_BRIDGE_PACKETS = BIT(3), 568 IEEE80211_SDATA_DONT_BRIDGE_PACKETS = BIT(3),
552 IEEE80211_SDATA_DISCONNECT_RESUME = BIT(4), 569 IEEE80211_SDATA_DISCONNECT_RESUME = BIT(4),
570 IEEE80211_SDATA_IN_DRIVER = BIT(5),
553}; 571};
554 572
555/** 573/**
@@ -600,6 +618,9 @@ struct ieee80211_sub_if_data {
600 struct ieee80211_fragment_entry fragments[IEEE80211_FRAGMENT_MAX]; 618 struct ieee80211_fragment_entry fragments[IEEE80211_FRAGMENT_MAX];
601 unsigned int fragment_next; 619 unsigned int fragment_next;
602 620
621 /* TID bitmap for NoAck policy */
622 u16 noack_map;
623
603 struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS]; 624 struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS];
604 struct ieee80211_key __rcu *default_unicast_key; 625 struct ieee80211_key __rcu *default_unicast_key;
605 struct ieee80211_key __rcu *default_multicast_key; 626 struct ieee80211_key __rcu *default_multicast_key;
@@ -722,17 +743,16 @@ enum {
722 * operating channel 743 * operating channel
723 * @SCAN_SET_CHANNEL: Set the next channel to be scanned 744 * @SCAN_SET_CHANNEL: Set the next channel to be scanned
724 * @SCAN_SEND_PROBE: Send probe requests and wait for probe responses 745 * @SCAN_SEND_PROBE: Send probe requests and wait for probe responses
725 * @SCAN_LEAVE_OPER_CHANNEL: Leave the operating channel, notify the AP 746 * @SCAN_SUSPEND: Suspend the scan and go back to operating channel to
726 * about us leaving the channel and stop all associated STA interfaces 747 * send out data
727 * @SCAN_ENTER_OPER_CHANNEL: Enter the operating channel again, notify the 748 * @SCAN_RESUME: Resume the scan and scan the next channel
728 * AP about us being back and restart all associated STA interfaces
729 */ 749 */
730enum mac80211_scan_state { 750enum mac80211_scan_state {
731 SCAN_DECISION, 751 SCAN_DECISION,
732 SCAN_SET_CHANNEL, 752 SCAN_SET_CHANNEL,
733 SCAN_SEND_PROBE, 753 SCAN_SEND_PROBE,
734 SCAN_LEAVE_OPER_CHANNEL, 754 SCAN_SUSPEND,
735 SCAN_ENTER_OPER_CHANNEL, 755 SCAN_RESUME,
736}; 756};
737 757
738struct ieee80211_local { 758struct ieee80211_local {
@@ -835,18 +855,15 @@ struct ieee80211_local {
835 855
836 /* Station data */ 856 /* Station data */
837 /* 857 /*
838 * The mutex only protects the list and counter, 858 * The mutex only protects the list, hash table and
839 * reads are done in RCU. 859 * counter, reads are done with RCU.
840 * Additionally, the lock protects the hash table,
841 * the pending list and each BSS's TIM bitmap.
842 */ 860 */
843 struct mutex sta_mtx; 861 struct mutex sta_mtx;
844 spinlock_t sta_lock; 862 spinlock_t tim_lock;
845 unsigned long num_sta; 863 unsigned long num_sta;
846 struct list_head sta_list, sta_pending_list; 864 struct list_head sta_list;
847 struct sta_info __rcu *sta_hash[STA_HASH_SIZE]; 865 struct sta_info __rcu *sta_hash[STA_HASH_SIZE];
848 struct timer_list sta_cleanup; 866 struct timer_list sta_cleanup;
849 struct work_struct sta_finish_work;
850 int sta_generation; 867 int sta_generation;
851 868
852 struct sk_buff_head pending[IEEE80211_MAX_QUEUES]; 869 struct sk_buff_head pending[IEEE80211_MAX_QUEUES];
@@ -951,7 +968,6 @@ struct ieee80211_local {
951 int total_ps_buffered; /* total number of all buffered unicast and 968 int total_ps_buffered; /* total number of all buffered unicast and
952 * multicast packets for power saving stations 969 * multicast packets for power saving stations
953 */ 970 */
954 int wifi_wme_noack_test;
955 unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ 971 unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */
956 972
957 /* 973 /*
@@ -1012,6 +1028,9 @@ struct ieee80211_local {
1012 u32 hw_roc_cookie; 1028 u32 hw_roc_cookie;
1013 bool hw_roc_for_tx; 1029 bool hw_roc_for_tx;
1014 1030
1031 struct idr ack_status_frames;
1032 spinlock_t ack_status_lock;
1033
1015 /* dummy netdev for use w/ NAPI */ 1034 /* dummy netdev for use w/ NAPI */
1016 struct net_device napi_dev; 1035 struct net_device napi_dev;
1017 1036
@@ -1030,6 +1049,69 @@ struct ieee80211_ra_tid {
1030 u16 tid; 1049 u16 tid;
1031}; 1050};
1032 1051
1052/* Parsed Information Elements */
1053struct ieee802_11_elems {
1054 u8 *ie_start;
1055 size_t total_len;
1056
1057 /* pointers to IEs */
1058 u8 *ssid;
1059 u8 *supp_rates;
1060 u8 *fh_params;
1061 u8 *ds_params;
1062 u8 *cf_params;
1063 struct ieee80211_tim_ie *tim;
1064 u8 *ibss_params;
1065 u8 *challenge;
1066 u8 *wpa;
1067 u8 *rsn;
1068 u8 *erp_info;
1069 u8 *ext_supp_rates;
1070 u8 *wmm_info;
1071 u8 *wmm_param;
1072 struct ieee80211_ht_cap *ht_cap_elem;
1073 struct ieee80211_ht_info *ht_info_elem;
1074 struct ieee80211_meshconf_ie *mesh_config;
1075 u8 *mesh_id;
1076 u8 *peering;
1077 u8 *preq;
1078 u8 *prep;
1079 u8 *perr;
1080 struct ieee80211_rann_ie *rann;
1081 u8 *ch_switch_elem;
1082 u8 *country_elem;
1083 u8 *pwr_constr_elem;
1084 u8 *quiet_elem; /* first quite element */
1085 u8 *timeout_int;
1086
1087 /* length of them, respectively */
1088 u8 ssid_len;
1089 u8 supp_rates_len;
1090 u8 fh_params_len;
1091 u8 ds_params_len;
1092 u8 cf_params_len;
1093 u8 tim_len;
1094 u8 ibss_params_len;
1095 u8 challenge_len;
1096 u8 wpa_len;
1097 u8 rsn_len;
1098 u8 erp_info_len;
1099 u8 ext_supp_rates_len;
1100 u8 wmm_info_len;
1101 u8 wmm_param_len;
1102 u8 mesh_id_len;
1103 u8 peering_len;
1104 u8 preq_len;
1105 u8 prep_len;
1106 u8 perr_len;
1107 u8 ch_switch_elem_len;
1108 u8 country_elem_len;
1109 u8 pwr_constr_elem_len;
1110 u8 quiet_elem_len;
1111 u8 num_of_quiet_elem; /* can be more the one */
1112 u8 timeout_int_len;
1113};
1114
1033static inline struct ieee80211_local *hw_to_local( 1115static inline struct ieee80211_local *hw_to_local(
1034 struct ieee80211_hw *hw) 1116 struct ieee80211_hw *hw)
1035{ 1117{
@@ -1090,9 +1172,8 @@ void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata);
1090/* IBSS code */ 1172/* IBSS code */
1091void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); 1173void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
1092void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata); 1174void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata);
1093struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, 1175void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
1094 u8 *bssid, u8 *addr, u32 supp_rates, 1176 const u8 *bssid, const u8 *addr, u32 supp_rates);
1095 gfp_t gfp);
1096int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata, 1177int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
1097 struct cfg80211_ibss_params *params); 1178 struct cfg80211_ibss_params *params);
1098int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata); 1179int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata);
@@ -1140,13 +1221,9 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata);
1140void ieee80211_sched_scan_stopped_work(struct work_struct *work); 1221void ieee80211_sched_scan_stopped_work(struct work_struct *work);
1141 1222
1142/* off-channel helpers */ 1223/* off-channel helpers */
1143bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local);
1144void ieee80211_offchannel_enable_all_ps(struct ieee80211_local *local,
1145 bool tell_ap);
1146void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local, 1224void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
1147 bool offchannel_ps_enable); 1225 bool offchannel_ps_enable);
1148void ieee80211_offchannel_return(struct ieee80211_local *local, 1226void ieee80211_offchannel_return(struct ieee80211_local *local,
1149 bool enable_beaconing,
1150 bool offchannel_ps_disable); 1227 bool offchannel_ps_disable);
1151void ieee80211_hw_roc_setup(struct ieee80211_local *local); 1228void ieee80211_hw_roc_setup(struct ieee80211_local *local);
1152 1229
@@ -1179,7 +1256,11 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1179 struct net_device *dev); 1256 struct net_device *dev);
1180 1257
1181/* HT */ 1258/* HT */
1182void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband, 1259bool ieee80111_cfg_override_disables_ht40(struct ieee80211_sub_if_data *sdata);
1260void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
1261 struct ieee80211_sta_ht_cap *ht_cap);
1262void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
1263 struct ieee80211_supported_band *sband,
1183 struct ieee80211_ht_cap *ht_cap_ie, 1264 struct ieee80211_ht_cap *ht_cap_ie,
1184 struct ieee80211_sta_ht_cap *ht_cap); 1265 struct ieee80211_sta_ht_cap *ht_cap);
1185void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, 1266void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
@@ -1266,7 +1347,16 @@ void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int ke
1266 gfp_t gfp); 1347 gfp_t gfp);
1267void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata); 1348void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata);
1268void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); 1349void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb);
1269void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); 1350
1351void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
1352 struct sk_buff *skb, int tid);
1353static void inline ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata,
1354 struct sk_buff *skb)
1355{
1356 /* Send all internal mgmt frames on VO. Accordingly set TID to 7. */
1357 ieee80211_tx_skb_tid(sdata, skb, 7);
1358}
1359
1270void ieee802_11_parse_elems(u8 *start, size_t len, 1360void ieee802_11_parse_elems(u8 *start, size_t len,
1271 struct ieee802_11_elems *elems); 1361 struct ieee802_11_elems *elems);
1272u32 ieee802_11_parse_elems_crc(u8 *start, size_t len, 1362u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
@@ -1334,6 +1424,12 @@ void ieee80211_recalc_smps(struct ieee80211_local *local);
1334size_t ieee80211_ie_split(const u8 *ies, size_t ielen, 1424size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
1335 const u8 *ids, int n_ids, size_t offset); 1425 const u8 *ids, int n_ids, size_t offset);
1336size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset); 1426size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset);
1427u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
1428 u16 cap);
1429u8 *ieee80211_ie_build_ht_info(u8 *pos,
1430 struct ieee80211_sta_ht_cap *ht_cap,
1431 struct ieee80211_channel *channel,
1432 enum nl80211_channel_type channel_type);
1337 1433
1338/* internal work items */ 1434/* internal work items */
1339void ieee80211_work_init(struct ieee80211_local *local); 1435void ieee80211_work_init(struct ieee80211_local *local);
@@ -1362,6 +1458,8 @@ ieee80211_get_channel_mode(struct ieee80211_local *local,
1362bool ieee80211_set_channel_type(struct ieee80211_local *local, 1458bool ieee80211_set_channel_type(struct ieee80211_local *local,
1363 struct ieee80211_sub_if_data *sdata, 1459 struct ieee80211_sub_if_data *sdata,
1364 enum nl80211_channel_type chantype); 1460 enum nl80211_channel_type chantype);
1461enum nl80211_channel_type
1462ieee80211_ht_info_to_channel_type(struct ieee80211_ht_info *ht_info);
1365 1463
1366#ifdef CONFIG_MAC80211_NOINLINE 1464#ifdef CONFIG_MAC80211_NOINLINE
1367#define debug_noinline noinline 1465#define debug_noinline noinline