Skip to content

Commit 4af14db

Browse files
committed
Merge tag 'mac80211-next-for-net-next-2021-08-20' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Johannes Berg says: ==================== Minor updates: * BSS coloring support * MEI commands for Intel platforms * various fixes/cleanups * tag 'mac80211-next-for-net-next-2021-08-20' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next: cfg80211: fix BSS color notify trace enum confusion mac80211: Fix insufficient headroom issue for AMSDU mac80211: add support for BSS color change nl80211: add support for BSS coloring mac80211: Use flex-array for radiotap header bitmap mac80211: radiotap: Use BIT() instead of shifts mac80211: Remove unnecessary variable and label mac80211: include <linux/rbtree.h> mac80211: Fix monitor MTU limit so that A-MSDUs get through mac80211: remove unnecessary NULL check in ieee80211_register_hw() mac80211: Reject zero MAC address in sta_info_insert_check() nl80211: vendor-cmd: add Intel vendor commands for iwlmei usage ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 0ba218e + c448f0f commit 4af14db

File tree

18 files changed

+764
-63
lines changed

18 files changed

+764
-63
lines changed

include/net/cfg80211.h

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,27 @@ struct cfg80211_csa_settings {
12521252
u8 count;
12531253
};
12541254

1255+
/**
1256+
* struct cfg80211_color_change_settings - color change settings
1257+
*
1258+
* Used for bss color change
1259+
*
1260+
* @beacon_color_change: beacon data while performing the color countdown
1261+
* @counter_offsets_beacon: offsets of the counters within the beacon (tail)
1262+
* @counter_offsets_presp: offsets of the counters within the probe response
1263+
* @beacon_next: beacon data to be used after the color change
1264+
* @count: number of beacons until the color change
1265+
* @color: the color used after the change
1266+
*/
1267+
struct cfg80211_color_change_settings {
1268+
struct cfg80211_beacon_data beacon_color_change;
1269+
u16 counter_offset_beacon;
1270+
u16 counter_offset_presp;
1271+
struct cfg80211_beacon_data beacon_next;
1272+
u8 count;
1273+
u8 color;
1274+
};
1275+
12551276
/**
12561277
* struct iface_combination_params - input parameters for interface combinations
12571278
*
@@ -3995,6 +4016,8 @@ struct mgmt_frame_regs {
39954016
* given TIDs. This callback may sleep.
39964017
*
39974018
* @set_sar_specs: Update the SAR (TX power) settings.
4019+
*
4020+
* @color_change: Initiate a color change.
39984021
*/
39994022
struct cfg80211_ops {
40004023
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -4322,6 +4345,9 @@ struct cfg80211_ops {
43224345
const u8 *peer, u8 tids);
43234346
int (*set_sar_specs)(struct wiphy *wiphy,
43244347
struct cfg80211_sar_specs *sar);
4348+
int (*color_change)(struct wiphy *wiphy,
4349+
struct net_device *dev,
4350+
struct cfg80211_color_change_settings *params);
43254351
};
43264352

43274353
/*
@@ -8218,4 +8244,70 @@ void cfg80211_update_owe_info_event(struct net_device *netdev,
82188244
*/
82198245
void cfg80211_bss_flush(struct wiphy *wiphy);
82208246

