qtnfmac: fix debugfs support for multiple cards
authorSergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Wed, 13 Nov 2019 11:06:49 +0000 (11:06 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:45:27 +0000 (16:45 +0100)
[ Upstream commit dd4c2260dab04f5ae7bdb79b9470e7da56f48145 ]

Fix merge artifact for commit 0b68fe10b8e8 ("qtnfmac: modify debugfs
to support multiple cards") and finally add debugfs support
for multiple qtnfmac wireless cards.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c

index 8ae318b5fe54646f962f3e5bf316ee6cb63e859f..4824be0c6231e3644ee62b8c611ddfef5138c9f4 100644 (file)
@@ -130,6 +130,8 @@ static int qtnf_dbg_shm_stats(struct seq_file *s, void *data)
 
 int qtnf_pcie_fw_boot_done(struct qtnf_bus *bus)
 {
+       struct qtnf_pcie_bus_priv *priv = get_bus_priv(bus);
+       char card_id[64];
        int ret;
 
        bus->fw_state = QTNF_FW_STATE_BOOT_DONE;
@@ -137,7 +139,9 @@ int qtnf_pcie_fw_boot_done(struct qtnf_bus *bus)
        if (ret) {
                pr_err("failed to attach core\n");
        } else {
-               qtnf_debugfs_init(bus, DRV_NAME);
+               snprintf(card_id, sizeof(card_id), "%s:%s",
+                        DRV_NAME, pci_name(priv->pdev));
+               qtnf_debugfs_init(bus, card_id);
                qtnf_debugfs_add_entry(bus, "mps", qtnf_dbg_mps_show);
                qtnf_debugfs_add_entry(bus, "msi_enabled", qtnf_dbg_msi_show);
                qtnf_debugfs_add_entry(bus, "shm_stats", qtnf_dbg_shm_stats);