Commit 92c1858e authored by Manikanta Pubbisetty's avatar Manikanta Pubbisetty Committed by Kalle Valo
Browse files

ath11k: Move parameters in bus_params to hw_params



In ath11k, bus_params were added with an intention to hold
parameters related to bus (AHB/PCI), but this is not true
as some bus parameters being different between chipsets of
the same bus.

With the addition of WCN6750 to ath11k, bus parameters are
going to be entirely different among AHB devices. Therefore,
it is wise to move bus_params to hw_params and get rid of
bus_params entirely.

Also, mhi_support parameter is not used anywhere in the driver,
remove it from bus_params.

Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1

Signed-off-by: default avatarManikanta Pubbisetty <quic_mpubbise@quicinc.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220429170502.20080-3-quic_mpubbise@quicinc.com
parent 00fd2408
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/module.h>
@@ -28,13 +29,6 @@ static const struct of_device_id ath11k_ahb_of_match[] = {

MODULE_DEVICE_TABLE(of, ath11k_ahb_of_match);

static const struct ath11k_bus_params ath11k_ahb_bus_params = {
	.mhi_support = false,
	.m3_fw_support = false,
	.fixed_bdf_addr = true,
	.fixed_mem_region = true,
};

#define ATH11K_IRQ_CE0_OFFSET 4

static const char *irq_name[ATH11K_IRQ_NUM_MAX] = {
@@ -685,8 +679,7 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
	}

	ab = ath11k_core_alloc(&pdev->dev, sizeof(struct ath11k_ahb),
			       ATH11K_BUS_AHB,
			       &ath11k_ahb_bus_params);
			       ATH11K_BUS_AHB);
	if (!ab) {
		dev_err(&pdev->dev, "failed to allocate ath11k base\n");
		return -ENOMEM;
+25 −3
Original line number Diff line number Diff line
@@ -102,6 +102,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.dbr_debug_support = true,
		.global_reset = false,
		.bios_sar_capa = NULL,
		.m3_fw_support = false,
		.fixed_bdf_addr = true,
		.fixed_mem_region = true,
		.static_window_map = false,
	},
	{
		.hw_rev = ATH11K_HW_IPQ6018_HW10,
@@ -169,6 +173,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.dbr_debug_support = true,
		.global_reset = false,
		.bios_sar_capa = NULL,
		.m3_fw_support = false,
		.fixed_bdf_addr = true,
		.fixed_mem_region = true,
		.static_window_map = false,
	},
	{
		.name = "qca6390 hw2.0",
@@ -235,6 +243,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.dbr_debug_support = false,
		.global_reset = true,
		.bios_sar_capa = NULL,
		.m3_fw_support = true,
		.fixed_bdf_addr = false,
		.fixed_mem_region = false,
		.static_window_map = false,
	},
	{
		.name = "qcn9074 hw1.0",
@@ -301,6 +313,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.dbr_debug_support = true,
		.global_reset = false,
		.bios_sar_capa = NULL,
		.m3_fw_support = true,
		.fixed_bdf_addr = false,
		.fixed_mem_region = false,
		.static_window_map = true,
	},
	{
		.name = "wcn6855 hw2.0",
@@ -367,6 +383,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.dbr_debug_support = false,
		.global_reset = true,
		.bios_sar_capa = &ath11k_hw_sar_capa_wcn6855,
		.m3_fw_support = true,
		.fixed_bdf_addr = false,
		.fixed_mem_region = false,
		.static_window_map = false,
	},
	{
		.name = "wcn6855 hw2.1",
@@ -432,6 +452,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
		.dbr_debug_support = false,
		.global_reset = true,
		.bios_sar_capa = &ath11k_hw_sar_capa_wcn6855,
		.m3_fw_support = true,
		.fixed_bdf_addr = false,
		.fixed_mem_region = false,
		.static_window_map = false,
	},
};

@@ -1730,8 +1754,7 @@ void ath11k_core_free(struct ath11k_base *ab)
EXPORT_SYMBOL(ath11k_core_free);

struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
				      enum ath11k_bus bus,
				      const struct ath11k_bus_params *bus_params)
				      enum ath11k_bus bus)
{
	struct ath11k_base *ab;

@@ -1770,7 +1793,6 @@ struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
	init_completion(&ab->wow.wakeup_completed);

	ab->dev = dev;
	ab->bus_params = *bus_params;
	ab->hif.bus = bus;

	return ab;
+1 −11
Original line number Diff line number Diff line
@@ -748,14 +748,6 @@ struct ath11k_board_data {
	size_t len;
};

struct ath11k_bus_params {
	bool mhi_support;
	bool m3_fw_support;
	bool fixed_bdf_addr;
	bool fixed_mem_region;
	bool static_window_map;
};

struct ath11k_pci_ops {
	int (*wakeup)(struct ath11k_base *ab);
	void (*release)(struct ath11k_base *ab);
@@ -887,7 +879,6 @@ struct ath11k_base {
	int bd_api;

	struct ath11k_hw_params hw_params;
	struct ath11k_bus_params bus_params;

	const struct firmware *cal_file;

@@ -1135,8 +1126,7 @@ int ath11k_core_pre_init(struct ath11k_base *ab);
int ath11k_core_init(struct ath11k_base *ath11k);
void ath11k_core_deinit(struct ath11k_base *ath11k);
struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
				      enum ath11k_bus bus,
				      const struct ath11k_bus_params *bus_params);
				      enum ath11k_bus bus);
void ath11k_core_free(struct ath11k_base *ath11k);
int ath11k_core_fetch_bdf(struct ath11k_base *ath11k,
			  struct ath11k_board_data *bd);
+4 −0
Original line number Diff line number Diff line
@@ -196,6 +196,10 @@ struct ath11k_hw_params {
	bool dbr_debug_support;
	bool global_reset;
	const struct cfg80211_sar_capa *bios_sar_capa;
	bool m3_fw_support;
	bool fixed_bdf_addr;
	bool fixed_mem_region;
	bool static_window_map;
};

struct ath11k_hw_ops {
+3 −11
Original line number Diff line number Diff line
@@ -115,13 +115,6 @@ static const struct ath11k_pci_ops ath11k_pci_ops_qcn9074 = {
	.window_read32 = ath11k_pci_window_read32,
};

static const struct ath11k_bus_params ath11k_pci_bus_params = {
	.mhi_support = true,
	.m3_fw_support = true,
	.fixed_bdf_addr = false,
	.fixed_mem_region = false,
};

static const struct ath11k_msi_config msi_config_one_msi = {
	.total_vectors = 1,
	.total_users = 4,
@@ -593,7 +586,7 @@ static int ath11k_pci_power_up(struct ath11k_base *ab)
		return ret;
	}

	if (ab->bus_params.static_window_map)
	if (ab->hw_params.static_window_map)
		ath11k_pci_select_static_window(ab_pci);

	return 0;
@@ -706,8 +699,8 @@ static int ath11k_pci_probe(struct pci_dev *pdev,
	u32 soc_hw_version_major, soc_hw_version_minor, addr;
	int ret;

	ab = ath11k_core_alloc(&pdev->dev, sizeof(*ab_pci), ATH11K_BUS_PCI,
			       &ath11k_pci_bus_params);
	ab = ath11k_core_alloc(&pdev->dev, sizeof(*ab_pci), ATH11K_BUS_PCI);

	if (!ab) {
		dev_err(&pdev->dev, "failed to allocate ath11k base\n");
		return -ENOMEM;
@@ -764,7 +757,6 @@ static int ath11k_pci_probe(struct pci_dev *pdev,
		ab->pci.ops = &ath11k_pci_ops_qca6390;
		break;
	case QCN9074_DEVICE_ID:
		ab->bus_params.static_window_map = true;
		ab->pci.ops = &ath11k_pci_ops_qcn9074;
		ab->hw_rev = ATH11K_HW_QCN9074_HW10;
		break;
Loading