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