diff options
author | mjacob <mjacob@FreeBSD.org> | 2002-04-04 23:46:01 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2002-04-04 23:46:01 +0000 |
commit | f62deac6f06bab39d2dffeb95d82b8341445d5af (patch) | |
tree | 58b8cc455f67309f7a70758f449ddc01e0ded92b /sys/dev/isp/ispmbox.h | |
parent | 2be9f95449ddaa06d1bf21938e091ea7ecd27626 (diff) | |
download | FreeBSD-src-f62deac6f06bab39d2dffeb95d82b8341445d5af.zip FreeBSD-src-f62deac6f06bab39d2dffeb95d82b8341445d5af.tar.gz |
Fix bus dma segment count to be based off of MAXPHYS, not BUS_SPACE_MAXSIZE.
Grumble. I've seen better documented architectures out of Redmond.
Redo fabric evaluation to not use GET ALL NEXT (GA_NXT). Switches seem
to be trying to wriggle out of supporting this well. Instead, use
GID_FT to get a list of Port IDs and then use GPN_ID/GNN_ID to find the
port and node wwn. This should make working on fabrics a bit cleaner and
more stable.
This also caused some cleanup of SNS subcommand canonicalization so that
we can actually check for FS_ACC and FS_RJT, and if we get an FS_RJT,
print out the reason and explanation codes.
We'll keep the old GA_NXT method around if people want to uncomment a
controlling definition in ispvar.h.
This also had us clean up ISPASYNC_FABRICDEV to use a local lportdb argument
and to have the caller explicitly say that a device is at the end of the
fabric list.
MFC after: 1 week
Diffstat (limited to 'sys/dev/isp/ispmbox.h')
-rw-r--r-- | sys/dev/isp/ispmbox.h | 120 |
1 files changed, 108 insertions, 12 deletions
diff --git a/sys/dev/isp/ispmbox.h b/sys/dev/isp/ispmbox.h index ea62877..1bf7648 100644 --- a/sys/dev/isp/ispmbox.h +++ b/sys/dev/isp/ispmbox.h @@ -773,9 +773,39 @@ typedef struct { #define SVC3_ROLE_MASK 0x30 #define SVC3_ROLE_SHIFT 4 -#define SNS_GAN 0x100 -#define SNS_GP3 0x171 -#define SNS_RFT 0x217 +/* + * CT definition + * + * This is as the QLogic f/w documentations defines it- which is just opposite, + * bit wise, from what the specification defines it as. Additionally, the + * ct_response and ct_resid (really from FC-GS-2) need to be byte swapped. + */ + +typedef struct { + u_int8_t ct_revision; + u_int8_t ct_portid[3]; + u_int8_t ct_fcs_type; + u_int8_t ct_fcs_subtype; + u_int8_t ct_options; + u_int8_t ct_res0; + u_int16_t ct_response; + u_int16_t ct_resid; + u_int8_t ct_res1; + u_int8_t ct_reason; + u_int8_t ct_explanation; + u_int8_t ct_vunique; +} ct_hdr_t; +#define FS_ACC 0x8002 +#define FS_RJT 0x8001 + +#define FC4_IP 5 /* ISO/EEC 8802-2 LLC/SNAP "Out of Order Delivery" */ +#define FC4_SCSI 8 /* SCSI-3 via Fivre Channel Protocol (FCP) */ + +#define SNS_GA_NXT 0x100 +#define SNS_GPN_ID 0x112 +#define SNS_GNN_ID 0x113 +#define SNS_GID_FT 0x171 +#define SNS_RFT_ID 0x217 typedef struct { u_int16_t snscb_rblen; /* response buffer length (words) */ u_int16_t snscb_res0; @@ -784,23 +814,70 @@ typedef struct { u_int16_t snscb_res1; u_int16_t snscb_data[1]; /* variable data */ } sns_screq_t; /* Subcommand Request Structure */ -#define SNS_GAN_REQ_SIZE (sizeof (sns_screq_t)+(5*(sizeof (u_int16_t)))) -#define SNS_GP3_REQ_SIZE (sizeof (sns_screq_t)+(5*(sizeof (u_int16_t)))) -#define SNS_RFT_REQ_SIZE (sizeof (sns_screq_t)+(21*(sizeof (u_int16_t)))) typedef struct { - u_int8_t snscb_cthdr[16]; + u_int16_t snscb_rblen; /* response buffer length (words) */ + u_int16_t snscb_res0; + u_int16_t snscb_addr[4]; /* response buffer address */ + u_int16_t snscb_sblen; /* subcommand buffer length (words) */ + u_int16_t snscb_res1; + u_int16_t snscb_cmd; + u_int16_t snscb_res2; + u_int32_t snscb_res3; + u_int32_t snscb_port; +} sns_ga_nxt_req_t; +#define SNS_GA_NXT_REQ_SIZE (sizeof (sns_ga_nxt_req_t)) + +typedef struct { + u_int16_t snscb_rblen; /* response buffer length (words) */ + u_int16_t snscb_res0; + u_int16_t snscb_addr[4]; /* response buffer address */ + u_int16_t snscb_sblen; /* subcommand buffer length (words) */ + u_int16_t snscb_res1; + u_int16_t snscb_cmd; + u_int16_t snscb_res2; + u_int32_t snscb_res3; + u_int32_t snscb_portid; +} sns_gxn_id_req_t; +#define SNS_GXN_ID_REQ_SIZE (sizeof (sns_gxn_id_req_t)) + +typedef struct { + u_int16_t snscb_rblen; /* response buffer length (words) */ + u_int16_t snscb_res0; + u_int16_t snscb_addr[4]; /* response buffer address */ + u_int16_t snscb_sblen; /* subcommand buffer length (words) */ + u_int16_t snscb_res1; + u_int16_t snscb_cmd; + u_int16_t snscb_mword_div_2; + u_int32_t snscb_res3; + u_int32_t snscb_fc4_type; +} sns_gid_ft_req_t; +#define SNS_GID_FT_REQ_SIZE (sizeof (sns_gid_ft_req_t)) + +typedef struct { + u_int16_t snscb_rblen; /* response buffer length (words) */ + u_int16_t snscb_res0; + u_int16_t snscb_addr[4]; /* response buffer address */ + u_int16_t snscb_sblen; /* subcommand buffer length (words) */ + u_int16_t snscb_res1; + u_int16_t snscb_cmd; + u_int16_t snscb_res2; + u_int32_t snscb_res3; + u_int32_t snscb_port; + u_int32_t snscb_fc4_types[8]; +} sns_rft_id_req_t; +#define SNS_RFT_ID_REQ_SIZE (sizeof (sns_rft_id_req_t)) + +typedef struct { + ct_hdr_t snscb_cthdr; u_int8_t snscb_port_type; u_int8_t snscb_port_id[3]; u_int8_t snscb_portname[8]; u_int16_t snscb_data[1]; /* variable data */ } sns_scrsp_t; /* Subcommand Response Structure */ -#define SNS_GAN_RESP_SIZE 608 /* Maximum response size (bytes) */ -#define SNS_GP3_RESP_SIZE 532 /* XXX: For 128 ports */ -#define SNS_RFT_RESP_SIZE 16 typedef struct { - u_int8_t snscb_cthdr[16]; + ct_hdr_t snscb_cthdr; u_int8_t snscb_port_type; u_int8_t snscb_port_id[3]; u_int8_t snscb_portname[8]; @@ -816,6 +893,25 @@ typedef struct { u_int8_t snscb_fpname[8]; u_int8_t snscb_reserved; u_int8_t snscb_hardaddr[3]; -} sns_ganrsp_t; /* Subcommand Response Structure */ +} sns_ga_nxt_rsp_t; /* Subcommand Response Structure */ +#define SNS_GA_NXT_RESP_SIZE (sizeof (sns_ga_nxt_rsp_t)) + +typedef struct { + ct_hdr_t snscb_cthdr; + u_int8_t snscb_wwn[8]; +} sns_gxn_id_rsp_t; +#define SNS_GXN_ID_RESP_SIZE (sizeof (sns_gxn_id_rsp_t)) + + +typedef struct { + ct_hdr_t snscb_cthdr; + struct { + u_int8_t control; + u_int8_t portid[3]; + } snscb_ports[1]; +} sns_gid_ft_rsp_t; +#define SNS_GID_FT_RESP_SIZE(x) ((sizeof (sns_gid_ft_rsp_t)) + ((x - 1) << 2)) + +#define SNS_RFT_ID_RESP_SIZE (sizeof (ct_hdr_t)) #endif /* _ISPMBOX_H */ |