Deleted Added
full compact
ispmbox.h (154704) ispmbox.h (155704)
1/* $FreeBSD: head/sys/dev/isp/ispmbox.h 154704 2006-01-23 06:23:37Z mjacob $ */
1/* $FreeBSD: head/sys/dev/isp/ispmbox.h 155704 2006-02-15 00:31:48Z mjacob $ */
2/*-
3 * Mailbox and Queue Entry Definitions for for Qlogic ISP SCSI adapters.
4 *
5 * Copyright (c) 1997-2006 by Matthew Jacob
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

243#define WRITE_RESPONSE_QUEUE_OUT_POINTER(isp, value) \
244 ISP_WRITE(isp, isp->isp_respoutrp, value)
245
246/*
247 * Command Structure Definitions
248 */
249
250typedef struct {
2/*-
3 * Mailbox and Queue Entry Definitions for for Qlogic ISP SCSI adapters.
4 *
5 * Copyright (c) 1997-2006 by Matthew Jacob
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

243#define WRITE_RESPONSE_QUEUE_OUT_POINTER(isp, value) \
244 ISP_WRITE(isp, isp->isp_respoutrp, value)
245
246/*
247 * Command Structure Definitions
248 */
249
250typedef struct {
251 u_int32_t ds_base;
252 u_int32_t ds_count;
251 uint32_t ds_base;
252 uint32_t ds_count;
253} ispds_t;
254
255typedef struct {
253} ispds_t;
254
255typedef struct {
256 u_int32_t ds_base;
257 u_int32_t ds_basehi;
258 u_int32_t ds_count;
256 uint32_t ds_base;
257 uint32_t ds_basehi;
258 uint32_t ds_count;
259} ispds64_t;
260
261#define DSTYPE_32BIT 0
262#define DSTYPE_64BIT 1
263typedef struct {
259} ispds64_t;
260
261#define DSTYPE_32BIT 0
262#define DSTYPE_64BIT 1
263typedef struct {
264 u_int16_t ds_type; /* 0-> ispds_t, 1-> ispds64_t */
265 u_int32_t ds_segment; /* unused */
266 u_int32_t ds_base; /* 32 bit address of DSD list */
264 uint16_t ds_type; /* 0-> ispds_t, 1-> ispds64_t */
265 uint32_t ds_segment; /* unused */
266 uint32_t ds_base; /* 32 bit address of DSD list */
267} ispdslist_t;
268
269
270/*
271 * These elements get swizzled around for SBus instances.
272 */
273#define ISP_SWAP8(a, b) { \
267} ispdslist_t;
268
269
270/*
271 * These elements get swizzled around for SBus instances.
272 */
273#define ISP_SWAP8(a, b) { \
274 u_int8_t tmp; \
274 uint8_t tmp; \
275 tmp = a; \
276 a = b; \
277 b = tmp; \
278}
279typedef struct {
275 tmp = a; \
276 a = b; \
277 b = tmp; \
278}
279typedef struct {
280 u_int8_t rqs_entry_type;
281 u_int8_t rqs_entry_count;
282 u_int8_t rqs_seqno;
283 u_int8_t rqs_flags;
280 uint8_t rqs_entry_type;
281 uint8_t rqs_entry_count;
282 uint8_t rqs_seqno;
283 uint8_t rqs_flags;
284} isphdr_t;
285
286/* RQS Flag definitions */
287#define RQSFLAG_CONTINUATION 0x01
288#define RQSFLAG_FULL 0x02
289#define RQSFLAG_BADHEADER 0x04
290#define RQSFLAG_BADPACKET 0x08
291

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

320#define RQSTYPE_RIO2 0x22
321#define RQSTYPE_IP_RECV 0x23
322#define RQSTYPE_IP_RECV_CONT 0x24
323
324
325#define ISP_RQDSEG 4
326typedef struct {
327 isphdr_t req_header;
284} isphdr_t;
285
286/* RQS Flag definitions */
287#define RQSFLAG_CONTINUATION 0x01
288#define RQSFLAG_FULL 0x02
289#define RQSFLAG_BADHEADER 0x04
290#define RQSFLAG_BADPACKET 0x08
291

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

320#define RQSTYPE_RIO2 0x22
321#define RQSTYPE_IP_RECV 0x23
322#define RQSTYPE_IP_RECV_CONT 0x24
323
324
325#define ISP_RQDSEG 4
326typedef struct {
327 isphdr_t req_header;
328 u_int32_t req_handle;
329 u_int8_t req_lun_trn;
330 u_int8_t req_target;
331 u_int16_t req_cdblen;
328 uint32_t req_handle;
329 uint8_t req_lun_trn;
330 uint8_t req_target;
331 uint16_t req_cdblen;
332#define req_modifier req_cdblen /* marker packet */
332#define req_modifier req_cdblen /* marker packet */
333 u_int16_t req_flags;
334 u_int16_t req_reserved;
335 u_int16_t req_time;
336 u_int16_t req_seg_count;
337 u_int8_t req_cdb[12];
333 uint16_t req_flags;
334 uint16_t req_reserved;
335 uint16_t req_time;
336 uint16_t req_seg_count;
337 uint8_t req_cdb[12];
338 ispds_t req_dataseg[ISP_RQDSEG];
339} ispreq_t;
340
341#define ispreq64_t ispreqt3_t /* same as.... */
342#define ISP_RQDSEG_A64 2
343
344/*
345 * A request packet can also be a marker packet.
346 */
347#define SYNC_DEVICE 0
348#define SYNC_TARGET 1
349#define SYNC_ALL 2
350#define SYNC_LIP 3
351
352#define ISP_RQDSEG_T2 3
353typedef struct {
354 isphdr_t req_header;
338 ispds_t req_dataseg[ISP_RQDSEG];
339} ispreq_t;
340
341#define ispreq64_t ispreqt3_t /* same as.... */
342#define ISP_RQDSEG_A64 2
343
344/*
345 * A request packet can also be a marker packet.
346 */
347#define SYNC_DEVICE 0
348#define SYNC_TARGET 1
349#define SYNC_ALL 2
350#define SYNC_LIP 3
351
352#define ISP_RQDSEG_T2 3
353typedef struct {
354 isphdr_t req_header;
355 u_int32_t req_handle;
356 u_int8_t req_lun_trn;
357 u_int8_t req_target;
358 u_int16_t req_scclun;
359 u_int16_t req_flags;
360 u_int16_t _res2;
361 u_int16_t req_time;
362 u_int16_t req_seg_count;
363 u_int8_t req_cdb[16];
364 u_int32_t req_totalcnt;
355 uint32_t req_handle;
356 uint8_t req_lun_trn;
357 uint8_t req_target;
358 uint16_t req_scclun;
359 uint16_t req_flags;
360 uint16_t _res2;
361 uint16_t req_time;
362 uint16_t req_seg_count;
363 uint8_t req_cdb[16];
364 uint32_t req_totalcnt;
365 ispds_t req_dataseg[ISP_RQDSEG_T2];
366} ispreqt2_t;
367
368typedef struct {
369 isphdr_t req_header;
365 ispds_t req_dataseg[ISP_RQDSEG_T2];
366} ispreqt2_t;
367
368typedef struct {
369 isphdr_t req_header;
370 u_int32_t req_handle;
371 u_int16_t req_target;
372 u_int16_t req_scclun;
373 u_int16_t req_flags;
374 u_int16_t _res2;
375 u_int16_t req_time;
376 u_int16_t req_seg_count;
377 u_int8_t req_cdb[16];
378 u_int32_t req_totalcnt;
370 uint32_t req_handle;
371 uint16_t req_target;
372 uint16_t req_scclun;
373 uint16_t req_flags;
374 uint16_t _res2;
375 uint16_t req_time;
376 uint16_t req_seg_count;
377 uint8_t req_cdb[16];
378 uint32_t req_totalcnt;
379 ispds_t req_dataseg[ISP_RQDSEG_T2];
380} ispreqt2e_t;
381
382#define ISP_RQDSEG_T3 2
383typedef struct {
384 isphdr_t req_header;
379 ispds_t req_dataseg[ISP_RQDSEG_T2];
380} ispreqt2e_t;
381
382#define ISP_RQDSEG_T3 2
383typedef struct {
384 isphdr_t req_header;
385 u_int32_t req_handle;
386 u_int8_t req_lun_trn;
387 u_int8_t req_target;
388 u_int16_t req_scclun;
389 u_int16_t req_flags;
390 u_int16_t _res2;
391 u_int16_t req_time;
392 u_int16_t req_seg_count;
393 u_int8_t req_cdb[16];
394 u_int32_t req_totalcnt;
385 uint32_t req_handle;
386 uint8_t req_lun_trn;
387 uint8_t req_target;
388 uint16_t req_scclun;
389 uint16_t req_flags;
390 uint16_t _res2;
391 uint16_t req_time;
392 uint16_t req_seg_count;
393 uint8_t req_cdb[16];
394 uint32_t req_totalcnt;
395 ispds64_t req_dataseg[ISP_RQDSEG_T3];
396} ispreqt3_t;
397
398typedef struct {
399 isphdr_t req_header;
395 ispds64_t req_dataseg[ISP_RQDSEG_T3];
396} ispreqt3_t;
397
398typedef struct {
399 isphdr_t req_header;
400 u_int32_t req_handle;
401 u_int16_t req_target;
402 u_int16_t req_scclun;
403 u_int16_t req_flags;
404 u_int16_t _res2;
405 u_int16_t req_time;
406 u_int16_t req_seg_count;
407 u_int8_t req_cdb[16];
408 u_int32_t req_totalcnt;
400 uint32_t req_handle;
401 uint16_t req_target;
402 uint16_t req_scclun;
403 uint16_t req_flags;
404 uint16_t _res2;
405 uint16_t req_time;
406 uint16_t req_seg_count;
407 uint8_t req_cdb[16];
408 uint32_t req_totalcnt;
409 ispds64_t req_dataseg[ISP_RQDSEG_T3];
410} ispreqt3e_t;
411
412/* req_flag values */
413#define REQFLAG_NODISCON 0x0001
414#define REQFLAG_HTAG 0x0002
415#define REQFLAG_OTAG 0x0004
416#define REQFLAG_STAG 0x0008

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

427#define REQFLAG_FRC_WIDE 0x0800
428#define REQFLAG_NOPARITY 0x1000
429#define REQFLAG_STOPQ 0x2000
430#define REQFLAG_XTRASNS 0x4000
431#define REQFLAG_PRIORITY 0x8000
432
433typedef struct {
434 isphdr_t req_header;
409 ispds64_t req_dataseg[ISP_RQDSEG_T3];
410} ispreqt3e_t;
411
412/* req_flag values */
413#define REQFLAG_NODISCON 0x0001
414#define REQFLAG_HTAG 0x0002
415#define REQFLAG_OTAG 0x0004
416#define REQFLAG_STAG 0x0008

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

427#define REQFLAG_FRC_WIDE 0x0800
428#define REQFLAG_NOPARITY 0x1000
429#define REQFLAG_STOPQ 0x2000
430#define REQFLAG_XTRASNS 0x4000
431#define REQFLAG_PRIORITY 0x8000
432
433typedef struct {
434 isphdr_t req_header;
435 u_int32_t req_handle;
436 u_int8_t req_lun_trn;
437 u_int8_t req_target;
438 u_int16_t req_cdblen;
439 u_int16_t req_flags;
440 u_int16_t _res1;
441 u_int16_t req_time;
442 u_int16_t req_seg_count;
443 u_int8_t req_cdb[44];
435 uint32_t req_handle;
436 uint8_t req_lun_trn;
437 uint8_t req_target;
438 uint16_t req_cdblen;
439 uint16_t req_flags;
440 uint16_t _res1;
441 uint16_t req_time;
442 uint16_t req_seg_count;
443 uint8_t req_cdb[44];
444} ispextreq_t;
445
446#define ISP_CDSEG 7
447typedef struct {
448 isphdr_t req_header;
444} ispextreq_t;
445
446#define ISP_CDSEG 7
447typedef struct {
448 isphdr_t req_header;
449 u_int32_t _res1;
449 uint32_t _res1;
450 ispds_t req_dataseg[ISP_CDSEG];
451} ispcontreq_t;
452
453#define ISP_CDSEG64 5
454typedef struct {
455 isphdr_t req_header;
456 ispds64_t req_dataseg[ISP_CDSEG64];
457} ispcontreq64_t;
458
459typedef struct {
460 isphdr_t req_header;
450 ispds_t req_dataseg[ISP_CDSEG];
451} ispcontreq_t;
452
453#define ISP_CDSEG64 5
454typedef struct {
455 isphdr_t req_header;
456 ispds64_t req_dataseg[ISP_CDSEG64];
457} ispcontreq64_t;
458
459typedef struct {
460 isphdr_t req_header;
461 u_int32_t req_handle;
462 u_int16_t req_scsi_status;
463 u_int16_t req_completion_status;
464 u_int16_t req_state_flags;
465 u_int16_t req_status_flags;
466 u_int16_t req_time;
461 uint32_t req_handle;
462 uint16_t req_scsi_status;
463 uint16_t req_completion_status;
464 uint16_t req_state_flags;
465 uint16_t req_status_flags;
466 uint16_t req_time;
467#define req_response_len req_time /* FC only */
467#define req_response_len req_time /* FC only */
468 u_int16_t req_sense_len;
469 u_int32_t req_resid;
470 u_int8_t req_response[8]; /* FC only */
471 u_int8_t req_sense_data[32];
468 uint16_t req_sense_len;
469 uint32_t req_resid;
470 uint8_t req_response[8]; /* FC only */
471 uint8_t req_sense_data[32];
472} ispstatusreq_t;
473
474typedef struct {
475 isphdr_t req_header;
472} ispstatusreq_t;
473
474typedef struct {
475 isphdr_t req_header;
476 u_int8_t req_sense_data[60];
476 uint8_t req_sense_data[60];
477} ispstatus_cont_t;
478
479/*
480 * For Qlogic 2X00, the high order byte of SCSI status has
481 * additional meaning.
482 */
483#define RQCS_RU 0x800 /* Residual Under */
484#define RQCS_RO 0x400 /* Residual Over */

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

602 (IS_FC(isp) && (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_2KLOGINS))
603
604/*
605 * Reduced Interrupt Operation Response Queue Entreis
606 */
607
608typedef struct {
609 isphdr_t req_header;
477} ispstatus_cont_t;
478
479/*
480 * For Qlogic 2X00, the high order byte of SCSI status has
481 * additional meaning.
482 */
483#define RQCS_RU 0x800 /* Residual Under */
484#define RQCS_RO 0x400 /* Residual Over */

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

602 (IS_FC(isp) && (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_2KLOGINS))
603
604/*
605 * Reduced Interrupt Operation Response Queue Entreis
606 */
607
608typedef struct {
609 isphdr_t req_header;
610 u_int32_t req_handles[15];
610 uint32_t req_handles[15];
611} isp_rio1_t;
612
613typedef struct {
614 isphdr_t req_header;
611} isp_rio1_t;
612
613typedef struct {
614 isphdr_t req_header;
615 u_int16_t req_handles[30];
615 uint16_t req_handles[30];
616} isp_rio2_t;
617
618/*
619 * FC (ISP2100) specific data structures
620 */
621
622/*
623 * Initialization Control Block
624 *
625 * Version One (prime) format.
626 */
627typedef struct isp_icb {
616} isp_rio2_t;
617
618/*
619 * FC (ISP2100) specific data structures
620 */
621
622/*
623 * Initialization Control Block
624 *
625 * Version One (prime) format.
626 */
627typedef struct isp_icb {
628 u_int8_t icb_version;
629 u_int8_t _reserved0;
630 u_int16_t icb_fwoptions;
631 u_int16_t icb_maxfrmlen;
632 u_int16_t icb_maxalloc;
633 u_int16_t icb_execthrottle;
634 u_int8_t icb_retry_count;
635 u_int8_t icb_retry_delay;
636 u_int8_t icb_portname[8];
637 u_int16_t icb_hardaddr;
638 u_int8_t icb_iqdevtype;
639 u_int8_t icb_logintime;
640 u_int8_t icb_nodename[8];
641 u_int16_t icb_rqstout;
642 u_int16_t icb_rspnsin;
643 u_int16_t icb_rqstqlen;
644 u_int16_t icb_rsltqlen;
645 u_int16_t icb_rqstaddr[4];
646 u_int16_t icb_respaddr[4];
647 u_int16_t icb_lunenables;
648 u_int8_t icb_ccnt;
649 u_int8_t icb_icnt;
650 u_int16_t icb_lunetimeout;
651 u_int16_t _reserved1;
652 u_int16_t icb_xfwoptions;
653 u_int8_t icb_racctimer;
654 u_int8_t icb_idelaytimer;
655 u_int16_t icb_zfwoptions;
656 u_int16_t _reserved2[13];
628 uint8_t icb_version;
629 uint8_t _reserved0;
630 uint16_t icb_fwoptions;
631 uint16_t icb_maxfrmlen;
632 uint16_t icb_maxalloc;
633 uint16_t icb_execthrottle;
634 uint8_t icb_retry_count;
635 uint8_t icb_retry_delay;
636 uint8_t icb_portname[8];
637 uint16_t icb_hardaddr;
638 uint8_t icb_iqdevtype;
639 uint8_t icb_logintime;
640 uint8_t icb_nodename[8];
641 uint16_t icb_rqstout;
642 uint16_t icb_rspnsin;
643 uint16_t icb_rqstqlen;
644 uint16_t icb_rsltqlen;
645 uint16_t icb_rqstaddr[4];
646 uint16_t icb_respaddr[4];
647 uint16_t icb_lunenables;
648 uint8_t icb_ccnt;
649 uint8_t icb_icnt;
650 uint16_t icb_lunetimeout;
651 uint16_t _reserved1;
652 uint16_t icb_xfwoptions;
653 uint8_t icb_racctimer;
654 uint8_t icb_idelaytimer;
655 uint16_t icb_zfwoptions;
656 uint16_t _reserved2[13];
657} isp_icb_t;
658#define ICB_VERSION1 1
659
660#define ICBOPT_HARD_ADDRESS 0x0001
661#define ICBOPT_FAIRNESS 0x0002
662#define ICBOPT_FULL_DUPLEX 0x0004
663#define ICBOPT_FAST_POST 0x0008
664#define ICBOPT_TGT_ENABLE 0x0010

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

720#define ICB_NNM2 5
721#define ICB_NNM3 4
722#define ICB_NNM4 3
723#define ICB_NNM5 2
724#define ICB_NNM6 1
725#define ICB_NNM7 0
726
727#define MAKE_NODE_NAME_FROM_WWN(array, wwn) \
657} isp_icb_t;
658#define ICB_VERSION1 1
659
660#define ICBOPT_HARD_ADDRESS 0x0001
661#define ICBOPT_FAIRNESS 0x0002
662#define ICBOPT_FULL_DUPLEX 0x0004
663#define ICBOPT_FAST_POST 0x0008
664#define ICBOPT_TGT_ENABLE 0x0010

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

720#define ICB_NNM2 5
721#define ICB_NNM3 4
722#define ICB_NNM4 3
723#define ICB_NNM5 2
724#define ICB_NNM6 1
725#define ICB_NNM7 0
726
727#define MAKE_NODE_NAME_FROM_WWN(array, wwn) \
728 array[ICB_NNM0] = (u_int8_t) ((wwn >> 0) & 0xff), \
729 array[ICB_NNM1] = (u_int8_t) ((wwn >> 8) & 0xff), \
730 array[ICB_NNM2] = (u_int8_t) ((wwn >> 16) & 0xff), \
731 array[ICB_NNM3] = (u_int8_t) ((wwn >> 24) & 0xff), \
732 array[ICB_NNM4] = (u_int8_t) ((wwn >> 32) & 0xff), \
733 array[ICB_NNM5] = (u_int8_t) ((wwn >> 40) & 0xff), \
734 array[ICB_NNM6] = (u_int8_t) ((wwn >> 48) & 0xff), \
735 array[ICB_NNM7] = (u_int8_t) ((wwn >> 56) & 0xff)
728 array[ICB_NNM0] = (uint8_t) ((wwn >> 0) & 0xff), \
729 array[ICB_NNM1] = (uint8_t) ((wwn >> 8) & 0xff), \
730 array[ICB_NNM2] = (uint8_t) ((wwn >> 16) & 0xff), \
731 array[ICB_NNM3] = (uint8_t) ((wwn >> 24) & 0xff), \
732 array[ICB_NNM4] = (uint8_t) ((wwn >> 32) & 0xff), \
733 array[ICB_NNM5] = (uint8_t) ((wwn >> 40) & 0xff), \
734 array[ICB_NNM6] = (uint8_t) ((wwn >> 48) & 0xff), \
735 array[ICB_NNM7] = (uint8_t) ((wwn >> 56) & 0xff)
736
737#define MAKE_WWN_FROM_NODE_NAME(wwn, array) \
736
737#define MAKE_WWN_FROM_NODE_NAME(wwn, array) \
738 wwn = ((u_int64_t) array[ICB_NNM0]) | \
739 ((u_int64_t) array[ICB_NNM1] << 8) | \
740 ((u_int64_t) array[ICB_NNM2] << 16) | \
741 ((u_int64_t) array[ICB_NNM3] << 24) | \
742 ((u_int64_t) array[ICB_NNM4] << 32) | \
743 ((u_int64_t) array[ICB_NNM5] << 40) | \
744 ((u_int64_t) array[ICB_NNM6] << 48) | \
745 ((u_int64_t) array[ICB_NNM7] << 56)
738 wwn = ((uint64_t) array[ICB_NNM0]) | \
739 ((uint64_t) array[ICB_NNM1] << 8) | \
740 ((uint64_t) array[ICB_NNM2] << 16) | \
741 ((uint64_t) array[ICB_NNM3] << 24) | \
742 ((uint64_t) array[ICB_NNM4] << 32) | \
743 ((uint64_t) array[ICB_NNM5] << 40) | \
744 ((uint64_t) array[ICB_NNM6] << 48) | \
745 ((uint64_t) array[ICB_NNM7] << 56)
746
747/*
748 * FC-AL Position Map
749 *
750 * This is an at most 128 byte map that returns either
751 * the LILP or Firmware generated list of ports.
752 *
753 * We deviate a bit from the returned qlogic format to
754 * use an extra bit to say whether this was a LILP or
755 * f/w generated map.
756 */
757typedef struct {
746
747/*
748 * FC-AL Position Map
749 *
750 * This is an at most 128 byte map that returns either
751 * the LILP or Firmware generated list of ports.
752 *
753 * We deviate a bit from the returned qlogic format to
754 * use an extra bit to say whether this was a LILP or
755 * f/w generated map.
756 */
757typedef struct {
758 u_int8_t fwmap : 1,
758 uint8_t fwmap : 1,
759 count : 7;
759 count : 7;
760 u_int8_t map[127];
760 uint8_t map[127];
761} fcpos_map_t;
762
763/*
764 * Port Data Base Element
765 */
766
767typedef struct {
761} fcpos_map_t;
762
763/*
764 * Port Data Base Element
765 */
766
767typedef struct {
768 u_int16_t pdb_options;
769 u_int8_t pdb_mstate;
770 u_int8_t pdb_sstate;
768 uint16_t pdb_options;
769 uint8_t pdb_mstate;
770 uint8_t pdb_sstate;
771#define BITS2WORD(x) ((x)[0] << 16 | (x)[3] << 8 | (x)[2])
771#define BITS2WORD(x) ((x)[0] << 16 | (x)[3] << 8 | (x)[2])
772 u_int8_t pdb_hardaddr_bits[4];
773 u_int8_t pdb_portid_bits[4];
774 u_int8_t pdb_nodename[8];
775 u_int8_t pdb_portname[8];
776 u_int16_t pdb_execthrottle;
777 u_int16_t pdb_exec_count;
778 u_int8_t pdb_retry_count;
779 u_int8_t pdb_retry_delay;
780 u_int16_t pdb_resalloc;
781 u_int16_t pdb_curalloc;
782 u_int16_t pdb_qhead;
783 u_int16_t pdb_qtail;
784 u_int16_t pdb_tl_next;
785 u_int16_t pdb_tl_last;
786 u_int16_t pdb_features; /* PLOGI, Common Service */
787 u_int16_t pdb_pconcurrnt; /* PLOGI, Common Service */
788 u_int16_t pdb_roi; /* PLOGI, Common Service */
789 u_int8_t pdb_target;
790 u_int8_t pdb_initiator; /* PLOGI, Class 3 Control Flags */
791 u_int16_t pdb_rdsiz; /* PLOGI, Class 3 */
792 u_int16_t pdb_ncseq; /* PLOGI, Class 3 */
793 u_int16_t pdb_noseq; /* PLOGI, Class 3 */
794 u_int16_t pdb_labrtflg;
795 u_int16_t pdb_lstopflg;
796 u_int16_t pdb_sqhead;
797 u_int16_t pdb_sqtail;
798 u_int16_t pdb_ptimer;
799 u_int16_t pdb_nxt_seqid;
800 u_int16_t pdb_fcount;
801 u_int16_t pdb_prli_len;
802 u_int16_t pdb_prli_svc0;
803 u_int16_t pdb_prli_svc3;
804 u_int16_t pdb_loopid;
805 u_int16_t pdb_il_ptr;
806 u_int16_t pdb_sl_ptr;
772 uint8_t pdb_hardaddr_bits[4];
773 uint8_t pdb_portid_bits[4];
774 uint8_t pdb_nodename[8];
775 uint8_t pdb_portname[8];
776 uint16_t pdb_execthrottle;
777 uint16_t pdb_exec_count;
778 uint8_t pdb_retry_count;
779 uint8_t pdb_retry_delay;
780 uint16_t pdb_resalloc;
781 uint16_t pdb_curalloc;
782 uint16_t pdb_qhead;
783 uint16_t pdb_qtail;
784 uint16_t pdb_tl_next;
785 uint16_t pdb_tl_last;
786 uint16_t pdb_features; /* PLOGI, Common Service */
787 uint16_t pdb_pconcurrnt; /* PLOGI, Common Service */
788 uint16_t pdb_roi; /* PLOGI, Common Service */
789 uint8_t pdb_target;
790 uint8_t pdb_initiator; /* PLOGI, Class 3 Control Flags */
791 uint16_t pdb_rdsiz; /* PLOGI, Class 3 */
792 uint16_t pdb_ncseq; /* PLOGI, Class 3 */
793 uint16_t pdb_noseq; /* PLOGI, Class 3 */
794 uint16_t pdb_labrtflg;
795 uint16_t pdb_lstopflg;
796 uint16_t pdb_sqhead;
797 uint16_t pdb_sqtail;
798 uint16_t pdb_ptimer;
799 uint16_t pdb_nxt_seqid;
800 uint16_t pdb_fcount;
801 uint16_t pdb_prli_len;
802 uint16_t pdb_prli_svc0;
803 uint16_t pdb_prli_svc3;
804 uint16_t pdb_loopid;
805 uint16_t pdb_il_ptr;
806 uint16_t pdb_sl_ptr;
807} isp_pdb_t;
808
809#define PDB_OPTIONS_XMITTING (1<<11)
810#define PDB_OPTIONS_LNKXMIT (1<<10)
811#define PDB_OPTIONS_ABORTED (1<<9)
812#define PDB_OPTIONS_ADISC (1<<1)
813
814#define PDB_STATE_DISCOVERY 0

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

833 * CT definition
834 *
835 * This is as the QLogic f/w documentations defines it- which is just opposite,
836 * bit wise, from what the specification defines it as. Additionally, the
837 * ct_response and ct_resid (really from FC-GS-2) need to be byte swapped.
838 */
839
840typedef struct {
807} isp_pdb_t;
808
809#define PDB_OPTIONS_XMITTING (1<<11)
810#define PDB_OPTIONS_LNKXMIT (1<<10)
811#define PDB_OPTIONS_ABORTED (1<<9)
812#define PDB_OPTIONS_ADISC (1<<1)
813
814#define PDB_STATE_DISCOVERY 0

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

833 * CT definition
834 *
835 * This is as the QLogic f/w documentations defines it- which is just opposite,
836 * bit wise, from what the specification defines it as. Additionally, the
837 * ct_response and ct_resid (really from FC-GS-2) need to be byte swapped.
838 */
839
840typedef struct {
841 u_int8_t ct_revision;
842 u_int8_t ct_portid[3];
843 u_int8_t ct_fcs_type;
844 u_int8_t ct_fcs_subtype;
845 u_int8_t ct_options;
846 u_int8_t ct_res0;
847 u_int16_t ct_response;
848 u_int16_t ct_resid;
849 u_int8_t ct_res1;
850 u_int8_t ct_reason;
851 u_int8_t ct_explanation;
852 u_int8_t ct_vunique;
841 uint8_t ct_revision;
842 uint8_t ct_portid[3];
843 uint8_t ct_fcs_type;
844 uint8_t ct_fcs_subtype;
845 uint8_t ct_options;
846 uint8_t ct_res0;
847 uint16_t ct_response;
848 uint16_t ct_resid;
849 uint8_t ct_res1;
850 uint8_t ct_reason;
851 uint8_t ct_explanation;
852 uint8_t ct_vunique;
853} ct_hdr_t;
854#define FS_ACC 0x8002
855#define FS_RJT 0x8001
856
857#define FC4_IP 5 /* ISO/EEC 8802-2 LLC/SNAP "Out of Order Delivery" */
858#define FC4_SCSI 8 /* SCSI-3 via Fivre Channel Protocol (FCP) */
859#define FC4_FC_SVC 0x20 /* Fibre Channel Services */
860
861#define SNS_GA_NXT 0x100
862#define SNS_GPN_ID 0x112
863#define SNS_GNN_ID 0x113
864#define SNS_GFF_ID 0x11F
865#define SNS_GID_FT 0x171
866#define SNS_RFT_ID 0x217
867typedef struct {
853} ct_hdr_t;
854#define FS_ACC 0x8002
855#define FS_RJT 0x8001
856
857#define FC4_IP 5 /* ISO/EEC 8802-2 LLC/SNAP "Out of Order Delivery" */
858#define FC4_SCSI 8 /* SCSI-3 via Fivre Channel Protocol (FCP) */
859#define FC4_FC_SVC 0x20 /* Fibre Channel Services */
860
861#define SNS_GA_NXT 0x100
862#define SNS_GPN_ID 0x112
863#define SNS_GNN_ID 0x113
864#define SNS_GFF_ID 0x11F
865#define SNS_GID_FT 0x171
866#define SNS_RFT_ID 0x217
867typedef struct {
868 u_int16_t snscb_rblen; /* response buffer length (words) */
869 u_int16_t snscb_res0;
870 u_int16_t snscb_addr[4]; /* response buffer address */
871 u_int16_t snscb_sblen; /* subcommand buffer length (words) */
872 u_int16_t snscb_res1;
873 u_int16_t snscb_data[1]; /* variable data */
868 uint16_t snscb_rblen; /* response buffer length (words) */
869 uint16_t snscb_res0;
870 uint16_t snscb_addr[4]; /* response buffer address */
871 uint16_t snscb_sblen; /* subcommand buffer length (words) */
872 uint16_t snscb_res1;
873 uint16_t snscb_data[1]; /* variable data */
874} sns_screq_t; /* Subcommand Request Structure */
875
876typedef struct {
874} sns_screq_t; /* Subcommand Request Structure */
875
876typedef struct {
877 u_int16_t snscb_rblen; /* response buffer length (words) */
878 u_int16_t snscb_res0;
879 u_int16_t snscb_addr[4]; /* response buffer address */
880 u_int16_t snscb_sblen; /* subcommand buffer length (words) */
881 u_int16_t snscb_res1;
882 u_int16_t snscb_cmd;
883 u_int16_t snscb_res2;
884 u_int32_t snscb_res3;
885 u_int32_t snscb_port;
877 uint16_t snscb_rblen; /* response buffer length (words) */
878 uint16_t snscb_res0;
879 uint16_t snscb_addr[4]; /* response buffer address */
880 uint16_t snscb_sblen; /* subcommand buffer length (words) */
881 uint16_t snscb_res1;
882 uint16_t snscb_cmd;
883 uint16_t snscb_res2;
884 uint32_t snscb_res3;
885 uint32_t snscb_port;
886} sns_ga_nxt_req_t;
887#define SNS_GA_NXT_REQ_SIZE (sizeof (sns_ga_nxt_req_t))
888
889typedef struct {
886} sns_ga_nxt_req_t;
887#define SNS_GA_NXT_REQ_SIZE (sizeof (sns_ga_nxt_req_t))
888
889typedef struct {
890 u_int16_t snscb_rblen; /* response buffer length (words) */
891 u_int16_t snscb_res0;
892 u_int16_t snscb_addr[4]; /* response buffer address */
893 u_int16_t snscb_sblen; /* subcommand buffer length (words) */
894 u_int16_t snscb_res1;
895 u_int16_t snscb_cmd;
896 u_int16_t snscb_res2;
897 u_int32_t snscb_res3;
898 u_int32_t snscb_portid;
890 uint16_t snscb_rblen; /* response buffer length (words) */
891 uint16_t snscb_res0;
892 uint16_t snscb_addr[4]; /* response buffer address */
893 uint16_t snscb_sblen; /* subcommand buffer length (words) */
894 uint16_t snscb_res1;
895 uint16_t snscb_cmd;
896 uint16_t snscb_res2;
897 uint32_t snscb_res3;
898 uint32_t snscb_portid;
899} sns_gxn_id_req_t;
900#define SNS_GXN_ID_REQ_SIZE (sizeof (sns_gxn_id_req_t))
901
902typedef struct {
899} sns_gxn_id_req_t;
900#define SNS_GXN_ID_REQ_SIZE (sizeof (sns_gxn_id_req_t))
901
902typedef struct {
903 u_int16_t snscb_rblen; /* response buffer length (words) */
904 u_int16_t snscb_res0;
905 u_int16_t snscb_addr[4]; /* response buffer address */
906 u_int16_t snscb_sblen; /* subcommand buffer length (words) */
907 u_int16_t snscb_res1;
908 u_int16_t snscb_cmd;
909 u_int16_t snscb_mword_div_2;
910 u_int32_t snscb_res3;
911 u_int32_t snscb_fc4_type;
903 uint16_t snscb_rblen; /* response buffer length (words) */
904 uint16_t snscb_res0;
905 uint16_t snscb_addr[4]; /* response buffer address */
906 uint16_t snscb_sblen; /* subcommand buffer length (words) */
907 uint16_t snscb_res1;
908 uint16_t snscb_cmd;
909 uint16_t snscb_mword_div_2;
910 uint32_t snscb_res3;
911 uint32_t snscb_fc4_type;
912} sns_gid_ft_req_t;
913#define SNS_GID_FT_REQ_SIZE (sizeof (sns_gid_ft_req_t))
914
915typedef struct {
912} sns_gid_ft_req_t;
913#define SNS_GID_FT_REQ_SIZE (sizeof (sns_gid_ft_req_t))
914
915typedef struct {
916 u_int16_t snscb_rblen; /* response buffer length (words) */
917 u_int16_t snscb_res0;
918 u_int16_t snscb_addr[4]; /* response buffer address */
919 u_int16_t snscb_sblen; /* subcommand buffer length (words) */
920 u_int16_t snscb_res1;
921 u_int16_t snscb_cmd;
922 u_int16_t snscb_res2;
923 u_int32_t snscb_res3;
924 u_int32_t snscb_port;
925 u_int32_t snscb_fc4_types[8];
916 uint16_t snscb_rblen; /* response buffer length (words) */
917 uint16_t snscb_res0;
918 uint16_t snscb_addr[4]; /* response buffer address */
919 uint16_t snscb_sblen; /* subcommand buffer length (words) */
920 uint16_t snscb_res1;
921 uint16_t snscb_cmd;
922 uint16_t snscb_res2;
923 uint32_t snscb_res3;
924 uint32_t snscb_port;
925 uint32_t snscb_fc4_types[8];
926} sns_rft_id_req_t;
927#define SNS_RFT_ID_REQ_SIZE (sizeof (sns_rft_id_req_t))
928
929typedef struct {
930 ct_hdr_t snscb_cthdr;
926} sns_rft_id_req_t;
927#define SNS_RFT_ID_REQ_SIZE (sizeof (sns_rft_id_req_t))
928
929typedef struct {
930 ct_hdr_t snscb_cthdr;
931 u_int8_t snscb_port_type;
932 u_int8_t snscb_port_id[3];
933 u_int8_t snscb_portname[8];
934 u_int16_t snscb_data[1]; /* variable data */
931 uint8_t snscb_port_type;
932 uint8_t snscb_port_id[3];
933 uint8_t snscb_portname[8];
934 uint16_t snscb_data[1]; /* variable data */
935} sns_scrsp_t; /* Subcommand Response Structure */
936
937typedef struct {
938 ct_hdr_t snscb_cthdr;
935} sns_scrsp_t; /* Subcommand Response Structure */
936
937typedef struct {
938 ct_hdr_t snscb_cthdr;
939 u_int8_t snscb_port_type;
940 u_int8_t snscb_port_id[3];
941 u_int8_t snscb_portname[8];
942 u_int8_t snscb_pnlen; /* symbolic port name length */
943 u_int8_t snscb_pname[255]; /* symbolic port name */
944 u_int8_t snscb_nodename[8];
945 u_int8_t snscb_nnlen; /* symbolic node name length */
946 u_int8_t snscb_nname[255]; /* symbolic node name */
947 u_int8_t snscb_ipassoc[8];
948 u_int8_t snscb_ipaddr[16];
949 u_int8_t snscb_svc_class[4];
950 u_int8_t snscb_fc4_types[32];
951 u_int8_t snscb_fpname[8];
952 u_int8_t snscb_reserved;
953 u_int8_t snscb_hardaddr[3];
939 uint8_t snscb_port_type;
940 uint8_t snscb_port_id[3];
941 uint8_t snscb_portname[8];
942 uint8_t snscb_pnlen; /* symbolic port name length */
943 uint8_t snscb_pname[255]; /* symbolic port name */
944 uint8_t snscb_nodename[8];
945 uint8_t snscb_nnlen; /* symbolic node name length */
946 uint8_t snscb_nname[255]; /* symbolic node name */
947 uint8_t snscb_ipassoc[8];
948 uint8_t snscb_ipaddr[16];
949 uint8_t snscb_svc_class[4];
950 uint8_t snscb_fc4_types[32];
951 uint8_t snscb_fpname[8];
952 uint8_t snscb_reserved;
953 uint8_t snscb_hardaddr[3];
954} sns_ga_nxt_rsp_t; /* Subcommand Response Structure */
955#define SNS_GA_NXT_RESP_SIZE (sizeof (sns_ga_nxt_rsp_t))
956
957typedef struct {
958 ct_hdr_t snscb_cthdr;
954} sns_ga_nxt_rsp_t; /* Subcommand Response Structure */
955#define SNS_GA_NXT_RESP_SIZE (sizeof (sns_ga_nxt_rsp_t))
956
957typedef struct {
958 ct_hdr_t snscb_cthdr;
959 u_int8_t snscb_wwn[8];
959 uint8_t snscb_wwn[8];
960} sns_gxn_id_rsp_t;
961#define SNS_GXN_ID_RESP_SIZE (sizeof (sns_gxn_id_rsp_t))
962
963typedef struct {
964 ct_hdr_t snscb_cthdr;
960} sns_gxn_id_rsp_t;
961#define SNS_GXN_ID_RESP_SIZE (sizeof (sns_gxn_id_rsp_t))
962
963typedef struct {
964 ct_hdr_t snscb_cthdr;
965 u_int32_t snscb_fc4_features[32];
965 uint32_t snscb_fc4_features[32];
966} sns_gff_id_rsp_t;
967#define SNS_GFF_ID_RESP_SIZE (sizeof (sns_gff_id_rsp_t))
968
969typedef struct {
970 ct_hdr_t snscb_cthdr;
971 struct {
966} sns_gff_id_rsp_t;
967#define SNS_GFF_ID_RESP_SIZE (sizeof (sns_gff_id_rsp_t))
968
969typedef struct {
970 ct_hdr_t snscb_cthdr;
971 struct {
972 u_int8_t control;
973 u_int8_t portid[3];
972 uint8_t control;
973 uint8_t portid[3];
974 } snscb_ports[1];
975} sns_gid_ft_rsp_t;
976#define SNS_GID_FT_RESP_SIZE(x) ((sizeof (sns_gid_ft_rsp_t)) + ((x - 1) << 2))
977
978#define SNS_RFT_ID_RESP_SIZE (sizeof (ct_hdr_t))
979
980#endif /* _ISPMBOX_H */
974 } snscb_ports[1];
975} sns_gid_ft_rsp_t;
976#define SNS_GID_FT_RESP_SIZE(x) ((sizeof (sns_gid_ft_rsp_t)) + ((x - 1) << 2))
977
978#define SNS_RFT_ID_RESP_SIZE (sizeof (ct_hdr_t))
979
980#endif /* _ISPMBOX_H */