forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/scsi/mpt3sas/mpt3sas_base.h
....@@ -55,6 +55,7 @@
5555 #include "mpi/mpi2_tool.h"
5656 #include "mpi/mpi2_sas.h"
5757 #include "mpi/mpi2_pci.h"
58
+#include "mpi/mpi2_image.h"
5859
5960 #include <scsi/scsi.h>
6061 #include <scsi/scsi_cmnd.h>
....@@ -66,6 +67,7 @@
6667 #include <scsi/scsi_eh.h>
6768 #include <linux/pci.h>
6869 #include <linux/poll.h>
70
+#include <linux/irq_poll.h>
6971
7072 #include "mpt3sas_debug.h"
7173 #include "mpt3sas_trigger_diag.h"
....@@ -74,8 +76,8 @@
7476 #define MPT3SAS_DRIVER_NAME "mpt3sas"
7577 #define MPT3SAS_AUTHOR "Avago Technologies <MPT-FusionLinux.pdl@avagotech.com>"
7678 #define MPT3SAS_DESCRIPTION "LSI MPT Fusion SAS 3.0 Device Driver"
77
-#define MPT3SAS_DRIVER_VERSION "26.100.00.00"
78
-#define MPT3SAS_MAJOR_VERSION 26
79
+#define MPT3SAS_DRIVER_VERSION "35.100.00.00"
80
+#define MPT3SAS_MAJOR_VERSION 35
7981 #define MPT3SAS_MINOR_VERSION 100
8082 #define MPT3SAS_BUILD_VERSION 0
8183 #define MPT3SAS_RELEASE_VERSION 00
....@@ -87,6 +89,10 @@
8789 #define MPT2SAS_MINOR_VERSION 102
8890 #define MPT2SAS_BUILD_VERSION 0
8991 #define MPT2SAS_RELEASE_VERSION 00
92
+
93
+/* CoreDump: Default timeout */
94
+#define MPT3SAS_DEFAULT_COREDUMP_TIMEOUT_SECONDS (15) /*15 seconds*/
95
+#define MPT3SAS_COREDUMP_LOOP_DONE (0xFF)
9096
9197 /*
9298 * Set MPT3SAS_SG_DEPTH value based on user input.
....@@ -138,7 +144,11 @@
138144 #define MAX_CHAIN_ELEMT_SZ 16
139145 #define DEFAULT_NUM_FWCHAIN_ELEMTS 8
140146
147
+#define IO_UNIT_CONTROL_SHUTDOWN_TIMEOUT 6
141148 #define FW_IMG_HDR_READ_TIMEOUT 15
149
+
150
+#define IOC_OPERATIONAL_WAIT_COUNT 10
151
+
142152 /*
143153 * NVMe defines
144154 */
....@@ -158,7 +168,14 @@
158168 /*
159169 * logging format
160170 */
161
-#define MPT3SAS_FMT "%s: "
171
+#define ioc_err(ioc, fmt, ...) \
172
+ pr_err("%s: " fmt, (ioc)->name, ##__VA_ARGS__)
173
+#define ioc_notice(ioc, fmt, ...) \
174
+ pr_notice("%s: " fmt, (ioc)->name, ##__VA_ARGS__)
175
+#define ioc_warn(ioc, fmt, ...) \
176
+ pr_warn("%s: " fmt, (ioc)->name, ##__VA_ARGS__)
177
+#define ioc_info(ioc, fmt, ...) \
178
+ pr_info("%s: " fmt, (ioc)->name, ##__VA_ARGS__)
162179
163180 /*
164181 * WarpDrive Specific Log codes
....@@ -181,6 +198,9 @@
181198
182199 #define SAS2_PCI_DEVICE_B0_REVISION (0x01)
183200 #define SAS3_PCI_DEVICE_C0_REVISION (0x02)
201
+
202
+/* Atlas PCIe Switch Management Port */
203
+#define MPI26_ATLAS_PCIe_SWITCH_DEVID (0x00B2)
184204
185205 /*
186206 * Intel HBA branding
....@@ -288,6 +308,8 @@
288308 #define MPT3_DIAG_BUFFER_IS_REGISTERED (0x01)
289309 #define MPT3_DIAG_BUFFER_IS_RELEASED (0x02)
290310 #define MPT3_DIAG_BUFFER_IS_DIAG_RESET (0x04)
311
+#define MPT3_DIAG_BUFFER_IS_DRIVER_ALLOCATED (0x08)
312
+#define MPT3_DIAG_BUFFER_IS_APP_OWNED (0x10)
291313
292314 /*
293315 * HP HBA branding
....@@ -340,6 +362,13 @@
340362
341363 #define VIRTUAL_IO_FAILED_RETRY (0x32010081)
342364
365
+/* High IOPs definitions */
366
+#define MPT3SAS_DEVICE_HIGH_IOPS_DEPTH 8
367
+#define MPT3SAS_HIGH_IOPS_REPLY_QUEUES 8
368
+#define MPT3SAS_HIGH_IOPS_BATCH_COUNT 16
369
+#define MPT3SAS_GEN35_MAX_MSIX_QUEUES 128
370
+#define RDPQ_MAX_INDEX_IN_ONE_CHUNK 16
371
+
343372 /* OEM Specific Flags will come from OEM specific header files */
344373 struct Mpi2ManufacturingPage10_t {
345374 MPI2_CONFIG_PAGE_HEADER Header; /* 00h */
....@@ -370,9 +399,15 @@
370399 u8 Reserved6; /* 2Fh */
371400 __le32 Reserved7[7]; /* 30h - 4Bh */
372401 u8 NVMeAbortTO; /* 4Ch */
373
- u8 Reserved8; /* 4Dh */
374
- u16 Reserved9; /* 4Eh */
375
- __le32 Reserved10[4]; /* 50h - 60h */
402
+ u8 NumPerDevEvents; /* 4Dh */
403
+ u8 HostTraceBufferDecrementSizeKB; /* 4Eh */
404
+ u8 HostTraceBufferFlags; /* 4Fh */
405
+ u16 HostTraceBufferMaxSizeKB; /* 50h */
406
+ u16 HostTraceBufferMinSizeKB; /* 52h */
407
+ u8 CoreDumpTOSec; /* 54h */
408
+ u8 Reserved8; /* 55h */
409
+ u16 Reserved9; /* 56h */
410
+ __le32 Reserved10; /* 58h */
376411 };
377412
378413 /**
....@@ -562,6 +597,8 @@
562597 * @enclosure_level: The level of device's enclosure from the controller
563598 * @connector_name: ASCII value of the Connector's name
564599 * @serial_number: pointer of serial number string allocated runtime
600
+ * @access_status: Device's Access Status
601
+ * @shutdown_latency: NVMe device's RTD3 Entry Latency
565602 * @refcount: reference count for deletion
566603 */
567604 struct _pcie_device {
....@@ -583,6 +620,8 @@
583620 u8 connector_name[4];
584621 u8 *serial_number;
585622 u8 reset_timeout;
623
+ u8 access_status;
624
+ u16 shutdown_latency;
586625 struct kref refcount;
587626 };
588627 /**
....@@ -809,6 +848,7 @@
809848 */
810849 struct scsiio_tracker {
811850 u16 smid;
851
+ struct scsi_cmnd *scmd;
812852 u8 cb_idx;
813853 u8 direct_io;
814854 struct pcie_sg_list pcie_sg_list;
....@@ -868,6 +908,9 @@
868908 * @reply_post_free: reply post base virt address
869909 * @name: the name registered to request_irq()
870910 * @busy: isr is actively processing replies on another cpu
911
+ * @os_irq: irq number
912
+ * @irqpoll: irq_poll object
913
+ * @irq_poll_scheduled: Tells whether irq poll is scheduled or not
871914 * @list: this list
872915 */
873916 struct adapter_reply_queue {
....@@ -877,6 +920,10 @@
877920 Mpi2ReplyDescriptorsUnion_t *reply_post_free;
878921 char name[MPT_NAME_LENGTH];
879922 atomic_t busy;
923
+ u32 os_irq;
924
+ struct irq_poll irqpoll;
925
+ bool irq_poll_scheduled;
926
+ bool irq_line_enable;
880927 struct list_head list;
881928 };
882929
....@@ -901,6 +948,13 @@
901948 typedef void (*PUT_SMID_IO_FP_HIP) (struct MPT3SAS_ADAPTER *ioc, u16 smid,
902949 u16 funcdep);
903950 typedef void (*PUT_SMID_DEFAULT) (struct MPT3SAS_ADAPTER *ioc, u16 smid);
951
+typedef u32 (*BASE_READ_REG) (const volatile void __iomem *addr);
952
+/*
953
+ * To get high iops reply queue's msix index when high iops mode is enabled
954
+ * else get the msix index of general reply queues.
955
+ */
956
+typedef u8 (*GET_MSIX_INDEX) (struct MPT3SAS_ADAPTER *ioc,
957
+ struct scsi_cmnd *scmd);
904958
905959 /* IOC Facts and Port Facts converted from little endian to cpu */
906960 union mpi3_version_union {
....@@ -973,7 +1027,6 @@
9731027 * @ir_firmware: IR firmware present
9741028 * @bars: bitmask of BAR's that must be configured
9751029 * @mask_interrupts: ignore interrupt
976
- * @dma_mask: used to set the consistent dma mask
9771030 * @pci_access_mutex: Mutex to synchronize ioctl, sysfs show path and
9781031 * pci resource handling
9791032 * @fault_reset_work_q_name: fw fault work queue
....@@ -983,6 +1036,8 @@
9831036 * @firmware_event_thread: ""
9841037 * @fw_event_lock:
9851038 * @fw_event_list: list of fw events
1039
+ * @current_evet: current processing firmware event
1040
+ * @fw_event_cleanup: set to one while cleaning up the fw events
9861041 * @aen_event_read_flag: event log was read
9871042 * @broadcast_aen_busy: broadcast aen waiting to be serviced
9881043 * @shost_recovery: host reset in progress
....@@ -1001,7 +1056,17 @@
10011056 * @msix_vector_count: number msix vectors
10021057 * @cpu_msix_table: table for mapping cpus to msix index
10031058 * @cpu_msix_table_sz: table size
1059
+ * @total_io_cnt: Gives total IO count, used to load balance the interrupts
1060
+ * @ioc_coredump_loop: will have non-zero value when FW is in CoreDump state
1061
+ * @high_iops_outstanding: used to load balance the interrupts
1062
+ * within high iops reply queues
1063
+ * @msix_load_balance: Enables load balancing of interrupts across
1064
+ * the multiple MSIXs
10041065 * @schedule_dead_ioc_flush_running_cmds: callback to flush pending commands
1066
+ * @thresh_hold: Max number of reply descriptors processed
1067
+ * before updating Host Index
1068
+ * @drv_support_bitmap: driver's supported feature bit map
1069
+ * @use_32bit_dma: Flag to use 32 bit consistent dma mask
10051070 * @scsi_io_cb_idx: shost generated commands
10061071 * @tm_cb_idx: task management commands
10071072 * @scsih_cb_idx: scsih internal commands
....@@ -1022,7 +1087,12 @@
10221087 * @event_context: unique id for each logged event
10231088 * @event_log: event log pointer
10241089 * @event_masks: events that are masked
1090
+ * @max_shutdown_latency: timeout value for NVMe shutdown operation,
1091
+ * which is equal that NVMe drive's RTD3 Entry Latency
1092
+ * which has reported maximum RTD3 Entry Latency value
1093
+ * among attached NVMe drives.
10251094 * @facts: static facts data
1095
+ * @prev_fw_facts: previous fw facts data
10261096 * @pfacts: static port facts data
10271097 * @manu_pg0: static manufacturing page 0
10281098 * @manu_pg10: static manufacturing page 10
....@@ -1119,6 +1189,8 @@
11191189 * path functions resulting in Null pointer reference followed by kernel
11201190 * crash. To avoid the above race condition we use mutex syncrhonization
11211191 * which ensures the syncrhonization between cli/sysfs_show path.
1192
+ * @atomic_desc_capable: Atomic Request Descriptor support.
1193
+ * @GET_MSIX_INDEX: Get the msix index of high iops queues.
11221194 */
11231195 struct MPT3SAS_ADAPTER {
11241196 struct list_head list;
....@@ -1136,7 +1208,6 @@
11361208 u8 ir_firmware;
11371209 int bars;
11381210 u8 mask_interrupts;
1139
- int dma_mask;
11401211
11411212 /* fw fault handler */
11421213 char fault_reset_work_q_name[20];
....@@ -1148,6 +1219,8 @@
11481219 struct workqueue_struct *firmware_event_thread;
11491220 spinlock_t fw_event_lock;
11501221 struct list_head fw_event_list;
1222
+ struct fw_event_work *current_event;
1223
+ u8 fw_events_cleanup;
11511224
11521225 /* misc flags */
11531226 int aen_event_read_flag;
....@@ -1177,6 +1250,16 @@
11771250 u32 ioc_reset_count;
11781251 MPT3SAS_FLUSH_RUNNING_CMDS schedule_dead_ioc_flush_running_cmds;
11791252 u32 non_operational_loop;
1253
+ u8 ioc_coredump_loop;
1254
+ atomic64_t total_io_cnt;
1255
+ atomic64_t high_iops_outstanding;
1256
+ bool msix_load_balance;
1257
+ u16 thresh_hold;
1258
+ u8 high_iops_queues;
1259
+ u32 drv_support_bitmap;
1260
+ u32 dma_mask;
1261
+ bool enable_sdev_max_qd;
1262
+ bool use_32bit_dma;
11801263
11811264 /* internal commands, callback index */
11821265 u8 scsi_io_cb_idx;
....@@ -1222,10 +1305,11 @@
12221305
12231306 u8 tm_custom_handling;
12241307 u8 nvme_abort_timeout;
1225
-
1308
+ u16 max_shutdown_latency;
12261309
12271310 /* static config pages */
12281311 struct mpt3sas_facts facts;
1312
+ struct mpt3sas_facts prev_fw_facts;
12291313 struct mpt3sas_port_facts *pfacts;
12301314 Mpi2ManufacturingPage0_t manu_pg0;
12311315 struct Mpi2ManufacturingPage10_t manu_pg10;
....@@ -1236,6 +1320,7 @@
12361320 Mpi2IOUnitPage0_t iounit_pg0;
12371321 Mpi2IOUnitPage1_t iounit_pg1;
12381322 Mpi2IOUnitPage8_t iounit_pg8;
1323
+ Mpi2IOCPage1_t ioc_pg1_copy;
12391324
12401325 struct _boot_device req_boot_device;
12411326 struct _boot_device req_alt_boot_device;
....@@ -1354,6 +1439,7 @@
13541439
13551440 u8 combined_reply_queue;
13561441 u8 combined_reply_index_count;
1442
+ u8 smp_affinity_enable;
13571443 /* reply post register index */
13581444 resource_size_t **replyPostRegisterIndex;
13591445
....@@ -1381,6 +1467,8 @@
13811467 u8 hide_drives;
13821468 spinlock_t diag_trigger_lock;
13831469 u8 diag_trigger_active;
1470
+ u8 atomic_desc_capable;
1471
+ BASE_READ_REG base_readl;
13841472 struct SL_WH_MASTER_TRIGGER_T diag_trigger_master;
13851473 struct SL_WH_EVENT_TRIGGERS_T diag_trigger_event;
13861474 struct SL_WH_SCSI_TRIGGERS_T diag_trigger_scsi;
....@@ -1388,9 +1476,22 @@
13881476 void *device_remove_in_progress;
13891477 u16 device_remove_in_progress_sz;
13901478 u8 is_gen35_ioc;
1479
+ u8 is_aero_ioc;
1480
+ struct dentry *debugfs_root;
1481
+ struct dentry *ioc_dump;
13911482 PUT_SMID_IO_FP_HIP put_smid_scsi_io;
1392
-
1483
+ PUT_SMID_IO_FP_HIP put_smid_fast_path;
1484
+ PUT_SMID_IO_FP_HIP put_smid_hi_priority;
1485
+ PUT_SMID_DEFAULT put_smid_default;
1486
+ GET_MSIX_INDEX get_msix_index_for_smlio;
13931487 };
1488
+
1489
+struct mpt3sas_debugfs_buffer {
1490
+ void *buf;
1491
+ u32 len;
1492
+};
1493
+
1494
+#define MPT_DRV_SUPPORT_BITMAP_MEMMOVE 0x00000001
13941495
13951496 typedef u8 (*MPT_CALLBACK)(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
13961497 u32 reply);
....@@ -1428,7 +1529,9 @@
14281529 u16 smid);
14291530 void *mpt3sas_base_get_pcie_sgl(struct MPT3SAS_ADAPTER *ioc, u16 smid);
14301531 dma_addr_t mpt3sas_base_get_pcie_sgl_dma(struct MPT3SAS_ADAPTER *ioc, u16 smid);
1431
-void mpt3sas_base_sync_reply_irqs(struct MPT3SAS_ADAPTER *ioc);
1532
+void mpt3sas_base_sync_reply_irqs(struct MPT3SAS_ADAPTER *ioc, u8 poll);
1533
+void mpt3sas_base_mask_interrupts(struct MPT3SAS_ADAPTER *ioc);
1534
+void mpt3sas_base_unmask_interrupts(struct MPT3SAS_ADAPTER *ioc);
14321535
14331536 void mpt3sas_base_put_smid_fast_path(struct MPT3SAS_ADAPTER *ioc, u16 smid,
14341537 u16 handle);
....@@ -1459,6 +1562,17 @@
14591562 u32 mpt3sas_base_get_iocstate(struct MPT3SAS_ADAPTER *ioc, int cooked);
14601563
14611564 void mpt3sas_base_fault_info(struct MPT3SAS_ADAPTER *ioc , u16 fault_code);
1565
+#define mpt3sas_print_fault_code(ioc, fault_code) \
1566
+do { pr_err("%s fault info from func: %s\n", ioc->name, __func__); \
1567
+ mpt3sas_base_fault_info(ioc, fault_code); } while (0)
1568
+
1569
+void mpt3sas_base_coredump_info(struct MPT3SAS_ADAPTER *ioc, u16 fault_code);
1570
+#define mpt3sas_print_coredump_info(ioc, fault_code) \
1571
+do { pr_err("%s fault info from func: %s\n", ioc->name, __func__); \
1572
+ mpt3sas_base_coredump_info(ioc, fault_code); } while (0)
1573
+
1574
+int mpt3sas_base_wait_for_coredump_completion(struct MPT3SAS_ADAPTER *ioc,
1575
+ const char *caller);
14621576 int mpt3sas_base_sas_iounit_control(struct MPT3SAS_ADAPTER *ioc,
14631577 Mpi2SasIoUnitControlReply_t *mpi_reply,
14641578 Mpi2SasIoUnitControlRequest_t *mpi_request);
....@@ -1480,6 +1594,12 @@
14801594
14811595 u8 mpt3sas_base_check_cmd_timeout(struct MPT3SAS_ADAPTER *ioc,
14821596 u8 status, void *mpi_request, int sz);
1597
+#define mpt3sas_check_cmd_timeout(ioc, status, mpi_request, sz, issue_reset) \
1598
+do { ioc_err(ioc, "In func: %s\n", __func__); \
1599
+ issue_reset = mpt3sas_base_check_cmd_timeout(ioc, \
1600
+ status, mpi_request, sz); } while (0)
1601
+
1602
+int mpt3sas_wait_for_ioc(struct MPT3SAS_ADAPTER *ioc, int wait_count);
14831603
14841604 /* scsih shared API */
14851605 struct scsi_cmnd *mpt3sas_scsih_scsi_lookup_get(struct MPT3SAS_ADAPTER *ioc,
....@@ -1487,14 +1607,16 @@
14871607 u8 mpt3sas_scsih_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 msix_index,
14881608 u32 reply);
14891609 void mpt3sas_scsih_pre_reset_handler(struct MPT3SAS_ADAPTER *ioc);
1490
-void mpt3sas_scsih_after_reset_handler(struct MPT3SAS_ADAPTER *ioc);
1610
+void mpt3sas_scsih_clear_outstanding_scsi_tm_commands(
1611
+ struct MPT3SAS_ADAPTER *ioc);
14911612 void mpt3sas_scsih_reset_done_handler(struct MPT3SAS_ADAPTER *ioc);
14921613
1493
-int mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, u64 lun,
1494
- u8 type, u16 smid_task, u16 msix_task, u8 timeout, u8 tr_method);
1614
+int mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle,
1615
+ uint channel, uint id, u64 lun, u8 type, u16 smid_task,
1616
+ u16 msix_task, u8 timeout, u8 tr_method);
14951617 int mpt3sas_scsih_issue_locked_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle,
1496
- u64 lun, u8 type, u16 smid_task, u16 msix_task,
1497
- u8 timeout, u8 tr_method);
1618
+ uint channel, uint id, u64 lun, u8 type, u16 smid_task,
1619
+ u16 msix_task, u8 timeout, u8 tr_method);
14981620
14991621 void mpt3sas_scsih_set_tm_flag(struct MPT3SAS_ADAPTER *ioc, u16 handle);
15001622 void mpt3sas_scsih_clear_tm_flag(struct MPT3SAS_ADAPTER *ioc, u16 handle);
....@@ -1520,6 +1642,7 @@
15201642 void mpt3sas_port_enable_complete(struct MPT3SAS_ADAPTER *ioc);
15211643 struct _raid_device *
15221644 mpt3sas_raid_device_find_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle);
1645
+void mpt3sas_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth);
15231646
15241647 /* config shared API */
15251648 u8 mpt3sas_config_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
....@@ -1577,6 +1700,10 @@
15771700 int mpt3sas_config_set_sas_iounit_pg1(struct MPT3SAS_ADAPTER *ioc,
15781701 Mpi2ConfigReply_t *mpi_reply, Mpi2SasIOUnitPage1_t *config_page,
15791702 u16 sz);
1703
+int mpt3sas_config_get_ioc_pg1(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigReply_t
1704
+ *mpi_reply, Mpi2IOCPage1_t *config_page);
1705
+int mpt3sas_config_set_ioc_pg1(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigReply_t
1706
+ *mpi_reply, Mpi2IOCPage1_t *config_page);
15801707 int mpt3sas_config_get_ioc_pg8(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigReply_t
15811708 *mpi_reply, Mpi2IOCPage8_t *config_page);
15821709 int mpt3sas_config_get_expander_pg0(struct MPT3SAS_ADAPTER *ioc,
....@@ -1616,7 +1743,7 @@
16161743 u8 mpt3sas_ctl_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
16171744 u32 reply);
16181745 void mpt3sas_ctl_pre_reset_handler(struct MPT3SAS_ADAPTER *ioc);
1619
-void mpt3sas_ctl_after_reset_handler(struct MPT3SAS_ADAPTER *ioc);
1746
+void mpt3sas_ctl_clear_outstanding_ioctls(struct MPT3SAS_ADAPTER *ioc);
16201747 void mpt3sas_ctl_reset_done_handler(struct MPT3SAS_ADAPTER *ioc);
16211748 u8 mpt3sas_ctl_event_callback(struct MPT3SAS_ADAPTER *ioc,
16221749 u8 msix_index, u32 reply);
....@@ -1651,7 +1778,7 @@
16511778 void mpt3sas_process_trigger_data(struct MPT3SAS_ADAPTER *ioc,
16521779 struct SL_WH_TRIGGERS_EVENT_DATA_T *event_data);
16531780 void mpt3sas_trigger_master(struct MPT3SAS_ADAPTER *ioc,
1654
- u32 tigger_bitmask);
1781
+ u32 trigger_bitmask);
16551782 void mpt3sas_trigger_event(struct MPT3SAS_ADAPTER *ioc, u16 event,
16561783 u16 log_entry_qualifier);
16571784 void mpt3sas_trigger_scsi(struct MPT3SAS_ADAPTER *ioc, u8 sense_key,
....@@ -1670,4 +1797,25 @@
16701797 /* NCQ Prio Handling Check */
16711798 bool scsih_ncq_prio_supp(struct scsi_device *sdev);
16721799
1800
+void mpt3sas_setup_debugfs(struct MPT3SAS_ADAPTER *ioc);
1801
+void mpt3sas_destroy_debugfs(struct MPT3SAS_ADAPTER *ioc);
1802
+void mpt3sas_init_debugfs(void);
1803
+void mpt3sas_exit_debugfs(void);
1804
+
1805
+/**
1806
+ * _scsih_is_pcie_scsi_device - determines if device is an pcie scsi device
1807
+ * @device_info: bitfield providing information about the device.
1808
+ * Context: none
1809
+ *
1810
+ * Returns 1 if scsi device.
1811
+ */
1812
+static inline int
1813
+mpt3sas_scsih_is_pcie_scsi_device(u32 device_info)
1814
+{
1815
+ if ((device_info &
1816
+ MPI26_PCIE_DEVINFO_MASK_DEVICE_TYPE) == MPI26_PCIE_DEVINFO_SCSI)
1817
+ return 1;
1818
+ else
1819
+ return 0;
1820
+}
16731821 #endif /* MPT3SAS_BASE_H_INCLUDED */