Deleted Added
full compact
isp_target.h (154704) isp_target.h (155704)
1/* $FreeBSD: head/sys/dev/isp/isp_target.h 154704 2006-01-23 06:23:37Z mjacob $ */
1/* $FreeBSD: head/sys/dev/isp/isp_target.h 155704 2006-02-15 00:31:48Z mjacob $ */
2/*-
3 * Qlogic Target Mode Structure and Flag Definitions
4 *
5 * Copyright (c) 1997, 1998
6 * Patrick Stirling
7 * pms@psconsult.com
8 * All rights reserved.
9 *

--- 28 unchanged lines hidden (view full) ---

38#define QLTM_SENSELEN 18 /* non-FC cards only */
39#define QLTM_SVALID 0x80
40
41/*
42 * Structure for Enable Lun and Modify Lun queue entries
43 */
44typedef struct {
45 isphdr_t le_header;
2/*-
3 * Qlogic Target Mode Structure and Flag Definitions
4 *
5 * Copyright (c) 1997, 1998
6 * Patrick Stirling
7 * pms@psconsult.com
8 * All rights reserved.
9 *

--- 28 unchanged lines hidden (view full) ---

38#define QLTM_SENSELEN 18 /* non-FC cards only */
39#define QLTM_SVALID 0x80
40
41/*
42 * Structure for Enable Lun and Modify Lun queue entries
43 */
44typedef struct {
45 isphdr_t le_header;
46 u_int32_t le_reserved;
47 u_int8_t le_lun;
48 u_int8_t le_rsvd;
49 u_int8_t le_ops; /* Modify LUN only */
50 u_int8_t le_tgt; /* Not for FC */
51 u_int32_t le_flags; /* Not for FC */
52 u_int8_t le_status;
53 u_int8_t le_reserved2;
54 u_int8_t le_cmd_count;
55 u_int8_t le_in_count;
56 u_int8_t le_cdb6len; /* Not for FC */
57 u_int8_t le_cdb7len; /* Not for FC */
58 u_int16_t le_timeout;
59 u_int16_t le_reserved3[20];
46 uint32_t le_reserved;
47 uint8_t le_lun;
48 uint8_t le_rsvd;
49 uint8_t le_ops; /* Modify LUN only */
50 uint8_t le_tgt; /* Not for FC */
51 uint32_t le_flags; /* Not for FC */
52 uint8_t le_status;
53 uint8_t le_reserved2;
54 uint8_t le_cmd_count;
55 uint8_t le_in_count;
56 uint8_t le_cdb6len; /* Not for FC */
57 uint8_t le_cdb7len; /* Not for FC */
58 uint16_t le_timeout;
59 uint16_t le_reserved3[20];
60} lun_entry_t;
61
62/*
63 * le_flags values
64 */
65#define LUN_TQAE 0x00000002 /* bit1 Tagged Queue Action Enable */
66#define LUN_DSSM 0x01000000 /* bit24 Disable Sending SDP Message */
67#define LUN_DISAD 0x02000000 /* bit25 Disable autodisconnect */

--- 18 unchanged lines hidden (view full) ---

86
87/*
88 * Immediate Notify Entry structure
89 */
90#define IN_MSGLEN 8 /* 8 bytes */
91#define IN_RSVDLEN 8 /* 8 words */
92typedef struct {
93 isphdr_t in_header;
60} lun_entry_t;
61
62/*
63 * le_flags values
64 */
65#define LUN_TQAE 0x00000002 /* bit1 Tagged Queue Action Enable */
66#define LUN_DSSM 0x01000000 /* bit24 Disable Sending SDP Message */
67#define LUN_DISAD 0x02000000 /* bit25 Disable autodisconnect */

--- 18 unchanged lines hidden (view full) ---

86
87/*
88 * Immediate Notify Entry structure
89 */
90#define IN_MSGLEN 8 /* 8 bytes */
91#define IN_RSVDLEN 8 /* 8 words */
92typedef struct {
93 isphdr_t in_header;
94 u_int32_t in_reserved;
95 u_int8_t in_lun; /* lun */
96 u_int8_t in_iid; /* initiator */
97 u_int8_t in_reserved2;
98 u_int8_t in_tgt; /* target */
99 u_int32_t in_flags;
100 u_int8_t in_status;
101 u_int8_t in_rsvd2;
102 u_int8_t in_tag_val; /* tag value */
103 u_int8_t in_tag_type; /* tag type */
104 u_int16_t in_seqid; /* sequence id */
105 u_int8_t in_msg[IN_MSGLEN]; /* SCSI message bytes */
106 u_int16_t in_reserved3[IN_RSVDLEN];
107 u_int8_t in_sense[QLTM_SENSELEN];/* suggested sense data */
94 uint32_t in_reserved;
95 uint8_t in_lun; /* lun */
96 uint8_t in_iid; /* initiator */
97 uint8_t in_reserved2;
98 uint8_t in_tgt; /* target */
99 uint32_t in_flags;
100 uint8_t in_status;
101 uint8_t in_rsvd2;
102 uint8_t in_tag_val; /* tag value */
103 uint8_t in_tag_type; /* tag type */
104 uint16_t in_seqid; /* sequence id */
105 uint8_t in_msg[IN_MSGLEN]; /* SCSI message bytes */
106 uint16_t in_reserved3[IN_RSVDLEN];
107 uint8_t in_sense[QLTM_SENSELEN];/* suggested sense data */
108} in_entry_t;
109
110typedef struct {
111 isphdr_t in_header;
108} in_entry_t;
109
110typedef struct {
111 isphdr_t in_header;
112 u_int32_t in_reserved;
113 u_int8_t in_lun; /* lun */
114 u_int8_t in_iid; /* initiator */
115 u_int16_t in_scclun;
116 u_int32_t in_reserved2;
117 u_int16_t in_status;
118 u_int16_t in_task_flags;
119 u_int16_t in_seqid; /* sequence id */
112 uint32_t in_reserved;
113 uint8_t in_lun; /* lun */
114 uint8_t in_iid; /* initiator */
115 uint16_t in_scclun;
116 uint32_t in_reserved2;
117 uint16_t in_status;
118 uint16_t in_task_flags;
119 uint16_t in_seqid; /* sequence id */
120} in_fcentry_t;
121
122typedef struct {
123 isphdr_t in_header;
120} in_fcentry_t;
121
122typedef struct {
123 isphdr_t in_header;
124 u_int32_t in_reserved;
125 u_int16_t in_iid; /* initiator */
126 u_int16_t in_scclun;
127 u_int32_t in_reserved2;
128 u_int16_t in_status;
129 u_int16_t in_task_flags;
130 u_int16_t in_seqid; /* sequence id */
124 uint32_t in_reserved;
125 uint16_t in_iid; /* initiator */
126 uint16_t in_scclun;
127 uint32_t in_reserved2;
128 uint16_t in_status;
129 uint16_t in_task_flags;
130 uint16_t in_seqid; /* sequence id */
131} in_fcentry_e_t;
132
133/*
134 * Values for the in_status field
135 */
136#define IN_REJECT 0x0D /* Message Reject message received */
137#define IN_RESET 0x0E /* Bus Reset occurred */
138#define IN_NO_RCAP 0x16 /* requested capability not available */

--- 38 unchanged lines hidden (view full) ---

177#endif
178
179/*
180 * Notify Acknowledge Entry structure
181 */
182#define NA_RSVDLEN 22
183typedef struct {
184 isphdr_t na_header;
131} in_fcentry_e_t;
132
133/*
134 * Values for the in_status field
135 */
136#define IN_REJECT 0x0D /* Message Reject message received */
137#define IN_RESET 0x0E /* Bus Reset occurred */
138#define IN_NO_RCAP 0x16 /* requested capability not available */

--- 38 unchanged lines hidden (view full) ---

177#endif
178
179/*
180 * Notify Acknowledge Entry structure
181 */
182#define NA_RSVDLEN 22
183typedef struct {
184 isphdr_t na_header;
185 u_int32_t na_reserved;
186 u_int8_t na_lun; /* lun */
187 u_int8_t na_iid; /* initiator */
188 u_int8_t na_reserved2;
189 u_int8_t na_tgt; /* target */
190 u_int32_t na_flags;
191 u_int8_t na_status;
192 u_int8_t na_event;
193 u_int16_t na_seqid; /* sequence id */
194 u_int16_t na_reserved3[NA_RSVDLEN];
185 uint32_t na_reserved;
186 uint8_t na_lun; /* lun */
187 uint8_t na_iid; /* initiator */
188 uint8_t na_reserved2;
189 uint8_t na_tgt; /* target */
190 uint32_t na_flags;
191 uint8_t na_status;
192 uint8_t na_event;
193 uint16_t na_seqid; /* sequence id */
194 uint16_t na_reserved3[NA_RSVDLEN];
195} na_entry_t;
196
197/*
198 * Value for the na_event field
199 */
200#define NA_RST_CLRD 0x80 /* Clear an async event notification */
201#define NA_OK 0x01 /* Notify Acknowledge Succeeded */
202#define NA_INVALID 0x06 /* Invalid Notify Acknowledge */
203
204#define NA2_RSVDLEN 21
205typedef struct {
206 isphdr_t na_header;
195} na_entry_t;
196
197/*
198 * Value for the na_event field
199 */
200#define NA_RST_CLRD 0x80 /* Clear an async event notification */
201#define NA_OK 0x01 /* Notify Acknowledge Succeeded */
202#define NA_INVALID 0x06 /* Invalid Notify Acknowledge */
203
204#define NA2_RSVDLEN 21
205typedef struct {
206 isphdr_t na_header;
207 u_int32_t na_reserved;
208 u_int8_t na_lun; /* lun */
209 u_int8_t na_iid; /* initiator */
210 u_int16_t na_scclun;
211 u_int16_t na_flags;
212 u_int16_t na_reserved2;
213 u_int16_t na_status;
214 u_int16_t na_task_flags;
215 u_int16_t na_seqid; /* sequence id */
216 u_int16_t na_reserved3[NA2_RSVDLEN];
207 uint32_t na_reserved;
208 uint8_t na_lun; /* lun */
209 uint8_t na_iid; /* initiator */
210 uint16_t na_scclun;
211 uint16_t na_flags;
212 uint16_t na_reserved2;
213 uint16_t na_status;
214 uint16_t na_task_flags;
215 uint16_t na_seqid; /* sequence id */
216 uint16_t na_reserved3[NA2_RSVDLEN];
217} na_fcentry_t;
218
219typedef struct {
220 isphdr_t na_header;
217} na_fcentry_t;
218
219typedef struct {
220 isphdr_t na_header;
221 u_int32_t na_reserved;
222 u_int16_t na_iid; /* initiator */
223 u_int16_t na_scclun;
224 u_int16_t na_flags;
225 u_int16_t na_reserved2;
226 u_int16_t na_status;
227 u_int16_t na_task_flags;
228 u_int16_t na_seqid; /* sequence id */
229 u_int16_t na_reserved3[NA2_RSVDLEN];
221 uint32_t na_reserved;
222 uint16_t na_iid; /* initiator */
223 uint16_t na_scclun;
224 uint16_t na_flags;
225 uint16_t na_reserved2;
226 uint16_t na_status;
227 uint16_t na_task_flags;
228 uint16_t na_seqid; /* sequence id */
229 uint16_t na_reserved3[NA2_RSVDLEN];
230} na_fcentry_e_t;
231
232#define NAFC_RCOUNT 0x80 /* increment resource count */
233#define NAFC_RST_CLRD 0x20 /* Clear LIP Reset */
234/*
235 * Accept Target I/O Entry structure
236 */
237#define ATIO_CDBLEN 26
238
239typedef struct {
240 isphdr_t at_header;
230} na_fcentry_e_t;
231
232#define NAFC_RCOUNT 0x80 /* increment resource count */
233#define NAFC_RST_CLRD 0x20 /* Clear LIP Reset */
234/*
235 * Accept Target I/O Entry structure
236 */
237#define ATIO_CDBLEN 26
238
239typedef struct {
240 isphdr_t at_header;
241 u_int16_t at_reserved;
242 u_int16_t at_handle;
243 u_int8_t at_lun; /* lun */
244 u_int8_t at_iid; /* initiator */
245 u_int8_t at_cdblen; /* cdb length */
246 u_int8_t at_tgt; /* target */
247 u_int32_t at_flags;
248 u_int8_t at_status; /* firmware status */
249 u_int8_t at_scsi_status; /* scsi status */
250 u_int8_t at_tag_val; /* tag value */
251 u_int8_t at_tag_type; /* tag type */
252 u_int8_t at_cdb[ATIO_CDBLEN]; /* received CDB */
253 u_int8_t at_sense[QLTM_SENSELEN];/* suggested sense data */
241 uint16_t at_reserved;
242 uint16_t at_handle;
243 uint8_t at_lun; /* lun */
244 uint8_t at_iid; /* initiator */
245 uint8_t at_cdblen; /* cdb length */
246 uint8_t at_tgt; /* target */
247 uint32_t at_flags;
248 uint8_t at_status; /* firmware status */
249 uint8_t at_scsi_status; /* scsi status */
250 uint8_t at_tag_val; /* tag value */
251 uint8_t at_tag_type; /* tag type */
252 uint8_t at_cdb[ATIO_CDBLEN]; /* received CDB */
253 uint8_t at_sense[QLTM_SENSELEN];/* suggested sense data */
254} at_entry_t;
255
256/*
257 * at_flags values
258 */
259#define AT_NODISC 0x00008000 /* disconnect disabled */
260#define AT_TQAE 0x00000002 /* Tagged Queue Action enabled */
261

--- 51 unchanged lines hidden (view full) ---

313
314/*
315 * Accept Target I/O Entry structure, Type 2
316 */
317#define ATIO2_CDBLEN 16
318
319typedef struct {
320 isphdr_t at_header;
254} at_entry_t;
255
256/*
257 * at_flags values
258 */
259#define AT_NODISC 0x00008000 /* disconnect disabled */
260#define AT_TQAE 0x00000002 /* Tagged Queue Action enabled */
261

--- 51 unchanged lines hidden (view full) ---

313
314/*
315 * Accept Target I/O Entry structure, Type 2
316 */
317#define ATIO2_CDBLEN 16
318
319typedef struct {
320 isphdr_t at_header;
321 u_int32_t at_reserved;
322 u_int8_t at_lun; /* lun or reserved */
323 u_int8_t at_iid; /* initiator */
324 u_int16_t at_rxid; /* response ID */
325 u_int16_t at_flags;
326 u_int16_t at_status; /* firmware status */
327 u_int8_t at_crn; /* command reference number */
328 u_int8_t at_taskcodes;
329 u_int8_t at_taskflags;
330 u_int8_t at_execodes;
331 u_int8_t at_cdb[ATIO2_CDBLEN]; /* received CDB */
332 u_int32_t at_datalen; /* allocated data len */
333 u_int16_t at_scclun; /* SCC Lun or reserved */
334 u_int16_t at_wwpn[4]; /* WWPN of initiator */
335 u_int16_t at_reserved2[6];
336 u_int16_t at_oxid;
321 uint32_t at_reserved;
322 uint8_t at_lun; /* lun or reserved */
323 uint8_t at_iid; /* initiator */
324 uint16_t at_rxid; /* response ID */
325 uint16_t at_flags;
326 uint16_t at_status; /* firmware status */
327 uint8_t at_crn; /* command reference number */
328 uint8_t at_taskcodes;
329 uint8_t at_taskflags;
330 uint8_t at_execodes;
331 uint8_t at_cdb[ATIO2_CDBLEN]; /* received CDB */
332 uint32_t at_datalen; /* allocated data len */
333 uint16_t at_scclun; /* SCC Lun or reserved */
334 uint16_t at_wwpn[4]; /* WWPN of initiator */
335 uint16_t at_reserved2[6];
336 uint16_t at_oxid;
337} at2_entry_t;
338
339typedef struct {
340 isphdr_t at_header;
337} at2_entry_t;
338
339typedef struct {
340 isphdr_t at_header;
341 u_int32_t at_reserved;
342 u_int16_t at_iid; /* initiator */
343 u_int16_t at_rxid; /* response ID */
344 u_int16_t at_flags;
345 u_int16_t at_status; /* firmware status */
346 u_int8_t at_crn; /* command reference number */
347 u_int8_t at_taskcodes;
348 u_int8_t at_taskflags;
349 u_int8_t at_execodes;
350 u_int8_t at_cdb[ATIO2_CDBLEN]; /* received CDB */
351 u_int32_t at_datalen; /* allocated data len */
352 u_int16_t at_scclun; /* SCC Lun or reserved */
353 u_int16_t at_wwpn[4]; /* WWPN of initiator */
354 u_int16_t at_reserved2[6];
355 u_int16_t at_oxid;
341 uint32_t at_reserved;
342 uint16_t at_iid; /* initiator */
343 uint16_t at_rxid; /* response ID */
344 uint16_t at_flags;
345 uint16_t at_status; /* firmware status */
346 uint8_t at_crn; /* command reference number */
347 uint8_t at_taskcodes;
348 uint8_t at_taskflags;
349 uint8_t at_execodes;
350 uint8_t at_cdb[ATIO2_CDBLEN]; /* received CDB */
351 uint32_t at_datalen; /* allocated data len */
352 uint16_t at_scclun; /* SCC Lun or reserved */
353 uint16_t at_wwpn[4]; /* WWPN of initiator */
354 uint16_t at_reserved2[6];
355 uint16_t at_oxid;
356} at2e_entry_t;
357
358#define ATIO2_WWPN_OFFSET 0x2A
359#define ATIO2_OXID_OFFSET 0x3E
360
361#define ATIO2_TC_ATTR_MASK 0x7
362#define ATIO2_TC_ATTR_SIMPLEQ 0
363#define ATIO2_TC_ATTR_HEADOFQ 1

--- 37 unchanged lines hidden (view full) ---

401 * Continue Target I/O Entry structure
402 * Request from driver. The response from the
403 * ISP firmware is the same except that the last 18
404 * bytes are overwritten by suggested sense data if
405 * the 'autosense valid' bit is set in the status byte.
406 */
407typedef struct {
408 isphdr_t ct_header;
356} at2e_entry_t;
357
358#define ATIO2_WWPN_OFFSET 0x2A
359#define ATIO2_OXID_OFFSET 0x3E
360
361#define ATIO2_TC_ATTR_MASK 0x7
362#define ATIO2_TC_ATTR_SIMPLEQ 0
363#define ATIO2_TC_ATTR_HEADOFQ 1

--- 37 unchanged lines hidden (view full) ---

401 * Continue Target I/O Entry structure
402 * Request from driver. The response from the
403 * ISP firmware is the same except that the last 18
404 * bytes are overwritten by suggested sense data if
405 * the 'autosense valid' bit is set in the status byte.
406 */
407typedef struct {
408 isphdr_t ct_header;
409 u_int16_t ct_reserved;
409 uint16_t ct_reserved;
410#define ct_syshandle ct_reserved /* we use this */
410#define ct_syshandle ct_reserved /* we use this */
411 u_int16_t ct_fwhandle; /* required by f/w */
412 u_int8_t ct_lun; /* lun */
413 u_int8_t ct_iid; /* initiator id */
414 u_int8_t ct_reserved2;
415 u_int8_t ct_tgt; /* our target id */
416 u_int32_t ct_flags;
417 u_int8_t ct_status; /* isp status */
418 u_int8_t ct_scsi_status; /* scsi status */
419 u_int8_t ct_tag_val; /* tag value */
420 u_int8_t ct_tag_type; /* tag type */
421 u_int32_t ct_xfrlen; /* transfer length */
422 u_int32_t ct_resid; /* residual length */
423 u_int16_t ct_timeout;
424 u_int16_t ct_seg_count;
411 uint16_t ct_fwhandle; /* required by f/w */
412 uint8_t ct_lun; /* lun */
413 uint8_t ct_iid; /* initiator id */
414 uint8_t ct_reserved2;
415 uint8_t ct_tgt; /* our target id */
416 uint32_t ct_flags;
417 uint8_t ct_status; /* isp status */
418 uint8_t ct_scsi_status; /* scsi status */
419 uint8_t ct_tag_val; /* tag value */
420 uint8_t ct_tag_type; /* tag type */
421 uint32_t ct_xfrlen; /* transfer length */
422 uint32_t ct_resid; /* residual length */
423 uint16_t ct_timeout;
424 uint16_t ct_seg_count;
425 /*
426 * This is so we can share tag name space with
427 * CTIO{2,3,4} with the minimum of pain.
428 */
429 union {
430 ispds_t ct_a[ISP_RQDSEG];
431 } _u;
432#define ct_dataseg _u.ct_a

--- 64 unchanged lines hidden (view full) ---

497 * offset.
498 */
499#define CTIO_SENSE_OFFSET 0x2E
500
501/*
502 * Entry length in u_longs. All entries are the same size so
503 * any one will do as the numerator.
504 */
425 /*
426 * This is so we can share tag name space with
427 * CTIO{2,3,4} with the minimum of pain.
428 */
429 union {
430 ispds_t ct_a[ISP_RQDSEG];
431 } _u;
432#define ct_dataseg _u.ct_a

--- 64 unchanged lines hidden (view full) ---

497 * offset.
498 */
499#define CTIO_SENSE_OFFSET 0x2E
500
501/*
502 * Entry length in u_longs. All entries are the same size so
503 * any one will do as the numerator.
504 */
505#define UINT32_ENTRY_SIZE (sizeof(at_entry_t)/sizeof(u_int32_t))
505#define UINT32_ENTRY_SIZE (sizeof(at_entry_t)/sizeof(uint32_t))
506
507/*
508 * QLA2100 CTIO (type 2) entry
509 */
510#define MAXRESPLEN 26
511typedef struct {
512 isphdr_t ct_header;
506
507/*
508 * QLA2100 CTIO (type 2) entry
509 */
510#define MAXRESPLEN 26
511typedef struct {
512 isphdr_t ct_header;
513 u_int16_t ct_reserved;
514 u_int16_t ct_fwhandle; /* just to match CTIO */
515 u_int8_t ct_lun; /* lun */
516 u_int8_t ct_iid; /* initiator id */
517 u_int16_t ct_rxid; /* response ID */
518 u_int16_t ct_flags;
519 u_int16_t ct_status; /* isp status */
520 u_int16_t ct_timeout;
521 u_int16_t ct_seg_count;
522 u_int32_t ct_reloff; /* relative offset */
513 uint16_t ct_reserved;
514 uint16_t ct_fwhandle; /* just to match CTIO */
515 uint8_t ct_lun; /* lun */
516 uint8_t ct_iid; /* initiator id */
517 uint16_t ct_rxid; /* response ID */
518 uint16_t ct_flags;
519 uint16_t ct_status; /* isp status */
520 uint16_t ct_timeout;
521 uint16_t ct_seg_count;
522 uint32_t ct_reloff; /* relative offset */
523 int32_t ct_resid; /* residual length */
524 union {
525 /*
526 * The three different modes that the target driver
527 * can set the CTIO{2,3,4} up as.
528 *
529 * The first is for sending FCP_DATA_IUs as well as
530 * (optionally) sending a terminal SCSI status FCP_RSP_IU.
531 *
532 * The second is for sending SCSI sense data in an FCP_RSP_IU.
533 * Note that no FCP_DATA_IUs will be sent.
534 *
535 * The third is for sending FCP_RSP_IUs as built specifically
536 * in system memory as located by the isp_dataseg.
537 */
538 struct {
523 int32_t ct_resid; /* residual length */
524 union {
525 /*
526 * The three different modes that the target driver
527 * can set the CTIO{2,3,4} up as.
528 *
529 * The first is for sending FCP_DATA_IUs as well as
530 * (optionally) sending a terminal SCSI status FCP_RSP_IU.
531 *
532 * The second is for sending SCSI sense data in an FCP_RSP_IU.
533 * Note that no FCP_DATA_IUs will be sent.
534 *
535 * The third is for sending FCP_RSP_IUs as built specifically
536 * in system memory as located by the isp_dataseg.
537 */
538 struct {
539 u_int32_t _reserved;
540 u_int16_t _reserved2;
541 u_int16_t ct_scsi_status;
542 u_int32_t ct_xfrlen;
539 uint32_t _reserved;
540 uint16_t _reserved2;
541 uint16_t ct_scsi_status;
542 uint32_t ct_xfrlen;
543 union {
544 ispds_t ct_a[ISP_RQDSEG_T2]; /* CTIO2 */
545 ispds64_t ct_b[ISP_RQDSEG_T3]; /* CTIO3 */
546 ispdslist_t ct_c; /* CTIO4 */
547 } _u;
548#define ct_dataseg _u.ct_a
549#define ct_dataseg64 _u.ct_b
550#define ct_dslist _u.ct_c
551 } m0;
552 struct {
543 union {
544 ispds_t ct_a[ISP_RQDSEG_T2]; /* CTIO2 */
545 ispds64_t ct_b[ISP_RQDSEG_T3]; /* CTIO3 */
546 ispdslist_t ct_c; /* CTIO4 */
547 } _u;
548#define ct_dataseg _u.ct_a
549#define ct_dataseg64 _u.ct_b
550#define ct_dslist _u.ct_c
551 } m0;
552 struct {
553 u_int16_t _reserved;
554 u_int16_t _reserved2;
555 u_int16_t ct_senselen;
556 u_int16_t ct_scsi_status;
557 u_int16_t ct_resplen;
558 u_int8_t ct_resp[MAXRESPLEN];
553 uint16_t _reserved;
554 uint16_t _reserved2;
555 uint16_t ct_senselen;
556 uint16_t ct_scsi_status;
557 uint16_t ct_resplen;
558 uint8_t ct_resp[MAXRESPLEN];
559 } m1;
560 struct {
559 } m1;
560 struct {
561 u_int32_t _reserved;
562 u_int16_t _reserved2;
563 u_int16_t _reserved3;
564 u_int32_t ct_datalen;
561 uint32_t _reserved;
562 uint16_t _reserved2;
563 uint16_t _reserved3;
564 uint32_t ct_datalen;
565 ispds_t ct_fcp_rsp_iudata;
566 } m2;
567 } rsp;
568} ct2_entry_t;
569
570typedef struct {
571 isphdr_t ct_header;
565 ispds_t ct_fcp_rsp_iudata;
566 } m2;
567 } rsp;
568} ct2_entry_t;
569
570typedef struct {
571 isphdr_t ct_header;
572 u_int16_t ct_reserved;
573 u_int16_t ct_fwhandle; /* just to match CTIO */
574 u_int16_t ct_iid; /* initiator id */
575 u_int16_t ct_rxid; /* response ID */
576 u_int16_t ct_flags;
577 u_int16_t ct_status; /* isp status */
578 u_int16_t ct_timeout;
579 u_int16_t ct_seg_count;
580 u_int32_t ct_reloff; /* relative offset */
572 uint16_t ct_reserved;
573 uint16_t ct_fwhandle; /* just to match CTIO */
574 uint16_t ct_iid; /* initiator id */
575 uint16_t ct_rxid; /* response ID */
576 uint16_t ct_flags;
577 uint16_t ct_status; /* isp status */
578 uint16_t ct_timeout;
579 uint16_t ct_seg_count;
580 uint32_t ct_reloff; /* relative offset */
581 int32_t ct_resid; /* residual length */
582 union {
583 struct {
581 int32_t ct_resid; /* residual length */
582 union {
583 struct {
584 u_int32_t _reserved;
585 u_int16_t _reserved2;
586 u_int16_t ct_scsi_status;
587 u_int32_t ct_xfrlen;
584 uint32_t _reserved;
585 uint16_t _reserved2;
586 uint16_t ct_scsi_status;
587 uint32_t ct_xfrlen;
588 union {
589 ispds_t ct_a[ISP_RQDSEG_T2]; /* CTIO2 */
590 ispds64_t ct_b[ISP_RQDSEG_T3]; /* CTIO3 */
591 ispdslist_t ct_c; /* CTIO4 */
592 } _u;
593 } m0;
594 struct {
588 union {
589 ispds_t ct_a[ISP_RQDSEG_T2]; /* CTIO2 */
590 ispds64_t ct_b[ISP_RQDSEG_T3]; /* CTIO3 */
591 ispdslist_t ct_c; /* CTIO4 */
592 } _u;
593 } m0;
594 struct {
595 u_int16_t _reserved;
596 u_int16_t _reserved2;
597 u_int16_t ct_senselen;
598 u_int16_t ct_scsi_status;
599 u_int16_t ct_resplen;
600 u_int8_t ct_resp[MAXRESPLEN];
595 uint16_t _reserved;
596 uint16_t _reserved2;
597 uint16_t ct_senselen;
598 uint16_t ct_scsi_status;
599 uint16_t ct_resplen;
600 uint8_t ct_resp[MAXRESPLEN];
601 } m1;
602 struct {
601 } m1;
602 struct {
603 u_int32_t _reserved;
604 u_int16_t _reserved2;
605 u_int16_t _reserved3;
606 u_int32_t ct_datalen;
603 uint32_t _reserved;
604 uint16_t _reserved2;
605 uint16_t _reserved3;
606 uint32_t ct_datalen;
607 ispds_t ct_fcp_rsp_iudata;
608 } m2;
609 } rsp;
610} ct2e_entry_t;
611
612/*
613 * ct_flags values for CTIO2
614 */

--- 34 unchanged lines hidden (view full) ---

649/*
650 * The functions below are for the publicly available
651 * target mode functions that are internal to the Qlogic driver.
652 */
653
654/*
655 * This function handles new response queue entry appropriate for target mode.
656 */
607 ispds_t ct_fcp_rsp_iudata;
608 } m2;
609 } rsp;
610} ct2e_entry_t;
611
612/*
613 * ct_flags values for CTIO2
614 */

--- 34 unchanged lines hidden (view full) ---

649/*
650 * The functions below are for the publicly available
651 * target mode functions that are internal to the Qlogic driver.
652 */
653
654/*
655 * This function handles new response queue entry appropriate for target mode.
656 */
657int isp_target_notify(struct ispsoftc *, void *, u_int16_t *);
657int isp_target_notify(ispsoftc_t *, void *, uint16_t *);
658
659/*
660 * This function externalizes the ability to acknowledge an Immediate Notify
661 * request.
662 */
658
659/*
660 * This function externalizes the ability to acknowledge an Immediate Notify
661 * request.
662 */
663void isp_notify_ack(struct ispsoftc *, void *);
663void isp_notify_ack(ispsoftc_t *, void *);
664
665/*
666 * Enable/Disable/Modify a logical unit.
667 * (softc, cmd, bus, tgt, lun, cmd_cnt, inotify_cnt, opaque)
668 */
669#define DFLT_CMND_CNT 0xfe /* unmonitored */
670#define DFLT_INOT_CNT 16
664
665/*
666 * Enable/Disable/Modify a logical unit.
667 * (softc, cmd, bus, tgt, lun, cmd_cnt, inotify_cnt, opaque)
668 */
669#define DFLT_CMND_CNT 0xfe /* unmonitored */
670#define DFLT_INOT_CNT 16
671int isp_lun_cmd(struct ispsoftc *, int, int, int, int, int, int, u_int32_t);
671int isp_lun_cmd(ispsoftc_t *, int, int, int, int, int, int, uint32_t);
672
673/*
674 * General request queue 'put' routine for target mode entries.
675 */
672
673/*
674 * General request queue 'put' routine for target mode entries.
675 */
676int isp_target_put_entry(struct ispsoftc *isp, void *);
676int isp_target_put_entry(ispsoftc_t *isp, void *);
677
678/*
679 * General routine to put back an ATIO entry-
680 * used for replenishing f/w resource counts.
681 * The argument is a pointer to a source ATIO
682 * or ATIO2.
683 */
677
678/*
679 * General routine to put back an ATIO entry-
680 * used for replenishing f/w resource counts.
681 * The argument is a pointer to a source ATIO
682 * or ATIO2.
683 */
684int isp_target_put_atio(struct ispsoftc *, void *);
684int isp_target_put_atio(ispsoftc_t *, void *);
685
686/*
687 * General routine to send a final CTIO for a command- used mostly for
688 * local responses.
689 */
685
686/*
687 * General routine to send a final CTIO for a command- used mostly for
688 * local responses.
689 */
690int isp_endcmd(struct ispsoftc *, void *, u_int32_t, u_int16_t);
690int isp_endcmd(ispsoftc_t *, void *, uint32_t, uint16_t);
691#define ECMD_SVALID 0x100
692
693/*
694 * Handle an asynchronous event
695 *
696 * Return nonzero if the interrupt that generated this event has been dismissed.
697 */
691#define ECMD_SVALID 0x100
692
693/*
694 * Handle an asynchronous event
695 *
696 * Return nonzero if the interrupt that generated this event has been dismissed.
697 */
698int isp_target_async(struct ispsoftc *, int, int);
698int isp_target_async(ispsoftc_t *, int, int);
699
700#endif /* _ISP_TARGET_H */
699
700#endif /* _ISP_TARGET_H */