Commit 4af14dba authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge tag 'mac80211-next-for-net-next-2021-08-20' of...

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/20210820105329.48674-1-johannes@sipsolutions.net


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 0ba218e2 c448f0fd
Loading
Loading
Loading
Loading
+92 −0
Original line number Diff line number Diff line
@@ -1252,6 +1252,27 @@ struct cfg80211_csa_settings {
	u8 count;
};

/**
 * struct cfg80211_color_change_settings - color change settings
 *
 * Used for bss color change
 *
 * @beacon_color_change: beacon data while performing the color countdown
 * @counter_offsets_beacon: offsets of the counters within the beacon (tail)
 * @counter_offsets_presp: offsets of the counters within the probe response
 * @beacon_next: beacon data to be used after the color change
 * @count: number of beacons until the color change
 * @color: the color used after the change
 */
struct cfg80211_color_change_settings {
	struct cfg80211_beacon_data beacon_color_change;
	u16 counter_offset_beacon;
	u16 counter_offset_presp;
	struct cfg80211_beacon_data beacon_next;
	u8 count;
	u8 color;
};

/**
 * struct iface_combination_params - input parameters for interface combinations
 *
@@ -3995,6 +4016,8 @@ struct mgmt_frame_regs {
 *	given TIDs. This callback may sleep.
 *
 * @set_sar_specs: Update the SAR (TX power) settings.
 *
 * @color_change: Initiate a color change.
 */
struct cfg80211_ops {
	int	(*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -4322,6 +4345,9 @@ struct cfg80211_ops {
				    const u8 *peer, u8 tids);
	int	(*set_sar_specs)(struct wiphy *wiphy,
				 struct cfg80211_sar_specs *sar);
	int	(*color_change)(struct wiphy *wiphy,
				struct net_device *dev,
				struct cfg80211_color_change_settings *params);
};

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

/**
 * cfg80211_bss_color_notify - notify about bss color event
 * @dev: network device
 * @gfp: allocation flags
 * @cmd: the actual event we want to notify
 * @count: the number of TBTTs until the color change happens
 * @color_bitmap: representations of the colors that the local BSS is aware of
 */
int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
			      enum nl80211_commands cmd, u8 count,
			      u64 color_bitmap);

/**
 * cfg80211_obss_color_collision_notify - notify about bss color collision
 * @dev: network device
 * @color_bitmap: representations of the colors that the local BSS is aware of
 */
static inline int cfg80211_obss_color_collision_notify(struct net_device *dev,
						       u64 color_bitmap)
{
	return cfg80211_bss_color_notify(dev, GFP_KERNEL,
					 NL80211_CMD_OBSS_COLOR_COLLISION,
					 0, color_bitmap);
}

/**
 * cfg80211_color_change_started_notify - notify color change start
 * @dev: the device on which the color is switched
 * @count: the number of TBTTs until the color change happens
 *
 * Inform the userspace about the color change that has started.
 */
static inline int cfg80211_color_change_started_notify(struct net_device *dev,
						       u8 count)
{
	return cfg80211_bss_color_notify(dev, GFP_KERNEL,
					 NL80211_CMD_COLOR_CHANGE_STARTED,
					 count, 0);
}

/**
 * cfg80211_color_change_aborted_notify - notify color change abort
 * @dev: the device on which the color is switched
 *
 * Inform the userspace about the color change that has aborted.
 */
static inline int cfg80211_color_change_aborted_notify(struct net_device *dev)
{
	return cfg80211_bss_color_notify(dev, GFP_KERNEL,
					 NL80211_CMD_COLOR_CHANGE_ABORTED,
					 0, 0);
}

/**
 * cfg80211_color_change_notify - notify color change completion
 * @dev: the device on which the color was switched
 *
 * Inform the userspace about the color change that has completed.
 */
static inline int cfg80211_color_change_notify(struct net_device *dev)
{
	return cfg80211_bss_color_notify(dev, GFP_KERNEL,
					 NL80211_CMD_COLOR_CHANGE_COMPLETED,
					 0, 0);
}

#endif /* __NET_CFG80211_H */
+5 −0
Original line number Diff line number Diff line
@@ -43,6 +43,11 @@ struct ieee80211_radiotap_header {
	 * @it_present: (first) present word
	 */
	__le32 it_present;

	/**
	 * @it_optional: all remaining presence bitmaps
	 */
	__le32 it_optional[];
} __packed;

