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.h278
1 files changed, 209 insertions, 69 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0289d4ce7070..493fa0c79005 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -70,11 +70,13 @@
70 * 70 *
71 * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band 71 * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band
72 * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7) 72 * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7)
73 * @IEEE80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz)
73 * @IEEE80211_NUM_BANDS: number of defined bands 74 * @IEEE80211_NUM_BANDS: number of defined bands
74 */ 75 */
75enum ieee80211_band { 76enum ieee80211_band {
76 IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ, 77 IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ,
77 IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ, 78 IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ,
79 IEEE80211_BAND_60GHZ = NL80211_BAND_60GHZ,
78 80
79 /* keep last */ 81 /* keep last */
80 IEEE80211_NUM_BANDS 82 IEEE80211_NUM_BANDS
@@ -211,6 +213,22 @@ struct ieee80211_sta_ht_cap {
211}; 213};
212 214
213/** 215/**
216 * struct ieee80211_sta_vht_cap - STA's VHT capabilities
217 *
218 * This structure describes most essential parameters needed
219 * to describe 802.11ac VHT capabilities for an STA.
220 *
221 * @vht_supported: is VHT supported by the STA
222 * @cap: VHT capabilities map as described in 802.11ac spec
223 * @vht_mcs: Supported VHT MCS rates
224 */
225struct ieee80211_sta_vht_cap {
226 bool vht_supported;
227 u32 cap; /* use IEEE80211_VHT_CAP_ */
228 struct ieee80211_vht_mcs_info vht_mcs;
229};
230
231/**
214 * struct ieee80211_supported_band - frequency band definition 232 * struct ieee80211_supported_band - frequency band definition
215 * 233 *
216 * This structure describes a frequency band a wiphy 234 * This structure describes a frequency band a wiphy
@@ -233,6 +251,7 @@ struct ieee80211_supported_band {
233 int n_channels; 251 int n_channels;
234 int n_bitrates; 252 int n_bitrates;
235 struct ieee80211_sta_ht_cap ht_cap; 253 struct ieee80211_sta_ht_cap ht_cap;
254 struct ieee80211_sta_vht_cap vht_cap;
236}; 255};
237 256
238/* 257/*
@@ -404,6 +423,8 @@ struct cfg80211_beacon_data {
404 * 423 *
405 * Used to configure an AP interface. 424 * Used to configure an AP interface.
406 * 425 *
426 * @channel: the channel to start the AP on
427 * @channel_type: the channel type to use
407 * @beacon: beacon data 428 * @beacon: beacon data
408 * @beacon_interval: beacon interval 429 * @beacon_interval: beacon interval
409 * @dtim_period: DTIM period 430 * @dtim_period: DTIM period
@@ -417,6 +438,9 @@ struct cfg80211_beacon_data {
417 * @inactivity_timeout: time in seconds to determine station's inactivity. 438 * @inactivity_timeout: time in seconds to determine station's inactivity.
418 */ 439 */
419struct cfg80211_ap_settings { 440struct cfg80211_ap_settings {
441 struct ieee80211_channel *channel;
442 enum nl80211_channel_type channel_type;
443
420 struct cfg80211_beacon_data beacon; 444 struct cfg80211_beacon_data beacon;
421 445
422 int beacon_interval, dtim_period; 446 int beacon_interval, dtim_period;
@@ -556,11 +580,13 @@ enum station_info_flags {
556 * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled 580 * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled
557 * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission 581 * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission
558 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval 582 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval
583 * @RATE_INFO_FLAGS_60G: 60gHz MCS
559 */ 584 */
560enum rate_info_flags { 585enum rate_info_flags {
561 RATE_INFO_FLAGS_MCS = 1<<0, 586 RATE_INFO_FLAGS_MCS = 1<<0,
562 RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1, 587 RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1,
563 RATE_INFO_FLAGS_SHORT_GI = 1<<2, 588 RATE_INFO_FLAGS_SHORT_GI = 1<<2,
589 RATE_INFO_FLAGS_60G = 1<<3,
564}; 590};
565 591
566/** 592/**
@@ -622,10 +648,10 @@ struct sta_bss_parameters {
622 * @llid: mesh local link id 648 * @llid: mesh local link id
623 * @plid: mesh peer link id 649 * @plid: mesh peer link id
624 * @plink_state: mesh peer link state 650 * @plink_state: mesh peer link state
625 * @signal: the signal strength, type depends on the wiphy's signal_type 651 * @signal: The signal strength, type depends on the wiphy's signal_type.
626 NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. 652 * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
627 * @signal_avg: avg signal strength, type depends on the wiphy's signal_type 653 * @signal_avg: Average signal strength, type depends on the wiphy's signal_type.
628 NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. 654 * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
629 * @txrate: current unicast bitrate from this station 655 * @txrate: current unicast bitrate from this station
630 * @rxrate: current unicast bitrate to this station 656 * @rxrate: current unicast bitrate to this station
631 * @rx_packets: packets received from this station 657 * @rx_packets: packets received from this station
@@ -785,47 +811,101 @@ struct bss_parameters {
785 int ht_opmode; 811 int ht_opmode;
786}; 812};
787 813
788/* 814/**
789 * struct mesh_config - 802.11s mesh configuration 815 * struct mesh_config - 802.11s mesh configuration
790 * 816 *
791 * These parameters can be changed while the mesh is active. 817 * These parameters can be changed while the mesh is active.
818 *
819 * @dot11MeshRetryTimeout: the initial retry timeout in millisecond units used
820 * by the Mesh Peering Open message
821 * @dot11MeshConfirmTimeout: the initial retry timeout in millisecond units
822 * used by the Mesh Peering Open message
823 * @dot11MeshHoldingTimeout: the confirm timeout in millisecond units used by
824 * the mesh peering management to close a mesh peering
825 * @dot11MeshMaxPeerLinks: the maximum number of peer links allowed on this
826 * mesh interface
827 * @dot11MeshMaxRetries: the maximum number of peer link open retries that can
828 * be sent to establish a new peer link instance in a mesh
829 * @dot11MeshTTL: the value of TTL field set at a source mesh STA
830 * @element_ttl: the value of TTL field set at a mesh STA for path selection
831 * elements
832 * @auto_open_plinks: whether we should automatically open peer links when we
833 * detect compatible mesh peers
834 * @dot11MeshNbrOffsetMaxNeighbor: the maximum number of neighbors to
835 * synchronize to for 11s default synchronization method
836 * @dot11MeshHWMPmaxPREQretries: the number of action frames containing a PREQ
837 * that an originator mesh STA can send to a particular path target
838 * @path_refresh_time: how frequently to refresh mesh paths in milliseconds
839 * @min_discovery_timeout: the minimum length of time to wait until giving up on
840 * a path discovery in milliseconds
841 * @dot11MeshHWMPactivePathTimeout: the time (in TUs) for which mesh STAs
842 * receiving a PREQ shall consider the forwarding information from the
843 * root to be valid. (TU = time unit)
844 * @dot11MeshHWMPpreqMinInterval: the minimum interval of time (in TUs) during
845 * which a mesh STA can send only one action frame containing a PREQ
846 * element
847 * @dot11MeshHWMPperrMinInterval: the minimum interval of time (in TUs) during
848 * which a mesh STA can send only one Action frame containing a PERR
849 * element
850 * @dot11MeshHWMPnetDiameterTraversalTime: the interval of time (in TUs) that
851 * it takes for an HWMP information element to propagate across the mesh
852 * @dot11MeshHWMPRootMode: the configuration of a mesh STA as root mesh STA
853 * @dot11MeshHWMPRannInterval: the interval of time (in TUs) between root
854 * announcements are transmitted
855 * @dot11MeshGateAnnouncementProtocol: whether to advertise that this mesh
856 * station has access to a broader network beyond the MBSS. (This is
857 * missnamed in draft 12.0: dot11MeshGateAnnouncementProtocol set to true
858 * only means that the station will announce others it's a mesh gate, but
859 * not necessarily using the gate announcement protocol. Still keeping the
860 * same nomenclature to be in sync with the spec)
861 * @dot11MeshForwarding: whether the Mesh STA is forwarding or non-forwarding
862 * entity (default is TRUE - forwarding entity)
863 * @rssi_threshold: the threshold for average signal strength of candidate
864 * station to establish a peer link
865 * @ht_opmode: mesh HT protection mode
866 *
867 * @dot11MeshHWMPactivePathToRootTimeout: The time (in TUs) for which mesh STAs
868 * receiving a proactive PREQ shall consider the forwarding information to
869 * the root mesh STA to be valid.
870 *
871 * @dot11MeshHWMProotInterval: The interval of time (in TUs) between proactive
872 * PREQs are transmitted.
873 * @dot11MeshHWMPconfirmationInterval: The minimum interval of time (in TUs)
874 * during which a mesh STA can send only one Action frame containing
875 * a PREQ element for root path confirmation.
792 */ 876 */
793struct mesh_config { 877struct mesh_config {
794 /* Timeouts in ms */
795 /* Mesh plink management parameters */
796 u16 dot11MeshRetryTimeout; 878 u16 dot11MeshRetryTimeout;
797 u16 dot11MeshConfirmTimeout; 879 u16 dot11MeshConfirmTimeout;
798 u16 dot11MeshHoldingTimeout; 880 u16 dot11MeshHoldingTimeout;
799 u16 dot11MeshMaxPeerLinks; 881 u16 dot11MeshMaxPeerLinks;
800 u8 dot11MeshMaxRetries; 882 u8 dot11MeshMaxRetries;
801 u8 dot11MeshTTL; 883 u8 dot11MeshTTL;
802 /* ttl used in path selection information elements */ 884 u8 element_ttl;
803 u8 element_ttl;
804 bool auto_open_plinks; 885 bool auto_open_plinks;
805 /* neighbor offset synchronization */
806 u32 dot11MeshNbrOffsetMaxNeighbor; 886 u32 dot11MeshNbrOffsetMaxNeighbor;
807 /* HWMP parameters */ 887 u8 dot11MeshHWMPmaxPREQretries;
808 u8 dot11MeshHWMPmaxPREQretries;
809 u32 path_refresh_time; 888 u32 path_refresh_time;
810 u16 min_discovery_timeout; 889 u16 min_discovery_timeout;
811 u32 dot11MeshHWMPactivePathTimeout; 890 u32 dot11MeshHWMPactivePathTimeout;
812 u16 dot11MeshHWMPpreqMinInterval; 891 u16 dot11MeshHWMPpreqMinInterval;
813 u16 dot11MeshHWMPperrMinInterval; 892 u16 dot11MeshHWMPperrMinInterval;
814 u16 dot11MeshHWMPnetDiameterTraversalTime; 893 u16 dot11MeshHWMPnetDiameterTraversalTime;
815 u8 dot11MeshHWMPRootMode; 894 u8 dot11MeshHWMPRootMode;
816 u16 dot11MeshHWMPRannInterval; 895 u16 dot11MeshHWMPRannInterval;
817 /* This is missnamed in draft 12.0: dot11MeshGateAnnouncementProtocol 896 bool dot11MeshGateAnnouncementProtocol;
818 * set to true only means that the station will announce others it's a
819 * mesh gate, but not necessarily using the gate announcement protocol.
820 * Still keeping the same nomenclature to be in sync with the spec. */
821 bool dot11MeshGateAnnouncementProtocol;
822 bool dot11MeshForwarding; 897 bool dot11MeshForwarding;
823 s32 rssi_threshold; 898 s32 rssi_threshold;
824 u16 ht_opmode; 899 u16 ht_opmode;
900 u32 dot11MeshHWMPactivePathToRootTimeout;
901 u16 dot11MeshHWMProotInterval;
902 u16 dot11MeshHWMPconfirmationInterval;
825}; 903};
826 904
827/** 905/**
828 * struct mesh_setup - 802.11s mesh setup configuration 906 * struct mesh_setup - 802.11s mesh setup configuration
907 * @channel: the channel to start the mesh network on
908 * @channel_type: the channel type to use
829 * @mesh_id: the mesh ID 909 * @mesh_id: the mesh ID
830 * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes 910 * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes
831 * @sync_method: which synchronization method to use 911 * @sync_method: which synchronization method to use
@@ -840,6 +920,8 @@ struct mesh_config {
840 * These parameters are fixed when the mesh is created. 920 * These parameters are fixed when the mesh is created.
841 */ 921 */
842struct mesh_setup { 922struct mesh_setup {
923 struct ieee80211_channel *channel;
924 enum nl80211_channel_type channel_type;
843 const u8 *mesh_id; 925 const u8 *mesh_id;
844 u8 mesh_id_len; 926 u8 mesh_id_len;
845 u8 sync_method; 927 u8 sync_method;
@@ -917,7 +999,7 @@ struct cfg80211_ssid {
917 * @ie_len: length of ie in octets 999 * @ie_len: length of ie in octets
918 * @rates: bitmap of rates to advertise for each band 1000 * @rates: bitmap of rates to advertise for each band
919 * @wiphy: the wiphy this was for 1001 * @wiphy: the wiphy this was for
920 * @dev: the interface 1002 * @wdev: the wireless device to scan for
921 * @aborted: (internal) scan request was notified as aborted 1003 * @aborted: (internal) scan request was notified as aborted
922 * @no_cck: used to send probe requests at non CCK rate in 2GHz band 1004 * @no_cck: used to send probe requests at non CCK rate in 2GHz band
923 */ 1005 */
@@ -930,9 +1012,10 @@ struct cfg80211_scan_request {
930 1012
931 u32 rates[IEEE80211_NUM_BANDS]; 1013 u32 rates[IEEE80211_NUM_BANDS];
932 1014
1015 struct wireless_dev *wdev;
1016
933 /* internal */ 1017 /* internal */
934 struct wiphy *wiphy; 1018 struct wiphy *wiphy;
935 struct net_device *dev;
936 bool aborted; 1019 bool aborted;
937 bool no_cck; 1020 bool no_cck;
938 1021
@@ -966,6 +1049,7 @@ struct cfg80211_match_set {
966 * @wiphy: the wiphy this was for 1049 * @wiphy: the wiphy this was for
967 * @dev: the interface 1050 * @dev: the interface
968 * @channels: channels to scan 1051 * @channels: channels to scan
1052 * @rssi_thold: don't report scan results below this threshold (in s32 dBm)
969 */ 1053 */
970struct cfg80211_sched_scan_request { 1054struct cfg80211_sched_scan_request {
971 struct cfg80211_ssid *ssids; 1055 struct cfg80211_ssid *ssids;
@@ -976,6 +1060,7 @@ struct cfg80211_sched_scan_request {
976 size_t ie_len; 1060 size_t ie_len;
977 struct cfg80211_match_set *match_sets; 1061 struct cfg80211_match_set *match_sets;
978 int n_match_sets; 1062 int n_match_sets;
1063 s32 rssi_thold;
979 1064
980 /* internal */ 1065 /* internal */
981 struct wiphy *wiphy; 1066 struct wiphy *wiphy;
@@ -1351,10 +1436,10 @@ struct cfg80211_gtk_rekey_data {
1351 * 1436 *
1352 * @add_virtual_intf: create a new virtual interface with the given name, 1437 * @add_virtual_intf: create a new virtual interface with the given name,
1353 * must set the struct wireless_dev's iftype. Beware: You must create 1438 * must set the struct wireless_dev's iftype. Beware: You must create
1354 * the new netdev in the wiphy's network namespace! Returns the netdev, 1439 * the new netdev in the wiphy's network namespace! Returns the struct
1355 * or an ERR_PTR. 1440 * wireless_dev, or an ERR_PTR.
1356 * 1441 *
1357 * @del_virtual_intf: remove the virtual interface determined by ifindex. 1442 * @del_virtual_intf: remove the virtual interface
1358 * 1443 *
1359 * @change_virtual_intf: change type/configuration of virtual interface, 1444 * @change_virtual_intf: change type/configuration of virtual interface,
1360 * keep the struct wireless_dev's iftype updated. 1445 * keep the struct wireless_dev's iftype updated.
@@ -1411,14 +1496,14 @@ struct cfg80211_gtk_rekey_data {
1411 * 1496 *
1412 * @set_txq_params: Set TX queue parameters 1497 * @set_txq_params: Set TX queue parameters
1413 * 1498 *
1414 * @set_channel: Set channel for a given wireless interface. Some devices 1499 * @libertas_set_mesh_channel: Only for backward compatibility for libertas,
1415 * may support multi-channel operation (by channel hopping) so cfg80211 1500 * as it doesn't implement join_mesh and needs to set the channel to
1416 * doesn't verify much. Note, however, that the passed netdev may be 1501 * join the mesh instead.
1417 * %NULL as well if the user requested changing the channel for the 1502 *
1418 * device itself, or for a monitor interface. 1503 * @set_monitor_channel: Set the monitor mode channel for the device. If other
1419 * @get_channel: Get the current operating channel, should return %NULL if 1504 * interfaces are active this callback should reject the configuration.
1420 * there's no single defined operating channel if for example the 1505 * If no interfaces are active or the device is down, the channel should
1421 * device implements channel hopping for multi-channel virtual interfaces. 1506 * be stored for when a monitor interface becomes active.
1422 * 1507 *
1423 * @scan: Request to do a scan. If returning zero, the scan request is given 1508 * @scan: Request to do a scan. If returning zero, the scan request is given
1424 * the driver, and will be valid until passed to cfg80211_scan_done(). 1509 * the driver, and will be valid until passed to cfg80211_scan_done().
@@ -1488,6 +1573,8 @@ struct cfg80211_gtk_rekey_data {
1488 * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 1573 * @set_power_mgmt: Configure WLAN power management. A timeout value of -1
1489 * allows the driver to adjust the dynamic ps timeout value. 1574 * allows the driver to adjust the dynamic ps timeout value.
1490 * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. 1575 * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold.
1576 * @set_cqm_txe_config: Configure connection quality monitor TX error
1577 * thresholds.
1491 * @sched_scan_start: Tell the driver to start a scheduled scan. 1578 * @sched_scan_start: Tell the driver to start a scheduled scan.
1492 * @sched_scan_stop: Tell the driver to stop an ongoing scheduled 1579 * @sched_scan_stop: Tell the driver to stop an ongoing scheduled
1493 * scan. The driver_initiated flag specifies whether the driver 1580 * scan. The driver_initiated flag specifies whether the driver
@@ -1525,18 +1612,23 @@ struct cfg80211_gtk_rekey_data {
1525 * @get_et_strings: Ethtool API to get a set of strings to describe stats 1612 * @get_et_strings: Ethtool API to get a set of strings to describe stats
1526 * and perhaps other supported types of ethtool data-sets. 1613 * and perhaps other supported types of ethtool data-sets.
1527 * See @ethtool_ops.get_strings 1614 * See @ethtool_ops.get_strings
1615 *
1616 * @get_channel: Get the current operating channel for the virtual interface.
1617 * For monitor interfaces, it should return %NULL unless there's a single
1618 * current monitoring channel.
1528 */ 1619 */
1529struct cfg80211_ops { 1620struct cfg80211_ops {
1530 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 1621 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
1531 int (*resume)(struct wiphy *wiphy); 1622 int (*resume)(struct wiphy *wiphy);
1532 void (*set_wakeup)(struct wiphy *wiphy, bool enabled); 1623 void (*set_wakeup)(struct wiphy *wiphy, bool enabled);
1533 1624
1534 struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, 1625 struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy,
1535 char *name, 1626 char *name,
1536 enum nl80211_iftype type, 1627 enum nl80211_iftype type,
1537 u32 *flags, 1628 u32 *flags,
1538 struct vif_params *params); 1629 struct vif_params *params);
1539 int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev); 1630 int (*del_virtual_intf)(struct wiphy *wiphy,
1631 struct wireless_dev *wdev);
1540 int (*change_virtual_intf)(struct wiphy *wiphy, 1632 int (*change_virtual_intf)(struct wiphy *wiphy,
1541 struct net_device *dev, 1633 struct net_device *dev,
1542 enum nl80211_iftype type, u32 *flags, 1634 enum nl80211_iftype type, u32 *flags,
@@ -1605,11 +1697,15 @@ struct cfg80211_ops {
1605 int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev, 1697 int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev,
1606 struct ieee80211_txq_params *params); 1698 struct ieee80211_txq_params *params);
1607 1699
1608 int (*set_channel)(struct wiphy *wiphy, struct net_device *dev, 1700 int (*libertas_set_mesh_channel)(struct wiphy *wiphy,
1609 struct ieee80211_channel *chan, 1701 struct net_device *dev,
1610 enum nl80211_channel_type channel_type); 1702 struct ieee80211_channel *chan);
1703
1704 int (*set_monitor_channel)(struct wiphy *wiphy,
1705 struct ieee80211_channel *chan,
1706 enum nl80211_channel_type channel_type);
1611 1707
1612 int (*scan)(struct wiphy *wiphy, struct net_device *dev, 1708 int (*scan)(struct wiphy *wiphy,
1613 struct cfg80211_scan_request *request); 1709 struct cfg80211_scan_request *request);
1614 1710
1615 int (*auth)(struct wiphy *wiphy, struct net_device *dev, 1711 int (*auth)(struct wiphy *wiphy, struct net_device *dev,
@@ -1663,23 +1759,23 @@ struct cfg80211_ops {
1663 int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev); 1759 int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev);
1664 1760
1665 int (*remain_on_channel)(struct wiphy *wiphy, 1761 int (*remain_on_channel)(struct wiphy *wiphy,
1666 struct net_device *dev, 1762 struct wireless_dev *wdev,
1667 struct ieee80211_channel *chan, 1763 struct ieee80211_channel *chan,
1668 enum nl80211_channel_type channel_type, 1764 enum nl80211_channel_type channel_type,
1669 unsigned int duration, 1765 unsigned int duration,
1670 u64 *cookie); 1766 u64 *cookie);
1671 int (*cancel_remain_on_channel)(struct wiphy *wiphy, 1767 int (*cancel_remain_on_channel)(struct wiphy *wiphy,
1672 struct net_device *dev, 1768 struct wireless_dev *wdev,
1673 u64 cookie); 1769 u64 cookie);
1674 1770
1675 int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, 1771 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
1676 struct ieee80211_channel *chan, bool offchan, 1772 struct ieee80211_channel *chan, bool offchan,
1677 enum nl80211_channel_type channel_type, 1773 enum nl80211_channel_type channel_type,
1678 bool channel_type_valid, unsigned int wait, 1774 bool channel_type_valid, unsigned int wait,
1679 const u8 *buf, size_t len, bool no_cck, 1775 const u8 *buf, size_t len, bool no_cck,
1680 bool dont_wait_for_ack, u64 *cookie); 1776 bool dont_wait_for_ack, u64 *cookie);
1681 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, 1777 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
1682 struct net_device *dev, 1778 struct wireless_dev *wdev,
1683 u64 cookie); 1779 u64 cookie);
1684 1780
1685 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, 1781 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
@@ -1689,8 +1785,12 @@ struct cfg80211_ops {
1689 struct net_device *dev, 1785 struct net_device *dev,
1690 s32 rssi_thold, u32 rssi_hyst); 1786 s32 rssi_thold, u32 rssi_hyst);
1691 1787
1788 int (*set_cqm_txe_config)(struct wiphy *wiphy,
1789 struct net_device *dev,
1790 u32 rate, u32 pkts, u32 intvl);
1791
1692 void (*mgmt_frame_register)(struct wiphy *wiphy, 1792 void (*mgmt_frame_register)(struct wiphy *wiphy,
1693 struct net_device *dev, 1793 struct wireless_dev *wdev,
1694 u16 frame_type, bool reg); 1794 u16 frame_type, bool reg);
1695 1795
1696 int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); 1796 int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant);
@@ -1721,15 +1821,17 @@ struct cfg80211_ops {
1721 struct net_device *dev, 1821 struct net_device *dev,
1722 u16 noack_map); 1822 u16 noack_map);
1723 1823
1724 struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy,
1725 enum nl80211_channel_type *type);
1726
1727 int (*get_et_sset_count)(struct wiphy *wiphy, 1824 int (*get_et_sset_count)(struct wiphy *wiphy,
1728 struct net_device *dev, int sset); 1825 struct net_device *dev, int sset);
1729 void (*get_et_stats)(struct wiphy *wiphy, struct net_device *dev, 1826 void (*get_et_stats)(struct wiphy *wiphy, struct net_device *dev,
1730 struct ethtool_stats *stats, u64 *data); 1827 struct ethtool_stats *stats, u64 *data);
1731 void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, 1828 void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev,
1732 u32 sset, u8 *data); 1829 u32 sset, u8 *data);
1830
1831 struct ieee80211_channel *
1832 (*get_channel)(struct wiphy *wiphy,
1833 struct wireless_dev *wdev,
1834 enum nl80211_channel_type *type);
1733}; 1835};
1734 1836
1735/* 1837/*
@@ -2083,7 +2185,9 @@ struct wiphy {
2083 char fw_version[ETHTOOL_BUSINFO_LEN]; 2185 char fw_version[ETHTOOL_BUSINFO_LEN];
2084 u32 hw_version; 2186 u32 hw_version;
2085 2187
2188#ifdef CONFIG_PM
2086 struct wiphy_wowlan_support wowlan; 2189 struct wiphy_wowlan_support wowlan;
2190#endif
2087 2191
2088 u16 max_remain_on_channel_duration; 2192 u16 max_remain_on_channel_duration;
2089 2193
@@ -2250,20 +2354,31 @@ struct cfg80211_internal_bss;
2250struct cfg80211_cached_keys; 2354struct cfg80211_cached_keys;
2251 2355
2252/** 2356/**
2253 * struct wireless_dev - wireless per-netdev state 2357 * struct wireless_dev - wireless device state
2358 *
2359 * For netdevs, this structure must be allocated by the driver
2360 * that uses the ieee80211_ptr field in struct net_device (this
2361 * is intentional so it can be allocated along with the netdev.)
2362 * It need not be registered then as netdev registration will
2363 * be intercepted by cfg80211 to see the new wireless device.
2254 * 2364 *
2255 * This structure must be allocated by the driver/stack 2365 * For non-netdev uses, it must also be allocated by the driver
2256 * that uses the ieee80211_ptr field in struct net_device 2366 * in response to the cfg80211 callbacks that require it, as
2257 * (this is intentional so it can be allocated along with 2367 * there's no netdev registration in that case it may not be
2258 * the netdev.) 2368 * allocated outside of callback operations that return it.
2259 * 2369 *
2260 * @wiphy: pointer to hardware description 2370 * @wiphy: pointer to hardware description
2261 * @iftype: interface type 2371 * @iftype: interface type
2262 * @list: (private) Used to collect the interfaces 2372 * @list: (private) Used to collect the interfaces
2263 * @netdev: (private) Used to reference back to the netdev 2373 * @netdev: (private) Used to reference back to the netdev, may be %NULL
2374 * @identifier: (private) Identifier used in nl80211 to identify this
2375 * wireless device if it has no netdev
2264 * @current_bss: (private) Used by the internal configuration code 2376 * @current_bss: (private) Used by the internal configuration code
2265 * @channel: (private) Used by the internal configuration code to track 2377 * @channel: (private) Used by the internal configuration code to track
2266 * user-set AP, monitor and WDS channels for wireless extensions 2378 * the user-set AP, monitor and WDS channel
2379 * @preset_chan: (private) Used by the internal configuration code to
2380 * track the channel to be used for AP later
2381 * @preset_chantype: (private) the corresponding channel type
2267 * @bssid: (private) Used by the internal configuration code 2382 * @bssid: (private) Used by the internal configuration code
2268 * @ssid: (private) Used by the internal configuration code 2383 * @ssid: (private) Used by the internal configuration code
2269 * @ssid_len: (private) Used by the internal configuration code 2384 * @ssid_len: (private) Used by the internal configuration code
@@ -2289,6 +2404,8 @@ struct wireless_dev {
2289 struct list_head list; 2404 struct list_head list;
2290 struct net_device *netdev; 2405 struct net_device *netdev;
2291 2406
2407 u32 identifier;
2408
2292 struct list_head mgmt_registrations; 2409 struct list_head mgmt_registrations;
2293 spinlock_t mgmt_registrations_lock; 2410 spinlock_t mgmt_registrations_lock;
2294 2411
@@ -2313,8 +2430,14 @@ struct wireless_dev {
2313 spinlock_t event_lock; 2430 spinlock_t event_lock;
2314 2431
2315 struct cfg80211_internal_bss *current_bss; /* associated / joined */ 2432 struct cfg80211_internal_bss *current_bss; /* associated / joined */
2433 struct ieee80211_channel *preset_chan;
2434 enum nl80211_channel_type preset_chantype;
2435
2436 /* for AP and mesh channel tracking */
2316 struct ieee80211_channel *channel; 2437 struct ieee80211_channel *channel;
2317 2438
2439 bool ibss_fixed;
2440
2318 bool ps; 2441 bool ps;
2319 int ps_timeout; 2442 int ps_timeout;
2320 2443
@@ -3169,7 +3292,7 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason,
3169 3292
3170/** 3293/**
3171 * cfg80211_ready_on_channel - notification of remain_on_channel start 3294 * cfg80211_ready_on_channel - notification of remain_on_channel start
3172 * @dev: network device 3295 * @wdev: wireless device
3173 * @cookie: the request cookie 3296 * @cookie: the request cookie
3174 * @chan: The current channel (from remain_on_channel request) 3297 * @chan: The current channel (from remain_on_channel request)
3175 * @channel_type: Channel type 3298 * @channel_type: Channel type
@@ -3177,21 +3300,20 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason,
3177 * channel 3300 * channel
3178 * @gfp: allocation flags 3301 * @gfp: allocation flags
3179 */ 3302 */
3180void cfg80211_ready_on_channel(struct net_device *dev, u64 cookie, 3303void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
3181 struct ieee80211_channel *chan, 3304 struct ieee80211_channel *chan,
3182 enum nl80211_channel_type channel_type, 3305 enum nl80211_channel_type channel_type,
3183 unsigned int duration, gfp_t gfp); 3306 unsigned int duration, gfp_t gfp);
3184 3307
3185/** 3308/**
3186 * cfg80211_remain_on_channel_expired - remain_on_channel duration expired 3309 * cfg80211_remain_on_channel_expired - remain_on_channel duration expired
3187 * @dev: network device 3310 * @wdev: wireless device
3188 * @cookie: the request cookie 3311 * @cookie: the request cookie
3189 * @chan: The current channel (from remain_on_channel request) 3312 * @chan: The current channel (from remain_on_channel request)
3190 * @channel_type: Channel type 3313 * @channel_type: Channel type
3191 * @gfp: allocation flags 3314 * @gfp: allocation flags
3192 */ 3315 */
3193void cfg80211_remain_on_channel_expired(struct net_device *dev, 3316void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
3194 u64 cookie,
3195 struct ieee80211_channel *chan, 3317 struct ieee80211_channel *chan,
3196 enum nl80211_channel_type channel_type, 3318 enum nl80211_channel_type channel_type,
3197 gfp_t gfp); 3319 gfp_t gfp);
@@ -3219,7 +3341,7 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp);
3219 3341
3220/** 3342/**
3221 * cfg80211_rx_mgmt - notification of received, unprocessed management frame 3343 * cfg80211_rx_mgmt - notification of received, unprocessed management frame
3222 * @dev: network device 3344 * @wdev: wireless device receiving the frame
3223 * @freq: Frequency on which the frame was received in MHz 3345 * @freq: Frequency on which the frame was received in MHz
3224 * @sig_dbm: signal strength in mBm, or 0 if unknown 3346 * @sig_dbm: signal strength in mBm, or 0 if unknown
3225 * @buf: Management frame (header + body) 3347 * @buf: Management frame (header + body)
@@ -3234,12 +3356,12 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp);
3234 * This function is called whenever an Action frame is received for a station 3356 * This function is called whenever an Action frame is received for a station
3235 * mode interface, but is not processed in kernel. 3357 * mode interface, but is not processed in kernel.
3236 */ 3358 */
3237bool cfg80211_rx_mgmt(struct net_device *dev, int freq, int sig_dbm, 3359bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
3238 const u8 *buf, size_t len, gfp_t gfp); 3360 const u8 *buf, size_t len, gfp_t gfp);
3239 3361
3240/** 3362/**
3241 * cfg80211_mgmt_tx_status - notification of TX status for management frame 3363 * cfg80211_mgmt_tx_status - notification of TX status for management frame
3242 * @dev: network device 3364 * @wdev: wireless device receiving the frame
3243 * @cookie: Cookie returned by cfg80211_ops::mgmt_tx() 3365 * @cookie: Cookie returned by cfg80211_ops::mgmt_tx()
3244 * @buf: Management frame (header + body) 3366 * @buf: Management frame (header + body)
3245 * @len: length of the frame data 3367 * @len: length of the frame data
@@ -3250,7 +3372,7 @@ bool cfg80211_rx_mgmt(struct net_device *dev, int freq, int sig_dbm,
3250 * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the 3372 * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the
3251 * transmission attempt. 3373 * transmission attempt.
3252 */ 3374 */
3253void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie, 3375void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie,
3254 const u8 *buf, size_t len, bool ack, gfp_t gfp); 3376 const u8 *buf, size_t len, bool ack, gfp_t gfp);
3255 3377
3256 3378
@@ -3280,6 +3402,21 @@ void cfg80211_cqm_pktloss_notify(struct net_device *dev,
3280 const u8 *peer, u32 num_packets, gfp_t gfp); 3402 const u8 *peer, u32 num_packets, gfp_t gfp);
3281 3403
3282/** 3404/**
3405 * cfg80211_cqm_txe_notify - TX error rate event
3406 * @dev: network device
3407 * @peer: peer's MAC address
3408 * @num_packets: how many packets were lost
3409 * @rate: % of packets which failed transmission
3410 * @intvl: interval (in s) over which the TX failure threshold was breached.
3411 * @gfp: context flags
3412 *
3413 * Notify userspace when configured % TX failures over number of packets in a
3414 * given interval is exceeded.
3415 */
3416void cfg80211_cqm_txe_notify(struct net_device *dev, const u8 *peer,
3417 u32 num_packets, u32 rate, u32 intvl, gfp_t gfp);
3418
3419/**
3283 * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying 3420 * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
3284 * @dev: network device 3421 * @dev: network device
3285 * @bssid: BSSID of AP (to avoid races) 3422 * @bssid: BSSID of AP (to avoid races)
@@ -3359,11 +3496,14 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,
3359 const u8 *frame, size_t len, 3496 const u8 *frame, size_t len,
3360 int freq, int sig_dbm, gfp_t gfp); 3497 int freq, int sig_dbm, gfp_t gfp);
3361 3498
3362/* 3499/**
3363 * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used 3500 * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used
3364 * @wiphy: the wiphy 3501 * @wiphy: the wiphy
3365 * @chan: main channel 3502 * @chan: main channel
3366 * @channel_type: HT mode 3503 * @channel_type: HT mode
3504 *
3505 * This function returns true if there is no secondary channel or the secondary
3506 * channel can be used for beaconing (i.e. is not a radar channel etc.)
3367 */ 3507 */
3368bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, 3508bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy,
3369 struct ieee80211_channel *chan, 3509 struct ieee80211_channel *chan,
@@ -3386,7 +3526,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev, int freq,
3386 * 3526 *
3387 * return 0 if MCS index >= 32 3527 * return 0 if MCS index >= 32
3388 */ 3528 */
3389u16 cfg80211_calculate_bitrate(struct rate_info *rate); 3529u32 cfg80211_calculate_bitrate(struct rate_info *rate);
3390 3530
3391/* Logging, debugging and troubleshooting/diagnostic helpers. */ 3531/* Logging, debugging and troubleshooting/diagnostic helpers. */
3392 3532