hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/wireless/ath/wil6210/pcie_bus.c
....@@ -1,18 +1,7 @@
1
+// SPDX-License-Identifier: ISC
12 /*
23 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
3
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
4
- *
5
- * Permission to use, copy, modify, and/or distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
8
- *
9
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
165 */
176
187 #include <linux/module.h>
....@@ -142,6 +131,8 @@
142131 min(sizeof(wil->platform_capa), sizeof(platform_capa)));
143132 }
144133
134
+ wil_info(wil, "platform_capa 0x%lx\n", *wil->platform_capa);
135
+
145136 /* extract FW capabilities from file without loading the FW */
146137 wil_request_firmware(wil, wil->wil_fw_name, false);
147138 wil_refresh_fw_capabilities(wil);
....@@ -176,7 +167,7 @@
176167 struct wil6210_vif *vif;
177168 int i;
178169
179
- for (i = 1; i < wil->max_vifs; i++) {
170
+ for (i = 1; i < GET_MAX_VIFS(wil); i++) {
180171 vif = wil->vifs[i];
181172 if (vif) {
182173 wil_vif_prepare_stop(vif);
....@@ -418,6 +409,7 @@
418409 }
419410 /* rollback to bus_disable */
420411
412
+ wil_clear_fw_log_addr(wil);
421413 rc = wil_if_add(wil);
422414 if (rc) {
423415 wil_err(wil, "wil_if_add failed: %d\n", rc);
....@@ -432,7 +424,7 @@
432424 mutex_unlock(&wil->mutex);
433425 if (rc) {
434426 wil_err(wil, "failed to load WMI only FW\n");
435
- goto if_remove;
427
+ /* ignore the error to allow debugging */
436428 }
437429 }
438430
....@@ -452,8 +444,6 @@
452444
453445 return 0;
454446
455
-if_remove:
456
- wil_if_remove(wil);
457447 bus_disable:
458448 wil_if_pcie_disable(wil);
459449 err_iounmap:
....@@ -628,8 +618,7 @@
628618
629619 static int __maybe_unused wil6210_pm_runtime_idle(struct device *dev)
630620 {
631
- struct pci_dev *pdev = to_pci_dev(dev);
632
- struct wil6210_priv *wil = pci_get_drvdata(pdev);
621
+ struct wil6210_priv *wil = dev_get_drvdata(dev);
633622
634623 wil_dbg_pm(wil, "Runtime idle\n");
635624
....@@ -643,8 +632,7 @@
643632
644633 static int __maybe_unused wil6210_pm_runtime_suspend(struct device *dev)
645634 {
646
- struct pci_dev *pdev = to_pci_dev(dev);
647
- struct wil6210_priv *wil = pci_get_drvdata(pdev);
635
+ struct wil6210_priv *wil = dev_get_drvdata(dev);
648636
649637 if (test_bit(wil_status_suspended, wil->status)) {
650638 wil_dbg_pm(wil, "trying to suspend while suspended\n");