Commit 7d528eaf authored by Johannes Berg's avatar Johannes Berg
Browse files

Revert "wifi: iwlwifi: update response for mcc_update command"



This reverts commit b70813e4 ("wifi: iwlwifi: update response
for mcc_update command") since it causes a merge conflict, and it
seems easier to redo the patch later.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 8b4580ab
Loading
Loading
Loading
Loading
+2 −33
Original line number Diff line number Diff line
@@ -322,7 +322,7 @@ struct iwl_mcc_update_resp_v3 {
} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_3 */

/**
 * struct iwl_mcc_update_resp_v4 - response to MCC_UPDATE_CMD.
 * struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
 * Contains the new channel control profile map, if changed, and the new MCC
 * (mobile country code).
 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
@@ -338,7 +338,7 @@ struct iwl_mcc_update_resp_v3 {
 * @channels: channel control data map, DWORD for each channel. Only the first
 *	16bits are used.
 */
struct iwl_mcc_update_resp_v4 {
struct iwl_mcc_update_resp {
	__le32 status;
	__le16 mcc;
	__le16 cap;
@@ -350,37 +350,6 @@ struct iwl_mcc_update_resp_v4 {
	__le32 channels[];
} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_4 */

/**
 * struct iwl_mcc_update_resp_v8 - response to MCC_UPDATE_CMD.
 * Contains the new channel control profile map, if changed, and the new MCC
 * (mobile country code).
 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
 * @status: see &enum iwl_mcc_update_status
 * @mcc: the new applied MCC
 * @padding: padding for 2 bytes.
 * @cap: capabilities for all channels which matches the MCC
 * @time: time elapsed from the MCC test start (in units of 30 seconds)
 * @geo_info: geographic specific profile information
 *     see &enum iwl_geo_information.
 * @source_id: the MCC source, see iwl_mcc_source
 * @reserved: for four bytes alignment.
 * @n_channels: number of channels in @channels_data.
 * @channels: channel control data map, DWORD for each channel. Only the first
 *     16bits are used.
 */
struct iwl_mcc_update_resp_v8 {
	__le32 status;
	__le16 mcc;
	u8 padding[2];
	__le32 cap;
	__le16 time;
	__le16 geo_info;
	u8 source_id;
	u8 reserved[3];
	__le32 n_channels;
	__le32 channels[];
} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_8 */

/**
 * struct iwl_mcc_chub_notif - chub notifies of mcc change
 * (MCC_CHUB_UPDATE_CMD = 0xc9)
+38 −79
Original line number Diff line number Diff line
@@ -173,34 +173,34 @@ enum iwl_nvm_channel_flags {
};

/**
 * enum iwl_reg_capa_flags_v1 - global flags applied for the whole regulatory
 * enum iwl_reg_capa_flags - global flags applied for the whole regulatory
 * domain.
 * @REG_CAPA_V1_BF_CCD_LOW_BAND: Beam-forming or Cyclic Delay Diversity in the
 * @REG_CAPA_BF_CCD_LOW_BAND: Beam-forming or Cyclic Delay Diversity in the
 *	2.4Ghz band is allowed.
 * @REG_CAPA_V1_BF_CCD_HIGH_BAND: Beam-forming or Cyclic Delay Diversity in the
 * @REG_CAPA_BF_CCD_HIGH_BAND: Beam-forming or Cyclic Delay Diversity in the
 *	5Ghz band is allowed.
 * @REG_CAPA_V1_160MHZ_ALLOWED: 11ac channel with a width of 160Mhz is allowed
 * @REG_CAPA_160MHZ_ALLOWED: 11ac channel with a width of 160Mhz is allowed
 *	for this regulatory domain (valid only in 5Ghz).
 * @REG_CAPA_V1_80MHZ_ALLOWED: 11ac channel with a width of 80Mhz is allowed
 * @REG_CAPA_80MHZ_ALLOWED: 11ac channel with a width of 80Mhz is allowed
 *	for this regulatory domain (valid only in 5Ghz).
 * @REG_CAPA_V1_MCS_8_ALLOWED: 11ac with MCS 8 is allowed.
 * @REG_CAPA_V1_MCS_9_ALLOWED: 11ac with MCS 9 is allowed.
 * @REG_CAPA_V1_40MHZ_FORBIDDEN: 11n channel with a width of 40Mhz is forbidden
 * @REG_CAPA_MCS_8_ALLOWED: 11ac with MCS 8 is allowed.
 * @REG_CAPA_MCS_9_ALLOWED: 11ac with MCS 9 is allowed.
 * @REG_CAPA_40MHZ_FORBIDDEN: 11n channel with a width of 40Mhz is forbidden
 *	for this regulatory domain (valid only in 5Ghz).
 * @REG_CAPA_V1_DC_HIGH_ENABLED: DC HIGH allowed.
 * @REG_CAPA_V1_11AX_DISABLED: 11ax is forbidden for this regulatory domain.
 * @REG_CAPA_DC_HIGH_ENABLED: DC HIGH allowed.
 * @REG_CAPA_11AX_DISABLED: 11ax is forbidden for this regulatory domain.
 */
enum iwl_reg_capa_flags_v1 {
	REG_CAPA_V1_BF_CCD_LOW_BAND	= BIT(0),
	REG_CAPA_V1_BF_CCD_HIGH_BAND	= BIT(1),
	REG_CAPA_V1_160MHZ_ALLOWED	= BIT(2),
	REG_CAPA_V1_80MHZ_ALLOWED	= BIT(3),
	REG_CAPA_V1_MCS_8_ALLOWED	= BIT(4),
	REG_CAPA_V1_MCS_9_ALLOWED	= BIT(5),
	REG_CAPA_V1_40MHZ_FORBIDDEN	= BIT(7),
	REG_CAPA_V1_DC_HIGH_ENABLED	= BIT(9),
	REG_CAPA_V1_11AX_DISABLED	= BIT(10),
}; /* GEO_CHANNEL_CAPABILITIES_API_S_VER_1 */
enum iwl_reg_capa_flags {
	REG_CAPA_BF_CCD_LOW_BAND	= BIT(0),
	REG_CAPA_BF_CCD_HIGH_BAND	= BIT(1),
	REG_CAPA_160MHZ_ALLOWED		= BIT(2),
	REG_CAPA_80MHZ_ALLOWED		= BIT(3),
	REG_CAPA_MCS_8_ALLOWED		= BIT(4),
	REG_CAPA_MCS_9_ALLOWED		= BIT(5),
	REG_CAPA_40MHZ_FORBIDDEN	= BIT(7),
	REG_CAPA_DC_HIGH_ENABLED	= BIT(9),
	REG_CAPA_11AX_DISABLED		= BIT(10),
};

/**
 * enum iwl_reg_capa_flags_v2 - global flags applied for the whole regulatory
@@ -234,31 +234,7 @@ enum iwl_reg_capa_flags_v2 {
	REG_CAPA_V2_WEATHER_DISABLED	= BIT(7),
	REG_CAPA_V2_40MHZ_ALLOWED	= BIT(8),
	REG_CAPA_V2_11AX_DISABLED	= BIT(10),
}; /* GEO_CHANNEL_CAPABILITIES_API_S_VER_2 */

/**
 * enum iwl_reg_capa_flags_v4 - global flags applied for the whole regulatory
 * domain.
 * @REG_CAPA_V4_160MHZ_ALLOWED: 11ac channel with a width of 160Mhz is allowed
 *	for this regulatory domain (valid only in 5Ghz).
 * @REG_CAPA_V4_80MHZ_ALLOWED: 11ac channel with a width of 80Mhz is allowed
 *	for this regulatory domain (valid only in 5Ghz).
 * @REG_CAPA_V4_MCS_12_ALLOWED: 11ac with MCS 12 is allowed.
 * @REG_CAPA_V4_MCS_13_ALLOWED: 11ac with MCS 13 is allowed.
 * @REG_CAPA_V4_11BE_DISABLED: 11be is forbidden for this regulatory domain.
 * @REG_CAPA_V4_11AX_DISABLED: 11ax is forbidden for this regulatory domain.
 * @REG_CAPA_V4_320MHZ_ALLOWED: 11be channel with a width of 320Mhz is allowed
 *	for this regulatory domain (valid only in 5GHz).
 */
enum iwl_reg_capa_flags_v4 {
	REG_CAPA_V4_160MHZ_ALLOWED		= BIT(3),
	REG_CAPA_V4_80MHZ_ALLOWED		= BIT(4),
	REG_CAPA_V4_MCS_12_ALLOWED		= BIT(5),
	REG_CAPA_V4_MCS_13_ALLOWED		= BIT(6),
	REG_CAPA_V4_11BE_DISABLED		= BIT(8),
	REG_CAPA_V4_11AX_DISABLED		= BIT(13),
	REG_CAPA_V4_320MHZ_ALLOWED		= BIT(16),
}; /* GEO_CHANNEL_CAPABILITIES_API_S_VER_4 */
};

/*
* API v2 for reg_capa_flags is relevant from version 6 and onwards of the
@@ -266,33 +242,23 @@ enum iwl_reg_capa_flags_v4 {
*/
#define REG_CAPA_V2_RESP_VER	6

/* API v4 for reg_capa_flags is relevant from version 8 and onwards of the
 * MCC update command response.
 */
#define REG_CAPA_V4_RESP_VER	8

/**
 * struct iwl_reg_capa - struct for global regulatory capabilities, Used for
 * handling the different APIs of reg_capa_flags.
 *
 * @allow_40mhz: 11n channel with a width of 40Mhz is allowed
 *	for this regulatory domain.
 *	for this regulatory domain (valid only in 5Ghz).
 * @allow_80mhz: 11ac channel with a width of 80Mhz is allowed
 *	for this regulatory domain (valid only in 5 and 6 Ghz).
 *	for this regulatory domain (valid only in 5Ghz).
 * @allow_160mhz: 11ac channel with a width of 160Mhz is allowed
 *	for this regulatory domain (valid only in 5 and 6 Ghz).
 * @allow_320mhz: 11be channel with a width of 320Mhz is allowed
 *	for this regulatory domain (valid only in 6 Ghz).
 *	for this regulatory domain (valid only in 5Ghz).
 * @disable_11ax: 11ax is forbidden for this regulatory domain.
 * @disable_11be: 11be is forbidden for this regulatory domain.
 */
struct iwl_reg_capa {
	bool allow_40mhz;
	bool allow_80mhz;
	bool allow_160mhz;
	bool allow_320mhz;
	bool disable_11ax;
	bool disable_11be;
	u16 allow_40mhz;
	u16 allow_80mhz;
	u16 allow_160mhz;
	u16 disable_11ax;
};

static inline void iwl_nvm_print_channel_flags(struct device *dev, u32 level,
@@ -1572,27 +1538,20 @@ static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan,
	return flags;
}

static struct iwl_reg_capa iwl_get_reg_capa(u32 flags, u8 resp_ver)
static struct iwl_reg_capa iwl_get_reg_capa(u16 flags, u8 resp_ver)
{
	struct iwl_reg_capa reg_capa = {};

	if (resp_ver >= REG_CAPA_V4_RESP_VER) {
		reg_capa.allow_40mhz = true;
		reg_capa.allow_80mhz = flags & REG_CAPA_V4_80MHZ_ALLOWED;
		reg_capa.allow_160mhz = flags & REG_CAPA_V4_160MHZ_ALLOWED;
		reg_capa.allow_320mhz = flags & REG_CAPA_V4_320MHZ_ALLOWED;
		reg_capa.disable_11ax = flags & REG_CAPA_V4_11AX_DISABLED;
		reg_capa.disable_11be = flags & REG_CAPA_V4_11BE_DISABLED;
	} else if (resp_ver >= REG_CAPA_V2_RESP_VER) {
	struct iwl_reg_capa reg_capa;

	if (resp_ver >= REG_CAPA_V2_RESP_VER) {
		reg_capa.allow_40mhz = flags & REG_CAPA_V2_40MHZ_ALLOWED;
		reg_capa.allow_80mhz = flags & REG_CAPA_V2_80MHZ_ALLOWED;
		reg_capa.allow_160mhz = flags & REG_CAPA_V2_160MHZ_ALLOWED;
		reg_capa.disable_11ax = flags & REG_CAPA_V2_11AX_DISABLED;
	} else {
		reg_capa.allow_40mhz = !(flags & REG_CAPA_V1_40MHZ_FORBIDDEN);
		reg_capa.allow_80mhz = flags & REG_CAPA_V1_80MHZ_ALLOWED;
		reg_capa.allow_160mhz = flags & REG_CAPA_V1_160MHZ_ALLOWED;
		reg_capa.disable_11ax = flags & REG_CAPA_V1_11AX_DISABLED;
		reg_capa.allow_40mhz = !(flags & REG_CAPA_40MHZ_FORBIDDEN);
		reg_capa.allow_80mhz = flags & REG_CAPA_80MHZ_ALLOWED;
		reg_capa.allow_160mhz = flags & REG_CAPA_160MHZ_ALLOWED;
		reg_capa.disable_11ax = flags & REG_CAPA_11AX_DISABLED;
	}
	return reg_capa;
}
@@ -1600,7 +1559,7 @@ static struct iwl_reg_capa iwl_get_reg_capa(u32 flags, u8 resp_ver)
struct ieee80211_regdomain *
iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
		       int num_of_ch, __le32 *channels, u16 fw_mcc,
		       u16 geo_info, u32 cap, u8 resp_ver)
		       u16 geo_info, u16 cap, u8 resp_ver)
{
	int ch_idx;
	u16 ch_flags;
+2 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
 * Copyright (C) 2005-2015, 2018-2022 Intel Corporation
 * Copyright (C) 2005-2015, 2018-2021 Intel Corporation
 * Copyright (C) 2016-2017 Intel Deutschland GmbH
 */
#ifndef __iwl_nvm_parse_h__
@@ -50,7 +50,7 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
struct ieee80211_regdomain *
iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
		       int num_of_ch, __le32 *channels, u16 fw_mcc,
		       u16 geo_info, u32 cap, u8 resp_ver);
		       u16 geo_info, u16 cap, u8 resp_ver);