8247+
/**
8248+
* cfg80211_bss_color_notify - notify about bss color event
8249+
* @dev: network device
8250+
* @gfp: allocation flags
8251+
* @cmd: the actual event we want to notify
8252+
* @count: the number of TBTTs until the color change happens
8253+
* @color_bitmap: representations of the colors that the local BSS is aware of
8254+
*/
8255+
int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
8256+
enum nl80211_commands cmd, u8 count,
8257+
u64 color_bitmap);
8258+
8259+
/**
8260+
* cfg80211_obss_color_collision_notify - notify about bss color collision
8261+
* @dev: network device
8262+
* @color_bitmap: representations of the colors that the local BSS is aware of
8263+
*/
8264+
static inline int cfg80211_obss_color_collision_notify(struct net_device *dev,
8265+
u64 color_bitmap)
8266+
{
8267+
return cfg80211_bss_color_notify(dev, GFP_KERNEL,
8268+
NL80211_CMD_OBSS_COLOR_COLLISION,
8269+
0, color_bitmap);
8270+
}
8271+
8272+
/**
8273+
* cfg80211_color_change_started_notify - notify color change start
8274+
* @dev: the device on which the color is switched
8275+
* @count: the number of TBTTs until the color change happens
8276+
*
8277+
* Inform the userspace about the color change that has started.
8278+
*/
8279+
static inline int cfg80211_color_change_started_notify(struct net_device *dev,
8280+
u8 count)
8281+
{
8282+
return cfg80211_bss_color_notify(dev, GFP_KERNEL,
8283+
NL80211_CMD_COLOR_CHANGE_STARTED,
8284+
count, 0);
8285+
}
8286+
8287+
/**
8288+
* cfg80211_color_change_aborted_notify - notify color change abort
8289+
* @dev: the device on which the color is switched
8290+
*
8291+
* Inform the userspace about the color change that has aborted.
8292+
*/
8293+
static inline int cfg80211_color_change_aborted_notify(struct net_device *dev)
8294+
{
8295+
return cfg80211_bss_color_notify(dev, GFP_KERNEL,
8296+
NL80211_CMD_COLOR_CHANGE_ABORTED,
8297+
0, 0);
8298+
}
8299+
8300+
/**
8301+
* cfg80211_color_change_notify - notify color change completion
8302+
* @dev: the device on which the color was switched
8303+
*
8304+
* Inform the userspace about the color change that has completed.
8305+
*/
8306+
static inline int cfg80211_color_change_notify(struct net_device *dev)
8307+
{
8308+
return cfg80211_bss_color_notify(dev, GFP_KERNEL,
8309+
NL80211_CMD_COLOR_CHANGE_COMPLETED,
8310+
0, 0);
8311+
}
8312+
82218313
#endif /* __NET_CFG80211_H */

include/net/ieee80211_radiotap.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ struct ieee80211_radiotap_header {
4343
* @it_present: (first) present word
4444
*/
4545
__le32 it_present;
46+
47+
/**
48+
* @it_optional: all remaining presence bitmaps
49+
*/
50+
__le32 it_optional[];
4651
} __packed;
4752

4853
/* version is always 0 */

