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.h237
1 files changed, 230 insertions, 7 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d30eada7c6cd..bfd6557946be 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -387,6 +387,7 @@ enum plink_actions {
387 * @listen_interval: listen interval or -1 for no change 387 * @listen_interval: listen interval or -1 for no change
388 * @aid: AID or zero for no change 388 * @aid: AID or zero for no change
389 * @plink_action: plink action to take 389 * @plink_action: plink action to take
390 * @plink_state: set the peer link state for a station
390 * @ht_capa: HT capabilities of station 391 * @ht_capa: HT capabilities of station
391 */ 392 */
392struct station_parameters { 393struct station_parameters {
@@ -397,6 +398,7 @@ struct station_parameters {
397 u16 aid; 398 u16 aid;
398 u8 supported_rates_len; 399 u8 supported_rates_len;
399 u8 plink_action; 400 u8 plink_action;
401 u8 plink_state;
400 struct ieee80211_ht_cap *ht_capa; 402 struct ieee80211_ht_cap *ht_capa;
401}; 403};
402 404
@@ -695,7 +697,8 @@ struct mesh_config {
695 * @path_metric: which metric to use 697 * @path_metric: which metric to use
696 * @ie: vendor information elements (optional) 698 * @ie: vendor information elements (optional)
697 * @ie_len: length of vendor information elements 699 * @ie_len: length of vendor information elements
698 * @is_secure: or not 700 * @is_authenticated: this mesh requires authentication
701 * @is_secure: this mesh uses security
699 * 702 *
700 * These parameters are fixed when the mesh is created. 703 * These parameters are fixed when the mesh is created.
701 */ 704 */
@@ -706,6 +709,7 @@ struct mesh_setup {
706 u8 path_metric; 709 u8 path_metric;
707 const u8 *ie; 710 const u8 *ie;
708 u8 ie_len; 711 u8 ie_len;
712 bool is_authenticated;
709 bool is_secure; 713 bool is_secure;
710}; 714};
711 715
@@ -793,6 +797,35 @@ struct cfg80211_scan_request {
793}; 797};
794 798
795/** 799/**
800 * struct cfg80211_sched_scan_request - scheduled scan request description
801 *
802 * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans)
803 * @n_ssids: number of SSIDs
804 * @n_channels: total number of channels to scan
805 * @interval: interval between each scheduled scan cycle
806 * @ie: optional information element(s) to add into Probe Request or %NULL
807 * @ie_len: length of ie in octets
808 * @wiphy: the wiphy this was for
809 * @dev: the interface
810 * @channels: channels to scan
811 */
812struct cfg80211_sched_scan_request {
813 struct cfg80211_ssid *ssids;
814 int n_ssids;
815 u32 n_channels;
816 u32 interval;
817 const u8 *ie;
818 size_t ie_len;
819
820 /* internal */
821 struct wiphy *wiphy;
822 struct net_device *dev;
823
824 /* keep last */
825 struct ieee80211_channel *channels[0];
826};
827
828/**
796 * enum cfg80211_signal_type - signal type 829 * enum cfg80211_signal_type - signal type
797 * 830 *
798 * @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available 831 * @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available
@@ -1088,6 +1121,38 @@ struct cfg80211_pmksa {
1088}; 1121};
1089 1122
1090/** 1123/**
1124 * struct cfg80211_wowlan_trig_pkt_pattern - packet pattern
1125 * @mask: bitmask where to match pattern and where to ignore bytes,
1126 * one bit per byte, in same format as nl80211
1127 * @pattern: bytes to match where bitmask is 1
1128 * @pattern_len: length of pattern (in bytes)
1129 *
1130 * Internal note: @mask and @pattern are allocated in one chunk of
1131 * memory, free @mask only!
1132 */
1133struct cfg80211_wowlan_trig_pkt_pattern {
1134 u8 *mask, *pattern;
1135 int pattern_len;
1136};
1137
1138/**
1139 * struct cfg80211_wowlan - Wake on Wireless-LAN support info
1140 *
1141 * This structure defines the enabled WoWLAN triggers for the device.
1142 * @any: wake up on any activity -- special trigger if device continues
1143 * operating as normal during suspend
1144 * @disconnect: wake up if getting disconnected
1145 * @magic_pkt: wake up on receiving magic packet
1146 * @patterns: wake up on receiving packet matching a pattern
1147 * @n_patterns: number of patterns
1148 */
1149struct cfg80211_wowlan {
1150 bool any, disconnect, magic_pkt;
1151 struct cfg80211_wowlan_trig_pkt_pattern *patterns;
1152 int n_patterns;
1153};
1154
1155/**
1091 * struct cfg80211_ops - backend description for wireless configuration 1156 * struct cfg80211_ops - backend description for wireless configuration
1092 * 1157 *
1093 * This struct is registered by fullmac card drivers and/or wireless stacks 1158 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -1100,7 +1165,9 @@ struct cfg80211_pmksa {
1100 * wireless extensions but this is subject to reevaluation as soon as this 1165 * wireless extensions but this is subject to reevaluation as soon as this
1101 * code is used more widely and we have a first user without wext. 1166 * code is used more widely and we have a first user without wext.
1102 * 1167 *
1103 * @suspend: wiphy device needs to be suspended 1168 * @suspend: wiphy device needs to be suspended. The variable @wow will
1169 * be %NULL or contain the enabled Wake-on-Wireless triggers that are
1170 * configured for the device.
1104 * @resume: wiphy device needs to be resumed 1171 * @resume: wiphy device needs to be resumed
1105 * 1172 *
1106 * @add_virtual_intf: create a new virtual interface with the given name, 1173 * @add_virtual_intf: create a new virtual interface with the given name,
@@ -1227,6 +1294,10 @@ struct cfg80211_pmksa {
1227 * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 1294 * @set_power_mgmt: Configure WLAN power management. A timeout value of -1
1228 * allows the driver to adjust the dynamic ps timeout value. 1295 * allows the driver to adjust the dynamic ps timeout value.
1229 * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. 1296 * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold.
1297 * @sched_scan_start: Tell the driver to start a scheduled scan.
1298 * @sched_scan_stop: Tell the driver to stop an ongoing scheduled
1299 * scan. The driver_initiated flag specifies whether the driver
1300 * itself has informed that the scan has stopped.
1230 * 1301 *
1231 * @mgmt_frame_register: Notify driver that a management frame type was 1302 * @mgmt_frame_register: Notify driver that a management frame type was
1232 * registered. Note that this callback may not sleep, and cannot run 1303 * registered. Note that this callback may not sleep, and cannot run
@@ -1244,7 +1315,7 @@ struct cfg80211_pmksa {
1244 * @get_ringparam: Get tx and rx ring current and maximum sizes. 1315 * @get_ringparam: Get tx and rx ring current and maximum sizes.
1245 */ 1316 */
1246struct cfg80211_ops { 1317struct cfg80211_ops {
1247 int (*suspend)(struct wiphy *wiphy); 1318 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
1248 int (*resume)(struct wiphy *wiphy); 1319 int (*resume)(struct wiphy *wiphy);
1249 1320
1250 struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, 1321 struct net_device * (*add_virtual_intf)(struct wiphy *wiphy,
@@ -1413,6 +1484,11 @@ struct cfg80211_ops {
1413 int (*set_ringparam)(struct wiphy *wiphy, u32 tx, u32 rx); 1484 int (*set_ringparam)(struct wiphy *wiphy, u32 tx, u32 rx);
1414 void (*get_ringparam)(struct wiphy *wiphy, 1485 void (*get_ringparam)(struct wiphy *wiphy,
1415 u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); 1486 u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max);
1487
1488 int (*sched_scan_start)(struct wiphy *wiphy,
1489 struct net_device *dev,
1490 struct cfg80211_sched_scan_request *request);
1491 int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev);
1416}; 1492};
1417 1493
1418/* 1494/*
@@ -1444,6 +1520,10 @@ struct cfg80211_ops {
1444 * hints read the documenation for regulatory_hint_found_beacon() 1520 * hints read the documenation for regulatory_hint_found_beacon()
1445 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this 1521 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
1446 * wiphy at all 1522 * wiphy at all
1523 * @WIPHY_FLAG_ENFORCE_COMBINATIONS: Set this flag to enforce interface
1524 * combinations for this device. This flag is used for backward
1525 * compatibility only until all drivers advertise combinations and
1526 * they will always be enforced.
1447 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled 1527 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
1448 * by default -- this flag will be set depending on the kernel's default 1528 * by default -- this flag will be set depending on the kernel's default
1449 * on wiphy_new(), but can be changed by the driver if it has a good 1529 * on wiphy_new(), but can be changed by the driver if it has a good
@@ -1455,10 +1535,9 @@ struct cfg80211_ops {
1455 * control port protocol ethertype. The device also honours the 1535 * control port protocol ethertype. The device also honours the
1456 * control_port_no_encrypt flag. 1536 * control_port_no_encrypt flag.
1457 * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. 1537 * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN.
1458 * @WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS: The device supports separate
1459 * unicast and multicast TX keys.
1460 * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing 1538 * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing
1461 * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH. 1539 * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH.
1540 * @WIPHY_FLAG_SCHED_SCAN: The device supports scheduled scans.
1462 */ 1541 */
1463enum wiphy_flags { 1542enum wiphy_flags {
1464 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 1543 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -1470,8 +1549,83 @@ enum wiphy_flags {
1470 WIPHY_FLAG_4ADDR_STATION = BIT(6), 1549 WIPHY_FLAG_4ADDR_STATION = BIT(6),
1471 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), 1550 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7),
1472 WIPHY_FLAG_IBSS_RSN = BIT(8), 1551 WIPHY_FLAG_IBSS_RSN = BIT(8),
1473 WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS= BIT(9),
1474 WIPHY_FLAG_MESH_AUTH = BIT(10), 1552 WIPHY_FLAG_MESH_AUTH = BIT(10),
1553 WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11),
1554 WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12),
1555};
1556
1557/**
1558 * struct ieee80211_iface_limit - limit on certain interface types
1559 * @max: maximum number of interfaces of these types
1560 * @types: interface types (bits)
1561 */
1562struct ieee80211_iface_limit {
1563 u16 max;
1564 u16 types;
1565};
1566
1567/**
1568 * struct ieee80211_iface_combination - possible interface combination
1569 * @limits: limits for the given interface types
1570 * @n_limits: number of limitations
1571 * @num_different_channels: can use up to this many different channels
1572 * @max_interfaces: maximum number of interfaces in total allowed in this
1573 * group
1574 * @beacon_int_infra_match: In this combination, the beacon intervals
1575 * between infrastructure and AP types must match. This is required
1576 * only in special cases.
1577 *
1578 * These examples can be expressed as follows:
1579 *
1580 * Allow #STA <= 1, #AP <= 1, matching BI, channels = 1, 2 total:
1581 *
1582 * struct ieee80211_iface_limit limits1[] = {
1583 * { .max = 1, .types = BIT(NL80211_IFTYPE_STATION), },
1584 * { .max = 1, .types = BIT(NL80211_IFTYPE_AP}, },
1585 * };
1586 * struct ieee80211_iface_combination combination1 = {
1587 * .limits = limits1,
1588 * .n_limits = ARRAY_SIZE(limits1),
1589 * .max_interfaces = 2,
1590 * .beacon_int_infra_match = true,
1591 * };
1592 *
1593 *
1594 * Allow #{AP, P2P-GO} <= 8, channels = 1, 8 total:
1595 *
1596 * struct ieee80211_iface_limit limits2[] = {
1597 * { .max = 8, .types = BIT(NL80211_IFTYPE_AP) |
1598 * BIT(NL80211_IFTYPE_P2P_GO), },
1599 * };
1600 * struct ieee80211_iface_combination combination2 = {
1601 * .limits = limits2,
1602 * .n_limits = ARRAY_SIZE(limits2),
1603 * .max_interfaces = 8,
1604 * .num_different_channels = 1,
1605 * };
1606 *
1607 *
1608 * Allow #STA <= 1, #{P2P-client,P2P-GO} <= 3 on two channels, 4 total.
1609 * This allows for an infrastructure connection and three P2P connections.
1610 *
1611 * struct ieee80211_iface_limit limits3[] = {
1612 * { .max = 1, .types = BIT(NL80211_IFTYPE_STATION), },
1613 * { .max = 3, .types = BIT(NL80211_IFTYPE_P2P_GO) |
1614 * BIT(NL80211_IFTYPE_P2P_CLIENT), },
1615 * };
1616 * struct ieee80211_iface_combination combination3 = {
1617 * .limits = limits3,
1618 * .n_limits = ARRAY_SIZE(limits3),
1619 * .max_interfaces = 4,
1620 * .num_different_channels = 2,
1621 * };
1622 */
1623struct ieee80211_iface_combination {
1624 const struct ieee80211_iface_limit *limits;
1625 u32 num_different_channels;
1626 u16 max_interfaces;
1627 u8 n_limits;
1628 bool beacon_int_infra_match;
1475}; 1629};
1476 1630
1477struct mac_address { 1631struct mac_address {
@@ -1483,6 +1637,38 @@ struct ieee80211_txrx_stypes {
1483}; 1637};
1484 1638
1485/** 1639/**
1640 * enum wiphy_wowlan_support_flags - WoWLAN support flags
1641 * @WIPHY_WOWLAN_ANY: supports wakeup for the special "any"
1642 * trigger that keeps the device operating as-is and
1643 * wakes up the host on any activity, for example a
1644 * received packet that passed filtering; note that the
1645 * packet should be preserved in that case
1646 * @WIPHY_WOWLAN_MAGIC_PKT: supports wakeup on magic packet
1647 * (see nl80211.h)
1648 * @WIPHY_WOWLAN_DISCONNECT: supports wakeup on disconnect
1649 */
1650enum wiphy_wowlan_support_flags {
1651 WIPHY_WOWLAN_ANY = BIT(0),
1652 WIPHY_WOWLAN_MAGIC_PKT = BIT(1),
1653 WIPHY_WOWLAN_DISCONNECT = BIT(2),
1654};
1655
1656/**
1657 * struct wiphy_wowlan_support - WoWLAN support data
1658 * @flags: see &enum wiphy_wowlan_support_flags
1659 * @n_patterns: number of supported wakeup patterns
1660 * (see nl80211.h for the pattern definition)
1661 * @pattern_max_len: maximum length of each pattern
1662 * @pattern_min_len: minimum length of each pattern
1663 */
1664struct wiphy_wowlan_support {
1665 u32 flags;
1666 int n_patterns;
1667 int pattern_max_len;
1668 int pattern_min_len;
1669};
1670
1671/**
1486 * struct wiphy - wireless hardware description 1672 * struct wiphy - wireless hardware description
1487 * @reg_notifier: the driver's regulatory notification callback, 1673 * @reg_notifier: the driver's regulatory notification callback,
1488 * note that if your driver uses wiphy_apply_custom_regulatory() 1674 * note that if your driver uses wiphy_apply_custom_regulatory()
@@ -1519,6 +1705,11 @@ struct ieee80211_txrx_stypes {
1519 * @priv: driver private data (sized according to wiphy_new() parameter) 1705 * @priv: driver private data (sized according to wiphy_new() parameter)
1520 * @interface_modes: bitmask of interfaces types valid for this wiphy, 1706 * @interface_modes: bitmask of interfaces types valid for this wiphy,
1521 * must be set by driver 1707 * must be set by driver
1708 * @iface_combinations: Valid interface combinations array, should not
1709 * list single interface types.
1710 * @n_iface_combinations: number of entries in @iface_combinations array.
1711 * @software_iftypes: bitmask of software interface types, these are not
1712 * subject to any restrictions since they are purely managed in SW.
1522 * @flags: wiphy flags, see &enum wiphy_flags 1713 * @flags: wiphy flags, see &enum wiphy_flags
1523 * @bss_priv_size: each BSS struct has private data allocated with it, 1714 * @bss_priv_size: each BSS struct has private data allocated with it,
1524 * this variable determines its size 1715 * this variable determines its size
@@ -1549,6 +1740,8 @@ struct ieee80211_txrx_stypes {
1549 * 1740 *
1550 * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation 1741 * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation
1551 * may request, if implemented. 1742 * may request, if implemented.
1743 *
1744 * @wowlan: WoWLAN support information
1552 */ 1745 */
1553struct wiphy { 1746struct wiphy {
1554 /* assign these fields before you register the wiphy */ 1747 /* assign these fields before you register the wiphy */
@@ -1561,6 +1754,10 @@ struct wiphy {
1561 1754
1562 const struct ieee80211_txrx_stypes *mgmt_stypes; 1755 const struct ieee80211_txrx_stypes *mgmt_stypes;
1563 1756
1757 const struct ieee80211_iface_combination *iface_combinations;
1758 int n_iface_combinations;
1759 u16 software_iftypes;
1760
1564 u16 n_addresses; 1761 u16 n_addresses;
1565 1762
1566 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 1763 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
@@ -1586,6 +1783,8 @@ struct wiphy {
1586 char fw_version[ETHTOOL_BUSINFO_LEN]; 1783 char fw_version[ETHTOOL_BUSINFO_LEN];
1587 u32 hw_version; 1784 u32 hw_version;
1588 1785
1786 struct wiphy_wowlan_support wowlan;
1787
1589 u16 max_remain_on_channel_duration; 1788 u16 max_remain_on_channel_duration;
1590 1789
1591 u8 max_num_pmkids; 1790 u8 max_num_pmkids;
@@ -1769,6 +1968,8 @@ struct cfg80211_cached_keys;
1769 * @mgmt_registrations_lock: lock for the list 1968 * @mgmt_registrations_lock: lock for the list
1770 * @mtx: mutex used to lock data in this struct 1969 * @mtx: mutex used to lock data in this struct
1771 * @cleanup_work: work struct used for cleanup that can't be done directly 1970 * @cleanup_work: work struct used for cleanup that can't be done directly
1971 * @beacon_interval: beacon interval used on this device for transmitting
1972 * beacons, 0 when not valid
1772 */ 1973 */
1773struct wireless_dev { 1974struct wireless_dev {
1774 struct wiphy *wiphy; 1975 struct wiphy *wiphy;
@@ -1809,6 +2010,8 @@ struct wireless_dev {
1809 bool ps; 2010 bool ps;
1810 int ps_timeout; 2011 int ps_timeout;
1811 2012
2013 int beacon_interval;
2014
1812#ifdef CONFIG_CFG80211_WEXT 2015#ifdef CONFIG_CFG80211_WEXT
1813 /* wext data */ 2016 /* wext data */
1814 struct { 2017 struct {
@@ -2034,10 +2237,12 @@ int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
2034 * @addr: The device MAC address. 2237 * @addr: The device MAC address.
2035 * @iftype: The device interface type. 2238 * @iftype: The device interface type.
2036 * @extra_headroom: The hardware extra headroom for SKBs in the @list. 2239 * @extra_headroom: The hardware extra headroom for SKBs in the @list.
2240 * @has_80211_header: Set it true if SKB is with IEEE 802.11 header.
2037 */ 2241 */
2038void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, 2242void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
2039 const u8 *addr, enum nl80211_iftype iftype, 2243 const u8 *addr, enum nl80211_iftype iftype,
2040 const unsigned int extra_headroom); 2244 const unsigned int extra_headroom,
2245 bool has_80211_header);
2041 2246
2042/** 2247/**
2043 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame 2248 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
@@ -2257,6 +2462,24 @@ int cfg80211_wext_siwpmksa(struct net_device *dev,
2257void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted); 2462void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted);
2258 2463
2259/** 2464/**
2465 * cfg80211_sched_scan_results - notify that new scan results are available
2466 *
2467 * @wiphy: the wiphy which got scheduled scan results
2468 */
2469void cfg80211_sched_scan_results(struct wiphy *wiphy);
2470
2471/**
2472 * cfg80211_sched_scan_stopped - notify that the scheduled scan has stopped
2473 *
2474 * @wiphy: the wiphy on which the scheduled scan stopped
2475 *
2476 * The driver can call this function to inform cfg80211 that the
2477 * scheduled scan had to be stopped, for whatever reason. The driver
2478 * is then called back via the sched_scan_stop operation when done.
2479 */
2480void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
2481
2482/**
2260 * cfg80211_inform_bss_frame - inform cfg80211 of a received BSS frame 2483 * cfg80211_inform_bss_frame - inform cfg80211 of a received BSS frame
2261 * 2484 *
2262 * @wiphy: the wiphy reporting the BSS 2485 * @wiphy: the wiphy reporting the BSS