Commit d5861378 authored by Johannes Berg's avatar Johannes Berg Committed by Miri Korenblit
Browse files

wifi: iwlwifi: trans: collect device information



Add a new device information 'info' substruct to the transport
that's const and can only be set by a special helper, and move
some information there.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250503224232.cd80cb55403c.Ic18524b66d655fad734bf97192a54d9cfa9fdf1f@changeid
parent d43c01d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -746,7 +746,7 @@ static int iwl_nvm_is_otp(struct iwl_trans *trans)
	u32 otpgp;

	/* OTP only valid for CP/PP and after */
	switch (trans->hw_rev & CSR_HW_REV_TYPE_MSK) {
	switch (trans->info.hw_rev & CSR_HW_REV_TYPE_MSK) {
	case CSR_HW_REV_TYPE_NONE:
		IWL_ERR(trans, "Unknown hardware type\n");
		return -EIO;
+2 −2
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
	ieee80211_hw_set(hw, SUPPORT_FAST_XMIT);
	ieee80211_hw_set(hw, WANT_MONITOR_VIF);

	if (priv->trans->max_skb_frags)
	if (priv->trans->info.max_skb_frags)
		hw->netdev_features = NETIF_F_HIGHDMA | NETIF_F_SG;

	hw->offchannel_tx_hw_queue = IWL_AUX_QUEUE;
@@ -188,7 +188,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
		priv->hw->wiphy->bands[NL80211_BAND_5GHZ] =
			&priv->nvm_data->bands[NL80211_BAND_5GHZ];

	hw->wiphy->hw_version = priv->trans->hw_id;
	hw->wiphy->hw_version = priv->trans->info.hw_id;

	iwl_leds_init(priv);

+4 −3
Original line number Diff line number Diff line
@@ -1248,7 +1248,8 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
	 ************************/
	hw = iwl_alloc_all();
	if (!hw) {
		pr_err("%s: Cannot allocate network device\n", trans->name);
		pr_err("%s: Cannot allocate network device\n",
		       trans->info.name);
		err = -ENOMEM;
		goto out;
	}
@@ -1378,7 +1379,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
	 * 2. Read REV register
	 ***********************/
	IWL_INFO(priv, "Detected %s, REV=0x%X\n",
		priv->trans->name, priv->trans->hw_rev);
		priv->trans->info.name, priv->trans->info.hw_rev);

	err = iwl_trans_start_hw(priv->trans);
	if (err)
@@ -1992,7 +1993,7 @@ static void iwl_nic_config(struct iwl_op_mode *op_mode)
	/* SKU Control */
	iwl_trans_set_bits_mask(priv->trans, CSR_HW_IF_CONFIG_REG,
				CSR_HW_IF_CONFIG_REG_MSK_MAC_STEP_DASH,
				CSR_HW_REV_STEP_DASH(priv->trans->hw_rev));
				CSR_HW_REV_STEP_DASH(priv->trans->info.hw_rev));

	/* write radio config values to register */
	if (priv->nvm_data->radio_cfg_type <= EEPROM_RF_CONFIG_TYPE_MAX) {
+11 −10
Original line number Diff line number Diff line
@@ -904,12 +904,13 @@ iwl_fw_error_dump_file(struct iwl_fw_runtime *fwrt,
		dump_data->len = cpu_to_le32(sizeof(*dump_info));
		dump_info = (void *)dump_data->data;
		dump_info->hw_type =
			cpu_to_le32(CSR_HW_REV_TYPE(fwrt->trans->hw_rev));
			cpu_to_le32(CSR_HW_REV_TYPE(fwrt->trans->info.hw_rev));
		dump_info->hw_step =
			cpu_to_le32(fwrt->trans->hw_rev_step);
			cpu_to_le32(fwrt->trans->info.hw_rev_step);
		memcpy(dump_info->fw_human_readable, fwrt->fw->human_readable,
		       sizeof(dump_info->fw_human_readable));
		strscpy_pad(dump_info->dev_human_readable, fwrt->trans->name,
		strscpy_pad(dump_info->dev_human_readable,
			    fwrt->trans->info.name,
			    sizeof(dump_info->dev_human_readable));
		strscpy_pad(dump_info->bus_human_readable, fwrt->dev->bus->name,
			sizeof(dump_info->bus_human_readable));
@@ -2403,13 +2404,13 @@ static u32 iwl_dump_ini_info(struct iwl_fw_runtime *fwrt,
	dump->ver_type = cpu_to_le32(fwrt->dump.fw_ver.type);
	dump->ver_subtype = cpu_to_le32(fwrt->dump.fw_ver.subtype);

	dump->hw_step = cpu_to_le32(fwrt->trans->hw_rev_step);
	dump->hw_step = cpu_to_le32(fwrt->trans->info.hw_rev_step);

	/*
	 * Several HWs all have type == 0x42, so we'll override this value
	 * according to the detected HW
	 */
	hw_type = CSR_HW_REV_TYPE(fwrt->trans->hw_rev);
	hw_type = CSR_HW_REV_TYPE(fwrt->trans->info.hw_rev);
	if (hw_type == IWL_AX210_HW_TYPE) {
		u32 prph_val = iwl_read_umac_prph(fwrt->trans, WFPM_OTP_CFG1_ADDR);
		u32 is_jacket = !!(prph_val & WFPM_OTP_CFG1_IS_JACKET_BIT);
@@ -2426,10 +2427,10 @@ static u32 iwl_dump_ini_info(struct iwl_fw_runtime *fwrt,
	dump->hw_type = cpu_to_le32(hw_type);

	dump->rf_id_flavor =
		cpu_to_le32(CSR_HW_RFID_FLAVOR(fwrt->trans->hw_rf_id));
	dump->rf_id_dash = cpu_to_le32(CSR_HW_RFID_DASH(fwrt->trans->hw_rf_id));
	dump->rf_id_step = cpu_to_le32(CSR_HW_RFID_STEP(fwrt->trans->hw_rf_id));
	dump->rf_id_type = cpu_to_le32(CSR_HW_RFID_TYPE(fwrt->trans->hw_rf_id));
		cpu_to_le32(CSR_HW_RFID_FLAVOR(fwrt->trans->info.hw_rf_id));
	dump->rf_id_dash = cpu_to_le32(CSR_HW_RFID_DASH(fwrt->trans->info.hw_rf_id));
	dump->rf_id_step = cpu_to_le32(CSR_HW_RFID_STEP(fwrt->trans->info.hw_rf_id));
	dump->rf_id_type = cpu_to_le32(CSR_HW_RFID_TYPE(fwrt->trans->info.hw_rf_id));

	dump->lmac_major = cpu_to_le32(fwrt->dump.fw_ver.lmac_major);
	dump->lmac_minor = cpu_to_le32(fwrt->dump.fw_ver.lmac_minor);
+1 −1
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ static ssize_t iwl_dbgfs_fw_ver_read(struct iwl_fw_runtime *fwrt,
	pos += scnprintf(pos, endpos - pos, "FW: %s\n",
			 fwrt->fw->human_readable);
	pos += scnprintf(pos, endpos - pos, "Device: %s\n",
			 fwrt->trans->name);
			 fwrt->trans->info.name);
	pos += scnprintf(pos, endpos - pos, "Bus: %s\n",
			 fwrt->dev->bus->name);

Loading