/**
 * struct iwl_nvm_section - describes an NVM section in memory.
+2 −2
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy,
	struct ieee80211_regdomain *regd = NULL;
	struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
	struct iwl_mcc_update_resp_v8 *resp;
	struct iwl_mcc_update_resp *resp;
	u8 resp_ver;

	IWL_DEBUG_LAR(mvm, "Getting regdomain data for %s from FW\n", alpha2);
@@ -138,7 +138,7 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy,
				      resp->channels,
				      __le16_to_cpu(resp->mcc),
				      __le16_to_cpu(resp->geo_info),
				      le32_to_cpu(resp->cap), resp_ver);
				      __le16_to_cpu(resp->cap), resp_ver);
	/* Store the return source id */
	src_id = resp->source_id;
	if (IS_ERR_OR_NULL(regd)) {
+1 −1
Original line number Diff line number Diff line
@@ -2219,7 +2219,7 @@ static inline void iwl_mvm_vendor_cmds_register(struct iwl_mvm *mvm) {}
#endif

/* Location Aware Regulatory */
struct iwl_mcc_update_resp_v8 *
struct iwl_mcc_update_resp *
iwl_mvm_update_mcc(struct iwl_mvm *mvm, const char *alpha2,
		   enum iwl_mcc_source src_id);
int iwl_mvm_init_mcc(struct iwl_mvm *mvm);
Loading