aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/cfg80211.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r--include/net/cfg80211.h483
1 files changed, 404 insertions, 79 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 3d874c620219..3d134a1fb96b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3,7 +3,7 @@
3/* 3/*
4 * 802.11 device and configuration interface 4 * 802.11 device and configuration interface
5 * 5 *
6 * Copyright 2006-2009 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -39,8 +39,8 @@
39 * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7) 39 * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7)
40 */ 40 */
41enum ieee80211_band { 41enum ieee80211_band {
42 IEEE80211_BAND_2GHZ, 42 IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ,
43 IEEE80211_BAND_5GHZ, 43 IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ,
44 44
45 /* keep last */ 45 /* keep last */
46 IEEE80211_NUM_BANDS 46 IEEE80211_NUM_BANDS
@@ -206,10 +206,12 @@ struct ieee80211_supported_band {
206 * struct vif_params - describes virtual interface parameters 206 * struct vif_params - describes virtual interface parameters
207 * @mesh_id: mesh ID to use 207 * @mesh_id: mesh ID to use
208 * @mesh_id_len: length of the mesh ID 208 * @mesh_id_len: length of the mesh ID
209 * @use_4addr: use 4-address frames
209 */ 210 */
210struct vif_params { 211struct vif_params {
211 u8 *mesh_id; 212 u8 *mesh_id;
212 int mesh_id_len; 213 int mesh_id_len;
214 int use_4addr;
213}; 215};
214 216
215/** 217/**
@@ -233,6 +235,35 @@ struct key_params {
233}; 235};
234 236
235/** 237/**
238 * enum survey_info_flags - survey information flags
239 *
240 * Used by the driver to indicate which info in &struct survey_info
241 * it has filled in during the get_survey().
242 */
243enum survey_info_flags {
244 SURVEY_INFO_NOISE_DBM = 1<<0,
245};
246
247/**
248 * struct survey_info - channel survey response
249 *
250 * Used by dump_survey() to report back per-channel survey information.
251 *
252 * @channel: the channel this survey record reports, mandatory
253 * @filled: bitflag of flags from &enum survey_info_flags
254 * @noise: channel noise in dBm. This and all following fields are
255 * optional
256 *
257 * This structure can later be expanded with things like
258 * channel duty cycle etc.
259 */
260struct survey_info {
261 struct ieee80211_channel *channel;
262 u32 filled;
263 s8 noise;
264};
265
266/**
236 * struct beacon_parameters - beacon parameters 267 * struct beacon_parameters - beacon parameters
237 * 268 *
238 * Used to configure the beacon for an interface. 269 * Used to configure the beacon for an interface.
@@ -418,7 +449,7 @@ enum monitor_flags {
418 * in during get_station() or dump_station(). 449 * in during get_station() or dump_station().
419 * 450 *
420 * MPATH_INFO_FRAME_QLEN: @frame_qlen filled 451 * MPATH_INFO_FRAME_QLEN: @frame_qlen filled
421 * MPATH_INFO_DSN: @dsn filled 452 * MPATH_INFO_SN: @sn filled
422 * MPATH_INFO_METRIC: @metric filled 453 * MPATH_INFO_METRIC: @metric filled
423 * MPATH_INFO_EXPTIME: @exptime filled 454 * MPATH_INFO_EXPTIME: @exptime filled
424 * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled 455 * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled
@@ -427,7 +458,7 @@ enum monitor_flags {
427 */ 458 */
428enum mpath_info_flags { 459enum mpath_info_flags {
429 MPATH_INFO_FRAME_QLEN = BIT(0), 460 MPATH_INFO_FRAME_QLEN = BIT(0),
430 MPATH_INFO_DSN = BIT(1), 461 MPATH_INFO_SN = BIT(1),
431 MPATH_INFO_METRIC = BIT(2), 462 MPATH_INFO_METRIC = BIT(2),
432 MPATH_INFO_EXPTIME = BIT(3), 463 MPATH_INFO_EXPTIME = BIT(3),
433 MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4), 464 MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4),
@@ -442,7 +473,7 @@ enum mpath_info_flags {
442 * 473 *
443 * @filled: bitfield of flags from &enum mpath_info_flags 474 * @filled: bitfield of flags from &enum mpath_info_flags
444 * @frame_qlen: number of queued frames for this destination 475 * @frame_qlen: number of queued frames for this destination
445 * @dsn: destination sequence number 476 * @sn: target sequence number
446 * @metric: metric (cost) of this mesh path 477 * @metric: metric (cost) of this mesh path
447 * @exptime: expiration time for the mesh path from now, in msecs 478 * @exptime: expiration time for the mesh path from now, in msecs
448 * @flags: mesh path flags 479 * @flags: mesh path flags
@@ -456,7 +487,7 @@ enum mpath_info_flags {
456struct mpath_info { 487struct mpath_info {
457 u32 filled; 488 u32 filled;
458 u32 frame_qlen; 489 u32 frame_qlen;
459 u32 dsn; 490 u32 sn;
460 u32 metric; 491 u32 metric;
461 u32 exptime; 492 u32 exptime;
462 u32 discovery_timeout; 493 u32 discovery_timeout;
@@ -506,6 +537,7 @@ struct mesh_config {
506 u32 dot11MeshHWMPactivePathTimeout; 537 u32 dot11MeshHWMPactivePathTimeout;
507 u16 dot11MeshHWMPpreqMinInterval; 538 u16 dot11MeshHWMPpreqMinInterval;
508 u16 dot11MeshHWMPnetDiameterTraversalTime; 539 u16 dot11MeshHWMPnetDiameterTraversalTime;
540 u8 dot11MeshHWMPRootMode;
509}; 541};
510 542
511/** 543/**
@@ -594,8 +626,14 @@ enum cfg80211_signal_type {
594 * @beacon_interval: the beacon interval as from the frame 626 * @beacon_interval: the beacon interval as from the frame
595 * @capability: the capability field in host byte order 627 * @capability: the capability field in host byte order
596 * @information_elements: the information elements (Note that there 628 * @information_elements: the information elements (Note that there
597 * is no guarantee that these are well-formed!) 629 * is no guarantee that these are well-formed!); this is a pointer to
630 * either the beacon_ies or proberesp_ies depending on whether Probe
631 * Response frame has been received
598 * @len_information_elements: total length of the information elements 632 * @len_information_elements: total length of the information elements
633 * @beacon_ies: the information elements from the last Beacon frame
634 * @len_beacon_ies: total length of the beacon_ies
635 * @proberesp_ies: the information elements from the last Probe Response frame
636 * @len_proberesp_ies: total length of the proberesp_ies
599 * @signal: signal strength value (type depends on the wiphy's signal_type) 637 * @signal: signal strength value (type depends on the wiphy's signal_type)
600 * @free_priv: function pointer to free private data 638 * @free_priv: function pointer to free private data
601 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes 639 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
@@ -609,6 +647,10 @@ struct cfg80211_bss {
609 u16 capability; 647 u16 capability;
610 u8 *information_elements; 648 u8 *information_elements;
611 size_t len_information_elements; 649 size_t len_information_elements;
650 u8 *beacon_ies;
651 size_t len_beacon_ies;
652 u8 *proberesp_ies;
653 size_t len_proberesp_ies;
612 654
613 s32 signal; 655 s32 signal;
614 656
@@ -805,6 +847,7 @@ enum wiphy_params_flags {
805 WIPHY_PARAM_RETRY_LONG = 1 << 1, 847 WIPHY_PARAM_RETRY_LONG = 1 << 1,
806 WIPHY_PARAM_FRAG_THRESHOLD = 1 << 2, 848 WIPHY_PARAM_FRAG_THRESHOLD = 1 << 2,
807 WIPHY_PARAM_RTS_THRESHOLD = 1 << 3, 849 WIPHY_PARAM_RTS_THRESHOLD = 1 << 3,
850 WIPHY_PARAM_COVERAGE_CLASS = 1 << 4,
808}; 851};
809 852
810/** 853/**
@@ -824,20 +867,24 @@ enum tx_power_setting {
824 * cfg80211_bitrate_mask - masks for bitrate control 867 * cfg80211_bitrate_mask - masks for bitrate control
825 */ 868 */
826struct cfg80211_bitrate_mask { 869struct cfg80211_bitrate_mask {
827/*
828 * As discussed in Berlin, this struct really
829 * should look like this:
830
831 struct { 870 struct {
832 u32 legacy; 871 u32 legacy;
833 u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; 872 /* TODO: add support for masking MCS rates; e.g.: */
873 /* u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; */
834 } control[IEEE80211_NUM_BANDS]; 874 } control[IEEE80211_NUM_BANDS];
835 875};
836 * Since we can always fix in-kernel users, let's keep 876/**
837 * it simpler for now: 877 * struct cfg80211_pmksa - PMK Security Association
878 *
879 * This structure is passed to the set/del_pmksa() method for PMKSA
880 * caching.
881 *
882 * @bssid: The AP's BSSID.
883 * @pmkid: The PMK material itself.
838 */ 884 */
839 u32 fixed; /* fixed bitrate, 0 == not fixed */ 885struct cfg80211_pmksa {
840 u32 maxrate; /* in kbps, 0 == no limit */ 886 u8 *bssid;
887 u8 *pmkid;
841}; 888};
842 889
843/** 890/**
@@ -941,7 +988,26 @@ struct cfg80211_bitrate_mask {
941 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting 988 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting
942 * functions to adjust rfkill hw state 989 * functions to adjust rfkill hw state
943 * 990 *
991 * @dump_survey: get site survey information.
992 *
993 * @remain_on_channel: Request the driver to remain awake on the specified
994 * channel for the specified duration to complete an off-channel
995 * operation (e.g., public action frame exchange). When the driver is
996 * ready on the requested channel, it must indicate this with an event
997 * notification by calling cfg80211_ready_on_channel().
998 * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation.
999 * This allows the operation to be terminated prior to timeout based on
1000 * the duration value.
1001 * @action: Transmit an action frame
1002 *
944 * @testmode_cmd: run a test mode command 1003 * @testmode_cmd: run a test mode command
1004 *
1005 * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac
1006 * devices running firmwares capable of generating the (re) association
1007 * RSN IE. It allows for faster roaming between WPA2 BSSIDs.
1008 * @del_pmksa: Delete a cached PMKID.
1009 * @flush_pmksa: Flush all cached PMKIDs.
1010 *
945 */ 1011 */
946struct cfg80211_ops { 1012struct cfg80211_ops {
947 int (*suspend)(struct wiphy *wiphy); 1013 int (*suspend)(struct wiphy *wiphy);
@@ -1060,7 +1126,30 @@ struct cfg80211_ops {
1060 const u8 *peer, 1126 const u8 *peer,
1061 const struct cfg80211_bitrate_mask *mask); 1127 const struct cfg80211_bitrate_mask *mask);
1062 1128
1063 /* some temporary stuff to finish wext */ 1129 int (*dump_survey)(struct wiphy *wiphy, struct net_device *netdev,
1130 int idx, struct survey_info *info);
1131
1132 int (*set_pmksa)(struct wiphy *wiphy, struct net_device *netdev,
1133 struct cfg80211_pmksa *pmksa);
1134 int (*del_pmksa)(struct wiphy *wiphy, struct net_device *netdev,
1135 struct cfg80211_pmksa *pmksa);
1136 int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev);
1137
1138 int (*remain_on_channel)(struct wiphy *wiphy,
1139 struct net_device *dev,
1140 struct ieee80211_channel *chan,
1141 enum nl80211_channel_type channel_type,
1142 unsigned int duration,
1143 u64 *cookie);
1144 int (*cancel_remain_on_channel)(struct wiphy *wiphy,
1145 struct net_device *dev,
1146 u64 cookie);
1147
1148 int (*action)(struct wiphy *wiphy, struct net_device *dev,
1149 struct ieee80211_channel *chan,
1150 enum nl80211_channel_type channel_type,
1151 const u8 *buf, size_t len, u64 *cookie);
1152
1064 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, 1153 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
1065 bool enabled, int timeout); 1154 bool enabled, int timeout);
1066}; 1155};
@@ -1071,27 +1160,54 @@ struct cfg80211_ops {
1071 */ 1160 */
1072 1161
1073/** 1162/**
1074 * struct wiphy - wireless hardware description 1163 * enum wiphy_flags - wiphy capability flags
1075 * @idx: the wiphy index assigned to this item 1164 *
1076 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 1165 * @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device
1077 * @custom_regulatory: tells us the driver for this device
1078 * has its own custom regulatory domain and cannot identify the 1166 * has its own custom regulatory domain and cannot identify the
1079 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled 1167 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
1080 * we will disregard the first regulatory hint (when the 1168 * we will disregard the first regulatory hint (when the
1081 * initiator is %REGDOM_SET_BY_CORE). 1169 * initiator is %REGDOM_SET_BY_CORE).
1082 * @strict_regulatory: tells us the driver for this device will ignore 1170 * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
1083 * regulatory domain settings until it gets its own regulatory domain 1171 * ignore regulatory domain settings until it gets its own regulatory
1084 * via its regulatory_hint(). After its gets its own regulatory domain 1172 * domain via its regulatory_hint(). After its gets its own regulatory
1085 * it will only allow further regulatory domain settings to further 1173 * domain it will only allow further regulatory domain settings to
1086 * enhance compliance. For example if channel 13 and 14 are disabled 1174 * further enhance compliance. For example if channel 13 and 14 are
1087 * by this regulatory domain no user regulatory domain can enable these 1175 * disabled by this regulatory domain no user regulatory domain can
1088 * channels at a later time. This can be used for devices which do not 1176 * enable these channels at a later time. This can be used for devices
1089 * have calibration information gauranteed for frequencies or settings 1177 * which do not have calibration information gauranteed for frequencies
1090 * outside of its regulatory domain. 1178 * or settings outside of its regulatory domain.
1091 * @disable_beacon_hints: enable this if your driver needs to ensure that 1179 * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure
1092 * passive scan flags and beaconing flags may not be lifted by cfg80211 1180 * that passive scan flags and beaconing flags may not be lifted by
1093 * due to regulatory beacon hints. For more information on beacon 1181 * cfg80211 due to regulatory beacon hints. For more information on beacon
1094 * hints read the documenation for regulatory_hint_found_beacon() 1182 * hints read the documenation for regulatory_hint_found_beacon()
1183 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
1184 * wiphy at all
1185 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
1186 * by default -- this flag will be set depending on the kernel's default
1187 * on wiphy_new(), but can be changed by the driver if it has a good
1188 * reason to override the default
1189 * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station
1190 * on a VLAN interface)
1191 * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station
1192 */
1193enum wiphy_flags {
1194 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
1195 WIPHY_FLAG_STRICT_REGULATORY = BIT(1),
1196 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2),
1197 WIPHY_FLAG_NETNS_OK = BIT(3),
1198 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
1199 WIPHY_FLAG_4ADDR_AP = BIT(5),
1200 WIPHY_FLAG_4ADDR_STATION = BIT(6),
1201};
1202
1203struct mac_address {
1204 u8 addr[ETH_ALEN];
1205};
1206
1207/**
1208 * struct wiphy - wireless hardware description
1209 * @idx: the wiphy index assigned to this item
1210 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
1095 * @reg_notifier: the driver's regulatory notification callback 1211 * @reg_notifier: the driver's regulatory notification callback
1096 * @regd: the driver's regulatory domain, if one was requested via 1212 * @regd: the driver's regulatory domain, if one was requested via
1097 * the regulatory_hint() API. This can be used by the driver 1213 * the regulatory_hint() API. This can be used by the driver
@@ -1106,27 +1222,33 @@ struct cfg80211_ops {
1106 * -1 = fragmentation disabled, only odd values >= 256 used 1222 * -1 = fragmentation disabled, only odd values >= 256 used
1107 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled 1223 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
1108 * @net: the network namespace this wiphy currently lives in 1224 * @net: the network namespace this wiphy currently lives in
1109 * @netnsok: if set to false, do not allow changing the netns of this 1225 * @perm_addr: permanent MAC address of this device
1110 * wiphy at all 1226 * @addr_mask: If the device supports multiple MAC addresses by masking,
1111 * @ps_default: default for powersave, will be set depending on the 1227 * set this to a mask with variable bits set to 1, e.g. if the last
1112 * kernel's default on wiphy_new(), but can be changed by the 1228 * four bits are variable then set it to 00:...:00:0f. The actual
1113 * driver if it has a good reason to override the default 1229 * variable bits shall be determined by the interfaces added, with
1230 * interfaces not matching the mask being rejected to be brought up.
1231 * @n_addresses: number of addresses in @addresses.
1232 * @addresses: If the device has more than one address, set this pointer
1233 * to a list of addresses (6 bytes each). The first one will be used
1234 * by default for perm_addr. In this case, the mask should be set to
1235 * all-zeroes. In this case it is assumed that the device can handle
1236 * the same number of arbitrary MAC addresses.
1114 */ 1237 */
1115struct wiphy { 1238struct wiphy {
1116 /* assign these fields before you register the wiphy */ 1239 /* assign these fields before you register the wiphy */
1117 1240
1118 /* permanent MAC address */ 1241 /* permanent MAC address(es) */
1119 u8 perm_addr[ETH_ALEN]; 1242 u8 perm_addr[ETH_ALEN];
1243 u8 addr_mask[ETH_ALEN];
1244
1245 u16 n_addresses;
1246 struct mac_address *addresses;
1120 1247
1121 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 1248 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
1122 u16 interface_modes; 1249 u16 interface_modes;
1123 1250
1124 bool custom_regulatory; 1251 u32 flags;
1125 bool strict_regulatory;
1126 bool disable_beacon_hints;
1127
1128 bool netnsok;
1129 bool ps_default;
1130 1252
1131 enum cfg80211_signal_type signal_type; 1253 enum cfg80211_signal_type signal_type;
1132 1254
@@ -1141,6 +1263,12 @@ struct wiphy {
1141 u8 retry_long; 1263 u8 retry_long;
1142 u32 frag_threshold; 1264 u32 frag_threshold;
1143 u32 rts_threshold; 1265 u32 rts_threshold;
1266 u8 coverage_class;
1267
1268 char fw_version[ETHTOOL_BUSINFO_LEN];
1269 u32 hw_version;
1270
1271 u8 max_num_pmkids;
1144 1272
1145 /* If multiple wiphys are registered and you're handed e.g. 1273 /* If multiple wiphys are registered and you're handed e.g.
1146 * a regular netdev with assigned ieee80211_ptr, you won't 1274 * a regular netdev with assigned ieee80211_ptr, you won't
@@ -1171,6 +1299,10 @@ struct wiphy {
1171 struct net *_net; 1299 struct net *_net;
1172#endif 1300#endif
1173 1301
1302#ifdef CONFIG_CFG80211_WEXT
1303 const struct iw_handler_def *wext;
1304#endif
1305
1174 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); 1306 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN)));
1175}; 1307};
1176 1308
@@ -1314,6 +1446,12 @@ struct cfg80211_cached_keys;
1314 * @ssid_len: (private) Used by the internal configuration code 1446 * @ssid_len: (private) Used by the internal configuration code
1315 * @wext: (private) Used by the internal wireless extensions compat code 1447 * @wext: (private) Used by the internal wireless extensions compat code
1316 * @wext_bssid: (private) Used by the internal wireless extensions compat code 1448 * @wext_bssid: (private) Used by the internal wireless extensions compat code
1449 * @use_4addr: indicates 4addr mode is used on this interface, must be
1450 * set by driver (if supported) on add_interface BEFORE registering the
1451 * netdev and may otherwise be used by driver read-only, will be update
1452 * by cfg80211 on change_interface
1453 * @action_registrations: list of registrations for action frames
1454 * @action_registrations_lock: lock for the list
1317 */ 1455 */
1318struct wireless_dev { 1456struct wireless_dev {
1319 struct wiphy *wiphy; 1457 struct wiphy *wiphy;
@@ -1323,10 +1461,15 @@ struct wireless_dev {
1323 struct list_head list; 1461 struct list_head list;
1324 struct net_device *netdev; 1462 struct net_device *netdev;
1325 1463
1464 struct list_head action_registrations;
1465 spinlock_t action_registrations_lock;
1466
1326 struct mutex mtx; 1467 struct mutex mtx;
1327 1468
1328 struct work_struct cleanup_work; 1469 struct work_struct cleanup_work;
1329 1470
1471 bool use_4addr;
1472
1330 /* currently used for IBSS and SME - might be rearranged later */ 1473 /* currently used for IBSS and SME - might be rearranged later */
1331 u8 ssid[IEEE80211_MAX_SSID_LEN]; 1474 u8 ssid[IEEE80211_MAX_SSID_LEN];
1332 u8 ssid_len; 1475 u8 ssid_len;
@@ -1345,7 +1488,10 @@ struct wireless_dev {
1345 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; 1488 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
1346 struct cfg80211_internal_bss *current_bss; /* associated / joined */ 1489 struct cfg80211_internal_bss *current_bss; /* associated / joined */
1347 1490
1348#ifdef CONFIG_WIRELESS_EXT 1491 bool ps;
1492 int ps_timeout;
1493
1494#ifdef CONFIG_CFG80211_WEXT
1349 /* wext data */ 1495 /* wext data */
1350 struct { 1496 struct {
1351 struct cfg80211_ibss_params ibss; 1497 struct cfg80211_ibss_params ibss;
@@ -1356,8 +1502,7 @@ struct wireless_dev {
1356 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; 1502 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
1357 u8 ssid[IEEE80211_MAX_SSID_LEN]; 1503 u8 ssid[IEEE80211_MAX_SSID_LEN];
1358 s8 default_key, default_mgmt_key; 1504 s8 default_key, default_mgmt_key;
1359 bool ps, prev_bssid_valid; 1505 bool prev_bssid_valid;
1360 int ps_timeout;
1361 } wext; 1506 } wext;
1362#endif 1507#endif
1363}; 1508};
@@ -1428,37 +1573,82 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
1428 * Documentation in Documentation/networking/radiotap-headers.txt 1573 * Documentation in Documentation/networking/radiotap-headers.txt
1429 */ 1574 */
1430 1575
1576struct radiotap_align_size {
1577 uint8_t align:4, size:4;
1578};
1579
1580struct ieee80211_radiotap_namespace {
1581 const struct radiotap_align_size *align_size;
1582 int n_bits;
1583 uint32_t oui;
1584 uint8_t subns;
1585};
1586
1587struct ieee80211_radiotap_vendor_namespaces {
1588 const struct ieee80211_radiotap_namespace *ns;
1589 int n_ns;
1590};
1591
1431/** 1592/**
1432 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args 1593 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
1433 * @rtheader: pointer to the radiotap header we are walking through 1594 * @this_arg_index: index of current arg, valid after each successful call
1434 * @max_length: length of radiotap header in cpu byte ordering 1595 * to ieee80211_radiotap_iterator_next()
1435 * @this_arg_index: IEEE80211_RADIOTAP_... index of current arg 1596 * @this_arg: pointer to current radiotap arg; it is valid after each
1436 * @this_arg: pointer to current radiotap arg 1597 * call to ieee80211_radiotap_iterator_next() but also after
1437 * @arg_index: internal next argument index 1598 * ieee80211_radiotap_iterator_init() where it will point to
1438 * @arg: internal next argument pointer 1599 * the beginning of the actual data portion
1439 * @next_bitmap: internal pointer to next present u32 1600 * @this_arg_size: length of the current arg, for convenience
1440 * @bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present 1601 * @current_namespace: pointer to the current namespace definition
1602 * (or internally %NULL if the current namespace is unknown)
1603 * @is_radiotap_ns: indicates whether the current namespace is the default
1604 * radiotap namespace or not
1605 *
1606 * @overrides: override standard radiotap fields
1607 * @n_overrides: number of overrides
1608 *
1609 * @_rtheader: pointer to the radiotap header we are walking through
1610 * @_max_length: length of radiotap header in cpu byte ordering
1611 * @_arg_index: next argument index
1612 * @_arg: next argument pointer
1613 * @_next_bitmap: internal pointer to next present u32
1614 * @_bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
1615 * @_vns: vendor namespace definitions
1616 * @_next_ns_data: beginning of the next namespace's data
1617 * @_reset_on_ext: internal; reset the arg index to 0 when going to the
1618 * next bitmap word
1619 *
1620 * Describes the radiotap parser state. Fields prefixed with an underscore
1621 * must not be used by users of the parser, only by the parser internally.
1441 */ 1622 */
1442 1623
1443struct ieee80211_radiotap_iterator { 1624struct ieee80211_radiotap_iterator {
1444 struct ieee80211_radiotap_header *rtheader; 1625 struct ieee80211_radiotap_header *_rtheader;
1445 int max_length; 1626 const struct ieee80211_radiotap_vendor_namespaces *_vns;
1627 const struct ieee80211_radiotap_namespace *current_namespace;
1628
1629 unsigned char *_arg, *_next_ns_data;
1630 uint32_t *_next_bitmap;
1631
1632 unsigned char *this_arg;
1446 int this_arg_index; 1633 int this_arg_index;
1447 u8 *this_arg; 1634 int this_arg_size;
1448 1635
1449 int arg_index; 1636 int is_radiotap_ns;
1450 u8 *arg; 1637
1451 __le32 *next_bitmap; 1638 int _max_length;
1452 u32 bitmap_shifter; 1639 int _arg_index;
1640 uint32_t _bitmap_shifter;
1641 int _reset_on_ext;
1453}; 1642};
1454 1643
1455extern int ieee80211_radiotap_iterator_init( 1644extern int ieee80211_radiotap_iterator_init(
1456 struct ieee80211_radiotap_iterator *iterator, 1645 struct ieee80211_radiotap_iterator *iterator,
1457 struct ieee80211_radiotap_header *radiotap_header, 1646 struct ieee80211_radiotap_header *radiotap_header,
1458 int max_length); 1647 int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns);
1459 1648
1460extern int ieee80211_radiotap_iterator_next( 1649extern int ieee80211_radiotap_iterator_next(
1461 struct ieee80211_radiotap_iterator *iterator); 1650 struct ieee80211_radiotap_iterator *iterator);
1651
1462 1652
1463extern const unsigned char rfc1042_header[6]; 1653extern const unsigned char rfc1042_header[6];
1464extern const unsigned char bridge_tunnel_header[6]; 1654extern const unsigned char bridge_tunnel_header[6];
@@ -1487,7 +1677,7 @@ unsigned int ieee80211_hdrlen(__le16 fc);
1487 * @addr: the device MAC address 1677 * @addr: the device MAC address
1488 * @iftype: the virtual interface type 1678 * @iftype: the virtual interface type
1489 */ 1679 */
1490int ieee80211_data_to_8023(struct sk_buff *skb, u8 *addr, 1680int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
1491 enum nl80211_iftype iftype); 1681 enum nl80211_iftype iftype);
1492 1682
1493/** 1683/**
@@ -1498,15 +1688,49 @@ int ieee80211_data_to_8023(struct sk_buff *skb, u8 *addr,
1498 * @bssid: the network bssid (used only for iftype STATION and ADHOC) 1688 * @bssid: the network bssid (used only for iftype STATION and ADHOC)
1499 * @qos: build 802.11 QoS data frame 1689 * @qos: build 802.11 QoS data frame
1500 */ 1690 */
1501int ieee80211_data_from_8023(struct sk_buff *skb, u8 *addr, 1691int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
1502 enum nl80211_iftype iftype, u8 *bssid, bool qos); 1692 enum nl80211_iftype iftype, u8 *bssid, bool qos);
1503 1693
1504/** 1694/**
1695 * ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame
1696 *
1697 * Decode an IEEE 802.11n A-MSDU frame and convert it to a list of
1698 * 802.3 frames. The @list will be empty if the decode fails. The
1699 * @skb is consumed after the function returns.
1700 *
1701 * @skb: The input IEEE 802.11n A-MSDU frame.
1702 * @list: The output list of 802.3 frames. It must be allocated and
1703 * initialized by by the caller.
1704 * @addr: The device MAC address.
1705 * @iftype: The device interface type.
1706 * @extra_headroom: The hardware extra headroom for SKBs in the @list.
1707 */
1708void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
1709 const u8 *addr, enum nl80211_iftype iftype,
1710 const unsigned int extra_headroom);
1711
1712/**
1505 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame 1713 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
1506 * @skb: the data frame 1714 * @skb: the data frame
1507 */ 1715 */
1508unsigned int cfg80211_classify8021d(struct sk_buff *skb); 1716unsigned int cfg80211_classify8021d(struct sk_buff *skb);
1509 1717
1718/**
1719 * cfg80211_find_ie - find information element in data
1720 *
1721 * @eid: element ID
1722 * @ies: data consisting of IEs
1723 * @len: length of data
1724 *
1725 * This function will return %NULL if the element ID could
1726 * not be found or if the element is invalid (claims to be
1727 * longer than the given data), or a pointer to the first byte
1728 * of the requested element, that is the byte containing the
1729 * element ID. There are no checks on the element length
1730 * other than having to fit into the given data.
1731 */
1732const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len);
1733
1510/* 1734/*
1511 * Regulatory helper functions for wiphys 1735 * Regulatory helper functions for wiphys
1512 */ 1736 */
@@ -1776,6 +2000,18 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
1776void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); 2000void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
1777 2001
1778/** 2002/**
2003 * __cfg80211_auth_canceled - notify cfg80211 that authentication was canceled
2004 * @dev: network device
2005 * @addr: The MAC address of the device with which the authentication timed out
2006 *
2007 * When a pending authentication had no action yet, the driver may decide
2008 * to not send a deauth frame, but in that case must calls this function
2009 * to tell cfg80211 about this decision. It is only valid to call this
2010 * function within the deauth() callback.
2011 */
2012void __cfg80211_auth_canceled(struct net_device *dev, const u8 *addr);
2013
2014/**
1779 * cfg80211_send_rx_assoc - notification of processed association 2015 * cfg80211_send_rx_assoc - notification of processed association
1780 * @dev: network device 2016 * @dev: network device
1781 * @buf: (re)association response frame (header + body) 2017 * @buf: (re)association response frame (header + body)
@@ -1802,30 +2038,45 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);
1802 * @dev: network device 2038 * @dev: network device
1803 * @buf: deauthentication frame (header + body) 2039 * @buf: deauthentication frame (header + body)
1804 * @len: length of the frame data 2040 * @len: length of the frame data
1805 * @cookie: cookie from ->deauth if called within that callback,
1806 * %NULL otherwise
1807 * 2041 *
1808 * This function is called whenever deauthentication has been processed in 2042 * This function is called whenever deauthentication has been processed in
1809 * station mode. This includes both received deauthentication frames and 2043 * station mode. This includes both received deauthentication frames and
1810 * locally generated ones. This function may sleep. 2044 * locally generated ones. This function may sleep.
1811 */ 2045 */
1812void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, 2046void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
1813 void *cookie); 2047
2048/**
2049 * __cfg80211_send_deauth - notification of processed deauthentication
2050 * @dev: network device
2051 * @buf: deauthentication frame (header + body)
2052 * @len: length of the frame data
2053 *
2054 * Like cfg80211_send_deauth(), but doesn't take the wdev lock.
2055 */
2056void __cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
1814 2057
1815/** 2058/**
1816 * cfg80211_send_disassoc - notification of processed disassociation 2059 * cfg80211_send_disassoc - notification of processed disassociation
1817 * @dev: network device 2060 * @dev: network device
1818 * @buf: disassociation response frame (header + body) 2061 * @buf: disassociation response frame (header + body)
1819 * @len: length of the frame data 2062 * @len: length of the frame data
1820 * @cookie: cookie from ->disassoc if called within that callback,
1821 * %NULL otherwise
1822 * 2063 *
1823 * This function is called whenever disassociation has been processed in 2064 * This function is called whenever disassociation has been processed in
1824 * station mode. This includes both received disassociation frames and locally 2065 * station mode. This includes both received disassociation frames and locally
1825 * generated ones. This function may sleep. 2066 * generated ones. This function may sleep.
1826 */ 2067 */
1827void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, 2068void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
1828 void *cookie); 2069
2070/**
2071 * __cfg80211_send_disassoc - notification of processed disassociation
2072 * @dev: network device
2073 * @buf: disassociation response frame (header + body)
2074 * @len: length of the frame data
2075 *
2076 * Like cfg80211_send_disassoc(), but doesn't take the wdev lock.
2077 */
2078void __cfg80211_send_disassoc(struct net_device *dev, const u8 *buf,
2079 size_t len);
1829 2080
1830/** 2081/**
1831 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) 2082 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
@@ -2011,5 +2262,79 @@ void cfg80211_roamed(struct net_device *dev, const u8 *bssid,
2011void cfg80211_disconnected(struct net_device *dev, u16 reason, 2262void cfg80211_disconnected(struct net_device *dev, u16 reason,
2012 u8 *ie, size_t ie_len, gfp_t gfp); 2263 u8 *ie, size_t ie_len, gfp_t gfp);
2013 2264
2265/**
2266 * cfg80211_ready_on_channel - notification of remain_on_channel start
2267 * @dev: network device
2268 * @cookie: the request cookie
2269 * @chan: The current channel (from remain_on_channel request)
2270 * @channel_type: Channel type
2271 * @duration: Duration in milliseconds that the driver intents to remain on the
2272 * channel
2273 * @gfp: allocation flags
2274 */
2275void cfg80211_ready_on_channel(struct net_device *dev, u64 cookie,
2276 struct ieee80211_channel *chan,
2277 enum nl80211_channel_type channel_type,
2278 unsigned int duration, gfp_t gfp);
2279
2280/**
2281 * cfg80211_remain_on_channel_expired - remain_on_channel duration expired
2282 * @dev: network device
2283 * @cookie: the request cookie
2284 * @chan: The current channel (from remain_on_channel request)
2285 * @channel_type: Channel type
2286 * @gfp: allocation flags
2287 */
2288void cfg80211_remain_on_channel_expired(struct net_device *dev,
2289 u64 cookie,
2290 struct ieee80211_channel *chan,
2291 enum nl80211_channel_type channel_type,
2292 gfp_t gfp);
2293
2294
2295/**
2296 * cfg80211_new_sta - notify userspace about station
2297 *
2298 * @dev: the netdev
2299 * @mac_addr: the station's address
2300 * @sinfo: the station information
2301 * @gfp: allocation flags
2302 */
2303void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
2304 struct station_info *sinfo, gfp_t gfp);
2305
2306/**
2307 * cfg80211_rx_action - notification of received, unprocessed Action frame
2308 * @dev: network device
2309 * @freq: Frequency on which the frame was received in MHz
2310 * @buf: Action frame (header + body)
2311 * @len: length of the frame data
2312 * @gfp: context flags
2313 * Returns %true if a user space application is responsible for rejecting the
2314 * unrecognized Action frame; %false if no such application is registered
2315 * (i.e., the driver is responsible for rejecting the unrecognized Action
2316 * frame)
2317 *
2318 * This function is called whenever an Action frame is received for a station
2319 * mode interface, but is not processed in kernel.
2320 */
2321bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf,
2322 size_t len, gfp_t gfp);
2323
2324/**
2325 * cfg80211_action_tx_status - notification of TX status for Action frame
2326 * @dev: network device
2327 * @cookie: Cookie returned by cfg80211_ops::action()
2328 * @buf: Action frame (header + body)
2329 * @len: length of the frame data
2330 * @ack: Whether frame was acknowledged
2331 * @gfp: context flags
2332 *
2333 * This function is called whenever an Action frame was requested to be
2334 * transmitted with cfg80211_ops::action() to report the TX status of the
2335 * transmission attempt.
2336 */
2337void cfg80211_action_tx_status(struct net_device *dev, u64 cookie,
2338 const u8 *buf, size_t len, bool ack, gfp_t gfp);
2014 2339
2015#endif /* __NET_CFG80211_H */ 2340#endif /* __NET_CFG80211_H */