diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-05-18 16:06:36 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-05-18 16:06:36 +0000 |
commit | a6eac17e9d9201cd216709ab136557b78bb17c16 (patch) | |
tree | 97200fa9884b9072a8a70fc77253c4753bbd9bd1 | |
parent | 0104529bd466688238c5b5bc13cc1adcf0a5a682 (diff) |
constify the quirck tables and fix the scsi_inqmatch() proto accordingly; krw@ ok
-rw-r--r-- | sys/scsi/cd.c | 6 | ||||
-rw-r--r-- | sys/scsi/ch.c | 10 | ||||
-rw-r--r-- | sys/scsi/scsiconf.c | 16 | ||||
-rw-r--r-- | sys/scsi/scsiconf.h | 4 | ||||
-rw-r--r-- | sys/scsi/sd.c | 6 | ||||
-rw-r--r-- | sys/scsi/ss.c | 14 | ||||
-rw-r--r-- | sys/scsi/ssvar.h | 4 | ||||
-rw-r--r-- | sys/scsi/st.c | 18 |
8 files changed, 39 insertions, 39 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index 23087f7f36f..b4baebd4ebc 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.70 2003/05/17 16:55:45 krw Exp $ */ +/* $OpenBSD: cd.c,v 1.71 2003/05/18 16:06:35 mickey Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -162,7 +162,7 @@ struct scsi_device cd_switch = { cddone, /* deal with stats at interrupt time */ }; -struct scsi_inquiry_pattern cd_patterns[] = { +const struct scsi_inquiry_pattern cd_patterns[] = { {T_CDROM, T_REMOV, "", "", ""}, {T_WORM, T_REMOV, @@ -191,7 +191,7 @@ cdmatch(parent, match, aux) int priority; (void)scsi_inqmatch(sa->sa_inqbuf, - (caddr_t)cd_patterns, sizeof(cd_patterns)/sizeof(cd_patterns[0]), + cd_patterns, sizeof(cd_patterns)/sizeof(cd_patterns[0]), sizeof(cd_patterns[0]), &priority); return (priority); } diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c index bb75bae176e..55f7e2c49f3 100644 --- a/sys/scsi/ch.c +++ b/sys/scsi/ch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ch.c,v 1.15 2003/03/28 11:42:28 mickey Exp $ */ +/* $OpenBSD: ch.c,v 1.16 2003/05/18 16:06:35 mickey Exp $ */ /* $NetBSD: ch.c,v 1.26 1997/02/21 22:06:52 thorpej Exp $ */ /* @@ -105,7 +105,7 @@ struct cfdriver ch_cd = { NULL, "ch", DV_DULL }; -struct scsi_inquiry_pattern ch_patterns[] = { +const struct scsi_inquiry_pattern ch_patterns[] = { {T_CHANGER, T_REMOV, "", "", ""}, }; @@ -146,7 +146,7 @@ chmatch(parent, match, aux) int priority; (void)scsi_inqmatch(sa->sa_inqbuf, - (caddr_t)ch_patterns, sizeof(ch_patterns)/sizeof(ch_patterns[0]), + ch_patterns, sizeof(ch_patterns)/sizeof(ch_patterns[0]), sizeof(ch_patterns[0]), &priority); return (priority); @@ -690,12 +690,12 @@ ch_get_quirks(sc, inqbuf) struct ch_softc *sc; struct scsi_inquiry_data *inqbuf; { - struct chquirk *match; + const struct chquirk *match; int priority; sc->sc_settledelay = 0; - match = (struct chquirk *)scsi_inqmatch(inqbuf, + match = (const struct chquirk *)scsi_inqmatch(inqbuf, (caddr_t)chquirks, sizeof(chquirks) / sizeof(chquirks[0]), sizeof(chquirks[0]), &priority); diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 49455f43811..4022e006155 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.c,v 1.72 2003/05/17 06:08:39 nate Exp $ */ +/* $OpenBSD: scsiconf.c,v 1.73 2003/05/18 16:06:35 mickey Exp $ */ /* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */ /* @@ -379,7 +379,7 @@ struct scsi_quirk_inquiry_pattern { u_int16_t quirks; }; -struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = { +const struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = { {{T_CDROM, T_REMOV, "CHINON ", "CD-ROM CDS-431 ", ""}, SDEV_NOLUNS}, {{T_CDROM, T_REMOV, @@ -763,7 +763,7 @@ scsi_probedev(scsi, target, lun) { struct scsi_link *sc_link; static struct scsi_inquiry_data inqbuf; - struct scsi_quirk_inquiry_pattern *finger; + const struct scsi_quirk_inquiry_pattern *finger; int checkdtype, priority; struct scsibus_attach_args sa; struct cfdata *cf; @@ -831,8 +831,8 @@ scsi_probedev(scsi, target, lun) } } - finger = (struct scsi_quirk_inquiry_pattern *)scsi_inqmatch(&inqbuf, - (caddr_t)scsi_quirk_patterns, + finger = (const struct scsi_quirk_inquiry_pattern *)scsi_inqmatch( + &inqbuf, scsi_quirk_patterns, sizeof(scsi_quirk_patterns)/sizeof(scsi_quirk_patterns[0]), sizeof(scsi_quirk_patterns[0]), &priority); @@ -946,16 +946,16 @@ bad: * Return a priority based on how much of the inquiry data matches * the patterns for the particular driver. */ -caddr_t +const void * scsi_inqmatch(inqbuf, base, nmatches, matchsize, bestpriority) struct scsi_inquiry_data *inqbuf; - caddr_t base; + const void *base; int nmatches, matchsize; int *bestpriority; { u_int8_t type; boolean removable; - caddr_t bestmatch; + const void *bestmatch; /* Include the qualifier to catch vendor-unique types. */ type = inqbuf->device; diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index c34f2b8de00..6b8a239a841 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.h,v 1.38 2003/05/16 19:54:05 krw Exp $ */ +/* $OpenBSD: scsiconf.h,v 1.39 2003/05/18 16:06:35 mickey Exp $ */ /* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */ /* @@ -315,7 +315,7 @@ struct scsi_xfer { #define TEST_READY_RETRIES_DEFAULT 5 #define TEST_READY_RETRIES_CD 10 -caddr_t scsi_inqmatch(struct scsi_inquiry_data *, caddr_t, int, +const void *scsi_inqmatch(struct scsi_inquiry_data *, const void *, int, int, int *); void scsi_init(void); diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index f43397976e3..46e19691539 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.59 2003/05/16 19:54:05 krw Exp $ */ +/* $OpenBSD: sd.c,v 1.60 2003/05/18 16:06:35 mickey Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -124,7 +124,7 @@ struct scsi_device sd_switch = { sddone, /* deal with stats at interrupt time */ }; -struct scsi_inquiry_pattern sd_patterns[] = { +const struct scsi_inquiry_pattern sd_patterns[] = { {T_DIRECT, T_FIXED, "", "", ""}, {T_DIRECT, T_REMOV, @@ -155,7 +155,7 @@ sdmatch(parent, match, aux) int priority; (void)scsi_inqmatch(sa->sa_inqbuf, - (caddr_t)sd_patterns, sizeof(sd_patterns)/sizeof(sd_patterns[0]), + sd_patterns, sizeof(sd_patterns)/sizeof(sd_patterns[0]), sizeof(sd_patterns[0]), &priority); return (priority); } diff --git a/sys/scsi/ss.c b/sys/scsi/ss.c index 0b5e6cb4188..5f8a97b03b6 100644 --- a/sys/scsi/ss.c +++ b/sys/scsi/ss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ss.c,v 1.47 2002/12/30 21:50:29 grange Exp $ */ +/* $OpenBSD: ss.c,v 1.48 2003/05/18 16:06:35 mickey Exp $ */ /* $NetBSD: ss.c,v 1.10 1996/05/05 19:52:55 christos Exp $ */ /* @@ -142,7 +142,7 @@ void get_buffer_status(struct ss_softc *, struct buf *); * Fujitsu M3096G wants 40 <= x <= 248 (tested OK at 40 & 64.) */ -struct ss_quirk_inquiry_pattern ss_quirk_patterns[] = { +const struct ss_quirk_inquiry_pattern ss_quirk_patterns[] = { {{T_SCANNER, T_FIXED, "ULTIMA ", "AT3 1.60 ", " "}, { "Ultima AT3", @@ -263,7 +263,7 @@ struct scsi_device ss_switch = { NULL, }; -struct scsi_inquiry_pattern ss_patterns[] = { +const struct scsi_inquiry_pattern ss_patterns[] = { {T_SCANNER, T_FIXED, "", "", ""}, {T_SCANNER, T_REMOV, @@ -303,7 +303,7 @@ ssmatch(parent, match, aux) int priority; (void)scsi_inqmatch(sa->sa_inqbuf, - (caddr_t)ss_patterns, sizeof(ss_patterns)/sizeof(ss_patterns[0]), + ss_patterns, sizeof(ss_patterns)/sizeof(ss_patterns[0]), sizeof(ss_patterns[0]), &priority); return (priority); } @@ -370,14 +370,14 @@ ss_identify_scanner(ss, inqbuf) struct ss_softc *ss; struct scsi_inquiry_data *inqbuf; { - struct ss_quirk_inquiry_pattern *finger; + const struct ss_quirk_inquiry_pattern *finger; int priority; /* * look for non-standard scanners with help of the quirk table * and install functions for special handling */ - finger = (struct ss_quirk_inquiry_pattern *)scsi_inqmatch(inqbuf, - (caddr_t)ss_quirk_patterns, + finger = (const struct ss_quirk_inquiry_pattern *)scsi_inqmatch(inqbuf, + ss_quirk_patterns, sizeof(ss_quirk_patterns)/sizeof(ss_quirk_patterns[0]), sizeof(ss_quirk_patterns[0]), &priority); if (priority != 0) { diff --git a/sys/scsi/ssvar.h b/sys/scsi/ssvar.h index b2a32309013..a1de14f3173 100644 --- a/sys/scsi/ssvar.h +++ b/sys/scsi/ssvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssvar.h,v 1.9 2002/03/14 01:27:13 millert Exp $ */ +/* $OpenBSD: ssvar.h,v 1.10 2003/05/18 16:06:35 mickey Exp $ */ /* $NetBSD: ssvar.h,v 1.2 1996/03/30 21:47:11 christos Exp $ */ /* @@ -68,7 +68,7 @@ struct ss_softc { struct scsi_link *sc_link; /* contains our targ, lun, etc. */ struct scan_io sio; struct buf buf_queue; /* the queue of pending IO operations */ - struct quirkdata *quirkdata; /* if we have a rogue entry */ + const struct quirkdata *quirkdata; /* if we have a rogue entry */ struct ss_special special; /* special handlers for spec. devices */ }; diff --git a/sys/scsi/st.c b/sys/scsi/st.c index 4e56cbe81e4..3120b24ff9b 100644 --- a/sys/scsi/st.c +++ b/sys/scsi/st.c @@ -1,4 +1,4 @@ -/* $OpenBSD: st.c,v 1.34 2003/03/11 01:12:09 krw Exp $ */ +/* $OpenBSD: st.c,v 1.35 2003/05/18 16:06:35 mickey Exp $ */ /* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */ /* @@ -117,7 +117,7 @@ struct st_quirk_inquiry_pattern { struct quirkdata quirkdata; }; -struct st_quirk_inquiry_pattern st_quirk_patterns[] = { +const struct st_quirk_inquiry_pattern st_quirk_patterns[] = { {{T_SEQUENTIAL, T_REMOV, " ", " ", " "}, {0, 0, { {ST_Q_FORCE_BLKSIZE, 512, 0}, /* minor 0-3 */ @@ -264,7 +264,7 @@ struct st_softc { /*--------------------parameters reported by the device ----------------------*/ int blkmin; /* min blk size */ int blkmax; /* max blk size */ - struct quirkdata *quirkdata; /* if we have a rogue entry */ + const struct quirkdata *quirkdata; /* if we have a rogue entry */ /*--------------------parameters reported by the device for this media--------*/ u_long numblks; /* nominal blocks capacity */ int media_blksize; /* 0 if not ST_FIXEDBLOCKS */ @@ -346,7 +346,7 @@ struct scsi_device st_switch = { ST_FIXEDBLOCKS | ST_READONLY | ST_FM_WRITTEN | \ ST_2FM_AT_EOD | ST_PER_ACTION) -struct scsi_inquiry_pattern st_patterns[] = { +const struct scsi_inquiry_pattern st_patterns[] = { {T_SEQUENTIAL, T_REMOV, "", "", ""}, }; @@ -360,7 +360,7 @@ stmatch(parent, match, aux) int priority; (void)scsi_inqmatch(sa->sa_inqbuf, - (caddr_t)st_patterns, sizeof(st_patterns)/sizeof(st_patterns[0]), + st_patterns, sizeof(st_patterns)/sizeof(st_patterns[0]), sizeof(st_patterns[0]), &priority); return (priority); } @@ -440,11 +440,11 @@ st_identify_drive(st, inqbuf) struct st_softc *st; struct scsi_inquiry_data *inqbuf; { - struct st_quirk_inquiry_pattern *finger; + const struct st_quirk_inquiry_pattern *finger; int priority; - finger = (struct st_quirk_inquiry_pattern *)scsi_inqmatch(inqbuf, - (caddr_t)st_quirk_patterns, + finger = (const struct st_quirk_inquiry_pattern *)scsi_inqmatch(inqbuf, + st_quirk_patterns, sizeof(st_quirk_patterns)/sizeof(st_quirk_patterns[0]), sizeof(st_quirk_patterns[0]), &priority); if (priority != 0) { @@ -466,7 +466,7 @@ st_loadquirks(st) struct st_softc *st; { int i; - struct modes *mode; + const struct modes *mode; struct modes *mode2; mode = st->quirkdata->modes; |