cnss2: Support dual wlan cards managed by cnss2 platform driver

Currently, the cnss2 platform driver just can support
one wlan device attached, so do the following changes
to cover dual wlan card attach case. Firstly, delay
the second device go to pcie link suspend and power
off state to make sure it really finished the pcie
enumeration. Then pcie enumeration succeeds with
multi-devices. Secondly, supporting to write the qrtr
node instance id to PCIE register for wlan fw reading,
which can fix qmi message exchange failure if active
two Hastings devices. Thirdly, change the usage of
plat_env to support dual Hastings.

Change-Id: Ica41a23d4e983b91c0ff1b4e76b380803fb877ab
This commit is contained in:
Chaoli Zhou
2023-01-18 11:31:32 +08:00
parent 436eadfdaa
commit f2346285bc
9 changed files with 551 additions and 44 deletions

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */
/* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */
/* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */
#include <linux/err.h>
@@ -944,8 +944,15 @@ int cnss_debugfs_create(struct cnss_plat_data *plat_priv)
{
int ret = 0;
struct dentry *root_dentry;
char name[CNSS_FS_NAME_SIZE];
root_dentry = debugfs_create_dir("cnss", 0);
if (cnss_is_dual_wlan_enabled())
snprintf(name, CNSS_FS_NAME_SIZE, CNSS_FS_NAME "_%d",
plat_priv->plat_idx);
else
snprintf(name, CNSS_FS_NAME_SIZE, CNSS_FS_NAME);
root_dentry = debugfs_create_dir(name, 0);
if (IS_ERR(root_dentry)) {
ret = PTR_ERR(root_dentry);
cnss_pr_err("Unable to create debugfs %d\n", ret);