CAM_NEW_TRAN_CODE placeholders for SAS support.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 2 Dec 2007 03:01:55 +0000 (03:01 +0000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 2 Dec 2007 03:01:55 +0000 (03:01 +0000)
Obtained-from: FreeBSD

sys/bus/cam/cam_ccb.h
sys/bus/cam/cam_xpt.c

index d773a5f..6fc4101 100644 (file)
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/cam/cam_ccb.h,v 1.15.2.3 2003/07/29 04:00:34 njl Exp $
- * $DragonFly: src/sys/bus/cam/cam_ccb.h,v 1.13 2007/11/28 21:20:25 pavalos Exp $
+ * $DragonFly: src/sys/bus/cam/cam_ccb.h,v 1.14 2007/12/02 03:01:55 pavalos Exp $
  */
 
 #ifndef _CAM_CAM_CCB_H
@@ -225,7 +225,8 @@ 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)
@@ -526,6 +527,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 */
 
@@ -557,6 +561,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 */
@@ -760,6 +765,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;
@@ -776,6 +788,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;
 };
 
index 382a7ff..4c4af6c 100644 (file)
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/cam/cam_xpt.c,v 1.80.2.18 2002/12/09 17:31:55 gibbs Exp $
- * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.56 2007/12/02 00:30:35 pavalos Exp $
+ * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.57 2007/12/02 03:01:55 pavalos Exp $
  */
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1572,6 +1572,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",