qla_target.h 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2004 - 2010 Vladislav Bolkhovitin <[email protected]>
  4. * Copyright (C) 2004 - 2005 Leonid Stoljar
  5. * Copyright (C) 2006 Nathaniel Clark <[email protected]>
  6. * Copyright (C) 2007 - 2010 ID7 Ltd.
  7. *
  8. * Forward port and refactoring to modern qla2xxx and target/configfs
  9. *
  10. * Copyright (C) 2010-2011 Nicholas A. Bellinger <[email protected]>
  11. *
  12. * Additional file for the target driver support.
  13. */
  14. /*
  15. * This is the global def file that is useful for including from the
  16. * target portion.
  17. */
  18. #ifndef __QLA_TARGET_H
  19. #define __QLA_TARGET_H
  20. #include "qla_def.h"
  21. #include "qla_dsd.h"
  22. /*
  23. * Must be changed on any change in any initiator visible interfaces or
  24. * data in the target add-on
  25. */
  26. #define QLA2XXX_TARGET_MAGIC 269
  27. /*
  28. * Must be changed on any change in any target visible interfaces or
  29. * data in the initiator
  30. */
  31. #define QLA2XXX_INITIATOR_MAGIC 57222
  32. #define QLA2XXX_INI_MODE_STR_EXCLUSIVE "exclusive"
  33. #define QLA2XXX_INI_MODE_STR_DISABLED "disabled"
  34. #define QLA2XXX_INI_MODE_STR_ENABLED "enabled"
  35. #define QLA2XXX_INI_MODE_STR_DUAL "dual"
  36. #define QLA2XXX_INI_MODE_EXCLUSIVE 0
  37. #define QLA2XXX_INI_MODE_DISABLED 1
  38. #define QLA2XXX_INI_MODE_ENABLED 2
  39. #define QLA2XXX_INI_MODE_DUAL 3
  40. #define QLA2XXX_COMMAND_COUNT_INIT 250
  41. #define QLA2XXX_IMMED_NOTIFY_COUNT_INIT 250
  42. /*
  43. * Used to mark which completion handles (for RIO Status's) are for CTIO's
  44. * vs. regular (non-target) info. This is checked for in
  45. * qla2x00_process_response_queue() to see if a handle coming back in a
  46. * multi-complete should come to the tgt driver or be handled there by qla2xxx
  47. */
  48. #define CTIO_COMPLETION_HANDLE_MARK BIT_29
  49. #if (CTIO_COMPLETION_HANDLE_MARK <= DEFAULT_OUTSTANDING_COMMANDS)
  50. #error "CTIO_COMPLETION_HANDLE_MARK not larger than "
  51. "DEFAULT_OUTSTANDING_COMMANDS"
  52. #endif
  53. #define HANDLE_IS_CTIO_COMP(h) (h & CTIO_COMPLETION_HANDLE_MARK)
  54. /* Used to mark CTIO as intermediate */
  55. #define CTIO_INTERMEDIATE_HANDLE_MARK BIT_30
  56. #define QLA_TGT_NULL_HANDLE 0
  57. #define QLA_TGT_HANDLE_MASK 0xF0000000
  58. #define QLA_QPID_HANDLE_MASK 0x00FF0000 /* qpair id mask */
  59. #define QLA_CMD_HANDLE_MASK 0x0000FFFF
  60. #define QLA_TGT_SKIP_HANDLE (0xFFFFFFFF & ~QLA_TGT_HANDLE_MASK)
  61. #define QLA_QPID_HANDLE_SHIFT 16
  62. #define GET_QID(_h) ((_h & QLA_QPID_HANDLE_MASK) >> QLA_QPID_HANDLE_SHIFT)
  63. #ifndef OF_SS_MODE_0
  64. /*
  65. * ISP target entries - Flags bit definitions.
  66. */
  67. #define OF_SS_MODE_0 0
  68. #define OF_SS_MODE_1 1
  69. #define OF_SS_MODE_2 2
  70. #define OF_SS_MODE_3 3
  71. #define OF_EXPL_CONF BIT_5 /* Explicit Confirmation Requested */
  72. #define OF_DATA_IN BIT_6 /* Data in to initiator */
  73. /* (data from target to initiator) */
  74. #define OF_DATA_OUT BIT_7 /* Data out from initiator */
  75. /* (data from initiator to target) */
  76. #define OF_NO_DATA (BIT_7 | BIT_6)
  77. #define OF_INC_RC BIT_8 /* Increment command resource count */
  78. #define OF_FAST_POST BIT_9 /* Enable mailbox fast posting. */
  79. #define OF_CONF_REQ BIT_13 /* Confirmation Requested */
  80. #define OF_TERM_EXCH BIT_14 /* Terminate exchange */
  81. #define OF_SSTS BIT_15 /* Send SCSI status */
  82. #endif
  83. #ifndef QLA_TGT_DATASEGS_PER_CMD32
  84. #define QLA_TGT_DATASEGS_PER_CMD32 3
  85. #define QLA_TGT_DATASEGS_PER_CONT32 7
  86. #define QLA_TGT_MAX_SG32(ql) \
  87. (((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD32 + \
  88. QLA_TGT_DATASEGS_PER_CONT32*((ql) - 1)) : 0)
  89. #define QLA_TGT_DATASEGS_PER_CMD64 2
  90. #define QLA_TGT_DATASEGS_PER_CONT64 5
  91. #define QLA_TGT_MAX_SG64(ql) \
  92. (((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD64 + \
  93. QLA_TGT_DATASEGS_PER_CONT64*((ql) - 1)) : 0)
  94. #endif
  95. #ifndef QLA_TGT_DATASEGS_PER_CMD_24XX
  96. #define QLA_TGT_DATASEGS_PER_CMD_24XX 1
  97. #define QLA_TGT_DATASEGS_PER_CONT_24XX 5
  98. #define QLA_TGT_MAX_SG_24XX(ql) \
  99. (min(1270, ((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD_24XX + \
  100. QLA_TGT_DATASEGS_PER_CONT_24XX*((ql) - 1)) : 0))
  101. #endif
  102. #define GET_TARGET_ID(ha, iocb) ((HAS_EXTENDED_IDS(ha)) \
  103. ? le16_to_cpu((iocb)->u.isp2x.target.extended) \
  104. : (uint16_t)(iocb)->u.isp2x.target.id.standard)
  105. #ifndef NOTIFY_ACK_TYPE
  106. #define NOTIFY_ACK_TYPE 0x0E /* Notify acknowledge entry. */
  107. /*
  108. * ISP queue - notify acknowledge entry structure definition.
  109. * This is sent to the ISP from the target driver.
  110. */
  111. struct nack_to_isp {
  112. uint8_t entry_type; /* Entry type. */
  113. uint8_t entry_count; /* Entry count. */
  114. uint8_t sys_define; /* System defined. */
  115. uint8_t entry_status; /* Entry Status. */
  116. union {
  117. struct {
  118. __le32 sys_define_2; /* System defined. */
  119. target_id_t target;
  120. uint8_t target_id;
  121. uint8_t reserved_1;
  122. __le16 flags;
  123. __le16 resp_code;
  124. __le16 status;
  125. __le16 task_flags;
  126. __le16 seq_id;
  127. __le16 srr_rx_id;
  128. __le32 srr_rel_offs;
  129. __le16 srr_ui;
  130. __le16 srr_flags;
  131. __le16 srr_reject_code;
  132. uint8_t srr_reject_vendor_uniq;
  133. uint8_t srr_reject_code_expl;
  134. uint8_t reserved_2[24];
  135. } isp2x;
  136. struct {
  137. uint32_t handle;
  138. __le16 nport_handle;
  139. uint16_t reserved_1;
  140. __le16 flags;
  141. __le16 srr_rx_id;
  142. __le16 status;
  143. uint8_t status_subcode;
  144. uint8_t fw_handle;
  145. __le32 exchange_address;
  146. __le32 srr_rel_offs;
  147. __le16 srr_ui;
  148. __le16 srr_flags;
  149. uint8_t reserved_4[19];
  150. uint8_t vp_index;
  151. uint8_t srr_reject_vendor_uniq;
  152. uint8_t srr_reject_code_expl;
  153. uint8_t srr_reject_code;
  154. uint8_t reserved_5[5];
  155. } isp24;
  156. } u;
  157. uint8_t reserved[2];
  158. __le16 ox_id;
  159. } __packed;
  160. #define NOTIFY_ACK_FLAGS_FCSP BIT_5
  161. #define NOTIFY_ACK_FLAGS_TERMINATE BIT_3
  162. #define NOTIFY_ACK_SRR_FLAGS_ACCEPT 0
  163. #define NOTIFY_ACK_SRR_FLAGS_REJECT 1
  164. #define NOTIFY_ACK_SRR_REJECT_REASON_UNABLE_TO_PERFORM 0x9
  165. #define NOTIFY_ACK_SRR_FLAGS_REJECT_EXPL_NO_EXPL 0
  166. #define NOTIFY_ACK_SRR_FLAGS_REJECT_EXPL_UNABLE_TO_SUPPLY_DATA 0x2a
  167. #define NOTIFY_ACK_SUCCESS 0x01
  168. #endif
  169. #ifndef ACCEPT_TGT_IO_TYPE
  170. #define ACCEPT_TGT_IO_TYPE 0x16 /* Accept target I/O entry. */
  171. #endif
  172. #ifndef CONTINUE_TGT_IO_TYPE
  173. #define CONTINUE_TGT_IO_TYPE 0x17
  174. /*
  175. * ISP queue - Continue Target I/O (CTIO) entry for status mode 0 structure.
  176. * This structure is sent to the ISP 2xxx from target driver.
  177. */
  178. struct ctio_to_2xxx {
  179. uint8_t entry_type; /* Entry type. */
  180. uint8_t entry_count; /* Entry count. */
  181. uint8_t sys_define; /* System defined. */
  182. uint8_t entry_status; /* Entry Status. */
  183. uint32_t handle; /* System defined handle */
  184. target_id_t target;
  185. __le16 rx_id;
  186. __le16 flags;
  187. __le16 status;
  188. __le16 timeout; /* 0 = 30 seconds, 0xFFFF = disable */
  189. __le16 dseg_count; /* Data segment count. */
  190. __le32 relative_offset;
  191. __le32 residual;
  192. __le16 reserved_1[3];
  193. __le16 scsi_status;
  194. __le32 transfer_length;
  195. struct dsd32 dsd[3];
  196. } __packed;
  197. #define ATIO_PATH_INVALID 0x07
  198. #define ATIO_CANT_PROV_CAP 0x16
  199. #define ATIO_CDB_VALID 0x3D
  200. #define ATIO_EXEC_READ BIT_1
  201. #define ATIO_EXEC_WRITE BIT_0
  202. #endif
  203. #ifndef CTIO_A64_TYPE
  204. #define CTIO_A64_TYPE 0x1F
  205. #define CTIO_SUCCESS 0x01
  206. #define CTIO_ABORTED 0x02
  207. #define CTIO_INVALID_RX_ID 0x08
  208. #define CTIO_TIMEOUT 0x0B
  209. #define CTIO_DIF_ERROR 0x0C /* DIF error detected */
  210. #define CTIO_LIP_RESET 0x0E
  211. #define CTIO_TARGET_RESET 0x17
  212. #define CTIO_PORT_UNAVAILABLE 0x28
  213. #define CTIO_PORT_LOGGED_OUT 0x29
  214. #define CTIO_PORT_CONF_CHANGED 0x2A
  215. #define CTIO_SRR_RECEIVED 0x45
  216. #define CTIO_FAST_AUTH_ERR 0x63
  217. #define CTIO_FAST_INCOMP_PAD_LEN 0x65
  218. #define CTIO_FAST_INVALID_REQ 0x66
  219. #define CTIO_FAST_SPI_ERR 0x67
  220. #endif
  221. #ifndef CTIO_RET_TYPE
  222. #define CTIO_RET_TYPE 0x17 /* CTIO return entry */
  223. #define ATIO_TYPE7 0x06 /* Accept target I/O entry for 24xx */
  224. #endif
  225. struct fcp_hdr {
  226. uint8_t r_ctl;
  227. be_id_t d_id;
  228. uint8_t cs_ctl;
  229. be_id_t s_id;
  230. uint8_t type;
  231. uint8_t f_ctl[3];
  232. uint8_t seq_id;
  233. uint8_t df_ctl;
  234. uint16_t seq_cnt;
  235. __be16 ox_id;
  236. uint16_t rx_id;
  237. __le32 parameter;
  238. };
  239. struct fcp_hdr_le {
  240. le_id_t d_id;
  241. uint8_t r_ctl;
  242. le_id_t s_id;
  243. uint8_t cs_ctl;
  244. uint8_t f_ctl[3];
  245. uint8_t type;
  246. __le16 seq_cnt;
  247. uint8_t df_ctl;
  248. uint8_t seq_id;
  249. __le16 rx_id;
  250. __le16 ox_id;
  251. __le32 parameter;
  252. };
  253. #define F_CTL_EXCH_CONTEXT_RESP BIT_23
  254. #define F_CTL_SEQ_CONTEXT_RESIP BIT_22
  255. #define F_CTL_LAST_SEQ BIT_20
  256. #define F_CTL_END_SEQ BIT_19
  257. #define F_CTL_SEQ_INITIATIVE BIT_16
  258. #define R_CTL_BASIC_LINK_SERV 0x80
  259. #define R_CTL_B_ACC 0x4
  260. #define R_CTL_B_RJT 0x5
  261. struct atio7_fcp_cmnd {
  262. uint64_t lun;
  263. uint8_t cmnd_ref;
  264. uint8_t task_attr:3;
  265. uint8_t reserved:5;
  266. uint8_t task_mgmt_flags;
  267. #define FCP_CMND_TASK_MGMT_CLEAR_ACA 6
  268. #define FCP_CMND_TASK_MGMT_TARGET_RESET 5
  269. #define FCP_CMND_TASK_MGMT_LU_RESET 4
  270. #define FCP_CMND_TASK_MGMT_CLEAR_TASK_SET 2
  271. #define FCP_CMND_TASK_MGMT_ABORT_TASK_SET 1
  272. uint8_t wrdata:1;
  273. uint8_t rddata:1;
  274. uint8_t add_cdb_len:6;
  275. uint8_t cdb[16];
  276. /*
  277. * add_cdb is optional and can absent from struct atio7_fcp_cmnd. Size 4
  278. * only to make sizeof(struct atio7_fcp_cmnd) be as expected by
  279. * BUILD_BUG_ON in qlt_init().
  280. */
  281. uint8_t add_cdb[4];
  282. /* __le32 data_length; */
  283. } __packed;
  284. /*
  285. * ISP queue - Accept Target I/O (ATIO) type entry IOCB structure.
  286. * This is sent from the ISP to the target driver.
  287. */
  288. struct atio_from_isp {
  289. union {
  290. struct {
  291. __le16 entry_hdr;
  292. uint8_t sys_define; /* System defined. */
  293. uint8_t entry_status; /* Entry Status. */
  294. __le32 sys_define_2; /* System defined. */
  295. target_id_t target;
  296. __le16 rx_id;
  297. __le16 flags;
  298. __le16 status;
  299. uint8_t command_ref;
  300. uint8_t task_codes;
  301. uint8_t task_flags;
  302. uint8_t execution_codes;
  303. uint8_t cdb[MAX_CMDSZ];
  304. __le32 data_length;
  305. __le16 lun;
  306. uint8_t initiator_port_name[WWN_SIZE]; /* on qla23xx */
  307. __le16 reserved_32[6];
  308. __le16 ox_id;
  309. } isp2x;
  310. struct {
  311. __le16 entry_hdr;
  312. uint8_t fcp_cmnd_len_low;
  313. uint8_t fcp_cmnd_len_high:4;
  314. uint8_t attr:4;
  315. __le32 exchange_addr;
  316. #define ATIO_EXCHANGE_ADDRESS_UNKNOWN 0xFFFFFFFF
  317. struct fcp_hdr fcp_hdr;
  318. struct atio7_fcp_cmnd fcp_cmnd;
  319. } isp24;
  320. struct {
  321. uint8_t entry_type; /* Entry type. */
  322. uint8_t entry_count; /* Entry count. */
  323. __le16 attr_n_length;
  324. #define FCP_CMD_LENGTH_MASK 0x0fff
  325. #define FCP_CMD_LENGTH_MIN 0x38
  326. uint8_t data[56];
  327. __le32 signature;
  328. #define ATIO_PROCESSED 0xDEADDEAD /* Signature */
  329. } raw;
  330. } u;
  331. } __packed;
  332. static inline int fcpcmd_is_corrupted(struct atio *atio)
  333. {
  334. if (atio->entry_type == ATIO_TYPE7 &&
  335. ((le16_to_cpu(atio->attr_n_length) & FCP_CMD_LENGTH_MASK) <
  336. FCP_CMD_LENGTH_MIN))
  337. return 1;
  338. else
  339. return 0;
  340. }
  341. /* adjust corrupted atio so we won't trip over the same entry again. */
  342. static inline void adjust_corrupted_atio(struct atio_from_isp *atio)
  343. {
  344. atio->u.raw.attr_n_length = cpu_to_le16(FCP_CMD_LENGTH_MIN);
  345. atio->u.isp24.fcp_cmnd.add_cdb_len = 0;
  346. }
  347. static inline int get_datalen_for_atio(struct atio_from_isp *atio)
  348. {
  349. int len = atio->u.isp24.fcp_cmnd.add_cdb_len;
  350. return get_unaligned_be32(&atio->u.isp24.fcp_cmnd.add_cdb[len * 4]);
  351. }
  352. #define CTIO_TYPE7 0x12 /* Continue target I/O entry (for 24xx) */
  353. /*
  354. * ISP queue - Continue Target I/O (ATIO) type 7 entry (for 24xx) structure.
  355. * This structure is sent to the ISP 24xx from the target driver.
  356. */
  357. struct ctio7_to_24xx {
  358. uint8_t entry_type; /* Entry type. */
  359. uint8_t entry_count; /* Entry count. */
  360. uint8_t sys_define; /* System defined. */
  361. uint8_t entry_status; /* Entry Status. */
  362. uint32_t handle; /* System defined handle */
  363. __le16 nport_handle;
  364. #define CTIO7_NHANDLE_UNRECOGNIZED 0xFFFF
  365. __le16 timeout;
  366. __le16 dseg_count; /* Data segment count. */
  367. uint8_t vp_index;
  368. uint8_t add_flags;
  369. le_id_t initiator_id;
  370. uint8_t reserved;
  371. __le32 exchange_addr;
  372. union {
  373. struct {
  374. __le16 reserved1;
  375. __le16 flags;
  376. union {
  377. __le32 residual;
  378. struct {
  379. uint8_t rsvd1;
  380. uint8_t edif_flags;
  381. #define EF_EN_EDIF BIT_0
  382. #define EF_NEW_SA BIT_1
  383. uint16_t rsvd2;
  384. };
  385. };
  386. __le16 ox_id;
  387. __le16 scsi_status;
  388. __le32 relative_offset;
  389. __le32 reserved2;
  390. __le32 transfer_length;
  391. __le32 reserved3;
  392. struct dsd64 dsd;
  393. } status0;
  394. struct {
  395. __le16 sense_length;
  396. __le16 flags;
  397. __le32 residual;
  398. __le16 ox_id;
  399. __le16 scsi_status;
  400. __le16 response_len;
  401. __le16 reserved;
  402. uint8_t sense_data[24];
  403. } status1;
  404. } u;
  405. } __packed;
  406. /*
  407. * ISP queue - CTIO type 7 from ISP 24xx to target driver
  408. * returned entry structure.
  409. */
  410. struct ctio7_from_24xx {
  411. uint8_t entry_type; /* Entry type. */
  412. uint8_t entry_count; /* Entry count. */
  413. uint8_t sys_define; /* System defined. */
  414. uint8_t entry_status; /* Entry Status. */
  415. uint32_t handle; /* System defined handle */
  416. __le16 status;
  417. __le16 timeout;
  418. __le16 dseg_count; /* Data segment count. */
  419. uint8_t vp_index;
  420. uint8_t reserved1[5];
  421. __le32 exchange_address;
  422. __le16 edif_sa_index;
  423. __le16 flags;
  424. __le32 residual;
  425. __le16 ox_id;
  426. __le16 reserved3;
  427. __le32 relative_offset;
  428. uint8_t reserved4[24];
  429. } __packed;
  430. /* CTIO7 flags values */
  431. #define CTIO7_FLAGS_SEND_STATUS BIT_15
  432. #define CTIO7_FLAGS_TERMINATE BIT_14
  433. #define CTIO7_FLAGS_CONFORM_REQ BIT_13
  434. #define CTIO7_FLAGS_DONT_RET_CTIO BIT_8
  435. #define CTIO7_FLAGS_STATUS_MODE_0 0
  436. #define CTIO7_FLAGS_STATUS_MODE_1 BIT_6
  437. #define CTIO7_FLAGS_STATUS_MODE_2 BIT_7
  438. #define CTIO7_FLAGS_EXPLICIT_CONFORM BIT_5
  439. #define CTIO7_FLAGS_CONFIRM_SATISF BIT_4
  440. #define CTIO7_FLAGS_DSD_PTR BIT_2
  441. #define CTIO7_FLAGS_DATA_IN BIT_1 /* data to initiator */
  442. #define CTIO7_FLAGS_DATA_OUT BIT_0 /* data from initiator */
  443. #define ELS_PLOGI 0x3
  444. #define ELS_FLOGI 0x4
  445. #define ELS_LOGO 0x5
  446. #define ELS_PRLI 0x20
  447. #define ELS_PRLO 0x21
  448. #define ELS_TPRLO 0x24
  449. #define ELS_PDISC 0x50
  450. #define ELS_ADISC 0x52
  451. /*
  452. *CTIO Type CRC_2 IOCB
  453. */
  454. struct ctio_crc2_to_fw {
  455. uint8_t entry_type; /* Entry type. */
  456. #define CTIO_CRC2 0x7A
  457. uint8_t entry_count; /* Entry count. */
  458. uint8_t sys_define; /* System defined. */
  459. uint8_t entry_status; /* Entry Status. */
  460. uint32_t handle; /* System handle. */
  461. __le16 nport_handle; /* N_PORT handle. */
  462. __le16 timeout; /* Command timeout. */
  463. __le16 dseg_count; /* Data segment count. */
  464. uint8_t vp_index;
  465. uint8_t add_flags; /* additional flags */
  466. #define CTIO_CRC2_AF_DIF_DSD_ENA BIT_3
  467. le_id_t initiator_id; /* initiator ID */
  468. uint8_t reserved1;
  469. __le32 exchange_addr; /* rcv exchange address */
  470. __le16 reserved2;
  471. __le16 flags; /* refer to CTIO7 flags values */
  472. __le32 residual;
  473. __le16 ox_id;
  474. __le16 scsi_status;
  475. __le32 relative_offset;
  476. __le32 reserved5;
  477. __le32 transfer_length; /* total fc transfer length */
  478. __le32 reserved6;
  479. __le64 crc_context_address __packed; /* Data segment address. */
  480. __le16 crc_context_len; /* Data segment length. */
  481. __le16 reserved_1; /* MUST be set to 0. */
  482. };
  483. /* CTIO Type CRC_x Status IOCB */
  484. struct ctio_crc_from_fw {
  485. uint8_t entry_type; /* Entry type. */
  486. uint8_t entry_count; /* Entry count. */
  487. uint8_t sys_define; /* System defined. */
  488. uint8_t entry_status; /* Entry Status. */
  489. uint32_t handle; /* System handle. */
  490. __le16 status;
  491. __le16 timeout; /* Command timeout. */
  492. __le16 dseg_count; /* Data segment count. */
  493. __le32 reserved1;
  494. __le16 state_flags;
  495. #define CTIO_CRC_SF_DIF_CHOPPED BIT_4
  496. __le32 exchange_address; /* rcv exchange address */
  497. __le16 reserved2;
  498. __le16 flags;
  499. __le32 resid_xfer_length;
  500. __le16 ox_id;
  501. uint8_t reserved3[12];
  502. __le16 runt_guard; /* reported runt blk guard */
  503. uint8_t actual_dif[8];
  504. uint8_t expected_dif[8];
  505. } __packed;
  506. /*
  507. * ISP queue - ABTS received/response entries structure definition for 24xx.
  508. */
  509. #define ABTS_RECV_24XX 0x54 /* ABTS received (for 24xx) */
  510. #define ABTS_RESP_24XX 0x55 /* ABTS responce (for 24xx) */
  511. /*
  512. * ISP queue - ABTS received IOCB entry structure definition for 24xx.
  513. * The ABTS BLS received from the wire is sent to the
  514. * target driver by the ISP 24xx.
  515. * The IOCB is placed on the response queue.
  516. */
  517. struct abts_recv_from_24xx {
  518. uint8_t entry_type; /* Entry type. */
  519. uint8_t entry_count; /* Entry count. */
  520. uint8_t sys_define; /* System defined. */
  521. uint8_t entry_status; /* Entry Status. */
  522. uint8_t reserved_1[6];
  523. __le16 nport_handle;
  524. uint8_t reserved_2[2];
  525. uint8_t vp_index;
  526. uint8_t reserved_3:4;
  527. uint8_t sof_type:4;
  528. __le32 exchange_address;
  529. struct fcp_hdr_le fcp_hdr_le;
  530. uint8_t reserved_4[16];
  531. __le32 exchange_addr_to_abort;
  532. } __packed;
  533. #define ABTS_PARAM_ABORT_SEQ BIT_0
  534. struct ba_acc_le {
  535. __le16 reserved;
  536. uint8_t seq_id_last;
  537. uint8_t seq_id_valid;
  538. #define SEQ_ID_VALID 0x80
  539. #define SEQ_ID_INVALID 0x00
  540. __le16 rx_id;
  541. __le16 ox_id;
  542. __le16 high_seq_cnt;
  543. __le16 low_seq_cnt;
  544. } __packed;
  545. struct ba_rjt_le {
  546. uint8_t vendor_uniq;
  547. uint8_t reason_expl;
  548. uint8_t reason_code;
  549. #define BA_RJT_REASON_CODE_INVALID_COMMAND 0x1
  550. #define BA_RJT_REASON_CODE_UNABLE_TO_PERFORM 0x9
  551. uint8_t reserved;
  552. } __packed;
  553. /*
  554. * ISP queue - ABTS Response IOCB entry structure definition for 24xx.
  555. * The ABTS response to the ABTS received is sent by the
  556. * target driver to the ISP 24xx.
  557. * The IOCB is placed on the request queue.
  558. */
  559. struct abts_resp_to_24xx {
  560. uint8_t entry_type; /* Entry type. */
  561. uint8_t entry_count; /* Entry count. */
  562. uint8_t sys_define; /* System defined. */
  563. uint8_t entry_status; /* Entry Status. */
  564. uint32_t handle;
  565. __le16 reserved_1;
  566. __le16 nport_handle;
  567. __le16 control_flags;
  568. #define ABTS_CONTR_FLG_TERM_EXCHG BIT_0
  569. uint8_t vp_index;
  570. uint8_t reserved_3:4;
  571. uint8_t sof_type:4;
  572. __le32 exchange_address;
  573. struct fcp_hdr_le fcp_hdr_le;
  574. union {
  575. struct ba_acc_le ba_acct;
  576. struct ba_rjt_le ba_rjt;
  577. } __packed payload;
  578. __le32 reserved_4;
  579. __le32 exchange_addr_to_abort;
  580. } __packed;
  581. /*
  582. * ISP queue - ABTS Response IOCB from ISP24xx Firmware entry structure.
  583. * The ABTS response with completion status to the ABTS response
  584. * (sent by the target driver to the ISP 24xx) is sent by the
  585. * ISP24xx firmware to the target driver.
  586. * The IOCB is placed on the response queue.
  587. */
  588. struct abts_resp_from_24xx_fw {
  589. uint8_t entry_type; /* Entry type. */
  590. uint8_t entry_count; /* Entry count. */
  591. uint8_t sys_define; /* System defined. */
  592. uint8_t entry_status; /* Entry Status. */
  593. uint32_t handle;
  594. __le16 compl_status;
  595. #define ABTS_RESP_COMPL_SUCCESS 0
  596. #define ABTS_RESP_COMPL_SUBCODE_ERROR 0x31
  597. __le16 nport_handle;
  598. __le16 reserved_1;
  599. uint8_t reserved_2;
  600. uint8_t reserved_3:4;
  601. uint8_t sof_type:4;
  602. __le32 exchange_address;
  603. struct fcp_hdr_le fcp_hdr_le;
  604. uint8_t reserved_4[8];
  605. __le32 error_subcode1;
  606. #define ABTS_RESP_SUBCODE_ERR_ABORTED_EXCH_NOT_TERM 0x1E
  607. __le32 error_subcode2;
  608. __le32 exchange_addr_to_abort;
  609. } __packed;
  610. /********************************************************************\
  611. * Type Definitions used by initiator & target halves
  612. \********************************************************************/
  613. struct qla_tgt_mgmt_cmd;
  614. struct fc_port;
  615. struct qla_tgt_cmd;
  616. /*
  617. * This structure provides a template of function calls that the
  618. * target driver (from within qla_target.c) can issue to the
  619. * target module (tcm_qla2xxx).
  620. */
  621. struct qla_tgt_func_tmpl {
  622. struct qla_tgt_cmd *(*find_cmd_by_tag)(struct fc_port *, uint64_t);
  623. int (*handle_cmd)(struct scsi_qla_host *, struct qla_tgt_cmd *,
  624. unsigned char *, uint32_t, int, int, int);
  625. void (*handle_data)(struct qla_tgt_cmd *);
  626. int (*handle_tmr)(struct qla_tgt_mgmt_cmd *, u64, uint16_t,
  627. uint32_t);
  628. struct qla_tgt_cmd *(*get_cmd)(struct fc_port *);
  629. void (*rel_cmd)(struct qla_tgt_cmd *);
  630. void (*free_cmd)(struct qla_tgt_cmd *);
  631. void (*free_mcmd)(struct qla_tgt_mgmt_cmd *);
  632. void (*free_session)(struct fc_port *);
  633. int (*check_initiator_node_acl)(struct scsi_qla_host *, unsigned char *,
  634. struct fc_port *);
  635. void (*update_sess)(struct fc_port *, port_id_t, uint16_t, bool);
  636. struct fc_port *(*find_sess_by_loop_id)(struct scsi_qla_host *,
  637. const uint16_t);
  638. struct fc_port *(*find_sess_by_s_id)(struct scsi_qla_host *,
  639. const be_id_t);
  640. void (*clear_nacl_from_fcport_map)(struct fc_port *);
  641. void (*put_sess)(struct fc_port *);
  642. void (*shutdown_sess)(struct fc_port *);
  643. int (*get_dif_tags)(struct qla_tgt_cmd *cmd, uint16_t *pfw_prot_opts);
  644. int (*chk_dif_tags)(uint32_t tag);
  645. void (*add_target)(struct scsi_qla_host *);
  646. void (*remove_target)(struct scsi_qla_host *);
  647. };
  648. int qla2x00_wait_for_hba_online(struct scsi_qla_host *);
  649. #include <target/target_core_base.h>
  650. #define QLA_TGT_TIMEOUT 10 /* in seconds */
  651. #define QLA_TGT_MAX_HW_PENDING_TIME 60 /* in seconds */
  652. /* Immediate notify status constants */
  653. #define IMM_NTFY_LIP_RESET 0x000E
  654. #define IMM_NTFY_LIP_LINK_REINIT 0x000F
  655. #define IMM_NTFY_IOCB_OVERFLOW 0x0016
  656. #define IMM_NTFY_ABORT_TASK 0x0020
  657. #define IMM_NTFY_PORT_LOGOUT 0x0029
  658. #define IMM_NTFY_PORT_CONFIG 0x002A
  659. #define IMM_NTFY_GLBL_TPRLO 0x002D
  660. #define IMM_NTFY_GLBL_LOGO 0x002E
  661. #define IMM_NTFY_RESOURCE 0x0034
  662. #define IMM_NTFY_MSG_RX 0x0036
  663. #define IMM_NTFY_SRR 0x0045
  664. #define IMM_NTFY_ELS 0x0046
  665. /* Immediate notify task flags */
  666. #define IMM_NTFY_TASK_MGMT_SHIFT 8
  667. #define QLA_TGT_CLEAR_ACA 0x40
  668. #define QLA_TGT_TARGET_RESET 0x20
  669. #define QLA_TGT_LUN_RESET 0x10
  670. #define QLA_TGT_CLEAR_TS 0x04
  671. #define QLA_TGT_ABORT_TS 0x02
  672. #define QLA_TGT_ABORT_ALL_SESS 0xFFFF
  673. #define QLA_TGT_ABORT_ALL 0xFFFE
  674. #define QLA_TGT_NEXUS_LOSS_SESS 0xFFFD
  675. #define QLA_TGT_NEXUS_LOSS 0xFFFC
  676. #define QLA_TGT_ABTS 0xFFFB
  677. #define QLA_TGT_2G_ABORT_TASK 0xFFFA
  678. /* Notify Acknowledge flags */
  679. #define NOTIFY_ACK_RES_COUNT BIT_8
  680. #define NOTIFY_ACK_CLEAR_LIP_RESET BIT_5
  681. #define NOTIFY_ACK_TM_RESP_CODE_VALID BIT_4
  682. /* Command's states */
  683. #define QLA_TGT_STATE_NEW 0 /* New command + target processing */
  684. #define QLA_TGT_STATE_NEED_DATA 1 /* target needs data to continue */
  685. #define QLA_TGT_STATE_DATA_IN 2 /* Data arrived + target processing */
  686. #define QLA_TGT_STATE_PROCESSED 3 /* target done processing */
  687. /* ATIO task_codes field */
  688. #define ATIO_SIMPLE_QUEUE 0
  689. #define ATIO_HEAD_OF_QUEUE 1
  690. #define ATIO_ORDERED_QUEUE 2
  691. #define ATIO_ACA_QUEUE 4
  692. #define ATIO_UNTAGGED 5
  693. /* TM failed response codes, see FCP (9.4.11 FCP_RSP_INFO) */
  694. #define FC_TM_SUCCESS 0
  695. #define FC_TM_BAD_FCP_DATA 1
  696. #define FC_TM_BAD_CMD 2
  697. #define FC_TM_FCP_DATA_MISMATCH 3
  698. #define FC_TM_REJECT 4
  699. #define FC_TM_FAILED 5
  700. #define QLA_TGT_SENSE_VALID(sense) ((sense != NULL) && \
  701. (((const uint8_t *)(sense))[0] & 0x70) == 0x70)
  702. struct qla_port_24xx_data {
  703. uint8_t port_name[WWN_SIZE];
  704. uint16_t loop_id;
  705. uint16_t reserved;
  706. };
  707. struct qla_qpair_hint {
  708. struct list_head hint_elem;
  709. struct qla_qpair *qpair;
  710. u16 cpuid;
  711. uint8_t cmd_cnt;
  712. };
  713. struct qla_tgt {
  714. struct scsi_qla_host *vha;
  715. struct qla_hw_data *ha;
  716. struct btree_head64 lun_qpair_map;
  717. struct qla_qpair_hint *qphints;
  718. /*
  719. * To sync between IRQ handlers and qlt_target_release(). Needed,
  720. * because req_pkt() can drop/reaquire HW lock inside. Protected by
  721. * HW lock.
  722. */
  723. int atio_irq_cmd_count;
  724. int sg_tablesize;
  725. /* Target's flags, serialized by pha->hardware_lock */
  726. unsigned int link_reinit_iocb_pending:1;
  727. /*
  728. * Protected by tgt_mutex AND hardware_lock for writing and tgt_mutex
  729. * OR hardware_lock for reading.
  730. */
  731. int tgt_stop; /* the target mode driver is being stopped */
  732. int tgt_stopped; /* the target mode driver has been stopped */
  733. /* Count of sessions refering qla_tgt. Protected by hardware_lock. */
  734. int sess_count;
  735. spinlock_t sess_work_lock;
  736. struct list_head sess_works_list;
  737. struct work_struct sess_work;
  738. struct imm_ntfy_from_isp link_reinit_iocb;
  739. wait_queue_head_t waitQ;
  740. int notify_ack_expected;
  741. int abts_resp_expected;
  742. int modify_lun_expected;
  743. atomic_t tgt_global_resets_count;
  744. struct list_head tgt_list_entry;
  745. };
  746. struct qla_tgt_sess_op {
  747. struct scsi_qla_host *vha;
  748. uint32_t chip_reset;
  749. struct atio_from_isp atio;
  750. struct work_struct work;
  751. struct list_head cmd_list;
  752. bool aborted;
  753. struct rsp_que *rsp;
  754. };
  755. enum trace_flags {
  756. TRC_NEW_CMD = BIT_0,
  757. TRC_DO_WORK = BIT_1,
  758. TRC_DO_WORK_ERR = BIT_2,
  759. TRC_XFR_RDY = BIT_3,
  760. TRC_XMIT_DATA = BIT_4,
  761. TRC_XMIT_STATUS = BIT_5,
  762. TRC_SRR_RSP = BIT_6,
  763. TRC_SRR_XRDY = BIT_7,
  764. TRC_SRR_TERM = BIT_8,
  765. TRC_SRR_CTIO = BIT_9,
  766. TRC_FLUSH = BIT_10,
  767. TRC_CTIO_ERR = BIT_11,
  768. TRC_CTIO_DONE = BIT_12,
  769. TRC_CTIO_ABORTED = BIT_13,
  770. TRC_CTIO_STRANGE = BIT_14,
  771. TRC_CMD_DONE = BIT_15,
  772. TRC_CMD_CHK_STOP = BIT_16,
  773. TRC_CMD_FREE = BIT_17,
  774. TRC_DATA_IN = BIT_18,
  775. TRC_ABORT = BIT_19,
  776. TRC_DIF_ERR = BIT_20,
  777. };
  778. struct qla_tgt_cmd {
  779. /*
  780. * Do not move cmd_type field. it needs to line up with srb->cmd_type
  781. */
  782. uint8_t cmd_type;
  783. uint8_t pad[7];
  784. struct se_cmd se_cmd;
  785. struct list_head sess_cmd_list;
  786. struct fc_port *sess;
  787. struct qla_qpair *qpair;
  788. uint32_t reset_count;
  789. int state;
  790. struct work_struct work;
  791. /* Sense buffer that will be mapped into outgoing status */
  792. unsigned char sense_buffer[TRANSPORT_SENSE_BUFFER];
  793. spinlock_t cmd_lock;
  794. /* to save extra sess dereferences */
  795. unsigned int conf_compl_supported:1;
  796. unsigned int sg_mapped:1;
  797. unsigned int write_data_transferred:1;
  798. unsigned int q_full:1;
  799. unsigned int term_exchg:1;
  800. unsigned int cmd_sent_to_fw:1;
  801. unsigned int cmd_in_wq:1;
  802. unsigned int edif:1;
  803. /*
  804. * This variable may be set from outside the LIO and I/O completion
  805. * callback functions. Do not declare this member variable as a
  806. * bitfield to avoid a read-modify-write operation when this variable
  807. * is set.
  808. */
  809. unsigned int aborted;
  810. struct scatterlist *sg; /* cmd data buffer SG vector */
  811. int sg_cnt; /* SG segments count */
  812. int bufflen; /* cmd buffer length */
  813. int offset;
  814. u64 unpacked_lun;
  815. enum dma_data_direction dma_data_direction;
  816. uint16_t ctio_flags;
  817. uint16_t vp_idx;
  818. uint16_t loop_id; /* to save extra sess dereferences */
  819. struct qla_tgt *tgt; /* to save extra sess dereferences */
  820. struct scsi_qla_host *vha;
  821. struct list_head cmd_list;
  822. struct atio_from_isp atio;
  823. uint8_t ctx_dsd_alloced;
  824. /* T10-DIF */
  825. #define DIF_ERR_NONE 0
  826. #define DIF_ERR_GRD 1
  827. #define DIF_ERR_REF 2
  828. #define DIF_ERR_APP 3
  829. int8_t dif_err_code;
  830. struct scatterlist *prot_sg;
  831. uint32_t prot_sg_cnt;
  832. uint32_t blk_sz, num_blks;
  833. uint8_t scsi_status, sense_key, asc, ascq;
  834. struct crc_context *ctx;
  835. const uint8_t *cdb;
  836. uint64_t lba;
  837. uint16_t a_guard, e_guard, a_app_tag, e_app_tag;
  838. uint32_t a_ref_tag, e_ref_tag;
  839. #define DIF_BUNDL_DMA_VALID 1
  840. uint16_t prot_flags;
  841. uint64_t jiffies_at_alloc;
  842. uint64_t jiffies_at_free;
  843. enum trace_flags trc_flags;
  844. };
  845. struct qla_tgt_sess_work_param {
  846. struct list_head sess_works_list_entry;
  847. #define QLA_TGT_SESS_WORK_ABORT 1
  848. int type;
  849. union {
  850. struct abts_recv_from_24xx abts;
  851. struct imm_ntfy_from_isp tm_iocb;
  852. struct atio_from_isp tm_iocb2;
  853. };
  854. };
  855. struct qla_tgt_mgmt_cmd {
  856. uint8_t cmd_type;
  857. uint8_t pad[3];
  858. uint16_t tmr_func;
  859. uint8_t fc_tm_rsp;
  860. uint8_t abort_io_attr;
  861. struct fc_port *sess;
  862. struct qla_qpair *qpair;
  863. struct scsi_qla_host *vha;
  864. struct se_cmd se_cmd;
  865. struct work_struct free_work;
  866. unsigned int flags;
  867. #define QLA24XX_MGMT_SEND_NACK BIT_0
  868. #define QLA24XX_MGMT_ABORT_IO_ATTR_VALID BIT_1
  869. uint32_t reset_count;
  870. struct work_struct work;
  871. uint64_t unpacked_lun;
  872. union {
  873. struct atio_from_isp atio;
  874. struct imm_ntfy_from_isp imm_ntfy;
  875. struct abts_recv_from_24xx abts;
  876. } __packed orig_iocb;
  877. };
  878. struct qla_tgt_prm {
  879. struct qla_tgt_cmd *cmd;
  880. struct qla_tgt *tgt;
  881. void *pkt;
  882. struct scatterlist *sg; /* cmd data buffer SG vector */
  883. unsigned char *sense_buffer;
  884. int seg_cnt;
  885. int req_cnt;
  886. uint16_t rq_result;
  887. int sense_buffer_len;
  888. int residual;
  889. int add_status_pkt;
  890. /* dif */
  891. struct scatterlist *prot_sg;
  892. uint16_t prot_seg_cnt;
  893. uint16_t tot_dsds;
  894. };
  895. /* Check for Switch reserved address */
  896. #define IS_SW_RESV_ADDR(_s_id) \
  897. ((_s_id.b.domain == 0xff) && ((_s_id.b.area & 0xf0) == 0xf0))
  898. #define QLA_TGT_XMIT_DATA 1
  899. #define QLA_TGT_XMIT_STATUS 2
  900. #define QLA_TGT_XMIT_ALL (QLA_TGT_XMIT_STATUS|QLA_TGT_XMIT_DATA)
  901. extern struct qla_tgt_data qla_target;
  902. /*
  903. * Function prototypes for qla_target.c logic used by qla2xxx LLD code.
  904. */
  905. extern int qlt_add_target(struct qla_hw_data *, struct scsi_qla_host *);
  906. extern int qlt_remove_target(struct qla_hw_data *, struct scsi_qla_host *);
  907. extern int qlt_lport_register(void *, u64, u64, u64,
  908. int (*callback)(struct scsi_qla_host *, void *, u64, u64));
  909. extern void qlt_lport_deregister(struct scsi_qla_host *);
  910. extern void qlt_unreg_sess(struct fc_port *);
  911. extern void qlt_fc_port_added(struct scsi_qla_host *, fc_port_t *);
  912. extern void qlt_fc_port_deleted(struct scsi_qla_host *, fc_port_t *, int);
  913. extern int __init qlt_init(void);
  914. extern void qlt_exit(void);
  915. extern void qlt_update_vp_map(struct scsi_qla_host *, int);
  916. extern void qlt_free_session_done(struct work_struct *);
  917. /*
  918. * This macro is used during early initializations when host->active_mode
  919. * is not set. Right now, ha value is ignored.
  920. */
  921. #define QLA_TGT_MODE_ENABLED() (ql2x_ini_mode != QLA2XXX_INI_MODE_ENABLED)
  922. extern int ql2x_ini_mode;
  923. static inline bool qla_tgt_mode_enabled(struct scsi_qla_host *ha)
  924. {
  925. return ha->host->active_mode == MODE_TARGET;
  926. }
  927. static inline bool qla_ini_mode_enabled(struct scsi_qla_host *ha)
  928. {
  929. return ha->host->active_mode == MODE_INITIATOR;
  930. }
  931. static inline bool qla_dual_mode_enabled(struct scsi_qla_host *ha)
  932. {
  933. return (ha->host->active_mode == MODE_DUAL);
  934. }
  935. static inline uint32_t sid_to_key(const be_id_t s_id)
  936. {
  937. return s_id.domain << 16 |
  938. s_id.area << 8 |
  939. s_id.al_pa;
  940. }
  941. /*
  942. * Exported symbols from qla_target.c LLD logic used by qla2xxx code..
  943. */
  944. extern void qlt_response_pkt_all_vps(struct scsi_qla_host *, struct rsp_que *,
  945. response_t *);
  946. extern int qlt_rdy_to_xfer(struct qla_tgt_cmd *);
  947. extern int qlt_xmit_response(struct qla_tgt_cmd *, int, uint8_t);
  948. extern int qlt_abort_cmd(struct qla_tgt_cmd *);
  949. extern void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *);
  950. extern void qlt_free_mcmd(struct qla_tgt_mgmt_cmd *);
  951. extern void qlt_free_cmd(struct qla_tgt_cmd *cmd);
  952. extern void qlt_async_event(uint16_t, struct scsi_qla_host *, uint16_t *);
  953. extern void qlt_enable_vha(struct scsi_qla_host *);
  954. extern void qlt_vport_create(struct scsi_qla_host *, struct qla_hw_data *);
  955. extern u8 qlt_rff_id(struct scsi_qla_host *);
  956. extern void qlt_init_atio_q_entries(struct scsi_qla_host *);
  957. extern void qlt_24xx_process_atio_queue(struct scsi_qla_host *, uint8_t);
  958. extern void qlt_24xx_config_rings(struct scsi_qla_host *);
  959. extern void qlt_24xx_config_nvram_stage1(struct scsi_qla_host *,
  960. struct nvram_24xx *);
  961. extern void qlt_24xx_config_nvram_stage2(struct scsi_qla_host *,
  962. struct init_cb_24xx *);
  963. extern void qlt_81xx_config_nvram_stage2(struct scsi_qla_host *,
  964. struct init_cb_81xx *);
  965. extern void qlt_81xx_config_nvram_stage1(struct scsi_qla_host *,
  966. struct nvram_81xx *);
  967. extern void qlt_modify_vp_config(struct scsi_qla_host *,
  968. struct vp_config_entry_24xx *);
  969. extern void qlt_probe_one_stage1(struct scsi_qla_host *, struct qla_hw_data *);
  970. extern int qlt_mem_alloc(struct qla_hw_data *);
  971. extern void qlt_mem_free(struct qla_hw_data *);
  972. extern int qlt_stop_phase1(struct qla_tgt *);
  973. extern void qlt_stop_phase2(struct qla_tgt *);
  974. extern irqreturn_t qla83xx_msix_atio_q(int, void *);
  975. extern void qlt_83xx_iospace_config(struct qla_hw_data *);
  976. extern int qlt_free_qfull_cmds(struct qla_qpair *);
  977. extern void qlt_logo_completion_handler(fc_port_t *, int);
  978. extern void qlt_do_generation_tick(struct scsi_qla_host *, int *);
  979. void qlt_send_resp_ctio(struct qla_qpair *, struct qla_tgt_cmd *, uint8_t,
  980. uint8_t, uint8_t, uint8_t);
  981. #endif /* __QLA_TARGET_H */