include/net/mac80211.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,6 +1711,10 @@ enum ieee80211_offload_flags {
17111711
* protected by fq->lock.
17121712
* @offload_flags: 802.3 -> 802.11 enapsulation offload flags, see
17131713
* &enum ieee80211_offload_flags.
1714+
* @color_change_active: marks whether a color change is ongoing. Internally it is
1715+
* write-protected by sdata_lock and local->mtx so holding either is fine
1716+
* for read access.
1717+
* @color_change_color: the bss color that will be used after the change.
17141718
*/
17151719
struct ieee80211_vif {
17161720
enum nl80211_iftype type;
@@ -1739,6 +1743,9 @@ struct ieee80211_vif {
17391743

17401744
bool txqs_stopped[IEEE80211_NUM_ACS];
17411745

1746+
bool color_change_active;
1747+
u8 color_change_color;
1748+
17421749
/* must be last */
17431750
u8 drv_priv[] __aligned(sizeof(void *));
17441751
};
@@ -5007,6 +5014,16 @@ void ieee80211_csa_finish(struct ieee80211_vif *vif);
50075014
*/
50085015
bool ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif);
50095016

5017+
/**
5018+
* ieee80211_color_change_finish - notify mac80211 about color change
5019+
* @vif: &struct ieee80211_vif pointer from the add_interface callback.
5020+
*
5021+
* After a color change announcement was scheduled and the counter in this
5022+
* announcement hits 1, this function must be called by the driver to
5023+
* notify mac80211 that the color can be changed
5024+
*/
5025+
void ieee80211_color_change_finish(struct ieee80211_vif *vif);
5026+
50105027
/**
50115028
* ieee80211_proberesp_get - retrieve a Probe Response template
50125029
* @hw: pointer obtained from ieee80211_alloc_hw().
@@ -6771,6 +6788,18 @@ struct sk_buff *
67716788
ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw,
67726789
struct ieee80211_vif *vif);
67736790

6791+
/**
6792+
* ieeee80211_obss_color_collision_notify - notify userland about a BSS color
6793+
* collision.
6794+
*
6795+
* @vif: &struct ieee80211_vif pointer from the add_interface callback.
6796+
* @color_bitmap: a 64 bit bitmap representing the colors that the local BSS is
6797+
* aware of.
6798+
*/
6799+
void
6800+
ieeee80211_obss_color_collision_notify(struct ieee80211_vif *vif,
6801+
u64 color_bitmap);
6802+
67746803
/**
67756804
* ieee80211_is_tx_data - check if frame is a data frame
67766805
*
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+
/*
3+
* Copyright (C) 2012-2014, 2018-2021 Intel Corporation
4+
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5+
* Copyright (C) 2016-2017 Intel Deutschland GmbH
6+
*/
7+
#ifndef __VENDOR_CMD_INTEL_H__
8+
#define __VENDOR_CMD_INTEL_H__
9+
10+
#define INTEL_OUI 0x001735
11+
12+
/**
13+
* enum iwl_mvm_vendor_cmd - supported vendor commands
14+
* @IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO: reports CSME connection info.
15+
* @IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP: asks for ownership on the device.
16+
* @IWL_MVM_VENDOR_CMD_ROAMING_FORBIDDEN_EVENT: notifies if roaming is allowed.
17+
* It contains a &IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN and a
18+
* &IWL_MVM_VENDOR_ATTR_VIF_ADDR attributes.
19+
*/
20+
21+
enum iwl_mvm_vendor_cmd {
22+
IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO = 0x2d,
23+
IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP = 0x30,
24+
IWL_MVM_VENDOR_CMD_ROAMING_FORBIDDEN_EVENT = 0x32,
25+
};
26+
27+
enum iwl_vendor_auth_akm_mode {
28+
IWL_VENDOR_AUTH_OPEN,
29+
IWL_VENDOR_AUTH_RSNA = 0x6,
30+
IWL_VENDOR_AUTH_RSNA_PSK,
31+
IWL_VENDOR_AUTH_SAE = 0x9,
32+
IWL_VENDOR_AUTH_MAX,
33+
};
34+
35+
/**
36+
* enum iwl_mvm_vendor_attr - attributes used in vendor commands
37+
* @__IWL_MVM_VENDOR_ATTR_INVALID: attribute 0 is invalid
38+
* @IWL_MVM_VENDOR_ATTR_VIF_ADDR: interface MAC address
39+
* @IWL_MVM_VENDOR_ATTR_ADDR: MAC address
40+
* @IWL_MVM_VENDOR_ATTR_SSID: SSID (binary attribute, 0..32 octets)
41+
* @IWL_MVM_VENDOR_ATTR_STA_CIPHER: the cipher to use for the station with the
42+
* mac address specified in &IWL_MVM_VENDOR_ATTR_ADDR.
43+
* @IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN: u8 attribute. Indicates whether
44+
* roaming is forbidden or not. Value 1 means roaming is forbidden,
45+
* 0 mean roaming is allowed.
46+
* @IWL_MVM_VENDOR_ATTR_AUTH_MODE: u32 attribute. Authentication mode type
47+
* as specified in &enum iwl_vendor_auth_akm_mode.
48+
* @IWL_MVM_VENDOR_ATTR_CHANNEL_NUM: u8 attribute. Contains channel number.
49+
* @IWL_MVM_VENDOR_ATTR_BAND: u8 attribute.
50+
* 0 for 2.4 GHz band, 1 for 5.2GHz band and 2 for 6GHz band.
51+
* @IWL_MVM_VENDOR_ATTR_COLLOC_CHANNEL: u32 attribute. Channel number of
52+
* collocated AP. Relevant for 6GHz AP info.
53+
* @IWL_MVM_VENDOR_ATTR_COLLOC_ADDR: MAC address of a collocated AP.
54+
* Relevant for 6GHz AP info.
55+
*
56+
* @NUM_IWL_MVM_VENDOR_ATTR: number of vendor attributes
57+
* @MAX_IWL_MVM_VENDOR_ATTR: highest vendor attribute number
58+
59+
*/
60+
enum iwl_mvm_vendor_attr {
61+
__IWL_MVM_VENDOR_ATTR_INVALID = 0x00,
62+
IWL_MVM_VENDOR_ATTR_VIF_ADDR = 0x02,
63+
IWL_MVM_VENDOR_ATTR_ADDR = 0x0a,
64+
IWL_MVM_VENDOR_ATTR_SSID = 0x3d,
65+
IWL_MVM_VENDOR_ATTR_STA_CIPHER = 0x51,
66+
IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN = 0x64,
67+
IWL_MVM_VENDOR_ATTR_AUTH_MODE = 0x65,
68+
IWL_MVM_VENDOR_ATTR_CHANNEL_NUM = 0x66,
69+
IWL_MVM_VENDOR_ATTR_BAND = 0x69,
70+
IWL_MVM_VENDOR_ATTR_COLLOC_CHANNEL = 0x70,
71+
IWL_MVM_VENDOR_ATTR_COLLOC_ADDR = 0x71,
72+
73+
NUM_IWL_MVM_VENDOR_ATTR,
74+
MAX_IWL_MVM_VENDOR_ATTR = NUM_IWL_MVM_VENDOR_ATTR - 1,
75+
};
76+
77+
#endif /* __VENDOR_CMD_INTEL_H__ */

include/uapi/linux/nl80211.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,21 @@
11851185
* passed using %NL80211_ATTR_SAR_SPEC. %NL80211_ATTR_WIPHY is used to
11861186
* specify the wiphy index to be applied to.
11871187
*
1188+
* @NL80211_CMD_OBSS_COLOR_COLLISION: This notification is sent out whenever
1189+
* mac80211/drv detects a bss color collision.
1190+
*
1191+
* @NL80211_CMD_COLOR_CHANGE_REQUEST: This command is used to indicate that
1192+
* userspace wants to change the BSS color.
1193+
*
1194+
* @NL80211_CMD_COLOR_CHANGE_STARTED: Notify userland, that a color change has
1195+
* started
1196+
*
1197+
* @NL80211_CMD_COLOR_CHANGE_ABORTED: Notify userland, that the color change has
1198+
* been aborted
1199+
*
1200+
* @NL80211_CMD_COLOR_CHANGE_COMPLETED: Notify userland that the color change
1201+
* has completed
1202+
*
11881203
* @NL80211_CMD_MAX: highest used command number
11891204
* @__NL80211_CMD_AFTER_LAST: internal use
11901205
*/
@@ -1417,6 +1432,14 @@ enum nl80211_commands {
14171432

14181433
NL80211_CMD_SET_SAR_SPECS,
14191434

1435+
NL80211_CMD_OBSS_COLOR_COLLISION,
1436+
1437+
NL80211_CMD_COLOR_CHANGE_REQUEST,
1438+
1439+
NL80211_CMD_COLOR_CHANGE_STARTED,
1440+
NL80211_CMD_COLOR_CHANGE_ABORTED,
1441+
NL80211_CMD_COLOR_CHANGE_COMPLETED,
1442+
14201443
/* add new commands above here */
14211444

14221445
/* used to define NL80211_CMD_MAX below */
@@ -2560,6 +2583,16 @@ enum nl80211_commands {
25602583
* disassoc events to indicate that an immediate reconnect to the AP
25612584
* is desired.
25622585
*
2586+
* @NL80211_ATTR_OBSS_COLOR_BITMAP: bitmap of the u64 BSS colors for the
2587+
* %NL80211_CMD_OBSS_COLOR_COLLISION event.
2588+
*
2589+
* @NL80211_ATTR_COLOR_CHANGE_COUNT: u8 attribute specifying the number of TBTT's
2590+
* until the color switch event.
2591+
* @NL80211_ATTR_COLOR_CHANGE_COLOR: u8 attribute specifying the color that we are
2592+
* switching to
2593+
* @NL80211_ATTR_COLOR_CHANGE_ELEMS: Nested set of attributes containing the IE
2594+
* information for the time while performing a color switch.
2595+
*
25632596
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
25642597
* @NL80211_ATTR_MAX: highest attribute number currently defined
25652598
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3057,6 +3090,12 @@ enum nl80211_attrs {
30573090

30583091
NL80211_ATTR_DISABLE_HE,
30593092

3093+
NL80211_ATTR_OBSS_COLOR_BITMAP,
3094+
3095+
NL80211_ATTR_COLOR_CHANGE_COUNT,
3096+
NL80211_ATTR_COLOR_CHANGE_COLOR,
3097+
NL80211_ATTR_COLOR_CHANGE_ELEMS,
3098+
30603099
/* add attributes here, update the policy in nl80211.c */
30613100

30623101
__NL80211_ATTR_AFTER_LAST,
@@ -5953,6 +5992,9 @@ enum nl80211_feature_flags {
59535992
* frame protection for all management frames exchanged during the
59545993
* negotiation and range measurement procedure.
59555994
*
5995+
* @NL80211_EXT_FEATURE_BSS_COLOR: The driver supports BSS color collision
5996+
* detection and change announcemnts.
5997+
*
59565998
* @NUM_NL80211_EXT_FEATURES: number of extended features.
59575999
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
59586000
*/
@@ -6017,6 +6059,7 @@ enum nl80211_ext_feature_index {
60176059
NL80211_EXT_FEATURE_SECURE_LTF,
60186060
NL80211_EXT_FEATURE_SECURE_RTT,
60196061
NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
6062+
NL80211_EXT_FEATURE_BSS_COLOR,
60206063

60216064
/* add new features before the definition below */
60226065
NUM_NL80211_EXT_FEATURES,

0 commit comments

Comments
 (0)