summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-05-31 16:54:37 +0000
committerphk <phk@FreeBSD.org>2003-05-31 16:54:37 +0000
commitaa09487f98e9008d4c1e3edc1338c2565ef631b1 (patch)
tree83537ab4363d70623187efb43975bd5c4309cff5 /sys
parent3953441927fcf31f3c502b9ec0ee765bab65e7e3 (diff)
downloadFreeBSD-src-aa09487f98e9008d4c1e3edc1338c2565ef631b1.zip
FreeBSD-src-aa09487f98e9008d4c1e3edc1338c2565ef631b1.tar.gz
Use symbolic constants instead of "4".
Use arrays instead of relying on struct packing. Identical md5(scsi_ch.o).
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/scsi/scsi_ch.c14
-rw-r--r--sys/cam/scsi/scsi_ch.h10
-rw-r--r--sys/sys/chio.h1
3 files changed, 10 insertions, 15 deletions
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index 520976e..3cb5a10 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -151,19 +151,19 @@ struct ch_softc {
* The following information is obtained from the
* element address assignment page.
*/
- int sc_firsts[4]; /* firsts, indexed by CHET_* */
- int sc_counts[4]; /* counts, indexed by CHET_* */
+ int sc_firsts[CHET_MAX + 1]; /* firsts */
+ int sc_counts[CHET_MAX + 1]; /* counts */
/*
* The following mask defines the legal combinations
* of elements for the MOVE MEDIUM command.
*/
- u_int8_t sc_movemask[4];
+ u_int8_t sc_movemask[CHET_MAX + 1];
/*
* As above, but for EXCHANGE MEDIUM.
*/
- u_int8_t sc_exchangemask[4];
+ u_int8_t sc_exchangemask[CHET_MAX + 1];
/*
* Quirks; see below. XXX KDM not implemented yet
@@ -1478,9 +1478,9 @@ chgetparams(struct cam_periph *periph)
bzero(softc->sc_movemask, sizeof(softc->sc_movemask));
bzero(softc->sc_exchangemask, sizeof(softc->sc_exchangemask));
- moves = &cap->move_from_mt;
- exchanges = &cap->exchange_with_mt;
- for (from = CHET_MT; from <= CHET_DT; ++from) {
+ moves = cap->move_from;
+ exchanges = cap->exchange_with;
+ for (from = CHET_MT; from <= CHET_MAX; ++from) {
softc->sc_movemask[from] = moves[from];
softc->sc_exchangemask[from] = exchanges[from];
}
diff --git a/sys/cam/scsi/scsi_ch.h b/sys/cam/scsi/scsi_ch.h
index 5239243..7547779 100644
--- a/sys/cam/scsi/scsi_ch.h
+++ b/sys/cam/scsi/scsi_ch.h
@@ -339,10 +339,7 @@ struct page_device_capabilities {
* MOVE MEDIUM command is legal. The top four bits of each
* of these values are reserved.
*/
- u_int8_t move_from_mt;
- u_int8_t move_from_st;
- u_int8_t move_from_ie;
- u_int8_t move_from_dt;
+ u_int8_t move_from[CHET_MAX + 1];
#define MOVE_TO_MT 0x01
#define MOVE_TO_ST 0x02
#define MOVE_TO_IE 0x04
@@ -353,10 +350,7 @@ struct page_device_capabilities {
/*
* Similar to above, but for EXCHANGE MEDIUM.
*/
- u_int8_t exchange_with_mt;
- u_int8_t exchange_with_st;
- u_int8_t exchange_with_ie;
- u_int8_t exchange_with_dt;
+ u_int8_t exchange_with[CHET_MAX + 1];
#define EXCHANGE_WITH_MT 0x01
#define EXCHANGE_WITH_ST 0x02
#define EXCHANGE_WITH_IE 0x04
diff --git a/sys/sys/chio.h b/sys/sys/chio.h
index 78e2248..e1ae110 100644
--- a/sys/sys/chio.h
+++ b/sys/sys/chio.h
@@ -52,6 +52,7 @@
#define CHET_ST 1 /* storage transport (slot) */
#define CHET_IE 2 /* import/export (portal) */
#define CHET_DT 3 /* data transfer (drive) */
+#define CHET_MAX CHET_DT
/*
* Maximum length of a volume identification string
OpenPOWER on IntegriCloud