summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_ccb.h
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2013-09-24 16:50:53 +0000
committerscottl <scottl@FreeBSD.org>2013-09-24 16:50:53 +0000
commit108b7070e7a17abc52f44f333ba095f8f0eafc3a (patch)
treeccab290b4cfbac27db6123e5df329c2ca4e9a641 /sys/cam/cam_ccb.h
parent6633bf70ed24c304037f64ca2f28e6ea8d2a0b47 (diff)
downloadFreeBSD-src-108b7070e7a17abc52f44f333ba095f8f0eafc3a.zip
FreeBSD-src-108b7070e7a17abc52f44f333ba095f8f0eafc3a.tar.gz
Update the CAM API for FreeBSD 10:
- Remove the timeout_ch field. It's been deprecated since FreeBSD 7.0; MPSAFE drivers should be managing their own timeout storage. The remaining non-MPSAFE drivers have been modified to also manage their own storage, and should be considered for updating to MPSAFE (or removal) during the FreeBSD 10.x lifecycle. - Add fields related to soft timeouts and quality of service, to be used in upcoming work. - Add room for more flags in the CCB header and path_inq structures. - Begin support for extended 64-bit LUNs. - Bump the CAM version number to 0x18, but add compat shims. Tested with camcontrol and smartctl. Reviewed by: nathanw, ken, kib Approved by: re Obtained from: Netflix
Diffstat (limited to 'sys/cam/cam_ccb.h')
-rw-r--r--sys/cam/cam_ccb.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h
index 4012068..3f594cb 100644
--- a/sys/cam/cam_ccb.h
+++ b/sys/cam/cam_ccb.h
@@ -107,6 +107,10 @@ typedef enum {
CAM_SEND_STATUS = 0x40000000 /* Send status after data phase */
} ccb_flags;
+typedef enum {
+ CAM_EXTLUN_VALID = 0x00000001,/* 64bit lun field is valid */
+} ccb_xflags;
+
/* XPT Opcodes for xpt_action */
typedef enum {
/* Function code flags are bits greater than 0xff */
@@ -296,6 +300,12 @@ typedef union {
u_int8_t bytes[CCB_SIM_PRIV_SIZE * sizeof(ccb_priv_entry)];
} ccb_spriv_area;
+typedef struct {
+ struct timeval *etime;
+ uintptr_t sim_data;
+ uintptr_t periph_data;
+} ccb_qos_area;
+
struct ccb_hdr {
cam_pinfo pinfo; /* Info for priority scheduling */
camq_entry xpt_links; /* For chaining in the XPT layer */
@@ -310,16 +320,14 @@ struct ccb_hdr {
path_id_t path_id; /* Path ID for the request */
target_id_t target_id; /* Target device ID */
lun_id_t target_lun; /* Target LUN number */
+ lun64_id_t ext_lun; /* 64bit extended/multi-level LUNs */
u_int32_t flags; /* ccb_flags */
+ u_int32_t xflags; /* Extended flags */
ccb_ppriv_area periph_priv;
ccb_spriv_area sim_priv;
- u_int32_t timeout; /* Timeout value */
-
- /*
- * Deprecated, only for use by non-MPSAFE SIMs. All others must
- * allocate and initialize their own callout storage.
- */
- struct callout_handle timeout_ch;
+ ccb_qos_area qos;
+ u_int32_t timeout; /* Hard timeout value in seconds */
+ struct timeval softtimeout; /* Soft timeout value in sec + usec */
};
/* Get Device Information CCB */
@@ -541,7 +549,7 @@ struct ccb_dev_match {
/*
* Definitions for the path inquiry CCB fields.
*/
-#define CAM_VERSION 0x17 /* Hex value for current version */
+#define CAM_VERSION 0x18 /* Hex value for current version */
typedef enum {
PI_MDP_ABLE = 0x80, /* Supports MDP message */
@@ -564,6 +572,7 @@ typedef enum {
} pi_tmflag;
typedef enum {
+ PIM_EXTLUNS = 0x100,/* 64bit extended LUNs supported */
PIM_SCANHILO = 0x80, /* Bus scans from high ID to low ID */
PIM_NOREMOVE = 0x40, /* Removeable devices not included in scan */
PIM_NOINITIATOR = 0x20, /* Initiator role not supported. */
@@ -595,8 +604,8 @@ struct ccb_pathinq {
struct ccb_hdr ccb_h;
u_int8_t version_num; /* Version number for the SIM/HBA */
u_int8_t hba_inquiry; /* Mimic of INQ byte 7 for the HBA */
- u_int8_t target_sprt; /* Flags for target mode support */
- u_int8_t hba_misc; /* Misc HBA features */
+ u_int16_t target_sprt; /* Flags for target mode support */
+ u_int32_t hba_misc; /* Misc HBA features */
u_int16_t hba_eng_cnt; /* HBA engine count */
/* Vendor Unique capabilities */
u_int8_t vuhba_flags[VUHBALEN];
OpenPOWER on IntegriCloud