diff options
author | John W. Linville <linville@tuxdriver.com> | 2014-05-22 13:58:36 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-05-22 13:58:36 -0400 |
commit | 40a10fd740a4d5a9f3da255cf8dae48c6723d1a6 (patch) | |
tree | a65eb4adca8e37ed7335345e94e36918593f7f92 /include/net | |
parent | 99abe65ff18b6bbac2e55524827b571c3eccfa86 (diff) | |
parent | 67af9811539be83dbdc0739215d29af23c870405 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/cfg80211.h | 191 | ||||
-rw-r--r-- | include/net/mac80211.h | 78 |
2 files changed, 203 insertions, 66 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index f2c318655519..e46c437944f7 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -341,8 +341,8 @@ struct vif_params { | |||
341 | * @seq_len: length of @seq. | 341 | * @seq_len: length of @seq. |
342 | */ | 342 | */ |
343 | struct key_params { | 343 | struct key_params { |
344 | u8 *key; | 344 | const u8 *key; |
345 | u8 *seq; | 345 | const u8 *seq; |
346 | int key_len; | 346 | int key_len; |
347 | int seq_len; | 347 | int seq_len; |
348 | u32 cipher; | 348 | u32 cipher; |
@@ -458,7 +458,7 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, | |||
458 | */ | 458 | */ |
459 | int cfg80211_chandef_dfs_required(struct wiphy *wiphy, | 459 | int cfg80211_chandef_dfs_required(struct wiphy *wiphy, |
460 | const struct cfg80211_chan_def *chandef, | 460 | const struct cfg80211_chan_def *chandef, |
461 | enum nl80211_iftype); | 461 | enum nl80211_iftype iftype); |
462 | 462 | ||
463 | /** | 463 | /** |
464 | * ieee80211_chandef_rate_flags - returns rate flags for a channel | 464 | * ieee80211_chandef_rate_flags - returns rate flags for a channel |
@@ -694,8 +694,10 @@ struct cfg80211_ap_settings { | |||
694 | * | 694 | * |
695 | * @chandef: defines the channel to use after the switch | 695 | * @chandef: defines the channel to use after the switch |
696 | * @beacon_csa: beacon data while performing the switch | 696 | * @beacon_csa: beacon data while performing the switch |
697 | * @counter_offset_beacon: offset for the counter within the beacon (tail) | 697 | * @counter_offsets_beacon: offsets of the counters within the beacon (tail) |
698 | * @counter_offset_presp: offset for the counter within the probe response | 698 | * @counter_offsets_presp: offsets of the counters within the probe response |
699 | * @n_counter_offsets_beacon: number of csa counters the beacon (tail) | ||
700 | * @n_counter_offsets_presp: number of csa counters in the probe response | ||
699 | * @beacon_after: beacon data to be used on the new channel | 701 | * @beacon_after: beacon data to be used on the new channel |
700 | * @radar_required: whether radar detection is required on the new channel | 702 | * @radar_required: whether radar detection is required on the new channel |
701 | * @block_tx: whether transmissions should be blocked while changing | 703 | * @block_tx: whether transmissions should be blocked while changing |
@@ -704,7 +706,10 @@ struct cfg80211_ap_settings { | |||
704 | struct cfg80211_csa_settings { | 706 | struct cfg80211_csa_settings { |
705 | struct cfg80211_chan_def chandef; | 707 | struct cfg80211_chan_def chandef; |
706 | struct cfg80211_beacon_data beacon_csa; | 708 | struct cfg80211_beacon_data beacon_csa; |
707 | u16 counter_offset_beacon, counter_offset_presp; | 709 | const u16 *counter_offsets_beacon; |
710 | const u16 *counter_offsets_presp; | ||
711 | unsigned int n_counter_offsets_beacon; | ||
712 | unsigned int n_counter_offsets_presp; | ||
708 | struct cfg80211_beacon_data beacon_after; | 713 | struct cfg80211_beacon_data beacon_after; |
709 | bool radar_required; | 714 | bool radar_required; |
710 | bool block_tx; | 715 | bool block_tx; |
@@ -868,36 +873,38 @@ int cfg80211_check_station_change(struct wiphy *wiphy, | |||
868 | * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled | 873 | * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled |
869 | * @STATION_INFO_CHAIN_SIGNAL: @chain_signal filled | 874 | * @STATION_INFO_CHAIN_SIGNAL: @chain_signal filled |
870 | * @STATION_INFO_CHAIN_SIGNAL_AVG: @chain_signal_avg filled | 875 | * @STATION_INFO_CHAIN_SIGNAL_AVG: @chain_signal_avg filled |
876 | * @STATION_INFO_EXPECTED_THROUGHPUT: @expected_throughput filled | ||
871 | */ | 877 | */ |
872 | enum station_info_flags { | 878 | enum station_info_flags { |
873 | STATION_INFO_INACTIVE_TIME = 1<<0, | 879 | STATION_INFO_INACTIVE_TIME = BIT(0), |
874 | STATION_INFO_RX_BYTES = 1<<1, | 880 | STATION_INFO_RX_BYTES = BIT(1), |
875 | STATION_INFO_TX_BYTES = 1<<2, | 881 | STATION_INFO_TX_BYTES = BIT(2), |
876 | STATION_INFO_LLID = 1<<3, | 882 | STATION_INFO_LLID = BIT(3), |
877 | STATION_INFO_PLID = 1<<4, | 883 | STATION_INFO_PLID = BIT(4), |
878 | STATION_INFO_PLINK_STATE = 1<<5, | 884 | STATION_INFO_PLINK_STATE = BIT(5), |
879 | STATION_INFO_SIGNAL = 1<<6, | 885 | STATION_INFO_SIGNAL = BIT(6), |
880 | STATION_INFO_TX_BITRATE = 1<<7, | 886 | STATION_INFO_TX_BITRATE = BIT(7), |
881 | STATION_INFO_RX_PACKETS = 1<<8, | 887 | STATION_INFO_RX_PACKETS = BIT(8), |
882 | STATION_INFO_TX_PACKETS = 1<<9, | 888 | STATION_INFO_TX_PACKETS = BIT(9), |
883 | STATION_INFO_TX_RETRIES = 1<<10, | 889 | STATION_INFO_TX_RETRIES = BIT(10), |
884 | STATION_INFO_TX_FAILED = 1<<11, | 890 | STATION_INFO_TX_FAILED = BIT(11), |
885 | STATION_INFO_RX_DROP_MISC = 1<<12, | 891 | STATION_INFO_RX_DROP_MISC = BIT(12), |
886 | STATION_INFO_SIGNAL_AVG = 1<<13, | 892 | STATION_INFO_SIGNAL_AVG = BIT(13), |
887 | STATION_INFO_RX_BITRATE = 1<<14, | 893 | STATION_INFO_RX_BITRATE = BIT(14), |
888 | STATION_INFO_BSS_PARAM = 1<<15, | 894 | STATION_INFO_BSS_PARAM = BIT(15), |
889 | STATION_INFO_CONNECTED_TIME = 1<<16, | 895 | STATION_INFO_CONNECTED_TIME = BIT(16), |
890 | STATION_INFO_ASSOC_REQ_IES = 1<<17, | 896 | STATION_INFO_ASSOC_REQ_IES = BIT(17), |
891 | STATION_INFO_STA_FLAGS = 1<<18, | 897 | STATION_INFO_STA_FLAGS = BIT(18), |
892 | STATION_INFO_BEACON_LOSS_COUNT = 1<<19, | 898 | STATION_INFO_BEACON_LOSS_COUNT = BIT(19), |
893 | STATION_INFO_T_OFFSET = 1<<20, | 899 | STATION_INFO_T_OFFSET = BIT(20), |
894 | STATION_INFO_LOCAL_PM = 1<<21, | 900 | STATION_INFO_LOCAL_PM = BIT(21), |
895 | STATION_INFO_PEER_PM = 1<<22, | 901 | STATION_INFO_PEER_PM = BIT(22), |
896 | STATION_INFO_NONPEER_PM = 1<<23, | 902 | STATION_INFO_NONPEER_PM = BIT(23), |
897 | STATION_INFO_RX_BYTES64 = 1<<24, | 903 | STATION_INFO_RX_BYTES64 = BIT(24), |
898 | STATION_INFO_TX_BYTES64 = 1<<25, | 904 | STATION_INFO_TX_BYTES64 = BIT(25), |
899 | STATION_INFO_CHAIN_SIGNAL = 1<<26, | 905 | STATION_INFO_CHAIN_SIGNAL = BIT(26), |
900 | STATION_INFO_CHAIN_SIGNAL_AVG = 1<<27, | 906 | STATION_INFO_CHAIN_SIGNAL_AVG = BIT(27), |
907 | STATION_INFO_EXPECTED_THROUGHPUT = BIT(28), | ||
901 | }; | 908 | }; |
902 | 909 | ||
903 | /** | 910 | /** |
@@ -1019,6 +1026,8 @@ struct sta_bss_parameters { | |||
1019 | * @local_pm: local mesh STA power save mode | 1026 | * @local_pm: local mesh STA power save mode |
1020 | * @peer_pm: peer mesh STA power save mode | 1027 | * @peer_pm: peer mesh STA power save mode |
1021 | * @nonpeer_pm: non-peer mesh STA power save mode | 1028 | * @nonpeer_pm: non-peer mesh STA power save mode |
1029 | * @expected_throughput: expected throughput in kbps (including 802.11 headers) | ||
1030 | * towards this station. | ||
1022 | */ | 1031 | */ |
1023 | struct station_info { | 1032 | struct station_info { |
1024 | u32 filled; | 1033 | u32 filled; |
@@ -1057,6 +1066,8 @@ struct station_info { | |||
1057 | enum nl80211_mesh_power_mode peer_pm; | 1066 | enum nl80211_mesh_power_mode peer_pm; |
1058 | enum nl80211_mesh_power_mode nonpeer_pm; | 1067 | enum nl80211_mesh_power_mode nonpeer_pm; |
1059 | 1068 | ||
1069 | u32 expected_throughput; | ||
1070 | |||
1060 | /* | 1071 | /* |
1061 | * Note: Add a new enum station_info_flags value for each new field and | 1072 | * Note: Add a new enum station_info_flags value for each new field and |
1062 | * use it to check which fields are initialized. | 1073 | * use it to check which fields are initialized. |
@@ -1064,6 +1075,19 @@ struct station_info { | |||
1064 | }; | 1075 | }; |
1065 | 1076 | ||
1066 | /** | 1077 | /** |
1078 | * cfg80211_get_station - retrieve information about a given station | ||
1079 | * @dev: the device where the station is supposed to be connected to | ||
1080 | * @mac_addr: the mac address of the station of interest | ||
1081 | * @sinfo: pointer to the structure to fill with the information | ||
1082 | * | ||
1083 | * Returns 0 on success and sinfo is filled with the available information | ||
1084 | * otherwise returns a negative error code and the content of sinfo has to be | ||
1085 | * considered undefined. | ||
1086 | */ | ||
1087 | int cfg80211_get_station(struct net_device *dev, const u8 *mac_addr, | ||
1088 | struct station_info *sinfo); | ||
1089 | |||
1090 | /** | ||
1067 | * enum monitor_flags - monitor flags | 1091 | * enum monitor_flags - monitor flags |
1068 | * | 1092 | * |
1069 | * Monitor interface configuration flags. Note that these must be the bits | 1093 | * Monitor interface configuration flags. Note that these must be the bits |
@@ -1164,7 +1188,7 @@ struct bss_parameters { | |||
1164 | int use_cts_prot; | 1188 | int use_cts_prot; |
1165 | int use_short_preamble; | 1189 | int use_short_preamble; |
1166 | int use_short_slot_time; | 1190 | int use_short_slot_time; |
1167 | u8 *basic_rates; | 1191 | const u8 *basic_rates; |
1168 | u8 basic_rates_len; | 1192 | u8 basic_rates_len; |
1169 | int ap_isolate; | 1193 | int ap_isolate; |
1170 | int ht_opmode; | 1194 | int ht_opmode; |
@@ -1694,10 +1718,10 @@ struct cfg80211_disassoc_request { | |||
1694 | * @ht_capa_mask: The bits of ht_capa which are to be used. | 1718 | * @ht_capa_mask: The bits of ht_capa which are to be used. |
1695 | */ | 1719 | */ |
1696 | struct cfg80211_ibss_params { | 1720 | struct cfg80211_ibss_params { |
1697 | u8 *ssid; | 1721 | const u8 *ssid; |
1698 | u8 *bssid; | 1722 | const u8 *bssid; |
1699 | struct cfg80211_chan_def chandef; | 1723 | struct cfg80211_chan_def chandef; |
1700 | u8 *ie; | 1724 | const u8 *ie; |
1701 | u8 ssid_len, ie_len; | 1725 | u8 ssid_len, ie_len; |
1702 | u16 beacon_interval; | 1726 | u16 beacon_interval; |
1703 | u32 basic_rates; | 1727 | u32 basic_rates; |
@@ -1806,8 +1830,8 @@ struct cfg80211_bitrate_mask { | |||
1806 | * @pmkid: The PMK material itself. | 1830 | * @pmkid: The PMK material itself. |
1807 | */ | 1831 | */ |
1808 | struct cfg80211_pmksa { | 1832 | struct cfg80211_pmksa { |
1809 | u8 *bssid; | 1833 | const u8 *bssid; |
1810 | u8 *pmkid; | 1834 | const u8 *pmkid; |
1811 | }; | 1835 | }; |
1812 | 1836 | ||
1813 | /** | 1837 | /** |
@@ -1822,7 +1846,7 @@ struct cfg80211_pmksa { | |||
1822 | * memory, free @mask only! | 1846 | * memory, free @mask only! |
1823 | */ | 1847 | */ |
1824 | struct cfg80211_pkt_pattern { | 1848 | struct cfg80211_pkt_pattern { |
1825 | u8 *mask, *pattern; | 1849 | const u8 *mask, *pattern; |
1826 | int pattern_len; | 1850 | int pattern_len; |
1827 | int pkt_offset; | 1851 | int pkt_offset; |
1828 | }; | 1852 | }; |
@@ -1986,6 +2010,8 @@ struct cfg80211_update_ft_ies_params { | |||
1986 | * @len: buffer length | 2010 | * @len: buffer length |
1987 | * @no_cck: don't use cck rates for this frame | 2011 | * @no_cck: don't use cck rates for this frame |
1988 | * @dont_wait_for_ack: tells the low level not to wait for an ack | 2012 | * @dont_wait_for_ack: tells the low level not to wait for an ack |
2013 | * @n_csa_offsets: length of csa_offsets array | ||
2014 | * @csa_offsets: array of all the csa offsets in the frame | ||
1989 | */ | 2015 | */ |
1990 | struct cfg80211_mgmt_tx_params { | 2016 | struct cfg80211_mgmt_tx_params { |
1991 | struct ieee80211_channel *chan; | 2017 | struct ieee80211_channel *chan; |
@@ -1995,6 +2021,8 @@ struct cfg80211_mgmt_tx_params { | |||
1995 | size_t len; | 2021 | size_t len; |
1996 | bool no_cck; | 2022 | bool no_cck; |
1997 | bool dont_wait_for_ack; | 2023 | bool dont_wait_for_ack; |
2024 | int n_csa_offsets; | ||
2025 | const u16 *csa_offsets; | ||
1998 | }; | 2026 | }; |
1999 | 2027 | ||
2000 | /** | 2028 | /** |
@@ -2336,28 +2364,29 @@ struct cfg80211_ops { | |||
2336 | 2364 | ||
2337 | 2365 | ||
2338 | int (*add_station)(struct wiphy *wiphy, struct net_device *dev, | 2366 | int (*add_station)(struct wiphy *wiphy, struct net_device *dev, |
2339 | u8 *mac, struct station_parameters *params); | 2367 | const u8 *mac, |
2368 | struct station_parameters *params); | ||
2340 | int (*del_station)(struct wiphy *wiphy, struct net_device *dev, | 2369 | int (*del_station)(struct wiphy *wiphy, struct net_device *dev, |
2341 | u8 *mac); | 2370 | const u8 *mac); |
2342 | int (*change_station)(struct wiphy *wiphy, struct net_device *dev, | 2371 | int (*change_station)(struct wiphy *wiphy, struct net_device *dev, |
2343 | u8 *mac, struct station_parameters *params); | 2372 | const u8 *mac, |
2373 | struct station_parameters *params); | ||
2344 | int (*get_station)(struct wiphy *wiphy, struct net_device *dev, | 2374 | int (*get_station)(struct wiphy *wiphy, struct net_device *dev, |
2345 | u8 *mac, struct station_info *sinfo); | 2375 | const u8 *mac, struct station_info *sinfo); |
2346 | int (*dump_station)(struct wiphy *wiphy, struct net_device *dev, | 2376 | int (*dump_station)(struct wiphy *wiphy, struct net_device *dev, |
2347 | int idx, u8 *mac, struct station_info *sinfo); | 2377 | int idx, u8 *mac, struct station_info *sinfo); |
2348 | 2378 | ||
2349 | int (*add_mpath)(struct wiphy *wiphy, struct net_device *dev, | 2379 | int (*add_mpath)(struct wiphy *wiphy, struct net_device *dev, |
2350 | u8 *dst, u8 *next_hop); | 2380 | const u8 *dst, const u8 *next_hop); |
2351 | int (*del_mpath)(struct wiphy *wiphy, struct net_device *dev, | 2381 | int (*del_mpath)(struct wiphy *wiphy, struct net_device *dev, |
2352 | u8 *dst); | 2382 | const u8 *dst); |
2353 | int (*change_mpath)(struct wiphy *wiphy, struct net_device *dev, | 2383 | int (*change_mpath)(struct wiphy *wiphy, struct net_device *dev, |
2354 | u8 *dst, u8 *next_hop); | 2384 | const u8 *dst, const u8 *next_hop); |
2355 | int (*get_mpath)(struct wiphy *wiphy, struct net_device *dev, | 2385 | int (*get_mpath)(struct wiphy *wiphy, struct net_device *dev, |
2356 | u8 *dst, u8 *next_hop, | 2386 | u8 *dst, u8 *next_hop, struct mpath_info *pinfo); |
2357 | struct mpath_info *pinfo); | ||
2358 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, | 2387 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, |
2359 | int idx, u8 *dst, u8 *next_hop, | 2388 | int idx, u8 *dst, u8 *next_hop, |
2360 | struct mpath_info *pinfo); | 2389 | struct mpath_info *pinfo); |
2361 | int (*get_mesh_config)(struct wiphy *wiphy, | 2390 | int (*get_mesh_config)(struct wiphy *wiphy, |
2362 | struct net_device *dev, | 2391 | struct net_device *dev, |
2363 | struct mesh_config *conf); | 2392 | struct mesh_config *conf); |
@@ -2487,11 +2516,11 @@ struct cfg80211_ops { | |||
2487 | struct cfg80211_gtk_rekey_data *data); | 2516 | struct cfg80211_gtk_rekey_data *data); |
2488 | 2517 | ||
2489 | int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 2518 | int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
2490 | u8 *peer, u8 action_code, u8 dialog_token, | 2519 | const u8 *peer, u8 action_code, u8 dialog_token, |
2491 | u16 status_code, u32 peer_capability, | 2520 | u16 status_code, u32 peer_capability, |
2492 | const u8 *buf, size_t len); | 2521 | const u8 *buf, size_t len); |
2493 | int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev, | 2522 | int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev, |
2494 | u8 *peer, enum nl80211_tdls_operation oper); | 2523 | const u8 *peer, enum nl80211_tdls_operation oper); |
2495 | 2524 | ||
2496 | int (*probe_client)(struct wiphy *wiphy, struct net_device *dev, | 2525 | int (*probe_client)(struct wiphy *wiphy, struct net_device *dev, |
2497 | const u8 *peer, u64 *cookie); | 2526 | const u8 *peer, u64 *cookie); |
@@ -2638,6 +2667,7 @@ struct ieee80211_iface_limit { | |||
2638 | * between infrastructure and AP types must match. This is required | 2667 | * between infrastructure and AP types must match. This is required |
2639 | * only in special cases. | 2668 | * only in special cases. |
2640 | * @radar_detect_widths: bitmap of channel widths supported for radar detection | 2669 | * @radar_detect_widths: bitmap of channel widths supported for radar detection |
2670 | * @radar_detect_regions: bitmap of regions supported for radar detection | ||
2641 | * | 2671 | * |
2642 | * With this structure the driver can describe which interface | 2672 | * With this structure the driver can describe which interface |
2643 | * combinations it supports concurrently. | 2673 | * combinations it supports concurrently. |
@@ -2695,6 +2725,7 @@ struct ieee80211_iface_combination { | |||
2695 | u8 n_limits; | 2725 | u8 n_limits; |
2696 | bool beacon_int_infra_match; | 2726 | bool beacon_int_infra_match; |
2697 | u8 radar_detect_widths; | 2727 | u8 radar_detect_widths; |
2728 | u8 radar_detect_regions; | ||
2698 | }; | 2729 | }; |
2699 | 2730 | ||
2700 | struct ieee80211_txrx_stypes { | 2731 | struct ieee80211_txrx_stypes { |
@@ -2925,6 +2956,17 @@ struct wiphy_vendor_command { | |||
2925 | * (including P2P GO) or 0 to indicate no such limit is advertised. The | 2956 | * (including P2P GO) or 0 to indicate no such limit is advertised. The |
2926 | * driver is allowed to advertise a theoretical limit that it can reach in | 2957 | * driver is allowed to advertise a theoretical limit that it can reach in |
2927 | * some cases, but may not always reach. | 2958 | * some cases, but may not always reach. |
2959 | * | ||
2960 | * @max_num_csa_counters: Number of supported csa_counters in beacons | ||
2961 | * and probe responses. This value should be set if the driver | ||
2962 | * wishes to limit the number of csa counters. Default (0) means | ||
2963 | * infinite. | ||
2964 | * @max_adj_channel_rssi_comp: max offset of between the channel on which the | ||
2965 | * frame was sent and the channel on which the frame was heard for which | ||
2966 | * the reported rssi is still valid. If a driver is able to compensate the | ||
2967 | * low rssi when a frame is heard on different channel, then it should set | ||
2968 | * this variable to the maximal offset for which it can compensate. | ||
2969 | * This value should be set in MHz. | ||
2928 | */ | 2970 | */ |
2929 | struct wiphy { | 2971 | struct wiphy { |
2930 | /* assign these fields before you register the wiphy */ | 2972 | /* assign these fields before you register the wiphy */ |
@@ -3042,6 +3084,9 @@ struct wiphy { | |||
3042 | 3084 | ||
3043 | u16 max_ap_assoc_sta; | 3085 | u16 max_ap_assoc_sta; |
3044 | 3086 | ||
3087 | u8 max_num_csa_counters; | ||
3088 | u8 max_adj_channel_rssi_comp; | ||
3089 | |||
3045 | char priv[0] __aligned(NETDEV_ALIGN); | 3090 | char priv[0] __aligned(NETDEV_ALIGN); |
3046 | }; | 3091 | }; |
3047 | 3092 | ||
@@ -3270,7 +3315,7 @@ struct wireless_dev { | |||
3270 | struct cfg80211_ibss_params ibss; | 3315 | struct cfg80211_ibss_params ibss; |
3271 | struct cfg80211_connect_params connect; | 3316 | struct cfg80211_connect_params connect; |
3272 | struct cfg80211_cached_keys *keys; | 3317 | struct cfg80211_cached_keys *keys; |
3273 | u8 *ie; | 3318 | const u8 *ie; |
3274 | size_t ie_len; | 3319 | size_t ie_len; |
3275 | u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; | 3320 | u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; |
3276 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 3321 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
@@ -3511,7 +3556,8 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, | |||
3511 | * Return: 0 on success, or a negative error code. | 3556 | * Return: 0 on success, or a negative error code. |
3512 | */ | 3557 | */ |
3513 | int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, | 3558 | int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, |
3514 | enum nl80211_iftype iftype, u8 *bssid, bool qos); | 3559 | enum nl80211_iftype iftype, const u8 *bssid, |
3560 | bool qos); | ||
3515 | 3561 | ||
3516 | /** | 3562 | /** |
3517 | * ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame | 3563 | * ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame |
@@ -4312,7 +4358,7 @@ void cfg80211_roamed_bss(struct net_device *dev, struct cfg80211_bss *bss, | |||
4312 | * and not try to connect to any AP any more. | 4358 | * and not try to connect to any AP any more. |
4313 | */ | 4359 | */ |
4314 | void cfg80211_disconnected(struct net_device *dev, u16 reason, | 4360 | void cfg80211_disconnected(struct net_device *dev, u16 reason, |
4315 | u8 *ie, size_t ie_len, gfp_t gfp); | 4361 | const u8 *ie, size_t ie_len, gfp_t gfp); |
4316 | 4362 | ||
4317 | /** | 4363 | /** |
4318 | * cfg80211_ready_on_channel - notification of remain_on_channel start | 4364 | * cfg80211_ready_on_channel - notification of remain_on_channel start |
@@ -4768,6 +4814,35 @@ int cfg80211_iter_combinations(struct wiphy *wiphy, | |||
4768 | void *data), | 4814 | void *data), |
4769 | void *data); | 4815 | void *data); |
4770 | 4816 | ||
4817 | /* | ||
4818 | * cfg80211_stop_iface - trigger interface disconnection | ||
4819 | * | ||
4820 | * @wiphy: the wiphy | ||
4821 | * @wdev: wireless device | ||
4822 | * @gfp: context flags | ||
4823 | * | ||
4824 | * Trigger interface to be stopped as if AP was stopped, IBSS/mesh left, STA | ||
4825 | * disconnected. | ||
4826 | * | ||
4827 | * Note: This doesn't need any locks and is asynchronous. | ||
4828 | */ | ||
4829 | void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, | ||
4830 | gfp_t gfp); | ||
4831 | |||
4832 | /** | ||
4833 | * cfg80211_shutdown_all_interfaces - shut down all interfaces for a wiphy | ||
4834 | * @wiphy: the wiphy to shut down | ||
4835 | * | ||
4836 | * This function shuts down all interfaces belonging to this wiphy by | ||
4837 | * calling dev_close() (and treating non-netdev interfaces as needed). | ||
4838 | * It shouldn't really be used unless there are some fatal device errors | ||
4839 | * that really can't be recovered in any other way. | ||
4840 | * | ||
4841 | * Callers must hold the RTNL and be able to deal with callbacks into | ||
4842 | * the driver while the function is running. | ||
4843 | */ | ||
4844 | void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy); | ||
4845 | |||
4771 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 4846 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
4772 | 4847 | ||
4773 | /* wiphy_printk helpers, similar to dev_printk */ | 4848 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 451c1bf00df9..2c78997bc48d 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -1113,7 +1113,9 @@ enum ieee80211_vif_flags { | |||
1113 | * @addr: address of this interface | 1113 | * @addr: address of this interface |
1114 | * @p2p: indicates whether this AP or STA interface is a p2p | 1114 | * @p2p: indicates whether this AP or STA interface is a p2p |
1115 | * interface, i.e. a GO or p2p-sta respectively | 1115 | * interface, i.e. a GO or p2p-sta respectively |
1116 | * @csa_active: marks whether a channel switch is going on | 1116 | * @csa_active: marks whether a channel switch is going on. Internally it is |
1117 | * write-protected by sdata_lock and local->mtx so holding either is fine | ||
1118 | * for read access. | ||
1117 | * @driver_flags: flags/capabilities the driver has for this interface, | 1119 | * @driver_flags: flags/capabilities the driver has for this interface, |
1118 | * these need to be set (or cleared) when the interface is added | 1120 | * these need to be set (or cleared) when the interface is added |
1119 | * or, if supported by the driver, the interface type is changed | 1121 | * or, if supported by the driver, the interface type is changed |
@@ -1374,6 +1376,7 @@ struct ieee80211_sta_rates { | |||
1374 | * the station moves to associated state. | 1376 | * the station moves to associated state. |
1375 | * @smps_mode: current SMPS mode (off, static or dynamic) | 1377 | * @smps_mode: current SMPS mode (off, static or dynamic) |
1376 | * @rates: rate control selection table | 1378 | * @rates: rate control selection table |
1379 | * @tdls: indicates whether the STA is a TDLS peer | ||
1377 | */ | 1380 | */ |
1378 | struct ieee80211_sta { | 1381 | struct ieee80211_sta { |
1379 | u32 supp_rates[IEEE80211_NUM_BANDS]; | 1382 | u32 supp_rates[IEEE80211_NUM_BANDS]; |
@@ -1388,6 +1391,7 @@ struct ieee80211_sta { | |||
1388 | enum ieee80211_sta_rx_bandwidth bandwidth; | 1391 | enum ieee80211_sta_rx_bandwidth bandwidth; |
1389 | enum ieee80211_smps_mode smps_mode; | 1392 | enum ieee80211_smps_mode smps_mode; |
1390 | struct ieee80211_sta_rates __rcu *rates; | 1393 | struct ieee80211_sta_rates __rcu *rates; |
1394 | bool tdls; | ||
1391 | 1395 | ||
1392 | /* must be last */ | 1396 | /* must be last */ |
1393 | u8 drv_priv[0] __aligned(sizeof(void *)); | 1397 | u8 drv_priv[0] __aligned(sizeof(void *)); |
@@ -2765,6 +2769,10 @@ enum ieee80211_roc_type { | |||
2765 | * information in bss_conf is set up and the beacon can be retrieved. A | 2769 | * information in bss_conf is set up and the beacon can be retrieved. A |
2766 | * channel context is bound before this is called. | 2770 | * channel context is bound before this is called. |
2767 | * @leave_ibss: Leave the IBSS again. | 2771 | * @leave_ibss: Leave the IBSS again. |
2772 | * | ||
2773 | * @get_expected_throughput: extract the expected throughput towards the | ||
2774 | * specified station. The returned value is expressed in Kbps. It returns 0 | ||
2775 | * if the RC algorithm does not have proper data to provide. | ||
2768 | */ | 2776 | */ |
2769 | struct ieee80211_ops { | 2777 | struct ieee80211_ops { |
2770 | void (*tx)(struct ieee80211_hw *hw, | 2778 | void (*tx)(struct ieee80211_hw *hw, |
@@ -2958,6 +2966,7 @@ struct ieee80211_ops { | |||
2958 | 2966 | ||
2959 | int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | 2967 | int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); |
2960 | void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | 2968 | void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); |
2969 | u32 (*get_expected_throughput)(struct ieee80211_sta *sta); | ||
2961 | }; | 2970 | }; |
2962 | 2971 | ||
2963 | /** | 2972 | /** |
@@ -3407,6 +3416,47 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | |||
3407 | */ | 3416 | */ |
3408 | void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); | 3417 | void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); |
3409 | 3418 | ||
3419 | #define IEEE80211_MAX_CSA_COUNTERS_NUM 2 | ||
3420 | |||
3421 | /** | ||
3422 | * struct ieee80211_mutable_offsets - mutable beacon offsets | ||
3423 | * @tim_offset: position of TIM element | ||
3424 | * @tim_length: size of TIM element | ||
3425 | * @csa_counter_offs: array of IEEE80211_MAX_CSA_COUNTERS_NUM offsets | ||
3426 | * to CSA counters. This array can contain zero values which | ||
3427 | * should be ignored. | ||
3428 | */ | ||
3429 | struct ieee80211_mutable_offsets { | ||
3430 | u16 tim_offset; | ||
3431 | u16 tim_length; | ||
3432 | |||
3433 | u16 csa_counter_offs[IEEE80211_MAX_CSA_COUNTERS_NUM]; | ||
3434 | }; | ||
3435 | |||
3436 | /** | ||
3437 | * ieee80211_beacon_get_template - beacon template generation function | ||
3438 | * @hw: pointer obtained from ieee80211_alloc_hw(). | ||
3439 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
3440 | * @offs: &struct ieee80211_mutable_offsets pointer to struct that will | ||
3441 | * receive the offsets that may be updated by the driver. | ||
3442 | * | ||
3443 | * If the driver implements beaconing modes, it must use this function to | ||
3444 | * obtain the beacon template. | ||
3445 | * | ||
3446 | * This function should be used if the beacon frames are generated by the | ||
3447 | * device, and then the driver must use the returned beacon as the template | ||
3448 | * The driver or the device are responsible to update the DTIM and, when | ||
3449 | * applicable, the CSA count. | ||
3450 | * | ||
3451 | * The driver is responsible for freeing the returned skb. | ||
3452 | * | ||
3453 | * Return: The beacon template. %NULL on error. | ||
3454 | */ | ||
3455 | struct sk_buff * | ||
3456 | ieee80211_beacon_get_template(struct ieee80211_hw *hw, | ||
3457 | struct ieee80211_vif *vif, | ||
3458 | struct ieee80211_mutable_offsets *offs); | ||
3459 | |||
3410 | /** | 3460 | /** |
3411 | * ieee80211_beacon_get_tim - beacon generation function | 3461 | * ieee80211_beacon_get_tim - beacon generation function |
3412 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 3462 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
@@ -3418,16 +3468,12 @@ void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); | |||
3418 | * Set to 0 if invalid (in non-AP modes). | 3468 | * Set to 0 if invalid (in non-AP modes). |
3419 | * | 3469 | * |
3420 | * If the driver implements beaconing modes, it must use this function to | 3470 | * If the driver implements beaconing modes, it must use this function to |
3421 | * obtain the beacon frame/template. | 3471 | * obtain the beacon frame. |
3422 | * | 3472 | * |
3423 | * If the beacon frames are generated by the host system (i.e., not in | 3473 | * If the beacon frames are generated by the host system (i.e., not in |
3424 | * hardware/firmware), the driver uses this function to get each beacon | 3474 | * hardware/firmware), the driver uses this function to get each beacon |
3425 | * frame from mac80211 -- it is responsible for calling this function | 3475 | * frame from mac80211 -- it is responsible for calling this function exactly |
3426 | * before the beacon is needed (e.g. based on hardware interrupt). | 3476 | * once before the beacon is needed (e.g. based on hardware interrupt). |
3427 | * | ||
3428 | * If the beacon frames are generated by the device, then the driver | ||
3429 | * must use the returned beacon as the template and change the TIM IE | ||
3430 | * according to the current DTIM parameters/TIM bitmap. | ||
3431 | * | 3477 | * |
3432 | * The driver is responsible for freeing the returned skb. | 3478 | * The driver is responsible for freeing the returned skb. |
3433 | * | 3479 | * |
@@ -3453,6 +3499,20 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
3453 | } | 3499 | } |
3454 | 3500 | ||
3455 | /** | 3501 | /** |
3502 | * ieee80211_csa_update_counter - request mac80211 to decrement the csa counter | ||
3503 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
3504 | * | ||
3505 | * The csa counter should be updated after each beacon transmission. | ||
3506 | * This function is called implicitly when | ||
3507 | * ieee80211_beacon_get/ieee80211_beacon_get_tim are called, however if the | ||
3508 | * beacon frames are generated by the device, the driver should call this | ||
3509 | * function after each beacon transmission to sync mac80211's csa counters. | ||
3510 | * | ||
3511 | * Return: new csa counter value | ||
3512 | */ | ||
3513 | u8 ieee80211_csa_update_counter(struct ieee80211_vif *vif); | ||
3514 | |||
3515 | /** | ||
3456 | * ieee80211_csa_finish - notify mac80211 about channel switch | 3516 | * ieee80211_csa_finish - notify mac80211 about channel switch |
3457 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 3517 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
3458 | * | 3518 | * |
@@ -4480,6 +4540,8 @@ struct rate_control_ops { | |||
4480 | void (*add_sta_debugfs)(void *priv, void *priv_sta, | 4540 | void (*add_sta_debugfs)(void *priv, void *priv_sta, |
4481 | struct dentry *dir); | 4541 | struct dentry *dir); |
4482 | void (*remove_sta_debugfs)(void *priv, void *priv_sta); | 4542 | void (*remove_sta_debugfs)(void *priv, void *priv_sta); |
4543 | |||
4544 | u32 (*get_expected_throughput)(void *priv_sta); | ||
4483 | }; | 4545 | }; |
4484 | 4546 | ||
4485 | static inline int rate_supported(struct ieee80211_sta *sta, | 4547 | static inline int rate_supported(struct ieee80211_sta *sta, |