Commit 33182810 authored by Alon Giladi's avatar Alon Giladi Committed by Johannes Berg
Browse files

wifi: iwlwifi: Add support for fragmented pnvm images

parent f6fa5835
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -323,6 +323,7 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;
 *	is supported.
 * @IWL_UCODE_TLV_CAPA_BT_COEX_RRC: supports BT Coex RRC
 * @IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT: supports gscan (no longer used)
 * @IWL_UCODE_TLV_CAPA_FRAGMENTED_PNVM_IMG: supports fragmented PNVM image
 * @IWL_UCODE_TLV_CAPA_SOC_LATENCY_SUPPORT: the firmware supports setting
 *	stabilization latency for SoCs.
 * @IWL_UCODE_TLV_CAPA_STA_PM_NOTIF: firmware will send STA PM notification
@@ -398,6 +399,7 @@ enum iwl_ucode_tlv_capa {
	IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT		= (__force iwl_ucode_tlv_capa_t)31,

	/* set 1 */
	IWL_UCODE_TLV_CAPA_FRAGMENTED_PNVM_IMG		= (__force iwl_ucode_tlv_capa_t)32,
	IWL_UCODE_TLV_CAPA_SOC_LATENCY_SUPPORT		= (__force iwl_ucode_tlv_capa_t)37,
	IWL_UCODE_TLV_CAPA_STA_PM_NOTIF			= (__force iwl_ucode_tlv_capa_t)38,
	IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT		= (__force iwl_ucode_tlv_capa_t)39,
+4 −3
Original line number Diff line number Diff line
@@ -271,7 +271,8 @@ static u8 *iwl_get_pnvm_image(struct iwl_trans *trans_p, size_t *len)
}

int iwl_pnvm_load(struct iwl_trans *trans,
		  struct iwl_notif_wait_data *notif_wait)
		  struct iwl_notif_wait_data *notif_wait,
		  const struct iwl_ucode_capabilities *capa)
{
	u8 *data;
	size_t length;
@@ -303,7 +304,7 @@ int iwl_pnvm_load(struct iwl_trans *trans,
			goto reduce_tables;
		}

		ret = iwl_trans_load_pnvm(trans, &pnvm_data);
		ret = iwl_trans_load_pnvm(trans, &pnvm_data, capa);
		/* can only free data after pvnm_data use, but
		 * pnvm_data.version used below is not a pointer
		 */
@@ -314,7 +315,7 @@ int iwl_pnvm_load(struct iwl_trans *trans,
			 pnvm_data.version);
	}

	iwl_trans_set_pnvm(trans);
	iwl_trans_set_pnvm(trans, capa);

reduce_tables:
	/* now try to get the reduce power table, if not loaded yet */
+3 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/******************************************************************************
 *
 * Copyright(c) 2020-2021 Intel Corporation
 * Copyright(c) 2020-2022 Intel Corporation
 *
 *****************************************************************************/

@@ -15,7 +15,8 @@
#define MAX_PNVM_NAME  64

int iwl_pnvm_load(struct iwl_trans *trans,
		  struct iwl_notif_wait_data *notif_wait);
		  struct iwl_notif_wait_data *notif_wait,
		  const struct iwl_ucode_capabilities *capa);

static inline
void iwl_pnvm_get_fs_name(struct iwl_trans *trans,
+4 −2
Original line number Diff line number Diff line
@@ -280,8 +280,10 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
void iwl_pcie_ctxt_info_gen3_free(struct iwl_trans *trans, bool alive);

int iwl_trans_pcie_ctx_info_gen3_load_pnvm(struct iwl_trans *trans,
					   const struct iwl_pnvm_image *pnvm_payloads);
void iwl_trans_pcie_ctx_info_gen3_set_pnvm(struct iwl_trans *trans);
					   const struct iwl_pnvm_image *pnvm_payloads,
					   const struct iwl_ucode_capabilities *capa);
void iwl_trans_pcie_ctx_info_gen3_set_pnvm(struct iwl_trans *trans,
					   const struct iwl_ucode_capabilities *capa);
int iwl_trans_pcie_ctx_info_gen3_set_reduce_power(struct iwl_trans *trans,
						  const void *data, u32 len);
int iwl_trans_pcie_ctx_info_gen3_set_step(struct iwl_trans *trans,
+10 −6
Original line number Diff line number Diff line
@@ -634,8 +634,10 @@ struct iwl_trans_ops {
	void (*debugfs_cleanup)(struct iwl_trans *trans);
	void (*sync_nmi)(struct iwl_trans *trans);
	int (*load_pnvm)(struct iwl_trans *trans,
			 const struct iwl_pnvm_image *pnvm_payloads);
	void (*set_pnvm)(struct iwl_trans *trans);
			 const struct iwl_pnvm_image *pnvm_payloads,
			 const struct iwl_ucode_capabilities *capa);
	void (*set_pnvm)(struct iwl_trans *trans,
			 const struct iwl_ucode_capabilities *capa);
	int (*set_reduce_power)(struct iwl_trans *trans,
				const void *data, u32 len);
	void (*interrupts)(struct iwl_trans *trans, bool enable);
@@ -1539,15 +1541,17 @@ void iwl_trans_sync_nmi_with_addr(struct iwl_trans *trans, u32 inta_addr,
				  u32 sw_err_bit);

static inline int iwl_trans_load_pnvm(struct iwl_trans *trans,
				      const struct iwl_pnvm_image *pnvm_data)
				      const struct iwl_pnvm_image *pnvm_data,
				      const struct iwl_ucode_capabilities *capa)
{
	return trans->ops->load_pnvm(trans, pnvm_data);
	return trans->ops->load_pnvm(trans, pnvm_data, capa);
}

static inline void iwl_trans_set_pnvm(struct iwl_trans *trans)
static inline void iwl_trans_set_pnvm(struct iwl_trans *trans,
				      const struct iwl_ucode_capabilities *capa)
{
	if (trans->ops->set_pnvm)
		trans->ops->set_pnvm(trans);
		trans->ops->set_pnvm(trans, capa);
}

static inline int iwl_trans_set_reduce_power(struct iwl_trans *trans,
Loading