diff options
author | mjacob <mjacob@FreeBSD.org> | 2006-01-20 19:21:38 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2006-01-20 19:21:38 +0000 |
commit | d8f173b52a1f186691e7a8d1ec50d0be0eac2c38 (patch) | |
tree | 6ac89b2947c183b8d5746033b8641da7a3682198 /sys/cam | |
parent | b203612a402534ee363f2e1c4b1e58b0207a842c (diff) | |
download | FreeBSD-src-d8f173b52a1f186691e7a8d1ec50d0be0eac2c38.zip FreeBSD-src-d8f173b52a1f186691e7a8d1ec50d0be0eac2c38.tar.gz |
CAM_NEW_TRAN_CODE placeholders for SAS support.
Reviewed by: nate, ken, justin
MFC after: 1 month
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/cam_ccb.h | 23 | ||||
-rw-r--r-- | sys/cam/cam_xpt.c | 7 |
2 files changed, 25 insertions, 5 deletions
diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 6128250..e03f3f9 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -226,13 +226,14 @@ typedef enum { XPORT_SSA, /* Serial Storage Architecture */ XPORT_USB, /* Universal Serial Bus */ XPORT_PPB, /* Parallel Port Bus */ - XPORT_ATA /* AT Attachment */ + XPORT_ATA, /* AT Attachment */ + XPORT_SAS, /* Serial Attached SCSI */ } cam_xport; -#define PROTO_VERSION_UNKNOWN (UINT_MAX - 1) -#define PROTO_VERSION_UNSPECIFIED UINT_MAX -#define XPORT_VERSION_UNKNOWN (UINT_MAX - 1) -#define XPORT_VERSION_UNSPECIFIED UINT_MAX +#define PROTO_VERSION_UNKNOWN (UINT_MAX - 1) +#define PROTO_VERSION_UNSPECIFIED UINT_MAX +#define XPORT_VERSION_UNKNOWN (UINT_MAX - 1) +#define XPORT_VERSION_UNSPECIFIED UINT_MAX #endif /* CAM_NEW_TRAN_CODE */ typedef union { @@ -527,6 +528,9 @@ struct ccb_pathinq_settings_fc { u_int32_t port; /* 24 bit port id, if known */ u_int32_t bitrate; /* Mbps */ }; +struct ccb_pathinq_settings_sas { + u_int32_t bitrate; /* Mbps */ +}; #define PATHINQ_SETTINGS_SIZE 128 #endif /* CAM_NEW_TRAN_CODE */ @@ -558,6 +562,7 @@ struct ccb_pathinq { union { struct ccb_pathinq_settings_spi spi; struct ccb_pathinq_settings_fc fc; + struct ccb_pathinq_settings_sas sas; char ccb_pathinq_settings_opaque[PATHINQ_SETTINGS_SIZE]; } xport_specific; #endif /* CAM_NEW_TRAN_CODE */ @@ -761,6 +766,13 @@ struct ccb_trans_settings_fc { u_int32_t bitrate; /* Mbps */ }; +struct ccb_trans_settings_sas { + u_int valid; /* Which fields to honor */ +#define CTS_SAS_VALID_SPEED 0x1000 + u_int32_t bitrate; /* Mbps */ +}; + + /* Get/Set transfer rate/width/disconnection/tag queueing settings */ struct ccb_trans_settings { struct ccb_hdr ccb_h; @@ -777,6 +789,7 @@ struct ccb_trans_settings { u_int valid; /* Which fields to honor */ struct ccb_trans_settings_spi spi; struct ccb_trans_settings_fc fc; + struct ccb_trans_settings_sas sas; } xport_specific; }; diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 2d887bb..1c90c6f 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -1632,6 +1632,13 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string) } } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SAS) { + struct ccb_trans_settings_sas *sas = &cts.xport_specific.sas; + if (sas->valid & CTS_SAS_VALID_SPEED) { + speed = sas->bitrate; + } + } + mb = speed / 1000; if (mb > 0) printf("%s%d: %d.%03dMB/s transfers", |