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.h198
1 files changed, 158 insertions, 40 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 3d874c620219..0884b9a0f778 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -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/**
@@ -839,6 +871,19 @@ struct cfg80211_bitrate_mask {
839 u32 fixed; /* fixed bitrate, 0 == not fixed */ 871 u32 fixed; /* fixed bitrate, 0 == not fixed */
840 u32 maxrate; /* in kbps, 0 == no limit */ 872 u32 maxrate; /* in kbps, 0 == no limit */
841}; 873};
874/**
875 * struct cfg80211_pmksa - PMK Security Association
876 *
877 * This structure is passed to the set/del_pmksa() method for PMKSA
878 * caching.
879 *
880 * @bssid: The AP's BSSID.
881 * @pmkid: The PMK material itself.
882 */
883struct cfg80211_pmksa {
884 u8 *bssid;
885 u8 *pmkid;
886};
842 887
843/** 888/**
844 * struct cfg80211_ops - backend description for wireless configuration 889 * struct cfg80211_ops - backend description for wireless configuration
@@ -941,7 +986,16 @@ struct cfg80211_bitrate_mask {
941 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting 986 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting
942 * functions to adjust rfkill hw state 987 * functions to adjust rfkill hw state
943 * 988 *
989 * @dump_survey: get site survey information.
990 *
944 * @testmode_cmd: run a test mode command 991 * @testmode_cmd: run a test mode command
992 *
993 * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac
994 * devices running firmwares capable of generating the (re) association
995 * RSN IE. It allows for faster roaming between WPA2 BSSIDs.
996 * @del_pmksa: Delete a cached PMKID.
997 * @flush_pmksa: Flush all cached PMKIDs.
998 *
945 */ 999 */
946struct cfg80211_ops { 1000struct cfg80211_ops {
947 int (*suspend)(struct wiphy *wiphy); 1001 int (*suspend)(struct wiphy *wiphy);
@@ -1060,6 +1114,15 @@ struct cfg80211_ops {
1060 const u8 *peer, 1114 const u8 *peer,
1061 const struct cfg80211_bitrate_mask *mask); 1115 const struct cfg80211_bitrate_mask *mask);
1062 1116
1117 int (*dump_survey)(struct wiphy *wiphy, struct net_device *netdev,
1118 int idx, struct survey_info *info);
1119
1120 int (*set_pmksa)(struct wiphy *wiphy, struct net_device *netdev,
1121 struct cfg80211_pmksa *pmksa);
1122 int (*del_pmksa)(struct wiphy *wiphy, struct net_device *netdev,
1123 struct cfg80211_pmksa *pmksa);
1124 int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev);
1125
1063 /* some temporary stuff to finish wext */ 1126 /* some temporary stuff to finish wext */
1064 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, 1127 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
1065 bool enabled, int timeout); 1128 bool enabled, int timeout);
@@ -1071,27 +1134,50 @@ struct cfg80211_ops {
1071 */ 1134 */
1072 1135
1073/** 1136/**
1074 * struct wiphy - wireless hardware description 1137 * enum wiphy_flags - wiphy capability flags
1075 * @idx: the wiphy index assigned to this item 1138 *
1076 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 1139 * @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 1140 * has its own custom regulatory domain and cannot identify the
1079 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled 1141 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
1080 * we will disregard the first regulatory hint (when the 1142 * we will disregard the first regulatory hint (when the
1081 * initiator is %REGDOM_SET_BY_CORE). 1143 * initiator is %REGDOM_SET_BY_CORE).
1082 * @strict_regulatory: tells us the driver for this device will ignore 1144 * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
1083 * regulatory domain settings until it gets its own regulatory domain 1145 * ignore regulatory domain settings until it gets its own regulatory
1084 * via its regulatory_hint(). After its gets its own regulatory domain 1146 * domain via its regulatory_hint(). After its gets its own regulatory
1085 * it will only allow further regulatory domain settings to further 1147 * domain it will only allow further regulatory domain settings to
1086 * enhance compliance. For example if channel 13 and 14 are disabled 1148 * further enhance compliance. For example if channel 13 and 14 are
1087 * by this regulatory domain no user regulatory domain can enable these 1149 * 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 1150 * enable these channels at a later time. This can be used for devices
1089 * have calibration information gauranteed for frequencies or settings 1151 * which do not have calibration information gauranteed for frequencies
1090 * outside of its regulatory domain. 1152 * or settings outside of its regulatory domain.
1091 * @disable_beacon_hints: enable this if your driver needs to ensure that 1153 * @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 1154 * that passive scan flags and beaconing flags may not be lifted by
1093 * due to regulatory beacon hints. For more information on beacon 1155 * cfg80211 due to regulatory beacon hints. For more information on beacon
1094 * hints read the documenation for regulatory_hint_found_beacon() 1156 * hints read the documenation for regulatory_hint_found_beacon()
1157 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
1158 * wiphy at all
1159 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
1160 * by default -- this flag will be set depending on the kernel's default
1161 * on wiphy_new(), but can be changed by the driver if it has a good
1162 * reason to override the default
1163 * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station
1164 * on a VLAN interface)
1165 * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station
1166 */
1167enum wiphy_flags {
1168 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
1169 WIPHY_FLAG_STRICT_REGULATORY = BIT(1),
1170 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2),
1171 WIPHY_FLAG_NETNS_OK = BIT(3),
1172 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
1173 WIPHY_FLAG_4ADDR_AP = BIT(5),
1174 WIPHY_FLAG_4ADDR_STATION = BIT(6),
1175};
1176
1177/**
1178 * struct wiphy - wireless hardware description
1179 * @idx: the wiphy index assigned to this item
1180 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
1095 * @reg_notifier: the driver's regulatory notification callback 1181 * @reg_notifier: the driver's regulatory notification callback
1096 * @regd: the driver's regulatory domain, if one was requested via 1182 * @regd: the driver's regulatory domain, if one was requested via
1097 * the regulatory_hint() API. This can be used by the driver 1183 * the regulatory_hint() API. This can be used by the driver
@@ -1106,11 +1192,6 @@ struct cfg80211_ops {
1106 * -1 = fragmentation disabled, only odd values >= 256 used 1192 * -1 = fragmentation disabled, only odd values >= 256 used
1107 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled 1193 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
1108 * @net: the network namespace this wiphy currently lives in 1194 * @net: the network namespace this wiphy currently lives in
1109 * @netnsok: if set to false, do not allow changing the netns of this
1110 * wiphy at all
1111 * @ps_default: default for powersave, will be set depending on the
1112 * kernel's default on wiphy_new(), but can be changed by the
1113 * driver if it has a good reason to override the default
1114 */ 1195 */
1115struct wiphy { 1196struct wiphy {
1116 /* assign these fields before you register the wiphy */ 1197 /* assign these fields before you register the wiphy */
@@ -1121,12 +1202,7 @@ struct wiphy {
1121 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 1202 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
1122 u16 interface_modes; 1203 u16 interface_modes;
1123 1204
1124 bool custom_regulatory; 1205 u32 flags;
1125 bool strict_regulatory;
1126 bool disable_beacon_hints;
1127
1128 bool netnsok;
1129 bool ps_default;
1130 1206
1131 enum cfg80211_signal_type signal_type; 1207 enum cfg80211_signal_type signal_type;
1132 1208
@@ -1142,6 +1218,11 @@ struct wiphy {
1142 u32 frag_threshold; 1218 u32 frag_threshold;
1143 u32 rts_threshold; 1219 u32 rts_threshold;
1144 1220
1221 char fw_version[ETHTOOL_BUSINFO_LEN];
1222 u32 hw_version;
1223
1224 u8 max_num_pmkids;
1225
1145 /* If multiple wiphys are registered and you're handed e.g. 1226 /* If multiple wiphys are registered and you're handed e.g.
1146 * a regular netdev with assigned ieee80211_ptr, you won't 1227 * a regular netdev with assigned ieee80211_ptr, you won't
1147 * know whether it points to a wiphy your driver has registered 1228 * know whether it points to a wiphy your driver has registered
@@ -1171,6 +1252,10 @@ struct wiphy {
1171 struct net *_net; 1252 struct net *_net;
1172#endif 1253#endif
1173 1254
1255#ifdef CONFIG_CFG80211_WEXT
1256 const struct iw_handler_def *wext;
1257#endif
1258
1174 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); 1259 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN)));
1175}; 1260};
1176 1261
@@ -1314,6 +1399,10 @@ struct cfg80211_cached_keys;
1314 * @ssid_len: (private) Used by the internal configuration code 1399 * @ssid_len: (private) Used by the internal configuration code
1315 * @wext: (private) Used by the internal wireless extensions compat code 1400 * @wext: (private) Used by the internal wireless extensions compat code
1316 * @wext_bssid: (private) Used by the internal wireless extensions compat code 1401 * @wext_bssid: (private) Used by the internal wireless extensions compat code
1402 * @use_4addr: indicates 4addr mode is used on this interface, must be
1403 * set by driver (if supported) on add_interface BEFORE registering the
1404 * netdev and may otherwise be used by driver read-only, will be update
1405 * by cfg80211 on change_interface
1317 */ 1406 */
1318struct wireless_dev { 1407struct wireless_dev {
1319 struct wiphy *wiphy; 1408 struct wiphy *wiphy;
@@ -1327,6 +1416,8 @@ struct wireless_dev {
1327 1416
1328 struct work_struct cleanup_work; 1417 struct work_struct cleanup_work;
1329 1418
1419 bool use_4addr;
1420
1330 /* currently used for IBSS and SME - might be rearranged later */ 1421 /* currently used for IBSS and SME - might be rearranged later */
1331 u8 ssid[IEEE80211_MAX_SSID_LEN]; 1422 u8 ssid[IEEE80211_MAX_SSID_LEN];
1332 u8 ssid_len; 1423 u8 ssid_len;
@@ -1345,7 +1436,7 @@ struct wireless_dev {
1345 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; 1436 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
1346 struct cfg80211_internal_bss *current_bss; /* associated / joined */ 1437 struct cfg80211_internal_bss *current_bss; /* associated / joined */
1347 1438
1348#ifdef CONFIG_WIRELESS_EXT 1439#ifdef CONFIG_CFG80211_WEXT
1349 /* wext data */ 1440 /* wext data */
1350 struct { 1441 struct {
1351 struct cfg80211_ibss_params ibss; 1442 struct cfg80211_ibss_params ibss;
@@ -1776,6 +1867,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); 1867void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
1777 1868
1778/** 1869/**
1870 * __cfg80211_auth_canceled - notify cfg80211 that authentication was canceled
1871 * @dev: network device
1872 * @addr: The MAC address of the device with which the authentication timed out
1873 *
1874 * When a pending authentication had no action yet, the driver may decide
1875 * to not send a deauth frame, but in that case must calls this function
1876 * to tell cfg80211 about this decision. It is only valid to call this
1877 * function within the deauth() callback.
1878 */
1879void __cfg80211_auth_canceled(struct net_device *dev, const u8 *addr);
1880
1881/**
1779 * cfg80211_send_rx_assoc - notification of processed association 1882 * cfg80211_send_rx_assoc - notification of processed association
1780 * @dev: network device 1883 * @dev: network device
1781 * @buf: (re)association response frame (header + body) 1884 * @buf: (re)association response frame (header + body)
@@ -1802,30 +1905,45 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);
1802 * @dev: network device 1905 * @dev: network device
1803 * @buf: deauthentication frame (header + body) 1906 * @buf: deauthentication frame (header + body)
1804 * @len: length of the frame data 1907 * @len: length of the frame data
1805 * @cookie: cookie from ->deauth if called within that callback,
1806 * %NULL otherwise
1807 * 1908 *
1808 * This function is called whenever deauthentication has been processed in 1909 * This function is called whenever deauthentication has been processed in
1809 * station mode. This includes both received deauthentication frames and 1910 * station mode. This includes both received deauthentication frames and
1810 * locally generated ones. This function may sleep. 1911 * locally generated ones. This function may sleep.
1811 */ 1912 */
1812void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, 1913void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
1813 void *cookie); 1914
1915/**
1916 * __cfg80211_send_deauth - notification of processed deauthentication
1917 * @dev: network device
1918 * @buf: deauthentication frame (header + body)
1919 * @len: length of the frame data
1920 *
1921 * Like cfg80211_send_deauth(), but doesn't take the wdev lock.
1922 */
1923void __cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
1814 1924
1815/** 1925/**
1816 * cfg80211_send_disassoc - notification of processed disassociation 1926 * cfg80211_send_disassoc - notification of processed disassociation
1817 * @dev: network device 1927 * @dev: network device
1818 * @buf: disassociation response frame (header + body) 1928 * @buf: disassociation response frame (header + body)
1819 * @len: length of the frame data 1929 * @len: length of the frame data
1820 * @cookie: cookie from ->disassoc if called within that callback,
1821 * %NULL otherwise
1822 * 1930 *
1823 * This function is called whenever disassociation has been processed in 1931 * This function is called whenever disassociation has been processed in
1824 * station mode. This includes both received disassociation frames and locally 1932 * station mode. This includes both received disassociation frames and locally
1825 * generated ones. This function may sleep. 1933 * generated ones. This function may sleep.
1826 */ 1934 */
1827void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, 1935void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
1828 void *cookie); 1936
1937/**
1938 * __cfg80211_send_disassoc - notification of processed disassociation
1939 * @dev: network device
1940 * @buf: disassociation response frame (header + body)
1941 * @len: length of the frame data
1942 *
1943 * Like cfg80211_send_disassoc(), but doesn't take the wdev lock.
1944 */
1945void __cfg80211_send_disassoc(struct net_device *dev, const u8 *buf,
1946 size_t len);
1829 1947
1830/** 1948/**
1831 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) 1949 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)