forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/ethernet/brocade/bna/bfa_ioc.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Linux network driver for QLogic BR-series Converged Network Adapter.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms of the GNU General Public License (GPL) Version 2 as
6
- * published by the Free Software Foundation
7
- *
8
- * This program is distributed in the hope that it will be useful, but
9
- * WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- * General Public License for more details.
124 */
135 /*
146 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
....@@ -277,7 +269,7 @@
277269 break;
278270
279271 case IOC_E_PFFAILED:
280
- /* !!! fall through !!! */
272
+ fallthrough;
281273 case IOC_E_HWERROR:
282274 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE);
283275 bfa_fsm_set_state(ioc, bfa_ioc_sm_fail);
....@@ -329,7 +321,7 @@
329321 case IOC_E_PFFAILED:
330322 case IOC_E_HWERROR:
331323 del_timer(&ioc->ioc_timer);
332
- /* fall through */
324
+ fallthrough;
333325 case IOC_E_TIMEOUT:
334326 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE);
335327 bfa_fsm_set_state(ioc, bfa_ioc_sm_fail);
....@@ -373,7 +365,8 @@
373365 case IOC_E_PFFAILED:
374366 case IOC_E_HWERROR:
375367 bfa_ioc_hb_stop(ioc);
376
- /* !!! fall through !!! */
368
+ fallthrough;
369
+
377370 case IOC_E_HBFAIL:
378371 if (ioc->iocpf.auto_recover)
379372 bfa_fsm_set_state(ioc, bfa_ioc_sm_fail_retry);
....@@ -743,7 +736,7 @@
743736
744737 case IOCPF_E_TIMEOUT:
745738 bfa_nw_ioc_hw_sem_release(ioc);
746
- bfa_ioc_pf_failed(ioc);
739
+ bfa_ioc_pf_failed(ioc);
747740 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_initfail_sync);
748741 break;
749742
....@@ -788,9 +781,8 @@
788781
789782 case IOCPF_E_INITFAIL:
790783 del_timer(&ioc->iocpf_timer);
791
- /*
792
- * !!! fall through !!!
793
- */
784
+ fallthrough;
785
+
794786 case IOCPF_E_TIMEOUT:
795787 bfa_nw_ioc_hw_sem_release(ioc);
796788 if (event == IOCPF_E_TIMEOUT)
....@@ -858,9 +850,7 @@
858850
859851 case IOCPF_E_FAIL:
860852 del_timer(&ioc->iocpf_timer);
861
- /*
862
- * !!! fall through !!!
863
- */
853
+ fallthrough;
864854
865855 case IOCPF_E_TIMEOUT:
866856 bfa_ioc_set_cur_ioc_fwstate(ioc, BFI_IOC_FAIL);
....@@ -1135,11 +1125,10 @@
11351125 static void
11361126 bfa_ioc_fwver_clear(struct bfa_ioc *ioc)
11371127 {
1138
- u32 pgnum, pgoff, loff = 0;
1128
+ u32 pgnum, loff = 0;
11391129 int i;
11401130
11411131 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff);
1142
- pgoff = PSS_SMEM_PGOFF(loff);
11431132 writel(pgnum, ioc->ioc_regs.host_page_num_fn);
11441133
11451134 for (i = 0; i < (sizeof(struct bfi_ioc_image_hdr) / sizeof(u32)); i++) {
....@@ -1547,7 +1536,6 @@
15471536 bfa_flash_fifo_flush(void __iomem *pci_bar)
15481537 {
15491538 u32 i;
1550
- u32 t;
15511539 union bfa_flash_dev_status_reg dev_status;
15521540
15531541 dev_status.i = readl(pci_bar + FLI_DEV_STATUS_REG);
....@@ -1557,7 +1545,7 @@
15571545
15581546 /* fifo counter in terms of words */
15591547 for (i = 0; i < dev_status.r.fifo_cnt; i++)
1560
- t = readl(pci_bar + FLI_RDDATA_REG);
1548
+ readl(pci_bar + FLI_RDDATA_REG);
15611549
15621550 /* Check the device status. It may take some time. */
15631551 for (i = 0; i < BFA_FLASH_CHECK_MAX; i++) {
....@@ -1776,7 +1764,7 @@
17761764 return BFI_IOC_IMG_VER_INCOMP;
17771765 }
17781766
1779
-/**
1767
+/*
17801768 * Returns TRUE if driver is willing to work with current smem f/w version.
17811769 */
17821770 bool
....@@ -2482,6 +2470,7 @@
24822470 *
24832471 * @ioc: memory for IOC
24842472 * @bfa: driver instance structure
2473
+ * @cbfn: callback function
24852474 */
24862475 void
24872476 bfa_nw_ioc_attach(struct bfa_ioc *ioc, void *bfa, struct bfa_ioc_cbfn *cbfn)
....@@ -2513,7 +2502,9 @@
25132502 /**
25142503 * bfa_nw_ioc_pci_init - Setup IOC PCI properties.
25152504 *
2505
+ * @ioc: memory for IOC
25162506 * @pcidev: PCI device information for this IOC
2507
+ * @clscode: class code
25172508 */
25182509 void
25192510 bfa_nw_ioc_pci_init(struct bfa_ioc *ioc, struct bfa_pcidev *pcidev,
....@@ -2582,6 +2573,7 @@
25822573 /**
25832574 * bfa_nw_ioc_mem_claim - Initialize IOC dma memory
25842575 *
2576
+ * @ioc: memory for IOC
25852577 * @dm_kva: kernel virtual address of IOC dma memory
25862578 * @dm_pa: physical address of IOC dma memory
25872579 */
....@@ -2649,6 +2641,8 @@
26492641 *
26502642 * @ioc: IOC instance
26512643 * @cmd: Mailbox command
2644
+ * @cbfn: callback function
2645
+ * @cbarg: arguments to callback
26522646 *
26532647 * Waits if mailbox is busy. Responsibility of caller to serialize
26542648 */