qla_target.h 32 KB

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