Commit 630ad41c authored by Govind Singh's avatar Govind Singh Committed by Kalle Valo

ath11k: Add drv private for bus opaque struct

Add drv private opaque structure to have bus level
structure for multibus support.
Signed-off-by: default avatarGovind Singh <govinds@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200506094400.4740-3-govinds@codeaurora.org
parent 31858805
...@@ -932,7 +932,7 @@ static int ath11k_ahb_probe(struct platform_device *pdev) ...@@ -932,7 +932,7 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
return ret; return ret;
} }
ab = ath11k_core_alloc(&pdev->dev); ab = ath11k_core_alloc(&pdev->dev, 0, ATH11K_BUS_AHB);
if (!ab) { if (!ab) {
dev_err(&pdev->dev, "failed to allocate ath11k base\n"); dev_err(&pdev->dev, "failed to allocate ath11k base\n");
return -ENOMEM; return -ENOMEM;
......
...@@ -756,11 +756,12 @@ void ath11k_core_free(struct ath11k_base *ab) ...@@ -756,11 +756,12 @@ void ath11k_core_free(struct ath11k_base *ab)
kfree(ab); kfree(ab);
} }
struct ath11k_base *ath11k_core_alloc(struct device *dev) struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
enum ath11k_bus bus)
{ {
struct ath11k_base *ab; struct ath11k_base *ab;
ab = kzalloc(sizeof(*ab), GFP_KERNEL); ab = kzalloc(sizeof(*ab) + priv_size, GFP_KERNEL);
if (!ab) if (!ab)
return NULL; return NULL;
......
...@@ -667,6 +667,9 @@ struct ath11k_base { ...@@ -667,6 +667,9 @@ struct ath11k_base {
/* Round robbin based TCL ring selector */ /* Round robbin based TCL ring selector */
atomic_t tcl_ring_selector; atomic_t tcl_ring_selector;
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
}; };
struct ath11k_fw_stats_pdev { struct ath11k_fw_stats_pdev {
...@@ -803,7 +806,8 @@ struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id); ...@@ -803,7 +806,8 @@ struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id);
int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab); int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab);
int ath11k_core_init(struct ath11k_base *ath11k); int ath11k_core_init(struct ath11k_base *ath11k);
void ath11k_core_deinit(struct ath11k_base *ath11k); void ath11k_core_deinit(struct ath11k_base *ath11k);
struct ath11k_base *ath11k_core_alloc(struct device *dev); struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
enum ath11k_bus bus);
void ath11k_core_free(struct ath11k_base *ath11k); void ath11k_core_free(struct ath11k_base *ath11k);
int ath11k_core_fetch_bdf(struct ath11k_base *ath11k, int ath11k_core_fetch_bdf(struct ath11k_base *ath11k,
struct ath11k_board_data *bd); struct ath11k_board_data *bd);
......
...@@ -99,6 +99,11 @@ enum ath11k_hw_rate_ofdm { ...@@ -99,6 +99,11 @@ enum ath11k_hw_rate_ofdm {
ATH11K_HW_RATE_OFDM_9M, ATH11K_HW_RATE_OFDM_9M,
}; };
enum ath11k_bus {
ATH11K_BUS_AHB,
ATH11K_BUS_PCI,
};
struct ath11k_hw_params { struct ath11k_hw_params {
const char *name; const char *name;
struct { struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment