hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/scsi/aacraid/aacraid.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Adaptec AAC series RAID controller driver
34 * (c) Copyright 2001 Red Hat Inc. <alan@redhat.com>
....@@ -9,25 +10,10 @@
910 * 2010-2015 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
1011 * 2016-2017 Microsemi Corp. (aacraid@microsemi.com)
1112 *
12
- * This program is free software; you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License as published by
14
- * the Free Software Foundation; either version 2, or (at your option)
15
- * any later version.
16
- *
17
- * This program is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details.
21
- *
22
- * You should have received a copy of the GNU General Public License
23
- * along with this program; see the file COPYING. If not, write to
24
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25
- *
2613 * Module Name:
2714 * aacraid.h
2815 *
2916 * Abstract: Contains all routines for control of the aacraid driver
30
- *
3117 */
3218
3319 #ifndef _AACRAID_H_
....@@ -40,6 +26,7 @@
4026 #define nblank(x) _nblank(x)[0]
4127
4228 #include <linux/interrupt.h>
29
+#include <linux/completion.h>
4330 #include <linux/pci.h>
4431 #include <scsi/scsi_host.h>
4532
....@@ -98,7 +85,7 @@
9885 #define PMC_GLOBAL_INT_BIT0 0x00000001
9986
10087 #ifndef AAC_DRIVER_BUILD
101
-# define AAC_DRIVER_BUILD 50877
88
+# define AAC_DRIVER_BUILD 50983
10289 # define AAC_DRIVER_BRANCH "-custom"
10390 #endif
10491 #define MAXIMUM_NUM_CONTAINERS 32
....@@ -121,6 +108,8 @@
121108 #define AAC_BUS_TARGET_LOOP (AAC_MAX_BUSES * AAC_MAX_TARGETS)
122109 #define AAC_MAX_NATIVE_SIZE 2048
123110 #define FW_ERROR_BUFFER_SIZE 512
111
+#define AAC_SA_TIMEOUT 180
112
+#define AAC_ARC_TIMEOUT 60
124113
125114 #define get_bus_number(x) (x/AAC_MAX_TARGETS)
126115 #define get_target_number(x) (x%AAC_MAX_TARGETS)
....@@ -1241,7 +1230,7 @@
12411230 u32 unique; // unique value representing this context
12421231 ulong jiffies; // used for cleanup - dmb changed to ulong
12431232 struct list_head next; // used to link context's into a linked list
1244
- struct semaphore wait_sem; // this is used to wait for the next fib to arrive.
1233
+ struct completion completion; // this is used to wait for the next fib to arrive.
12451234 int wait; // Set to true when thread is in WaitForSingleObject
12461235 unsigned long count; // total number of FIBs on FibList
12471236 struct list_head fib_list; // this holds fibs and their attachd hw_fibs
....@@ -1313,7 +1302,7 @@
13131302 * This is the event the sendfib routine will wait on if the
13141303 * caller did not pass one and this is synch io.
13151304 */
1316
- struct semaphore event_wait;
1305
+ struct completion event_wait;
13171306 spinlock_t event_lock;
13181307
13191308 u32 done; /* gets set to 1 when fib is complete */
....@@ -1341,7 +1330,7 @@
13411330 #define AAC_DEVTYPE_ARC_RAW 2
13421331 #define AAC_DEVTYPE_NATIVE_RAW 3
13431332
1344
-#define AAC_SAFW_RESCAN_DELAY (10 * HZ)
1333
+#define AAC_RESCAN_DELAY (10 * HZ)
13451334
13461335 struct aac_hba_map_info {
13471336 __le32 rmw_nexus; /* nexus for native HBA devices */
....@@ -1614,6 +1603,7 @@
16141603 struct fsa_dev_info *fsa_dev;
16151604 struct task_struct *thread;
16161605 struct delayed_work safw_rescan_work;
1606
+ struct delayed_work src_reinit_aif_worker;
16171607 int cardtype;
16181608 /*
16191609 *This lock will protect the two 32-bit
....@@ -1686,6 +1676,7 @@
16861676 u8 adapter_shutdown;
16871677 u32 handle_pci_error;
16881678 bool init_reset;
1679
+ u8 soft_reset_support;
16891680 };
16901681
16911682 #define aac_adapter_interrupt(dev) \
....@@ -2657,7 +2648,12 @@
26572648
26582649 static inline void aac_schedule_safw_scan_worker(struct aac_dev *dev)
26592650 {
2660
- schedule_delayed_work(&dev->safw_rescan_work, AAC_SAFW_RESCAN_DELAY);
2651
+ schedule_delayed_work(&dev->safw_rescan_work, AAC_RESCAN_DELAY);
2652
+}
2653
+
2654
+static inline void aac_schedule_src_reinit_aif_worker(struct aac_dev *dev)
2655
+{
2656
+ schedule_delayed_work(&dev->src_reinit_aif_worker, AAC_RESCAN_DELAY);
26612657 }
26622658
26632659 static inline void aac_safw_rescan_worker(struct work_struct *work)
....@@ -2671,10 +2667,10 @@
26712667 aac_scan_host(dev);
26722668 }
26732669
2674
-static inline void aac_cancel_safw_rescan_worker(struct aac_dev *dev)
2670
+static inline void aac_cancel_rescan_worker(struct aac_dev *dev)
26752671 {
2676
- if (dev->sa_firmware)
2677
- cancel_delayed_work_sync(&dev->safw_rescan_work);
2672
+ cancel_delayed_work_sync(&dev->safw_rescan_work);
2673
+ cancel_delayed_work_sync(&dev->src_reinit_aif_worker);
26782674 }
26792675
26802676 /* SCp.phase values */
....@@ -2684,6 +2680,7 @@
26842680 #define AAC_OWNER_FIRMWARE 0x106
26852681
26862682 void aac_safw_rescan_worker(struct work_struct *work);
2683
+void aac_src_reinit_aif_worker(struct work_struct *work);
26872684 int aac_acquire_irq(struct aac_dev *dev);
26882685 void aac_free_irq(struct aac_dev *dev);
26892686 int aac_setup_safw_adapter(struct aac_dev *dev);
....@@ -2710,12 +2707,12 @@
27102707 int aac_get_config_status(struct aac_dev *dev, int commit_flag);
27112708 int aac_get_containers(struct aac_dev *dev);
27122709 int aac_scsi_cmd(struct scsi_cmnd *cmd);
2713
-int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg);
2710
+int aac_dev_ioctl(struct aac_dev *dev, unsigned int cmd, void __user *arg);
27142711 #ifndef shost_to_class
27152712 #define shost_to_class(shost) &shost->shost_dev
27162713 #endif
27172714 ssize_t aac_get_serial_number(struct device *dev, char *buf);
2718
-int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg);
2715
+int aac_do_ioctl(struct aac_dev *dev, unsigned int cmd, void __user *arg);
27192716 int aac_rx_init(struct aac_dev *dev);
27202717 int aac_rkt_init(struct aac_dev *dev);
27212718 int aac_nark_init(struct aac_dev *dev);
....@@ -2741,6 +2738,7 @@
27412738 int _aac_rx_init(struct aac_dev *dev);
27422739 int aac_rx_select_comm(struct aac_dev *dev, int comm);
27432740 int aac_rx_deliver_producer(struct fib * fib);
2741
+void aac_reinit_aif(struct aac_dev *aac, unsigned int index);
27442742
27452743 static inline int aac_is_src(struct aac_dev *dev)
27462744 {