summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_ccb.h
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1999-05-22 21:58:47 +0000
committergibbs <gibbs@FreeBSD.org>1999-05-22 21:58:47 +0000
commit95dc85b099eb4f732b322f090ce0abad1280fbfd (patch)
tree84ee71641db91cb247029bd5aa2d5bffd89b16dd /sys/cam/cam_ccb.h
parente4dc7e4c0e6535e2f3849d8c0335cbd9e6f86379 (diff)
downloadFreeBSD-src-95dc85b099eb4f732b322f090ce0abad1280fbfd.zip
FreeBSD-src-95dc85b099eb4f732b322f090ce0abad1280fbfd.tar.gz
Add the XPT_PATH_STATS and XPT_GDEV_STATS function codes. These ccb
types allow the reporting of error counts and other statistics. Currently we provide information on the last BDR or bus reset as well as active transaction inforamtion, but this will be expanded as more information is added to aid in error recovery. Use the 'last reset' information to better handle bus settle delays. Peripheral drivers now control whether a bus settle delay occurs and for how long. This allows target mode peripheral drivers to avoid having their device queue frozen by the XPT for what shoudl only be initiator type behavior. Don't perform a bus reset if the target device is incapable of performing transfer negotiation (e.g. Fiber Channel). If we don't perform a bus reset but the controller is capable of transfer negotiations, force negotiations on the first transaction to go to the device. This ensures that we aren't tripped up by a left over negotiation from the prom, BIOS, loader, etc. Add a default async handler funstion to cam_periph.c to remove duplicated code in all initiator type peripheral drivers. Allow mapping of XPT_CONT_TARGET_IO ccbs from userland. They are itentical to XPT_SCSI_IO ccbs as far as data mapping is concerned.
Diffstat (limited to 'sys/cam/cam_ccb.h')
-rw-r--r--sys/cam/cam_ccb.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h
index 67b5934..a45d62a 100644
--- a/sys/cam/cam_ccb.h
+++ b/sys/cam/cam_ccb.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_ccb.h,v 1.4 1999/03/05 23:13:20 gibbs Exp $
+ * $Id: cam_ccb.h,v 1.5 1999/05/06 20:15:57 ken Exp $
*/
#ifndef _CAM_CAM_CCB_H
@@ -33,6 +33,7 @@
#include <sys/queue.h>
#include <sys/cdefs.h>
+#include <sys/time.h>
#ifndef KERNEL
#include <sys/callout.h>
#endif
@@ -128,6 +129,10 @@ typedef enum {
/* Get EDT entries matching the given pattern */
XPT_DEBUG = 0x0a,
/* Turn on debugging for a bus, target or lun */
+ XPT_PATH_STATS = 0x0b,
+ /* Path statistics (error counts, etc.) */
+ XPT_GDEV_STATS = 0x0c,
+ /* Device statistics (error counts, etc.) */
/* SCSI Control Functions: 0x10->0x1F */
XPT_ABORT = 0x10,
/* Abort the specified CCB */
@@ -243,6 +248,11 @@ struct ccb_getdev {
u_int8_t serial_num[252];
u_int8_t serial_num_len;
u_int8_t pd_type; /* returned peripheral device type */
+/*
+ * GARBAGE COLLECT
+ * Moved to ccb_getdevstats but left here for binary compatibility.
+ * Remove in next rev of CAM version.
+ */
int dev_openings; /* Space left for more work on device*/
int dev_active; /* Transactions running on the device */
int devq_openings;/* Space left for more queued work */
@@ -258,6 +268,19 @@ struct ccb_getdev {
int mintags;
};
+/* Device Statistics CCB */
+struct ccb_getdevstats {
+ struct ccb_hdr ccb_h;
+ int dev_openings; /* Space left for more work on device*/
+ int dev_active; /* Transactions running on the device */
+ int devq_openings; /* Space left for more queued work */
+ int devq_queued; /* Transactions queued to be sent */
+ int held; /*
+ * CCBs held by peripheral drivers
+ * for this device
+ */
+ struct timeval last_reset; /* Time of last bus reset/loop init */
+};
typedef enum {
CAM_GDEVLIST_LAST_DEVICE,
@@ -488,6 +511,12 @@ struct ccb_pathinq {
u_int32_t base_transfer_speed;/* Base bus speed in KB/sec */
};
+/* Path Statistics CCB */
+struct ccb_pathstats {
+ struct ccb_hdr ccb_h;
+ struct timeval last_reset; /* Time of last bus reset/loop init */
+};
+
typedef union {
u_int8_t *sense_ptr; /*
* Pointer to storage
@@ -757,6 +786,8 @@ union ccb {
struct ccb_relsim crs;
struct ccb_setasync csa;
struct ccb_setdev csd;
+ struct ccb_pathstats cpis;
+ struct ccb_getdevstats cgds;
struct ccb_dev_match cdm;
struct ccb_trans_settings cts;
struct ccb_calc_geometry ccg;
OpenPOWER on IntegriCloud