/* version is always 0 */
+29 −0
Original line number Diff line number Diff line
@@ -1711,6 +1711,10 @@ enum ieee80211_offload_flags {
 *	protected by fq->lock.
 * @offload_flags: 802.3 -> 802.11 enapsulation offload flags, see
 *	&enum ieee80211_offload_flags.
 * @color_change_active: marks whether a color change is ongoing. Internally it is
 *	write-protected by sdata_lock and local->mtx so holding either is fine
 *	for read access.
 * @color_change_color: the bss color that will be used after the change.
 */
struct ieee80211_vif {
	enum nl80211_iftype type;
@@ -1739,6 +1743,9 @@ struct ieee80211_vif {

	bool txqs_stopped[IEEE80211_NUM_ACS];

	bool color_change_active;
	u8 color_change_color;

	/* must be last */
	u8 drv_priv[] __aligned(sizeof(void *));
};
@@ -5007,6 +5014,16 @@ void ieee80211_csa_finish(struct ieee80211_vif *vif);
 */
bool ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif);

/**
 * ieee80211_color_change_finish - notify mac80211 about color change
 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
 *
 * After a color change announcement was scheduled and the counter in this
 * announcement hits 1, this function must be called by the driver to
 * notify mac80211 that the color can be changed
 */
void ieee80211_color_change_finish(struct ieee80211_vif *vif);

/**
 * ieee80211_proberesp_get - retrieve a Probe Response template
 * @hw: pointer obtained from ieee80211_alloc_hw().
@@ -6771,6 +6788,18 @@ struct sk_buff *
ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw,
					  struct ieee80211_vif *vif);

/**
 * ieeee80211_obss_color_collision_notify - notify userland about a BSS color
 * collision.
 *
 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
 * @color_bitmap: a 64 bit bitmap representing the colors that the local BSS is
 *	aware of.
 */
void
ieeee80211_obss_color_collision_notify(struct ieee80211_vif *vif,
				       u64 color_bitmap);

/**
 * ieee80211_is_tx_data - check if frame is a data frame
 *
+77 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
 * Copyright (C) 2012-2014, 2018-2021 Intel Corporation
 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
 * Copyright (C) 2016-2017 Intel Deutschland GmbH
 */
#ifndef __VENDOR_CMD_INTEL_H__
#define __VENDOR_CMD_INTEL_H__

#define INTEL_OUI	0x001735

/**
 * enum iwl_mvm_vendor_cmd - supported vendor commands
 * @IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO: reports CSME connection info.
 * @IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP: asks for ownership on the device.
 * @IWL_MVM_VENDOR_CMD_ROAMING_FORBIDDEN_EVENT: notifies if roaming is allowed.
 *	It contains a &IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN and a
 *	&IWL_MVM_VENDOR_ATTR_VIF_ADDR attributes.
 */

enum iwl_mvm_vendor_cmd {
	IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO			= 0x2d,
	IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP			= 0x30,
	IWL_MVM_VENDOR_CMD_ROAMING_FORBIDDEN_EVENT		= 0x32,
};

enum iwl_vendor_auth_akm_mode {
	IWL_VENDOR_AUTH_OPEN,
	IWL_VENDOR_AUTH_RSNA = 0x6,
	IWL_VENDOR_AUTH_RSNA_PSK,
	IWL_VENDOR_AUTH_SAE = 0x9,
	IWL_VENDOR_AUTH_MAX,
};

/**
 * enum iwl_mvm_vendor_attr - attributes used in vendor commands
 * @__IWL_MVM_VENDOR_ATTR_INVALID: attribute 0 is invalid
 * @IWL_MVM_VENDOR_ATTR_VIF_ADDR: interface MAC address
 * @IWL_MVM_VENDOR_ATTR_ADDR: MAC address
 * @IWL_MVM_VENDOR_ATTR_SSID: SSID (binary attribute, 0..32 octets)
 * @IWL_MVM_VENDOR_ATTR_STA_CIPHER: the cipher to use for the station with the
 *	mac address specified in &IWL_MVM_VENDOR_ATTR_ADDR.
 * @IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN: u8 attribute. Indicates whether
 *	roaming is forbidden or not. Value 1 means roaming is forbidden,
 *	0 mean roaming is allowed.
 * @IWL_MVM_VENDOR_ATTR_AUTH_MODE: u32 attribute. Authentication mode type
 *	as specified in &enum iwl_vendor_auth_akm_mode.
 * @IWL_MVM_VENDOR_ATTR_CHANNEL_NUM: u8 attribute. Contains channel number.
 * @IWL_MVM_VENDOR_ATTR_BAND: u8 attribute.
 *	0 for 2.4 GHz band, 1 for 5.2GHz band and 2 for 6GHz band.
 * @IWL_MVM_VENDOR_ATTR_COLLOC_CHANNEL: u32 attribute. Channel number of
 *	collocated AP. Relevant for 6GHz AP info.
 * @IWL_MVM_VENDOR_ATTR_COLLOC_ADDR: MAC address of a collocated AP.
 *	Relevant for 6GHz AP info.
 *
 * @NUM_IWL_MVM_VENDOR_ATTR: number of vendor attributes
 * @MAX_IWL_MVM_VENDOR_ATTR: highest vendor attribute number

 */
enum iwl_mvm_vendor_attr {
	__IWL_MVM_VENDOR_ATTR_INVALID				= 0x00,
	IWL_MVM_VENDOR_ATTR_VIF_ADDR				= 0x02,
	IWL_MVM_VENDOR_ATTR_ADDR				= 0x0a,
	IWL_MVM_VENDOR_ATTR_SSID				= 0x3d,
	IWL_MVM_VENDOR_ATTR_STA_CIPHER				= 0x51,
	IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN			= 0x64,
	IWL_MVM_VENDOR_ATTR_AUTH_MODE				= 0x65,
	IWL_MVM_VENDOR_ATTR_CHANNEL_NUM				= 0x66,
	IWL_MVM_VENDOR_ATTR_BAND				= 0x69,
	IWL_MVM_VENDOR_ATTR_COLLOC_CHANNEL			= 0x70,
	IWL_MVM_VENDOR_ATTR_COLLOC_ADDR				= 0x71,

	NUM_IWL_MVM_VENDOR_ATTR,
	MAX_IWL_MVM_VENDOR_ATTR = NUM_IWL_MVM_VENDOR_ATTR - 1,
};

#endif /* __VENDOR_CMD_INTEL_H__ */
+43 −0
Original line number Diff line number Diff line
@@ -1185,6 +1185,21 @@
 *	passed using %NL80211_ATTR_SAR_SPEC. %NL80211_ATTR_WIPHY is used to
 *	specify the wiphy index to be applied to.
 *
 * @NL80211_CMD_OBSS_COLOR_COLLISION: This notification is sent out whenever
 *	mac80211/drv detects a bss color collision.
 *
 * @NL80211_CMD_COLOR_CHANGE_REQUEST: This command is used to indicate that
 *	userspace wants to change the BSS color.
 *
 * @NL80211_CMD_COLOR_CHANGE_STARTED: Notify userland, that a color change has
 *	started
 *
 * @NL80211_CMD_COLOR_CHANGE_ABORTED: Notify userland, that the color change has
 *	been aborted
 *
 * @NL80211_CMD_COLOR_CHANGE_COMPLETED: Notify userland that the color change
 *	has completed
 *
 * @NL80211_CMD_MAX: highest used command number
 * @__NL80211_CMD_AFTER_LAST: internal use
 */
@@ -1417,6 +1432,14 @@ enum nl80211_commands {

	NL80211_CMD_SET_SAR_SPECS,

	NL80211_CMD_OBSS_COLOR_COLLISION,

	NL80211_CMD_COLOR_CHANGE_REQUEST,

	NL80211_CMD_COLOR_CHANGE_STARTED,
	NL80211_CMD_COLOR_CHANGE_ABORTED,
	NL80211_CMD_COLOR_CHANGE_COMPLETED,

	/* add new commands above here */

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

	NL80211_ATTR_DISABLE_HE,

	NL80211_ATTR_OBSS_COLOR_BITMAP,

	NL80211_ATTR_COLOR_CHANGE_COUNT,
	NL80211_ATTR_COLOR_CHANGE_COLOR,
	NL80211_ATTR_COLOR_CHANGE_ELEMS,

	/* add attributes here, update the policy in nl80211.c */

	__NL80211_ATTR_AFTER_LAST,
@@ -5953,6 +5992,9 @@ enum nl80211_feature_flags {
 *      frame protection for all management frames exchanged during the
 *      negotiation and range measurement procedure.
 *
 * @NL80211_EXT_FEATURE_BSS_COLOR: The driver supports BSS color collision
 *	detection and change announcemnts.
 *
 * @NUM_NL80211_EXT_FEATURES: number of extended features.
 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
 */
@@ -6017,6 +6059,7 @@ enum nl80211_ext_feature_index {
	NL80211_EXT_FEATURE_SECURE_LTF,
	NL80211_EXT_FEATURE_SECURE_RTT,
	NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
	NL80211_EXT_FEATURE_BSS_COLOR,

	/* add new features before the definition below */
	NUM_NL80211_EXT_FEATURES,
Loading