summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/cam
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-11-04 11:33:00 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-11-04 15:28:21 +0100
commitaf5333e0a02b2295304d4e029b15ee15a4fe2b3a (patch)
treec5c43680d374f58b487eeeaf18fb7ec6b84ba074 /freebsd/sys/cam
parentBUS_SPACE(9): Use simple memory model for ARM (diff)
downloadrtems-libbsd-af5333e0a02b2295304d4e029b15ee15a4fe2b3a.tar.bz2
Update to FreeBSD 8.4
Diffstat (limited to 'freebsd/sys/cam')
-rw-r--r--freebsd/sys/cam/ata/ata_all.h2
-rw-r--r--freebsd/sys/cam/cam.h1
-rw-r--r--freebsd/sys/cam/cam_ccb.h33
-rw-r--r--freebsd/sys/cam/cam_debug.h60
-rw-r--r--freebsd/sys/cam/cam_periph.h2
-rw-r--r--freebsd/sys/cam/cam_sim.h4
-rw-r--r--freebsd/sys/cam/cam_xpt.h27
-rw-r--r--freebsd/sys/cam/cam_xpt_sim.h2
-rw-r--r--freebsd/sys/cam/scsi/scsi_all.c177
-rw-r--r--freebsd/sys/cam/scsi/scsi_all.h25
10 files changed, 280 insertions, 53 deletions
diff --git a/freebsd/sys/cam/ata/ata_all.h b/freebsd/sys/cam/ata/ata_all.h
index 2e838fdc..526fc194 100644
--- a/freebsd/sys/cam/ata/ata_all.h
+++ b/freebsd/sys/cam/ata/ata_all.h
@@ -35,6 +35,8 @@ struct ccb_ataio;
struct cam_periph;
union ccb;
+#define SID_DMA 0x10 /* Abuse inq_flags bit to track enabled DMA. */
+
struct ata_cmd {
u_int8_t flags; /* ATA command flags */
#define CAM_ATAIO_48BIT 0x01 /* Command has 48-bit format */
diff --git a/freebsd/sys/cam/cam.h b/freebsd/sys/cam/cam.h
index 5a58db6c..8ea1d04c 100644
--- a/freebsd/sys/cam/cam.h
+++ b/freebsd/sys/cam/cam.h
@@ -87,6 +87,7 @@ typedef struct {
#define CAM_PRIORITY_NORMAL ((CAM_RL_NORMAL << 8) + 0x80)
#define CAM_PRIORITY_NONE (u_int32_t)-1
#define CAM_PRIORITY_TO_RL(x) ((x) >> 8)
+#define CAM_RL_TO_PRIORITY(x) ((x) << 8)
u_int32_t generation;
int index;
#define CAM_UNQUEUED_INDEX -1
diff --git a/freebsd/sys/cam/cam_ccb.h b/freebsd/sys/cam/cam_ccb.h
index 89042942..3e85eacb 100644
--- a/freebsd/sys/cam/cam_ccb.h
+++ b/freebsd/sys/cam/cam_ccb.h
@@ -187,6 +187,11 @@ typedef enum {
/*
* Set SIM specific knob values.
*/
+
+ XPT_SCAN_TGT = 0x1E | XPT_FC_QUEUED | XPT_FC_USER_CCB
+ | XPT_FC_XPT_ONLY,
+ /* Scan Target */
+
/* HBA engine commands 0x20->0x2F */
XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY,
/* HBA engine feature inquiry */
@@ -251,6 +256,14 @@ typedef enum {
XPORT_ISCSI, /* iSCSI */
} cam_xport;
+#define XPORT_IS_ATA(t) ((t) == XPORT_ATA || (t) == XPORT_SATA)
+#define XPORT_IS_SCSI(t) ((t) != XPORT_UNKNOWN && \
+ (t) != XPORT_UNSPECIFIED && \
+ !XPORT_IS_ATA(t))
+#define XPORT_DEVSTAT_TYPE(t) (XPORT_IS_ATA(t) ? DEVSTAT_TYPE_IF_IDE : \
+ XPORT_IS_SCSI(t) ? DEVSTAT_TYPE_IF_SCSI : \
+ DEVSTAT_TYPE_IF_OTHER)
+
#define PROTO_VERSION_UNKNOWN (UINT_MAX - 1)
#define PROTO_VERSION_UNSPECIFIED UINT_MAX
#define XPORT_VERSION_UNKNOWN (UINT_MAX - 1)
@@ -808,6 +821,14 @@ struct ccb_trans_settings_scsi
#define CTS_SCSI_FLAGS_TAG_ENB 0x01
};
+struct ccb_trans_settings_ata
+{
+ u_int valid; /* Which fields to honor */
+#define CTS_ATA_VALID_TQ 0x01
+ u_int flags;
+#define CTS_ATA_FLAGS_TAG_ENB 0x01
+};
+
struct ccb_trans_settings_spi
{
u_int valid; /* Which fields to honor */
@@ -842,7 +863,7 @@ struct ccb_trans_settings_sas {
u_int32_t bitrate; /* Mbps */
};
-struct ccb_trans_settings_ata {
+struct ccb_trans_settings_pata {
u_int valid; /* Which fields to honor */
#define CTS_ATA_VALID_MODE 0x01
#define CTS_ATA_VALID_BYTECOUNT 0x02
@@ -869,9 +890,10 @@ struct ccb_trans_settings_sata {
u_int atapi; /* Length of ATAPI CDB */
u_int caps; /* Device and host SATA caps. */
#define CTS_SATA_CAPS_H 0x0000ffff
-#define CTS_SATA_CAPS_HH_PMREQ 0x00000001
-#define CTS_SATA_CAPS_HH_APST 0x00000002
-#define CTS_SATA_CAPS_HH_DMAAA 0x00000010 /* Auto-activation */
+#define CTS_SATA_CAPS_H_PMREQ 0x00000001
+#define CTS_SATA_CAPS_H_APST 0x00000002
+#define CTS_SATA_CAPS_H_DMAAA 0x00000010 /* Auto-activation */
+#define CTS_SATA_CAPS_H_AN 0x00000020 /* Async. notification */
#define CTS_SATA_CAPS_D 0xffff0000
#define CTS_SATA_CAPS_D_PMREQ 0x00010000
#define CTS_SATA_CAPS_D_APST 0x00020000
@@ -887,6 +909,7 @@ struct ccb_trans_settings {
u_int transport_version;
union {
u_int valid; /* Which fields to honor */
+ struct ccb_trans_settings_ata ata;
struct ccb_trans_settings_scsi scsi;
} proto_specific;
union {
@@ -894,7 +917,7 @@ struct ccb_trans_settings {
struct ccb_trans_settings_spi spi;
struct ccb_trans_settings_fc fc;
struct ccb_trans_settings_sas sas;
- struct ccb_trans_settings_ata ata;
+ struct ccb_trans_settings_pata ata;
struct ccb_trans_settings_sata sata;
} xport_specific;
};
diff --git a/freebsd/sys/cam/cam_debug.h b/freebsd/sys/cam/cam_debug.h
index 4b0fd245..37acd7dc 100644
--- a/freebsd/sys/cam/cam_debug.h
+++ b/freebsd/sys/cam/cam_debug.h
@@ -40,10 +40,39 @@ typedef enum {
CAM_DEBUG_SUBTRACE = 0x04, /* internal to routine flows */
CAM_DEBUG_CDB = 0x08, /* print out SCSI CDBs only */
CAM_DEBUG_XPT = 0x10, /* print out xpt scheduling */
- CAM_DEBUG_PERIPH = 0x20 /* print out peripheral calls */
+ CAM_DEBUG_PERIPH = 0x20, /* print out peripheral calls */
+ CAM_DEBUG_PROBE = 0x40 /* print out probe actions */
} cam_debug_flags;
-#if defined(CAMDEBUG) && defined(_KERNEL)
+#if defined(_KERNEL) && !defined(__rtems__)
+
+#ifndef CAM_DEBUG_FLAGS
+#define CAM_DEBUG_FLAGS CAM_DEBUG_NONE
+#endif
+
+#ifndef CAM_DEBUG_COMPILE
+#ifdef CAMDEBUG
+#define CAM_DEBUG_COMPILE (-1)
+#else
+#define CAM_DEBUG_COMPILE (CAM_DEBUG_INFO | CAM_DEBUG_CDB | \
+ CAM_DEBUG_PERIPH | CAM_DEBUG_PROBE | \
+ CAM_DEBUG_FLAGS)
+#endif
+#endif
+
+#ifndef CAM_DEBUG_BUS
+#define CAM_DEBUG_BUS (-1)
+#endif
+#ifndef CAM_DEBUG_TARGET
+#define CAM_DEBUG_TARGET (-1)
+#endif
+#ifndef CAM_DEBUG_LUN
+#define CAM_DEBUG_LUN (-1)
+#endif
+
+#ifndef CAM_DEBUG_DELAY
+#define CAM_DEBUG_DELAY 0
+#endif
/* Path we want to debug */
extern struct cam_path *cam_dpath;
@@ -51,37 +80,48 @@ extern struct cam_path *cam_dpath;
extern u_int32_t cam_dflags;
/* Printf delay value (to prevent scrolling) */
extern u_int32_t cam_debug_delay;
-
+
/* Debugging macros. */
#define CAM_DEBUGGED(path, flag) \
- ((cam_dflags & (flag)) \
+ (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \
&& (cam_dpath != NULL) \
&& (xpt_path_comp(cam_dpath, path) >= 0) \
&& (xpt_path_comp(cam_dpath, path) < 2))
+
#define CAM_DEBUG(path, flag, printfargs) \
- if ((cam_dflags & (flag)) \
+ if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \
&& (cam_dpath != NULL) \
&& (xpt_path_comp(cam_dpath, path) >= 0) \
&& (xpt_path_comp(cam_dpath, path) < 2)) { \
xpt_print_path(path); \
- printf printfargs; \
+ printf printfargs; \
if (cam_debug_delay != 0) \
DELAY(cam_debug_delay); \
}
+
#define CAM_DEBUG_PRINT(flag, printfargs) \
- if (cam_dflags & (flag)) { \
+ if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \
printf("cam_debug: "); \
- printf printfargs; \
+ printf printfargs; \
+ if (cam_debug_delay != 0) \
+ DELAY(cam_debug_delay); \
+ }
+
+#define CAM_DEBUG_PATH_PRINT(flag, path, printfargs) \
+ if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \
+ xpt_print(path, "cam_debug: "); \
+ printf printfargs; \
if (cam_debug_delay != 0) \
DELAY(cam_debug_delay); \
}
-#else /* !CAMDEBUG || !_KERNEL */
+#else /* !_KERNEL */
#define CAM_DEBUGGED(A, B) 0
#define CAM_DEBUG(A, B, C)
#define CAM_DEBUG_PRINT(A, B)
+#define CAM_DEBUG_PATH_PRINT(A, B, C)
-#endif /* CAMDEBUG && _KERNEL */
+#endif /* _KERNEL */
#endif /* _CAM_CAM_DEBUG_H */
diff --git a/freebsd/sys/cam/cam_periph.h b/freebsd/sys/cam/cam_periph.h
index 33e9f758..c68fc9ba 100644
--- a/freebsd/sys/cam/cam_periph.h
+++ b/freebsd/sys/cam/cam_periph.h
@@ -119,6 +119,7 @@ struct cam_periph {
#define CAM_PERIPH_NEW_DEV_FOUND 0x10
#define CAM_PERIPH_RECOVERY_INPROG 0x20
#define CAM_PERIPH_SENSE_INPROG 0x40
+#define CAM_PERIPH_FREE 0x80
u_int32_t immediate_priority;
u_int32_t refcount;
SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */
@@ -145,6 +146,7 @@ struct cam_periph *cam_periph_find(struct cam_path *path, char *name);
cam_status cam_periph_acquire(struct cam_periph *periph);
void cam_periph_release(struct cam_periph *periph);
void cam_periph_release_locked(struct cam_periph *periph);
+void cam_periph_release_locked_buses(struct cam_periph *periph);
int cam_periph_hold(struct cam_periph *periph, int priority);
void cam_periph_unhold(struct cam_periph *periph);
void cam_periph_invalidate(struct cam_periph *periph);
diff --git a/freebsd/sys/cam/cam_sim.h b/freebsd/sys/cam/cam_sim.h
index 6b5a496f..ce6b38fc 100644
--- a/freebsd/sys/cam/cam_sim.h
+++ b/freebsd/sys/cam/cam_sim.h
@@ -140,7 +140,9 @@ struct cam_sim {
u_int32_t flags;
#define CAM_SIM_REL_TIMEOUT_PENDING 0x01
#define CAM_SIM_MPSAFE 0x02
-#define CAM_SIM_ON_DONEQ 0x04
+#define CAM_SIM_ON_DONEQ 0x04
+#define CAM_SIM_POLLED 0x08
+#define CAM_SIM_BATCH 0x10
struct callout callout;
struct cam_devq *devq; /* Device Queue to use for this SIM */
int refcount; /* References to the SIM. */
diff --git a/freebsd/sys/cam/cam_xpt.h b/freebsd/sys/cam/cam_xpt.h
index 61a7f3f0..c716a6ec 100644
--- a/freebsd/sys/cam/cam_xpt.h
+++ b/freebsd/sys/cam/cam_xpt.h
@@ -63,28 +63,6 @@ struct async_node {
SLIST_HEAD(async_list, async_node);
SLIST_HEAD(periph_list, cam_periph);
-#if defined(CAM_DEBUG_FLAGS) && !defined(CAMDEBUG)
-#error "You must have options CAMDEBUG to use options CAM_DEBUG_FLAGS"
-#endif
-
-/*
- * In order to enable the CAM_DEBUG_* options, the user must have CAMDEBUG
- * enabled. Also, the user must have either none, or all of CAM_DEBUG_BUS,
- * CAM_DEBUG_TARGET, and CAM_DEBUG_LUN specified.
- */
-#if defined(CAM_DEBUG_BUS) || defined(CAM_DEBUG_TARGET) \
- || defined(CAM_DEBUG_LUN)
-#ifdef CAMDEBUG
-#if !defined(CAM_DEBUG_BUS) || !defined(CAM_DEBUG_TARGET) \
- || !defined(CAM_DEBUG_LUN)
-#error "You must define all or none of CAM_DEBUG_BUS, CAM_DEBUG_TARGET \
- and CAM_DEBUG_LUN"
-#endif /* !CAM_DEBUG_BUS || !CAM_DEBUG_TARGET || !CAM_DEBUG_LUN */
-#else /* !CAMDEBUG */
-#error "You must use options CAMDEBUG if you use the CAM_DEBUG_* options"
-#endif /* CAMDEBUG */
-#endif /* CAM_DEBUG_BUS || CAM_DEBUG_TARGET || CAM_DEBUG_LUN */
-
void xpt_action(union ccb *new_ccb);
void xpt_action_default(union ccb *new_ccb);
union ccb *xpt_alloc_ccb(void);
@@ -104,6 +82,9 @@ cam_status xpt_create_path_unlocked(struct cam_path **new_path_ptr,
path_id_t path_id,
target_id_t target_id, lun_id_t lun_id);
void xpt_free_path(struct cam_path *path);
+void xpt_path_counts(struct cam_path *path, uint32_t *bus_ref,
+ uint32_t *periph_ref, uint32_t *target_ref,
+ uint32_t *device_ref);
int xpt_path_comp(struct cam_path *path1,
struct cam_path *path2);
void xpt_print_path(struct cam_path *path);
@@ -113,6 +94,7 @@ int xpt_path_string(struct cam_path *path, char *str,
path_id_t xpt_path_path_id(struct cam_path *path);
target_id_t xpt_path_target_id(struct cam_path *path);
lun_id_t xpt_path_lun_id(struct cam_path *path);
+int xpt_path_legacy_ata_id(struct cam_path *path);
struct cam_sim *xpt_path_sim(struct cam_path *path);
struct cam_periph *xpt_path_periph(struct cam_path *path);
void xpt_async(u_int32_t async_code, struct cam_path *path,
@@ -135,4 +117,3 @@ void xpt_release_path(struct cam_path *path);
#endif /* _KERNEL */
#endif /* _CAM_CAM_XPT_H */
-
diff --git a/freebsd/sys/cam/cam_xpt_sim.h b/freebsd/sys/cam/cam_xpt_sim.h
index 323f786c..67b895f2 100644
--- a/freebsd/sys/cam/cam_xpt_sim.h
+++ b/freebsd/sys/cam/cam_xpt_sim.h
@@ -51,6 +51,8 @@ void xpt_release_devq_rl(struct cam_path *path, cam_rl rl,
u_int count, int run_queue);
int xpt_sim_opened(struct cam_sim *sim);
void xpt_done(union ccb *done_ccb);
+void xpt_batch_start(struct cam_sim *sim);
+void xpt_batch_done(struct cam_sim *sim);
#endif
#endif /* _CAM_CAM_XPT_SIM_H */
diff --git a/freebsd/sys/cam/scsi/scsi_all.c b/freebsd/sys/cam/scsi/scsi_all.c
index 324a8e3a..bf002dbe 100644
--- a/freebsd/sys/cam/scsi/scsi_all.c
+++ b/freebsd/sys/cam/scsi/scsi_all.c
@@ -760,7 +760,7 @@ static struct asc_table_entry asc_table[] = {
*
* SCSI ASC/ASCQ Assignments
* Numeric Sorted Listing
- * as of 7/29/08
+ * as of 5/20/12
*
* D - DIRECT ACCESS DEVICE (SBC-2) device column key
* .T - SEQUENTIAL ACCESS DEVICE (SSC) -------------------
@@ -846,6 +846,12 @@ static struct asc_table_entry asc_table[] = {
/* DT R MAEBKV */
{ SST(0x00, 0x1E, SS_RDEF, /* XXX TBD */
"Conflicting SA creation request") },
+ /* DT B */
+ { SST(0x00, 0x1F, SS_RDEF, /* XXX TBD */
+ "Logical unit transitioning to another power condition") },
+ /* DT P B */
+ { SST(0x00, 0x20, SS_RDEF, /* XXX TBD */
+ "Extended copy information available") },
/* D W O BK */
{ SST(0x01, 0x00, SS_RDEF,
"No index/sector signal") },
@@ -915,6 +921,33 @@ static struct asc_table_entry asc_table[] = {
/* DT R MAEBKV */
{ SST(0x04, 0x13, SS_RDEF, /* XXX TBD */
"Logical unit not ready, SA creation in progress") },
+ /* D B */
+ { SST(0x04, 0x14, SS_RDEF, /* XXX TBD */
+ "Logical unit not ready, space allocation in progress") },
+ /* M */
+ { SST(0x04, 0x15, SS_RDEF, /* XXX TBD */
+ "Logical unit not ready, robotics disabled") },
+ /* M */
+ { SST(0x04, 0x16, SS_RDEF, /* XXX TBD */
+ "Logical unit not ready, configuration required") },
+ /* M */
+ { SST(0x04, 0x17, SS_RDEF, /* XXX TBD */
+ "Logical unit not ready, calibration required") },
+ /* M */
+ { SST(0x04, 0x18, SS_RDEF, /* XXX TBD */
+ "Logical unit not ready, a door is open") },
+ /* M */
+ { SST(0x04, 0x19, SS_RDEF, /* XXX TBD */
+ "Logical unit not ready, operating in sequential mode") },
+ /* DT B */
+ { SST(0x04, 0x1A, SS_RDEF, /* XXX TBD */
+ "Logical unit not ready, START/STOP UNIT command in progress") },
+ /* D B */
+ { SST(0x04, 0x1B, SS_RDEF, /* XXX TBD */
+ "Logical unit not ready, sanitize in progress") },
+ /* DT MAEB */
+ { SST(0x04, 0x1C, SS_RDEF, /* XXX TBD */
+ "Logical unit not ready, additional power use not yet granted") },
/* DTL WROMAEBKVF */
{ SST(0x05, 0x00, SS_RDEF,
"Logical unit does not respond to selection") },
@@ -981,6 +1014,12 @@ static struct asc_table_entry asc_table[] = {
/* DTLPWROMAEBKVF */
{ SST(0x0B, 0x07, SS_RDEF, /* XXX TBD */
"Warning - degraded power to non-volatile cache") },
+ /* DTLPWROMAEBKVF */
+ { SST(0x0B, 0x08, SS_RDEF, /* XXX TBD */
+ "Warning - power loss expected") },
+ /* D */
+ { SST(0x0B, 0x09, SS_RDEF, /* XXX TBD */
+ "Warning - device statistics notification available") },
/* T R */
{ SST(0x0C, 0x00, SS_RDEF,
"Write error") },
@@ -1023,6 +1062,9 @@ static struct asc_table_entry asc_table[] = {
/* DTLPWRO AEBKVF */
{ SST(0x0C, 0x0D, SS_RDEF, /* XXX TBD */
"Write error - not enough unsolicited data") },
+ /* DT W O BK */
+ { SST(0x0C, 0x0E, SS_RDEF, /* XXX TBD */
+ "Multiple write errors") },
/* R */
{ SST(0x0C, 0x0F, SS_RDEF, /* XXX TBD */
"Defects in error window") },
@@ -1068,6 +1110,12 @@ static struct asc_table_entry asc_table[] = {
/* DT W O */
{ SST(0x10, 0x03, SS_RDEF, /* XXX TBD */
"Logical block reference tag check failed") },
+ /* T */
+ { SST(0x10, 0x04, SS_RDEF, /* XXX TBD */
+ "Logical block protection error on recovered buffer data") },
+ /* T */
+ { SST(0x10, 0x05, SS_RDEF, /* XXX TBD */
+ "Logical block protection method error") },
/* DT WRO BK */
{ SST(0x11, 0x00, SS_RDEF,
"Unrecovered read error") },
@@ -1272,6 +1320,9 @@ static struct asc_table_entry asc_table[] = {
/* DT WRO BK */
{ SST(0x1D, 0x00, SS_FATAL,
"Miscompare during verify operation") },
+ /* D B */
+ { SST(0x1D, 0x01, SS_RDEF, /* XXX TBD */
+ "Miscomparable verify of unmapped LBA") },
/* D W O BK */
{ SST(0x1E, 0x00, SS_NOP | SSQ_PRINT_SENSE,
"Recovered ID with ECC correction") },
@@ -1314,6 +1365,9 @@ static struct asc_table_entry asc_table[] = {
/* DT PWROMAEBK */
{ SST(0x20, 0x0B, SS_RDEF, /* XXX TBD */
"Access denied - ACL LUN conflict") },
+ /* T */
+ { SST(0x20, 0x0C, SS_FATAL | EINVAL,
+ "Illegal command when not in append-only mode") },
/* DT WRO BK */
{ SST(0x21, 0x00, SS_FATAL | EINVAL,
"Logical block address out of range") },
@@ -1329,6 +1383,39 @@ static struct asc_table_entry asc_table[] = {
/* D */
{ SST(0x22, 0x00, SS_FATAL | EINVAL,
"Illegal function (use 20 00, 24 00, or 26 00)") },
+ /* DT P B */
+ { SST(0x23, 0x00, SS_RDEF, /* XXX TBD */
+ "Invalid token operation, cause not reportable") },
+ /* DT P B */
+ { SST(0x23, 0x01, SS_RDEF, /* XXX TBD */
+ "Invalid token operation, unsupported token type") },
+ /* DT P B */
+ { SST(0x23, 0x02, SS_RDEF, /* XXX TBD */
+ "Invalid token operation, remote token usage not supported") },
+ /* DT P B */
+ { SST(0x23, 0x03, SS_RDEF, /* XXX TBD */
+ "Invalid token operation, remote ROD token creation not supported") },
+ /* DT P B */
+ { SST(0x23, 0x04, SS_RDEF, /* XXX TBD */
+ "Invalid token operation, token unknown") },
+ /* DT P B */
+ { SST(0x23, 0x05, SS_RDEF, /* XXX TBD */
+ "Invalid token operation, token corrupt") },
+ /* DT P B */
+ { SST(0x23, 0x06, SS_RDEF, /* XXX TBD */
+ "Invalid token operation, token revoked") },
+ /* DT P B */
+ { SST(0x23, 0x07, SS_RDEF, /* XXX TBD */
+ "Invalid token operation, token expired") },
+ /* DT P B */
+ { SST(0x23, 0x08, SS_RDEF, /* XXX TBD */
+ "Invalid token operation, token cancelled") },
+ /* DT P B */
+ { SST(0x23, 0x09, SS_RDEF, /* XXX TBD */
+ "Invalid token operation, token deleted") },
+ /* DT P B */
+ { SST(0x23, 0x0A, SS_RDEF, /* XXX TBD */
+ "Invalid token operation, invalid token length") },
/* DTLPWROMAEBKVF */
{ SST(0x24, 0x00, SS_FATAL | EINVAL,
"Invalid field in CDB") },
@@ -1437,6 +1524,9 @@ static struct asc_table_entry asc_table[] = {
/* R F */
{ SST(0x27, 0x06, SS_RDEF, /* XXX TBD */
"Conditional write protect") },
+ /* D B */
+ { SST(0x27, 0x07, SS_RDEF, /* XXX TBD */
+ "Space allocation failed write protect") },
/* DTLPWROMAEBKVF */
{ SST(0x28, 0x00, SS_FATAL | ENXIO,
"Not ready to ready change, medium may have changed") },
@@ -1535,6 +1625,9 @@ static struct asc_table_entry asc_table[] = {
/* DT R MAEBKV */
{ SST(0x2A, 0x14, SS_RDEF, /* XXX TBD */
"SA creation capabilities data has changed") },
+ /* T M V */
+ { SST(0x2A, 0x15, SS_RDEF, /* XXX TBD */
+ "Medium removal prevention preempted") },
/* DTLPWRO K */
{ SST(0x2B, 0x00, SS_RDEF,
"Copy cannot execute since host cannot disconnect") },
@@ -1574,6 +1667,9 @@ static struct asc_table_entry asc_table[] = {
/* T */
{ SST(0x2C, 0x0B, SS_RDEF, /* XXX TBD */
"Not reserved") },
+ /* D */
+ { SST(0x2C, 0x0C, SS_RDEF, /* XXX TBD */
+ "ORWRITE generation does not match") },
/* T */
{ SST(0x2D, 0x00, SS_RDEF,
"Overwrite error on update in place") },
@@ -1637,6 +1733,9 @@ static struct asc_table_entry asc_table[] = {
/* M */
{ SST(0x30, 0x12, SS_RDEF, /* XXX TBD */
"Incompatible volume qualifier") },
+ /* M */
+ { SST(0x30, 0x13, SS_RDEF, /* XXX TBD */
+ "Cleaning volume expired") },
/* DT WRO BK */
{ SST(0x31, 0x00, SS_RDEF,
"Medium format corrupted") },
@@ -1646,6 +1745,9 @@ static struct asc_table_entry asc_table[] = {
/* R */
{ SST(0x31, 0x02, SS_RDEF, /* XXX TBD */
"Zoned formatting failed due to spare linking") },
+ /* D B */
+ { SST(0x31, 0x03, SS_RDEF, /* XXX TBD */
+ "SANITIZE command failed") },
/* D W O BK */
{ SST(0x32, 0x00, SS_RDEF,
"No defect spare location available") },
@@ -1694,6 +1796,9 @@ static struct asc_table_entry asc_table[] = {
/* B */
{ SST(0x38, 0x06, SS_RDEF, /* XXX TBD */
"ESN - device busy class event") },
+ /* D */
+ { SST(0x38, 0x07, SS_RDEF, /* XXX TBD */
+ "Thin provisioning soft threshold reached") },
/* DTL WROMAE K */
{ SST(0x39, 0x00, SS_RDEF,
"Saving parameters not supported") },
@@ -1793,6 +1898,9 @@ static struct asc_table_entry asc_table[] = {
/* M */
{ SST(0x3B, 0x1B, SS_RDEF, /* XXX TBD */
"Data transfer device inserted") },
+ /* T */
+ { SST(0x3B, 0x1C, SS_RDEF, /* XXX TBD */
+ "Too many logical objects on partition to support operation") },
/* DTLPWROMAE K */
{ SST(0x3D, 0x00, SS_RDEF,
"Invalid bits in IDENTIFY message") },
@@ -1896,6 +2004,9 @@ static struct asc_table_entry asc_table[] = {
/* DTLPWROMAEBKVF */
{ SST(0x44, 0x00, SS_RDEF,
"Internal target failure") },
+ /* DT P MAEBKVF */
+ { SST(0x44, 0x01, SS_RDEF, /* XXX TBD */
+ "Persistent reservation information lost") },
/* DT B */
{ SST(0x44, 0x71, SS_RDEF, /* XXX TBD */
"ATA device failed set features") },
@@ -1959,6 +2070,27 @@ static struct asc_table_entry asc_table[] = {
/* DT PWROMAEBK */
{ SST(0x4B, 0x06, SS_RDEF, /* XXX TBD */
"Initiator response timeout") },
+ /* DT PWROMAEBK F */
+ { SST(0x4B, 0x07, SS_RDEF, /* XXX TBD */
+ "Connection lost") },
+ /* DT PWROMAEBK F */
+ { SST(0x4B, 0x08, SS_RDEF, /* XXX TBD */
+ "Data-in buffer overflow - data buffer size") },
+ /* DT PWROMAEBK F */
+ { SST(0x4B, 0x09, SS_RDEF, /* XXX TBD */
+ "Data-in buffer overflow - data buffer descriptor area") },
+ /* DT PWROMAEBK F */
+ { SST(0x4B, 0x0A, SS_RDEF, /* XXX TBD */
+ "Data-in buffer error") },
+ /* DT PWROMAEBK F */
+ { SST(0x4B, 0x0B, SS_RDEF, /* XXX TBD */
+ "Data-out buffer overflow - data buffer size") },
+ /* DT PWROMAEBK F */
+ { SST(0x4B, 0x0C, SS_RDEF, /* XXX TBD */
+ "Data-out buffer overflow - data buffer descriptor area") },
+ /* DT PWROMAEBK F */
+ { SST(0x4B, 0x0D, SS_RDEF, /* XXX TBD */
+ "Data-out buffer error") },
/* DTLPWROMAEBKVF */
{ SST(0x4C, 0x00, SS_RDEF,
"Logical unit failed self-configuration") },
@@ -2004,6 +2136,18 @@ static struct asc_table_entry asc_table[] = {
/* T */
{ SST(0x53, 0x04, SS_RDEF, /* XXX TBD */
"Medium thread or unthread failure") },
+ /* M */
+ { SST(0x53, 0x05, SS_RDEF, /* XXX TBD */
+ "Volume identifier invalid") },
+ /* T */
+ { SST(0x53, 0x06, SS_RDEF, /* XXX TBD */
+ "Volume identifier missing") },
+ /* M */
+ { SST(0x53, 0x07, SS_RDEF, /* XXX TBD */
+ "Duplicate volume identifier") },
+ /* M */
+ { SST(0x53, 0x08, SS_RDEF, /* XXX TBD */
+ "Element status unknown") },
/* P */
{ SST(0x54, 0x00, SS_RDEF,
"SCSI to host system interface failure") },
@@ -2040,6 +2184,15 @@ static struct asc_table_entry asc_table[] = {
/* M */
{ SST(0x55, 0x0A, SS_RDEF, /* XXX TBD */
"Data currently unavailable") },
+ /* DTLPWROMAEBKVF */
+ { SST(0x55, 0x0B, SS_RDEF, /* XXX TBD */
+ "Insufficient power for operation") },
+ /* DT P B */
+ { SST(0x55, 0x0C, SS_RDEF, /* XXX TBD */
+ "Insufficient resources to create ROD") },
+ /* DT P B */
+ { SST(0x55, 0x0D, SS_RDEF, /* XXX TBD */
+ "Insufficient resources to create ROD token") },
/* R */
{ SST(0x57, 0x00, SS_RDEF,
"Unable to recover table-of-contents") },
@@ -2346,6 +2499,24 @@ static struct asc_table_entry asc_table[] = {
/* DTLPWRO A K */
{ SST(0x5E, 0x04, SS_RDEF,
"Standby condition activated by command") },
+ /* DTLPWRO A K */
+ { SST(0x5E, 0x05, SS_RDEF,
+ "Idle-B condition activated by timer") },
+ /* DTLPWRO A K */
+ { SST(0x5E, 0x06, SS_RDEF,
+ "Idle-B condition activated by command") },
+ /* DTLPWRO A K */
+ { SST(0x5E, 0x07, SS_RDEF,
+ "Idle-C condition activated by timer") },
+ /* DTLPWRO A K */
+ { SST(0x5E, 0x08, SS_RDEF,
+ "Idle-C condition activated by command") },
+ /* DTLPWRO A K */
+ { SST(0x5E, 0x09, SS_RDEF,
+ "Standby-Y condition activated by timer") },
+ /* DTLPWRO A K */
+ { SST(0x5E, 0x0A, SS_RDEF,
+ "Standby-Y condition activated by command") },
/* B */
{ SST(0x5E, 0x41, SS_RDEF, /* XXX TBD */
"Power state change to active") },
@@ -3044,6 +3215,10 @@ scsi_command_string(struct cam_device *device, struct ccb_scsiio *csio,
sizeof(cdb_str)));
}
+#ifdef _KERNEL
+ xpt_free_ccb((union ccb *)cgd);
+#endif
+
return(0);
}
diff --git a/freebsd/sys/cam/scsi/scsi_all.h b/freebsd/sys/cam/scsi/scsi_all.h
index cddf4f9f..f6608056 100644
--- a/freebsd/sys/cam/scsi/scsi_all.h
+++ b/freebsd/sys/cam/scsi/scsi_all.h
@@ -611,6 +611,7 @@ struct ata_pass_16 {
#define READ_12 0xA8
#define WRITE_12 0xAA
#define READ_ELEMENT_STATUS 0xB8
+#define READ_CD 0xBE
/* Maintenance In Service Action Codes */
#define REPORT_IDENTIFYING_INFRMATION 0x05
@@ -846,6 +847,17 @@ struct scsi_read_capacity_data_long
{
uint8_t addr[8];
uint8_t length[4];
+#define SRC16_PROT_EN 0x01
+#define SRC16_P_TYPE 0x0e
+ uint8_t prot;
+#define SRC16_LBPPBE 0x0f
+#define SRC16_PI_EXPONENT 0xf0
+#define SRC16_PI_EXPONENT_SHIFT 4
+ uint8_t prot_lbppbe;
+#define SRC16_LALBA 0x3fff
+#define SRC16_LBPRZ 0x4000
+#define SRC16_LBPME 0x8000
+ uint8_t lalba_lbp[2];
};
struct scsi_report_luns
@@ -1123,12 +1135,6 @@ int scsi_sense_sbuf(struct ccb_scsiio *csio, struct sbuf *sb,
char * scsi_sense_string(struct ccb_scsiio *csio,
char *str, int str_len);
void scsi_sense_print(struct ccb_scsiio *csio);
-int scsi_interpret_sense(union ccb *ccb,
- u_int32_t sense_flags,
- u_int32_t *relsim_flags,
- u_int32_t *reduction,
- u_int32_t *timeout,
- scsi_sense_action error_action);
#else /* _KERNEL */
int scsi_command_string(struct cam_device *device,
struct ccb_scsiio *csio, struct sbuf *sb);
@@ -1140,13 +1146,6 @@ char * scsi_sense_string(struct cam_device *device,
char *str, int str_len);
void scsi_sense_print(struct cam_device *device,
struct ccb_scsiio *csio, FILE *ofile);
-int scsi_interpret_sense(struct cam_device *device,
- union ccb *ccb,
- u_int32_t sense_flags,
- u_int32_t *relsim_flags,
- u_int32_t *reduction,
- u_int32_t *timeout,
- scsi_sense_action error_action);
#endif /* _KERNEL */
#define SF_RETRY_UA 0x01