mpt2sas_base.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979
  1. /*
  2. * This is the Fusion MPT base driver providing common API layer interface
  3. * for access to MPT (Message Passing Technology) firmware.
  4. *
  5. * This code is based on drivers/scsi/mpt2sas/mpt2_base.h
  6. * Copyright (C) 2007-2010 LSI Corporation
  7. * (mailto:DL-MPTFusionLinux@lsi.com)
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * NO WARRANTY
  20. * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
  21. * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
  22. * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
  23. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
  24. * solely responsible for determining the appropriateness of using and
  25. * distributing the Program and assumes all risks associated with its
  26. * exercise of rights under this Agreement, including but not limited to
  27. * the risks and costs of program errors, damage to or loss of data,
  28. * programs or equipment, and unavailability or interruption of operations.
  29. * DISCLAIMER OF LIABILITY
  30. * NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
  31. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  32. * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
  33. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
  34. * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  35. * USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
  36. * HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
  37. * You should have received a copy of the GNU General Public License
  38. * along with this program; if not, write to the Free Software
  39. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
  40. * USA.
  41. */
  42. #ifndef MPT2SAS_BASE_H_INCLUDED
  43. #define MPT2SAS_BASE_H_INCLUDED
  44. #include "mpi/mpi2_type.h"
  45. #include "mpi/mpi2.h"
  46. #include "mpi/mpi2_ioc.h"
  47. #include "mpi/mpi2_cnfg.h"
  48. #include "mpi/mpi2_init.h"
  49. #include "mpi/mpi2_raid.h"
  50. #include "mpi/mpi2_tool.h"
  51. #include "mpi/mpi2_sas.h"
  52. #include <scsi/scsi.h>
  53. #include <scsi/scsi_cmnd.h>
  54. #include <scsi/scsi_device.h>
  55. #include <scsi/scsi_host.h>
  56. #include <scsi/scsi_tcq.h>
  57. #include <scsi/scsi_transport_sas.h>
  58. #include <scsi/scsi_dbg.h>
  59. #include <scsi/scsi_eh.h>
  60. #include "mpt2sas_debug.h"
  61. /* driver versioning info */
  62. #define MPT2SAS_DRIVER_NAME "mpt2sas"
  63. #define MPT2SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>"
  64. #define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver"
  65. #define MPT2SAS_DRIVER_VERSION "08.100.00.00"
  66. #define MPT2SAS_MAJOR_VERSION 08
  67. #define MPT2SAS_MINOR_VERSION 100
  68. #define MPT2SAS_BUILD_VERSION 00
  69. #define MPT2SAS_RELEASE_VERSION 00
  70. /*
  71. * Set MPT2SAS_SG_DEPTH value based on user input.
  72. */
  73. #ifdef CONFIG_SCSI_MPT2SAS_MAX_SGE
  74. #if CONFIG_SCSI_MPT2SAS_MAX_SGE < 16
  75. #define MPT2SAS_SG_DEPTH 16
  76. #elif CONFIG_SCSI_MPT2SAS_MAX_SGE > 128
  77. #define MPT2SAS_SG_DEPTH 128
  78. #else
  79. #define MPT2SAS_SG_DEPTH CONFIG_SCSI_MPT2SAS_MAX_SGE
  80. #endif
  81. #else
  82. #define MPT2SAS_SG_DEPTH 128 /* MAX_HW_SEGMENTS */
  83. #endif
  84. /*
  85. * Generic Defines
  86. */
  87. #define MPT2SAS_SATA_QUEUE_DEPTH 32
  88. #define MPT2SAS_SAS_QUEUE_DEPTH 254
  89. #define MPT2SAS_RAID_QUEUE_DEPTH 128
  90. #define MPT_NAME_LENGTH 32 /* generic length of strings */
  91. #define MPT_STRING_LENGTH 64
  92. #define MPT_MAX_CALLBACKS 16
  93. #define CAN_SLEEP 1
  94. #define NO_SLEEP 0
  95. #define INTERNAL_CMDS_COUNT 10 /* reserved cmds */
  96. #define MPI2_HIM_MASK 0xFFFFFFFF /* mask every bit*/
  97. #define MPT2SAS_INVALID_DEVICE_HANDLE 0xFFFF
  98. /*
  99. * reset phases
  100. */
  101. #define MPT2_IOC_PRE_RESET 1 /* prior to host reset */
  102. #define MPT2_IOC_AFTER_RESET 2 /* just after host reset */
  103. #define MPT2_IOC_DONE_RESET 3 /* links re-initialized */
  104. /*
  105. * logging format
  106. */
  107. #define MPT2SAS_FMT "%s: "
  108. #define MPT2SAS_INFO_FMT KERN_INFO MPT2SAS_FMT
  109. #define MPT2SAS_NOTE_FMT KERN_NOTICE MPT2SAS_FMT
  110. #define MPT2SAS_WARN_FMT KERN_WARNING MPT2SAS_FMT
  111. #define MPT2SAS_ERR_FMT KERN_ERR MPT2SAS_FMT
  112. /*
  113. * Dell HBA branding
  114. */
  115. #define MPT2SAS_DELL_BRANDING_SIZE 32
  116. #define MPT2SAS_DELL_6GBPS_SAS_HBA_BRANDING "Dell 6Gbps SAS HBA"
  117. #define MPT2SAS_DELL_PERC_H200_ADAPTER_BRANDING "Dell PERC H200 Adapter"
  118. #define MPT2SAS_DELL_PERC_H200_INTEGRATED_BRANDING "Dell PERC H200 Integrated"
  119. #define MPT2SAS_DELL_PERC_H200_MODULAR_BRANDING "Dell PERC H200 Modular"
  120. #define MPT2SAS_DELL_PERC_H200_EMBEDDED_BRANDING "Dell PERC H200 Embedded"
  121. #define MPT2SAS_DELL_PERC_H200_BRANDING "Dell PERC H200"
  122. #define MPT2SAS_DELL_6GBPS_SAS_BRANDING "Dell 6Gbps SAS"
  123. /*
  124. * Dell HBA SSDIDs
  125. */
  126. #define MPT2SAS_DELL_6GBPS_SAS_HBA_SSDID 0x1F1C
  127. #define MPT2SAS_DELL_PERC_H200_ADAPTER_SSDID 0x1F1D
  128. #define MPT2SAS_DELL_PERC_H200_INTEGRATED_SSDID 0x1F1E
  129. #define MPT2SAS_DELL_PERC_H200_MODULAR_SSDID 0x1F1F
  130. #define MPT2SAS_DELL_PERC_H200_EMBEDDED_SSDID 0x1F20
  131. #define MPT2SAS_DELL_PERC_H200_SSDID 0x1F21
  132. #define MPT2SAS_DELL_6GBPS_SAS_SSDID 0x1F22
  133. /*
  134. * Intel HBA branding
  135. */
  136. #define MPT2SAS_INTEL_RMS2LL080_BRANDING \
  137. "Intel Integrated RAID Module RMS2LL080"
  138. #define MPT2SAS_INTEL_RMS2LL040_BRANDING \
  139. "Intel Integrated RAID Module RMS2LL040"
  140. /*
  141. * Intel HBA SSDIDs
  142. */
  143. #define MPT2SAS_INTEL_RMS2LL080_SSDID 0x350E
  144. #define MPT2SAS_INTEL_RMS2LL040_SSDID 0x350F
  145. /*
  146. * per target private data
  147. */
  148. #define MPT_TARGET_FLAGS_RAID_COMPONENT 0x01
  149. #define MPT_TARGET_FLAGS_VOLUME 0x02
  150. #define MPT_TARGET_FLAGS_DELETED 0x04
  151. /**
  152. * struct MPT2SAS_TARGET - starget private hostdata
  153. * @starget: starget object
  154. * @sas_address: target sas address
  155. * @handle: device handle
  156. * @num_luns: number luns
  157. * @flags: MPT_TARGET_FLAGS_XXX flags
  158. * @deleted: target flaged for deletion
  159. * @tm_busy: target is busy with TM request.
  160. */
  161. struct MPT2SAS_TARGET {
  162. struct scsi_target *starget;
  163. u64 sas_address;
  164. u16 handle;
  165. int num_luns;
  166. u32 flags;
  167. u8 deleted;
  168. u8 tm_busy;
  169. };
  170. /*
  171. * per device private data
  172. */
  173. #define MPT_DEVICE_FLAGS_INIT 0x01
  174. #define MPT_DEVICE_TLR_ON 0x02
  175. /**
  176. * struct MPT2SAS_DEVICE - sdev private hostdata
  177. * @sas_target: starget private hostdata
  178. * @lun: lun number
  179. * @flags: MPT_DEVICE_XXX flags
  180. * @configured_lun: lun is configured
  181. * @block: device is in SDEV_BLOCK state
  182. * @tlr_snoop_check: flag used in determining whether to disable TLR
  183. */
  184. /* OEM Identifiers */
  185. #define MFG10_OEM_ID_INVALID (0x00000000)
  186. #define MFG10_OEM_ID_DELL (0x00000001)
  187. #define MFG10_OEM_ID_FSC (0x00000002)
  188. #define MFG10_OEM_ID_SUN (0x00000003)
  189. #define MFG10_OEM_ID_IBM (0x00000004)
  190. /* GENERIC Flags 0*/
  191. #define MFG10_GF0_OCE_DISABLED (0x00000001)
  192. #define MFG10_GF0_R1E_DRIVE_COUNT (0x00000002)
  193. #define MFG10_GF0_R10_DISPLAY (0x00000004)
  194. #define MFG10_GF0_SSD_DATA_SCRUB_DISABLE (0x00000008)
  195. #define MFG10_GF0_SINGLE_DRIVE_R0 (0x00000010)
  196. /* OEM Specific Flags will come from OEM specific header files */
  197. typedef struct _MPI2_CONFIG_PAGE_MAN_10 {
  198. MPI2_CONFIG_PAGE_HEADER Header; /* 00h */
  199. U8 OEMIdentifier; /* 04h */
  200. U8 Reserved1; /* 05h */
  201. U16 Reserved2; /* 08h */
  202. U32 Reserved3; /* 0Ch */
  203. U32 GenericFlags0; /* 10h */
  204. U32 GenericFlags1; /* 14h */
  205. U32 Reserved4; /* 18h */
  206. U32 OEMSpecificFlags0; /* 1Ch */
  207. U32 OEMSpecificFlags1; /* 20h */
  208. U32 Reserved5[18]; /* 24h-60h*/
  209. } MPI2_CONFIG_PAGE_MAN_10,
  210. MPI2_POINTER PTR_MPI2_CONFIG_PAGE_MAN_10,
  211. Mpi2ManufacturingPage10_t, MPI2_POINTER pMpi2ManufacturingPage10_t;
  212. struct MPT2SAS_DEVICE {
  213. struct MPT2SAS_TARGET *sas_target;
  214. unsigned int lun;
  215. u32 flags;
  216. u8 configured_lun;
  217. u8 block;
  218. u8 tlr_snoop_check;
  219. };
  220. #define MPT2_CMD_NOT_USED 0x8000 /* free */
  221. #define MPT2_CMD_COMPLETE 0x0001 /* completed */
  222. #define MPT2_CMD_PENDING 0x0002 /* pending */
  223. #define MPT2_CMD_REPLY_VALID 0x0004 /* reply is valid */
  224. #define MPT2_CMD_RESET 0x0008 /* host reset dropped the command */
  225. /**
  226. * struct _internal_cmd - internal commands struct
  227. * @mutex: mutex
  228. * @done: completion
  229. * @reply: reply message pointer
  230. * @sense: sense data
  231. * @status: MPT2_CMD_XXX status
  232. * @smid: system message id
  233. */
  234. struct _internal_cmd {
  235. struct mutex mutex;
  236. struct completion done;
  237. void *reply;
  238. void *sense;
  239. u16 status;
  240. u16 smid;
  241. };
  242. /**
  243. * struct _sas_device - attached device information
  244. * @list: sas device list
  245. * @starget: starget object
  246. * @sas_address: device sas address
  247. * @device_name: retrieved from the SAS IDENTIFY frame.
  248. * @handle: device handle
  249. * @sas_address_parent: sas address of parent expander or sas host
  250. * @enclosure_handle: enclosure handle
  251. * @enclosure_logical_id: enclosure logical identifier
  252. * @volume_handle: volume handle (valid when hidden raid member)
  253. * @volume_wwid: volume unique identifier
  254. * @device_info: bitfield provides detailed info about the device
  255. * @id: target id
  256. * @channel: target channel
  257. * @slot: number number
  258. * @phy: phy identifier provided in sas device page 0
  259. * @responding: used in _scsih_sas_device_mark_responding
  260. */
  261. struct _sas_device {
  262. struct list_head list;
  263. struct scsi_target *starget;
  264. u64 sas_address;
  265. u64 device_name;
  266. u16 handle;
  267. u64 sas_address_parent;
  268. u16 enclosure_handle;
  269. u64 enclosure_logical_id;
  270. u16 volume_handle;
  271. u64 volume_wwid;
  272. u32 device_info;
  273. int id;
  274. int channel;
  275. u16 slot;
  276. u8 phy;
  277. u8 responding;
  278. };
  279. /**
  280. * struct _raid_device - raid volume link list
  281. * @list: sas device list
  282. * @starget: starget object
  283. * @sdev: scsi device struct (volumes are single lun)
  284. * @wwid: unique identifier for the volume
  285. * @handle: device handle
  286. * @id: target id
  287. * @channel: target channel
  288. * @volume_type: the raid level
  289. * @device_info: bitfield provides detailed info about the hidden components
  290. * @num_pds: number of hidden raid components
  291. * @responding: used in _scsih_raid_device_mark_responding
  292. * @percent_complete: resync percent complete
  293. */
  294. struct _raid_device {
  295. struct list_head list;
  296. struct scsi_target *starget;
  297. struct scsi_device *sdev;
  298. u64 wwid;
  299. u16 handle;
  300. int id;
  301. int channel;
  302. u8 volume_type;
  303. u32 device_info;
  304. u8 num_pds;
  305. u8 responding;
  306. u8 percent_complete;
  307. };
  308. /**
  309. * struct _boot_device - boot device info
  310. * @is_raid: flag to indicate whether this is volume
  311. * @device: holds pointer for either struct _sas_device or
  312. * struct _raid_device
  313. */
  314. struct _boot_device {
  315. u8 is_raid;
  316. void *device;
  317. };
  318. /**
  319. * struct _sas_port - wide/narrow sas port information
  320. * @port_list: list of ports belonging to expander
  321. * @num_phys: number of phys belonging to this port
  322. * @remote_identify: attached device identification
  323. * @rphy: sas transport rphy object
  324. * @port: sas transport wide/narrow port object
  325. * @phy_list: _sas_phy list objects belonging to this port
  326. */
  327. struct _sas_port {
  328. struct list_head port_list;
  329. u8 num_phys;
  330. struct sas_identify remote_identify;
  331. struct sas_rphy *rphy;
  332. struct sas_port *port;
  333. struct list_head phy_list;
  334. };
  335. /**
  336. * struct _sas_phy - phy information
  337. * @port_siblings: list of phys belonging to a port
  338. * @identify: phy identification
  339. * @remote_identify: attached device identification
  340. * @phy: sas transport phy object
  341. * @phy_id: unique phy id
  342. * @handle: device handle for this phy
  343. * @attached_handle: device handle for attached device
  344. * @phy_belongs_to_port: port has been created for this phy
  345. */
  346. struct _sas_phy {
  347. struct list_head port_siblings;
  348. struct sas_identify identify;
  349. struct sas_identify remote_identify;
  350. struct sas_phy *phy;
  351. u8 phy_id;
  352. u16 handle;
  353. u16 attached_handle;
  354. u8 phy_belongs_to_port;
  355. };
  356. /**
  357. * struct _sas_node - sas_host/expander information
  358. * @list: list of expanders
  359. * @parent_dev: parent device class
  360. * @num_phys: number phys belonging to this sas_host/expander
  361. * @sas_address: sas address of this sas_host/expander
  362. * @handle: handle for this sas_host/expander
  363. * @sas_address_parent: sas address of parent expander or sas host
  364. * @enclosure_handle: handle for this a member of an enclosure
  365. * @device_info: bitwise defining capabilities of this sas_host/expander
  366. * @responding: used in _scsih_expander_device_mark_responding
  367. * @phy: a list of phys that make up this sas_host/expander
  368. * @sas_port_list: list of ports attached to this sas_host/expander
  369. */
  370. struct _sas_node {
  371. struct list_head list;
  372. struct device *parent_dev;
  373. u8 num_phys;
  374. u64 sas_address;
  375. u16 handle;
  376. u64 sas_address_parent;
  377. u16 enclosure_handle;
  378. u64 enclosure_logical_id;
  379. u8 responding;
  380. struct _sas_phy *phy;
  381. struct list_head sas_port_list;
  382. };
  383. /**
  384. * enum reset_type - reset state
  385. * @FORCE_BIG_HAMMER: issue diagnostic reset
  386. * @SOFT_RESET: issue message_unit_reset, if fails to to big hammer
  387. */
  388. enum reset_type {
  389. FORCE_BIG_HAMMER,
  390. SOFT_RESET,
  391. };
  392. /**
  393. * struct chain_tracker - firmware chain tracker
  394. * @chain_buffer: chain buffer
  395. * @chain_buffer_dma: physical address
  396. * @tracker_list: list of free request (ioc->free_chain_list)
  397. */
  398. struct chain_tracker {
  399. void *chain_buffer;
  400. dma_addr_t chain_buffer_dma;
  401. struct list_head tracker_list;
  402. };
  403. /**
  404. * struct scsiio_tracker - scsi mf request tracker
  405. * @smid: system message id
  406. * @scmd: scsi request pointer
  407. * @cb_idx: callback index
  408. * @chain_list: list of chains associated to this IO
  409. * @tracker_list: list of free request (ioc->free_list)
  410. */
  411. struct scsiio_tracker {
  412. u16 smid;
  413. struct scsi_cmnd *scmd;
  414. u8 cb_idx;
  415. struct list_head chain_list;
  416. struct list_head tracker_list;
  417. };
  418. /**
  419. * struct request_tracker - misc mf request tracker
  420. * @smid: system message id
  421. * @scmd: scsi request pointer
  422. * @cb_idx: callback index
  423. * @tracker_list: list of free request (ioc->free_list)
  424. */
  425. struct request_tracker {
  426. u16 smid;
  427. u8 cb_idx;
  428. struct list_head tracker_list;
  429. };
  430. /**
  431. * struct _tr_list - target reset list
  432. * @handle: device handle
  433. * @state: state machine
  434. */
  435. struct _tr_list {
  436. struct list_head list;
  437. u16 handle;
  438. u16 state;
  439. };
  440. typedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr);
  441. /**
  442. * struct MPT2SAS_ADAPTER - per adapter struct
  443. * @list: ioc_list
  444. * @shost: shost object
  445. * @id: unique adapter id
  446. * @pci_irq: irq number
  447. * @name: generic ioc string
  448. * @tmp_string: tmp string used for logging
  449. * @pdev: pci pdev object
  450. * @chip: memory mapped register space
  451. * @chip_phys: physical addrss prior to mapping
  452. * @logging_level: see mpt2sas_debug.h
  453. * @fwfault_debug: debuging FW timeouts
  454. * @ir_firmware: IR firmware present
  455. * @bars: bitmask of BAR's that must be configured
  456. * @mask_interrupts: ignore interrupt
  457. * @fault_reset_work_q_name: fw fault work queue
  458. * @fault_reset_work_q: ""
  459. * @fault_reset_work: ""
  460. * @firmware_event_name: fw event work queue
  461. * @firmware_event_thread: ""
  462. * @fw_events_off: flag to turn off fw event handling
  463. * @fw_event_lock:
  464. * @fw_event_list: list of fw events
  465. * @aen_event_read_flag: event log was read
  466. * @broadcast_aen_busy: broadcast aen waiting to be serviced
  467. * @shost_recovery: host reset in progress
  468. * @ioc_reset_in_progress_lock:
  469. * @ioc_link_reset_in_progress: phy/hard reset in progress
  470. * @ignore_loginfos: ignore loginfos during task management
  471. * @remove_host: flag for when driver unloads, to avoid sending dev resets
  472. * @pci_error_recovery: flag to prevent ioc access until slot reset completes
  473. * @wait_for_port_enable_to_complete:
  474. * @msix_enable: flag indicating msix is enabled
  475. * @msix_vector_count: number msix vectors
  476. * @msix_table: virt address to the msix table
  477. * @msix_table_backup: backup msix table
  478. * @scsi_io_cb_idx: shost generated commands
  479. * @tm_cb_idx: task management commands
  480. * @scsih_cb_idx: scsih internal commands
  481. * @transport_cb_idx: transport internal commands
  482. * @ctl_cb_idx: clt internal commands
  483. * @base_cb_idx: base internal commands
  484. * @config_cb_idx: base internal commands
  485. * @tm_tr_cb_idx : device removal target reset handshake
  486. * @tm_tr_volume_cb_idx : volume removal target reset
  487. * @base_cmds:
  488. * @transport_cmds:
  489. * @scsih_cmds:
  490. * @tm_cmds:
  491. * @ctl_cmds:
  492. * @config_cmds:
  493. * @base_add_sg_single: handler for either 32/64 bit sgl's
  494. * @event_type: bits indicating which events to log
  495. * @event_context: unique id for each logged event
  496. * @event_log: event log pointer
  497. * @event_masks: events that are masked
  498. * @facts: static facts data
  499. * @pfacts: static port facts data
  500. * @manu_pg0: static manufacturing page 0
  501. * @manu_pg10: static manufacturing page 10
  502. * @bios_pg2: static bios page 2
  503. * @bios_pg3: static bios page 3
  504. * @ioc_pg8: static ioc page 8
  505. * @iounit_pg0: static iounit page 0
  506. * @iounit_pg1: static iounit page 1
  507. * @sas_hba: sas host object
  508. * @sas_expander_list: expander object list
  509. * @sas_node_lock:
  510. * @sas_device_list: sas device object list
  511. * @sas_device_init_list: sas device object list (used only at init time)
  512. * @sas_device_lock:
  513. * @io_missing_delay: time for IO completed by fw when PDR enabled
  514. * @device_missing_delay: time for device missing by fw when PDR enabled
  515. * @sas_id : used for setting volume target IDs
  516. * @pd_handles : bitmask for PD handles
  517. * @pd_handles_sz : size of pd_handle bitmask
  518. * @config_page_sz: config page size
  519. * @config_page: reserve memory for config page payload
  520. * @config_page_dma:
  521. * @hba_queue_depth: hba request queue depth
  522. * @sge_size: sg element size for either 32/64 bit
  523. * @scsiio_depth: SCSI_IO queue depth
  524. * @request_sz: per request frame size
  525. * @request: pool of request frames
  526. * @request_dma:
  527. * @request_dma_sz:
  528. * @scsi_lookup: firmware request tracker list
  529. * @scsi_lookup_lock:
  530. * @free_list: free list of request
  531. * @chain: pool of chains
  532. * @pending_io_count:
  533. * @reset_wq:
  534. * @chain_dma:
  535. * @max_sges_in_main_message: number sg elements in main message
  536. * @max_sges_in_chain_message: number sg elements per chain
  537. * @chains_needed_per_io: max chains per io
  538. * @chain_offset_value_for_main_message: location 1st sg in main
  539. * @chain_depth: total chains allocated
  540. * @hi_priority_smid:
  541. * @hi_priority:
  542. * @hi_priority_dma:
  543. * @hi_priority_depth:
  544. * @hpr_lookup:
  545. * @hpr_free_list:
  546. * @internal_smid:
  547. * @internal:
  548. * @internal_dma:
  549. * @internal_depth:
  550. * @internal_lookup:
  551. * @internal_free_list:
  552. * @sense: pool of sense
  553. * @sense_dma:
  554. * @sense_dma_pool:
  555. * @reply_depth: hba reply queue depth:
  556. * @reply_sz: per reply frame size:
  557. * @reply: pool of replys:
  558. * @reply_dma:
  559. * @reply_dma_pool:
  560. * @reply_free_queue_depth: reply free depth
  561. * @reply_free: pool for reply free queue (32 bit addr)
  562. * @reply_free_dma:
  563. * @reply_free_dma_pool:
  564. * @reply_free_host_index: tail index in pool to insert free replys
  565. * @reply_post_queue_depth: reply post queue depth
  566. * @reply_post_free: pool for reply post (64bit descriptor)
  567. * @reply_post_free_dma:
  568. * @reply_post_free_dma_pool:
  569. * @reply_post_host_index: head index in the pool where FW completes IO
  570. * @delayed_tr_list: target reset link list
  571. * @delayed_tr_volume_list: volume target reset link list
  572. */
  573. struct MPT2SAS_ADAPTER {
  574. struct list_head list;
  575. struct Scsi_Host *shost;
  576. u8 id;
  577. u32 pci_irq;
  578. char name[MPT_NAME_LENGTH];
  579. char tmp_string[MPT_STRING_LENGTH];
  580. struct pci_dev *pdev;
  581. Mpi2SystemInterfaceRegs_t __iomem *chip;
  582. resource_size_t chip_phys;
  583. int logging_level;
  584. int fwfault_debug;
  585. u8 ir_firmware;
  586. int bars;
  587. u8 mask_interrupts;
  588. /* fw fault handler */
  589. char fault_reset_work_q_name[20];
  590. struct workqueue_struct *fault_reset_work_q;
  591. struct delayed_work fault_reset_work;
  592. /* fw event handler */
  593. char firmware_event_name[20];
  594. struct workqueue_struct *firmware_event_thread;
  595. spinlock_t fw_event_lock;
  596. struct list_head fw_event_list;
  597. /* misc flags */
  598. int aen_event_read_flag;
  599. u8 broadcast_aen_busy;
  600. u8 shost_recovery;
  601. struct mutex reset_in_progress_mutex;
  602. struct completion shost_recovery_done;
  603. spinlock_t ioc_reset_in_progress_lock;
  604. u8 ioc_link_reset_in_progress;
  605. int ioc_reset_in_progress_status;
  606. u8 ignore_loginfos;
  607. u8 remove_host;
  608. u8 pci_error_recovery;
  609. u8 wait_for_port_enable_to_complete;
  610. u8 msix_enable;
  611. u16 msix_vector_count;
  612. u32 *msix_table;
  613. u32 *msix_table_backup;
  614. u32 ioc_reset_count;
  615. /* internal commands, callback index */
  616. u8 scsi_io_cb_idx;
  617. u8 tm_cb_idx;
  618. u8 transport_cb_idx;
  619. u8 scsih_cb_idx;
  620. u8 ctl_cb_idx;
  621. u8 base_cb_idx;
  622. u8 config_cb_idx;
  623. u8 tm_tr_cb_idx;
  624. u8 tm_tr_volume_cb_idx;
  625. u8 tm_sas_control_cb_idx;
  626. struct _internal_cmd base_cmds;
  627. struct _internal_cmd transport_cmds;
  628. struct _internal_cmd scsih_cmds;
  629. struct _internal_cmd tm_cmds;
  630. struct _internal_cmd ctl_cmds;
  631. struct _internal_cmd config_cmds;
  632. MPT_ADD_SGE base_add_sg_single;
  633. /* event log */
  634. u32 event_type[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS];
  635. u32 event_context;
  636. void *event_log;
  637. u32 event_masks[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS];
  638. /* static config pages */
  639. Mpi2IOCFactsReply_t facts;
  640. Mpi2PortFactsReply_t *pfacts;
  641. Mpi2ManufacturingPage0_t manu_pg0;
  642. Mpi2BiosPage2_t bios_pg2;
  643. Mpi2BiosPage3_t bios_pg3;
  644. Mpi2IOCPage8_t ioc_pg8;
  645. Mpi2IOUnitPage0_t iounit_pg0;
  646. Mpi2IOUnitPage1_t iounit_pg1;
  647. struct _boot_device req_boot_device;
  648. struct _boot_device req_alt_boot_device;
  649. struct _boot_device current_boot_device;
  650. /* sas hba, expander, and device list */
  651. struct _sas_node sas_hba;
  652. struct list_head sas_expander_list;
  653. spinlock_t sas_node_lock;
  654. struct list_head sas_device_list;
  655. struct list_head sas_device_init_list;
  656. spinlock_t sas_device_lock;
  657. struct list_head raid_device_list;
  658. spinlock_t raid_device_lock;
  659. u8 io_missing_delay;
  660. u16 device_missing_delay;
  661. int sas_id;
  662. void *pd_handles;
  663. u16 pd_handles_sz;
  664. /* config page */
  665. u16 config_page_sz;
  666. void *config_page;
  667. dma_addr_t config_page_dma;
  668. /* scsiio request */
  669. u16 hba_queue_depth;
  670. u16 sge_size;
  671. u16 scsiio_depth;
  672. u16 request_sz;
  673. u8 *request;
  674. dma_addr_t request_dma;
  675. u32 request_dma_sz;
  676. struct scsiio_tracker *scsi_lookup;
  677. ulong scsi_lookup_pages;
  678. spinlock_t scsi_lookup_lock;
  679. struct list_head free_list;
  680. int pending_io_count;
  681. wait_queue_head_t reset_wq;
  682. /* chain */
  683. struct chain_tracker *chain_lookup;
  684. struct list_head free_chain_list;
  685. struct dma_pool *chain_dma_pool;
  686. ulong chain_pages;
  687. u16 max_sges_in_main_message;
  688. u16 max_sges_in_chain_message;
  689. u16 chains_needed_per_io;
  690. u16 chain_offset_value_for_main_message;
  691. u32 chain_depth;
  692. /* hi-priority queue */
  693. u16 hi_priority_smid;
  694. u8 *hi_priority;
  695. dma_addr_t hi_priority_dma;
  696. u16 hi_priority_depth;
  697. struct request_tracker *hpr_lookup;
  698. struct list_head hpr_free_list;
  699. /* internal queue */
  700. u16 internal_smid;
  701. u8 *internal;
  702. dma_addr_t internal_dma;
  703. u16 internal_depth;
  704. struct request_tracker *internal_lookup;
  705. struct list_head internal_free_list;
  706. /* sense */
  707. u8 *sense;
  708. dma_addr_t sense_dma;
  709. struct dma_pool *sense_dma_pool;
  710. /* reply */
  711. u16 reply_sz;
  712. u8 *reply;
  713. dma_addr_t reply_dma;
  714. u32 reply_dma_max_address;
  715. u32 reply_dma_min_address;
  716. struct dma_pool *reply_dma_pool;
  717. /* reply free queue */
  718. u16 reply_free_queue_depth;
  719. u32 *reply_free;
  720. dma_addr_t reply_free_dma;
  721. struct dma_pool *reply_free_dma_pool;
  722. u32 reply_free_host_index;
  723. /* reply post queue */
  724. u16 reply_post_queue_depth;
  725. Mpi2ReplyDescriptorsUnion_t *reply_post_free;
  726. dma_addr_t reply_post_free_dma;
  727. struct dma_pool *reply_post_free_dma_pool;
  728. u32 reply_post_host_index;
  729. struct list_head delayed_tr_list;
  730. struct list_head delayed_tr_volume_list;
  731. /* diag buffer support */
  732. u8 *diag_buffer[MPI2_DIAG_BUF_TYPE_COUNT];
  733. u32 diag_buffer_sz[MPI2_DIAG_BUF_TYPE_COUNT];
  734. dma_addr_t diag_buffer_dma[MPI2_DIAG_BUF_TYPE_COUNT];
  735. u8 diag_buffer_status[MPI2_DIAG_BUF_TYPE_COUNT];
  736. u32 unique_id[MPI2_DIAG_BUF_TYPE_COUNT];
  737. Mpi2ManufacturingPage10_t manu_pg10;
  738. u32 product_specific[MPI2_DIAG_BUF_TYPE_COUNT][23];
  739. u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT];
  740. u32 ring_buffer_offset;
  741. u32 ring_buffer_sz;
  742. };
  743. typedef u8 (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
  744. u32 reply);
  745. /* base shared API */
  746. extern struct list_head mpt2sas_ioc_list;
  747. void mpt2sas_base_start_watchdog(struct MPT2SAS_ADAPTER *ioc);
  748. void mpt2sas_base_stop_watchdog(struct MPT2SAS_ADAPTER *ioc);
  749. int mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc);
  750. void mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc);
  751. int mpt2sas_base_map_resources(struct MPT2SAS_ADAPTER *ioc);
  752. void mpt2sas_base_free_resources(struct MPT2SAS_ADAPTER *ioc);
  753. int mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
  754. enum reset_type type);
  755. void *mpt2sas_base_get_msg_frame(struct MPT2SAS_ADAPTER *ioc, u16 smid);
  756. void *mpt2sas_base_get_sense_buffer(struct MPT2SAS_ADAPTER *ioc, u16 smid);
  757. void mpt2sas_base_build_zero_len_sge(struct MPT2SAS_ADAPTER *ioc, void *paddr);
  758. __le32 mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc,
  759. u16 smid);
  760. /* hi-priority queue */
  761. u16 mpt2sas_base_get_smid_hpr(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx);
  762. u16 mpt2sas_base_get_smid_scsiio(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx,
  763. struct scsi_cmnd *scmd);
  764. u16 mpt2sas_base_get_smid(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx);
  765. void mpt2sas_base_free_smid(struct MPT2SAS_ADAPTER *ioc, u16 smid);
  766. void mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid,
  767. u16 handle);
  768. void mpt2sas_base_put_smid_hi_priority(struct MPT2SAS_ADAPTER *ioc, u16 smid);
  769. void mpt2sas_base_put_smid_target_assist(struct MPT2SAS_ADAPTER *ioc, u16 smid,
  770. u16 io_index);
  771. void mpt2sas_base_put_smid_default(struct MPT2SAS_ADAPTER *ioc, u16 smid);
  772. void mpt2sas_base_initialize_callback_handler(void);
  773. u8 mpt2sas_base_register_callback_handler(MPT_CALLBACK cb_func);
  774. void mpt2sas_base_release_callback_handler(u8 cb_idx);
  775. u8 mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
  776. u32 reply);
  777. void *mpt2sas_base_get_reply_virt_addr(struct MPT2SAS_ADAPTER *ioc, u32 phys_addr);
  778. u32 mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked);
  779. void mpt2sas_base_fault_info(struct MPT2SAS_ADAPTER *ioc , u16 fault_code);
  780. int mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc,
  781. Mpi2SasIoUnitControlReply_t *mpi_reply, Mpi2SasIoUnitControlRequest_t
  782. *mpi_request);
  783. int mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc,
  784. Mpi2SepReply_t *mpi_reply, Mpi2SepRequest_t *mpi_request);
  785. void mpt2sas_base_validate_event_type(struct MPT2SAS_ADAPTER *ioc, u32 *event_type);
  786. void mpt2sas_halt_firmware(struct MPT2SAS_ADAPTER *ioc);
  787. /* scsih shared API */
  788. u8 mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index,
  789. u32 reply);
  790. int mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle,
  791. uint channel, uint id, uint lun, u8 type, u16 smid_task,
  792. ulong timeout, struct scsi_cmnd *scmd);
  793. void mpt2sas_scsih_set_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle);
  794. void mpt2sas_scsih_clear_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle);
  795. void mpt2sas_expander_remove(struct MPT2SAS_ADAPTER *ioc, u64 sas_address);
  796. void mpt2sas_device_remove(struct MPT2SAS_ADAPTER *ioc, u64 sas_address);
  797. struct _sas_node *mpt2sas_scsih_expander_find_by_handle(struct MPT2SAS_ADAPTER *ioc,
  798. u16 handle);
  799. struct _sas_node *mpt2sas_scsih_expander_find_by_sas_address(struct MPT2SAS_ADAPTER
  800. *ioc, u64 sas_address);
  801. struct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address(
  802. struct MPT2SAS_ADAPTER *ioc, u64 sas_address);
  803. void mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase);
  804. /* config shared API */
  805. u8 mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
  806. u32 reply);
  807. int mpt2sas_config_get_number_hba_phys(struct MPT2SAS_ADAPTER *ioc, u8 *num_phys);
  808. int mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc,
  809. Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage0_t *config_page);
  810. int mpt2sas_config_get_manufacturing_pg10(struct MPT2SAS_ADAPTER *ioc,
  811. Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage10_t *config_page);
  812. int mpt2sas_config_get_bios_pg2(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  813. *mpi_reply, Mpi2BiosPage2_t *config_page);
  814. int mpt2sas_config_get_bios_pg3(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  815. *mpi_reply, Mpi2BiosPage3_t *config_page);
  816. int mpt2sas_config_get_iounit_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  817. *mpi_reply, Mpi2IOUnitPage0_t *config_page);
  818. int mpt2sas_config_get_sas_device_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  819. *mpi_reply, Mpi2SasDevicePage0_t *config_page, u32 form, u32 handle);
  820. int mpt2sas_config_get_sas_device_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  821. *mpi_reply, Mpi2SasDevicePage1_t *config_page, u32 form, u32 handle);
  822. int mpt2sas_config_get_sas_iounit_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  823. *mpi_reply, Mpi2SasIOUnitPage0_t *config_page, u16 sz);
  824. int mpt2sas_config_get_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  825. *mpi_reply, Mpi2IOUnitPage1_t *config_page);
  826. int mpt2sas_config_set_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  827. *mpi_reply, Mpi2IOUnitPage1_t *config_page);
  828. int mpt2sas_config_get_sas_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  829. *mpi_reply, Mpi2SasIOUnitPage1_t *config_page, u16 sz);
  830. int mpt2sas_config_set_sas_iounit_pg1(struct MPT2SAS_ADAPTER *ioc,
  831. Mpi2ConfigReply_t *mpi_reply, Mpi2SasIOUnitPage1_t *config_page, u16 sz);
  832. int mpt2sas_config_get_ioc_pg8(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  833. *mpi_reply, Mpi2IOCPage8_t *config_page);
  834. int mpt2sas_config_get_expander_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  835. *mpi_reply, Mpi2ExpanderPage0_t *config_page, u32 form, u32 handle);
  836. int mpt2sas_config_get_expander_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  837. *mpi_reply, Mpi2ExpanderPage1_t *config_page, u32 phy_number, u16 handle);
  838. int mpt2sas_config_get_enclosure_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  839. *mpi_reply, Mpi2SasEnclosurePage0_t *config_page, u32 form, u32 handle);
  840. int mpt2sas_config_get_phy_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  841. *mpi_reply, Mpi2SasPhyPage0_t *config_page, u32 phy_number);
  842. int mpt2sas_config_get_phy_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  843. *mpi_reply, Mpi2SasPhyPage1_t *config_page, u32 phy_number);
  844. int mpt2sas_config_get_raid_volume_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  845. *mpi_reply, Mpi2RaidVolPage1_t *config_page, u32 form, u32 handle);
  846. int mpt2sas_config_get_number_pds(struct MPT2SAS_ADAPTER *ioc, u16 handle, u8 *num_pds);
  847. int mpt2sas_config_get_raid_volume_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  848. *mpi_reply, Mpi2RaidVolPage0_t *config_page, u32 form, u32 handle, u16 sz);
  849. int mpt2sas_config_get_phys_disk_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
  850. *mpi_reply, Mpi2RaidPhysDiskPage0_t *config_page, u32 form,
  851. u32 form_specific);
  852. int mpt2sas_config_get_volume_handle(struct MPT2SAS_ADAPTER *ioc, u16 pd_handle,
  853. u16 *volume_handle);
  854. int mpt2sas_config_get_volume_wwid(struct MPT2SAS_ADAPTER *ioc, u16 volume_handle,
  855. u64 *wwid);
  856. /* ctl shared API */
  857. extern struct device_attribute *mpt2sas_host_attrs[];
  858. extern struct device_attribute *mpt2sas_dev_attrs[];
  859. void mpt2sas_ctl_init(void);
  860. void mpt2sas_ctl_exit(void);
  861. u8 mpt2sas_ctl_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
  862. u32 reply);
  863. void mpt2sas_ctl_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase);
  864. u8 mpt2sas_ctl_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index,
  865. u32 reply);
  866. void mpt2sas_ctl_add_to_event_log(struct MPT2SAS_ADAPTER *ioc,
  867. Mpi2EventNotificationReply_t *mpi_reply);
  868. void mpt2sas_enable_diag_buffer(struct MPT2SAS_ADAPTER *ioc,
  869. u8 bits_to_regsiter);
  870. /* transport shared API */
  871. u8 mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
  872. u32 reply);
  873. struct _sas_port *mpt2sas_transport_port_add(struct MPT2SAS_ADAPTER *ioc,
  874. u16 handle, u64 sas_address);
  875. void mpt2sas_transport_port_remove(struct MPT2SAS_ADAPTER *ioc, u64 sas_address,
  876. u64 sas_address_parent);
  877. int mpt2sas_transport_add_host_phy(struct MPT2SAS_ADAPTER *ioc, struct _sas_phy
  878. *mpt2sas_phy, Mpi2SasPhyPage0_t phy_pg0, struct device *parent_dev);
  879. int mpt2sas_transport_add_expander_phy(struct MPT2SAS_ADAPTER *ioc, struct _sas_phy
  880. *mpt2sas_phy, Mpi2ExpanderPage1_t expander_pg1, struct device *parent_dev);
  881. void mpt2sas_transport_update_links(struct MPT2SAS_ADAPTER *ioc,
  882. u64 sas_address, u16 handle, u8 phy_number, u8 link_rate);
  883. extern struct sas_function_template mpt2sas_transport_functions;
  884. extern struct scsi_transport_template *mpt2sas_transport_template;
  885. extern int scsi_internal_device_block(struct scsi_device *sdev);
  886. extern u8 mpt2sas_stm_zero_smid_handler(struct MPT2SAS_ADAPTER *ioc,
  887. u8 msix_index, u32 reply);
  888. extern int scsi_internal_device_unblock(struct scsi_device *sdev);
  889. #endif /* MPT2SAS_BASE_H_INCLUDED */