Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Backing out changes to clean up scsipi. I was pointe...
details: https://anonhg.NetBSD.org/src/rev/0228e1bfcb48
branches: trunk
changeset: 573551:0228e1bfcb48
user: reinoud <reinoud%NetBSD.org@localhost>
date: Tue Feb 01 00:19:34 2005 +0000
description:
Backing out changes to clean up scsipi. I was pointed out there were
problems i hadn't seen. To prevent lossage i'd decided to back off all
changes and let them be reviewed on tech-kern.
diffstat:
sys/dev/scsipi/atapi_tape.h | 74 +++++-----
sys/dev/scsipi/atapi_wdc.c | 6 +-
sys/dev/scsipi/cd.c | 68 ++++----
sys/dev/scsipi/cdvar.h | 8 +-
sys/dev/scsipi/ch.c | 50 +++---
sys/dev/scsipi/if_se.c | 48 +++---
sys/dev/scsipi/scsi_all.h | 54 +++---
sys/dev/scsipi/scsi_changer.h | 214 +++++++++++++++---------------
sys/dev/scsipi/scsi_ctron_ether.h | 96 +++++++-------
sys/dev/scsipi/scsi_disk.h | 260 +++++++++++++++++++-------------------
sys/dev/scsipi/scsi_iu.h | 14 +-
sys/dev/scsipi/scsi_scanner.h | 68 ++++----
sys/dev/scsipi/scsi_tape.h | 136 +++++++++---------
sys/dev/scsipi/scsiconf.c | 10 +-
sys/dev/scsipi/scsipi_all.h | 168 ++++++++++++------------
sys/dev/scsipi/scsipi_base.c | 18 +-
sys/dev/scsipi/scsipi_base.h | 6 +-
sys/dev/scsipi/scsipi_cd.h | 128 +++++++++---------
sys/dev/scsipi/scsipi_disk.h | 92 ++++++------
sys/dev/scsipi/scsipi_ioctl.c | 6 +-
sys/dev/scsipi/scsipi_verbose.c | 6 +-
sys/dev/scsipi/scsipiconf.c | 14 +-
sys/dev/scsipi/scsipiconf.h | 130 +++++++++---------
sys/dev/scsipi/sd.c | 53 +++---
sys/dev/scsipi/sdvar.h | 18 +-
sys/dev/scsipi/ses.c | 12 +-
sys/dev/scsipi/ss.c | 8 +-
sys/dev/scsipi/ss_mustek.c | 8 +-
sys/dev/scsipi/ss_mustek.h | 74 +++++-----
sys/dev/scsipi/ss_scanjet.c | 14 +-
sys/dev/scsipi/ssvar.h | 4 +-
sys/dev/scsipi/st.c | 54 +++---
sys/dev/scsipi/st_scsi.c | 16 +-
sys/dev/scsipi/stvar.h | 36 ++--
sys/dev/scsipi/uk.c | 7 +-
sys/dev/usb/umass_scsipi.c | 8 +-
36 files changed, 992 insertions(+), 994 deletions(-)
diffs (truncated from 4437 to 300 lines):
diff -r 4bf73ddc6f4a -r 0228e1bfcb48 sys/dev/scsipi/atapi_tape.h
--- a/sys/dev/scsipi/atapi_tape.h Mon Jan 31 23:49:36 2005 +0000
+++ b/sys/dev/scsipi/atapi_tape.h Tue Feb 01 00:19:34 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atapi_tape.h,v 1.3 2005/01/31 23:06:41 reinoud Exp $ */
+/* $NetBSD: atapi_tape.h,v 1.4 2005/02/01 00:19:34 reinoud Exp $ */
/*-
@@ -43,18 +43,18 @@
/* mode page data header */
struct scsipi_mode_header header;
/* capabilities page */
- uint8_t page_code;
+ u_int8_t page_code;
#define ATAPI_TAPE_CAP_PAGE 0x2a
- uint8_t page_length; /* page Length == 0x12 */
- uint8_t reserved2;
- uint8_t reserved3;
- uint8_t cap1;
+ u_int8_t page_length; /* page Length == 0x12 */
+ u_int8_t reserved2;
+ u_int8_t reserved3;
+ u_int8_t cap1;
#define ATAPI_TAPE_CAP_PAGE_RO 0x01; /* read Only Mode */
#define ATAPI_TAPE_CAP_PAGE_REV 0x20; /* supports reverse direction */
- uint8_t cap2;
+ u_int8_t cap2;
#define ATAPI_TAPE_CAP_PAGE_EF 0x08; /* supports ERASE formatting */
#define ATAPI_TAPE_CAP_PAGE_QFA 0x20 /* supports QFA formats */
- uint8_t cap3;
+ u_int8_t cap3;
#define ATAPI_TAPE_CAP_PAGE_LCK 0x01 /* supports locking media */
#define ATAPI_TAPE_CAP_PAGE_LCKED 0x02 /* the media is locked */
#define ATAPI_TAPE_CAP_PAGE_PRV 0x04 /* defaults to prevent state */
@@ -62,42 +62,42 @@
#define ATAPI_TAPE_CAP_PAGE_DIS 0x10 /* can break request > ctl */
#define ATAPI_TAPE_CAP_PAGE_ECC 0x40 /* supports error correction */
#define ATAPI_TAPE_CAP_PAGE_CMP 0x80 /* supports data compression */
- uint8_t cap4;
+ u_int8_t cap4;
#define ATAPI_TAPE_CAP_PAGE_BLK512 0x02 /* supports 512b block size */
#define ATAPI_TAPE_CAP_PAGE_BLK1K 0x04 /* supports 1024b block size */
#define ATAPI_TAPE_CAP_PAGE_BLK32K 0x80 /* supports 32kb block size */
- uint16_t max_speed; /* supported speed in KBps */
- uint16_t max_defects; /* max stored defect entries */
- uint16_t ctl; /* continuous transfer limit */
- uint16_t speed; /* current Speed, in KBps */
- uint16_t buffer_size; /* buffer Size, in 512 bytes */
- uint8_t reserved18;
- uint8_t reserved19;
+ u_int16_t max_speed; /* supported speed in KBps */
+ u_int16_t max_defects; /* max stored defect entries */
+ u_int16_t ctl; /* continuous transfer limit */
+ u_int16_t speed; /* current Speed, in KBps */
+ u_int16_t buffer_size; /* buffer Size, in 512 bytes */
+ u_int8_t reserved18;
+ u_int8_t reserved19;
};
/* ATAPI OnStream ADR data transfer mode page (ADR unique) */
struct ast_transferpage {
/* mode page data header */
- uint8_t data_length; /* total length of data */
- uint8_t medium_type; /* medium type (if any) */
- uint8_t dsp; /* device specific parameter */
- uint8_t blk_desc_len; /* block Descriptor Length */
+ u_int8_t data_length; /* total length of data */
+ u_int8_t medium_type; /* medium type (if any) */
+ u_int8_t dsp; /* device specific parameter */
+ u_int8_t blk_desc_len; /* block Descriptor Length */
/* data transfer page */
- uint8_t page_code :6;
+ u_int8_t page_code :6;
#define ATAPI_TAPE_TRANSFER_PAGE 0x30
- uint8_t reserved0_6 :1;
- uint8_t ps :1; /* parameters saveable */
- uint8_t page_length; /* page Length == 0x02 */
- uint8_t reserved2;
- uint8_t read32k :1; /* 32k blk size (data only) */
- uint8_t read32k5 :1; /* 32.5k blk size (data&AUX) */
- uint8_t reserved3_23 :2;
- uint8_t write32k :1; /* 32k blk size (data only) */
- uint8_t write32k5 :1; /* 32.5k blk size (data&AUX) */
- uint8_t reserved3_6 :1;
- uint8_t streaming :1; /* streaming mode enable */
+ u_int8_t reserved0_6 :1;
+ u_int8_t ps :1; /* parameters saveable */
+ u_int8_t page_length; /* page Length == 0x02 */
+ u_int8_t reserved2;
+ u_int8_t read32k :1; /* 32k blk size (data only) */
+ u_int8_t read32k5 :1; /* 32.5k blk size (data&AUX) */
+ u_int8_t reserved3_23 :2;
+ u_int8_t write32k :1; /* 32k blk size (data only) */
+ u_int8_t write32k5 :1; /* 32.5k blk size (data&AUX) */
+ u_int8_t reserved3_6 :1;
+ u_int8_t streaming :1; /* streaming mode enable */
};
/* ATAPI OnStream ADR vendor identification mode page (ADR unique) */
@@ -105,10 +105,10 @@
/* mode page data header */
struct scsipi_mode_header header;
/* data transfer page */
- uint8_t page_code;
+ u_int8_t page_code;
#define ATAPI_TAPE_IDENTIFY_PAGE 0x36
- uint8_t page_length; /* page Length == 0x06 */
- uint8_t ident[4]; /* host id string */
- uint8_t reserved6;
- uint8_t reserved7;
+ u_int8_t page_length; /* page Length == 0x06 */
+ u_int8_t ident[4]; /* host id string */
+ u_int8_t reserved6;
+ u_int8_t reserved7;
};
diff -r 4bf73ddc6f4a -r 0228e1bfcb48 sys/dev/scsipi/atapi_wdc.c
--- a/sys/dev/scsipi/atapi_wdc.c Mon Jan 31 23:49:36 2005 +0000
+++ b/sys/dev/scsipi/atapi_wdc.c Tue Feb 01 00:19:34 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atapi_wdc.c,v 1.90 2005/01/31 23:06:41 reinoud Exp $ */
+/* $NetBSD: atapi_wdc.c,v 1.91 2005/02/01 00:19:34 reinoud Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.90 2005/01/31 23:06:41 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.91 2005/02/01 00:19:34 reinoud Exp $");
#ifndef ATADEBUG
#define ATADEBUG
@@ -914,7 +914,7 @@
ATADEBUG_PRINT(("wdc_atapi_done %s:%d:%d: flags 0x%x\n",
atac->atac_dev.dv_xname, chp->ch_channel, xfer->c_drive,
- (uint)xfer->c_flags), DEBUG_XFERS);
+ (u_int)xfer->c_flags), DEBUG_XFERS);
callout_stop(&chp->ch_callout);
/* mark controller inactive and free the command */
chp->ch_queue->active_xfer = NULL;
diff -r 4bf73ddc6f4a -r 0228e1bfcb48 sys/dev/scsipi/cd.c
--- a/sys/dev/scsipi/cd.c Mon Jan 31 23:49:36 2005 +0000
+++ b/sys/dev/scsipi/cd.c Tue Feb 01 00:19:34 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd.c,v 1.217 2005/01/31 23:39:02 reinoud Exp $ */
+/* $NetBSD: cd.c,v 1.218 2005/02/01 00:19:34 reinoud Exp $ */
/*-
* Copyright (c) 1998, 2001, 2003, 2004 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.217 2005/01/31 23:39:02 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.218 2005/02/01 00:19:34 reinoud Exp $");
#include "rnd.h"
@@ -116,7 +116,7 @@
static void cddone(struct scsipi_xfer *, int);
static void cdbounce(struct buf *);
static int cd_interpret_sense(struct scsipi_xfer *);
-static uint32_t cd_size(struct cd_softc *, int);
+static u_long cd_size(struct cd_softc *, int);
static int cd_play(struct cd_softc *, int, int);
static int cd_play_tracks(struct cd_softc *, int, int, int, int);
static int cd_play_msf(struct cd_softc *, int, int, int, int, int, int);
@@ -137,9 +137,9 @@
static int dvd_read_manufact(struct cd_softc *, dvd_struct *);
static int dvd_read_struct(struct cd_softc *, dvd_struct *);
-static int cd_mode_sense(struct cd_softc *, uint8_t, void *, size_t, int,
+static int cd_mode_sense(struct cd_softc *, u_int8_t, void *, size_t, int,
int, int *);
-static int cd_mode_select(struct cd_softc *, uint8_t, void *, size_t,
+static int cd_mode_select(struct cd_softc *, u_int8_t, void *, size_t,
int, int);
static int cd_setchan(struct cd_softc *, int, int, int, int, int);
static int cd_getvol(struct cd_softc *, struct ioc_vol *, int);
@@ -838,7 +838,7 @@
* Note: we cannot sleep as we may be an interrupt
*/
xs = scsipi_make_xs(periph, cmdp, cmdlen,
- (uint8_t *)bp->b_data, bp->b_bcount,
+ (u_char *)bp->b_data, bp->b_bcount,
CDRETRIES, 30000, bp, flags);
if (__predict_false(xs == NULL)) {
/*
@@ -1070,9 +1070,9 @@
* addresses format
*/
static void
-lba2msf(uint32_t lba, uint8_t *m, uint8_t *s, uint8_t *f)
+lba2msf(u_long lba, u_char *m, u_char *s, u_char *f)
{
- uint32_t tmp;
+ u_long tmp;
tmp = lba + CD_BLOCK_OFFSET; /* offset of first logical frame */
tmp &= 0xffffff; /* negative lbas use only 24 bits */
@@ -1082,8 +1082,8 @@
*f = tmp % CD_FRAMES;
}
-static uint32_t
-msf2lba(uint8_t m, uint8_t s, uint8_t f)
+static u_long
+msf2lba(u_char m, u_char s, u_char f)
{
return ((((m * CD_SECS) + s) * CD_FRAMES + f) - CD_BLOCK_OFFSET);
@@ -1125,7 +1125,7 @@
* Knows about the internals of this device
*/
static int
-cdioctl(dev_t dev, ulong cmd, caddr_t addr, int flag, struct proc *p)
+cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
{
struct cd_softc *cd = cd_cd.cd_devs[CDUNIT(dev)];
struct scsipi_periph *periph = cd->sc_periph;
@@ -1297,7 +1297,7 @@
struct ioc_read_subchannel *args =
(struct ioc_read_subchannel *)addr;
struct cd_sub_channel_info data;
- uint len = args->data_len;
+ u_int len = args->data_len;
if (len > sizeof(data) ||
len < sizeof(struct cd_sub_channel_header))
@@ -1330,7 +1330,7 @@
(struct ioc_read_toc_entry *)addr;
struct ioc_toc_header *th;
struct cd_toc_entry *cte;
- uint len = te->data_len;
+ u_int len = te->data_len;
int ntracks;
th = &toc.header;
@@ -1571,13 +1571,13 @@
/*
* Find out from the device what it's capacity is
*/
-static uint32_t
+static u_long
cd_size(struct cd_softc *cd, int flags)
{
struct scsipi_read_cd_capacity cmd;
struct scsipi_read_cd_cap_data data;
int blksize;
- uint32_t size;
+ u_long size;
if (cd->sc_periph->periph_quirks & PQUIRK_NOCAPACITY) {
/*
@@ -1619,7 +1619,7 @@
if (size < 100)
size = 400000; /* ditto */
cd->params.disksize = size;
- cd->params.disksize512 = ((uint64_t)cd->params.disksize * blksize) / DEV_BSIZE;
+ cd->params.disksize512 = ((u_int64_t)cd->params.disksize * blksize) / DEV_BSIZE;
SC_DEBUG(cd->sc_periph, SCSIPI_DB2,
("cd_size: %d %ld\n", blksize, size));
@@ -1839,7 +1839,7 @@
dvd_auth(struct cd_softc *cd, dvd_authinfo *a)
{
struct scsipi_generic cmd;
- uint8_t buf[20];
+ u_int8_t buf[20];
int error;
memset(cmd.bytes, 0, 15);
@@ -1987,7 +1987,7 @@
dvd_read_physical(struct cd_softc *cd, dvd_struct *s)
{
struct scsipi_generic cmd;
- uint8_t buf[4 + 4 * 20], *bufp;
+ u_int8_t buf[4 + 4 * 20], *bufp;
int error;
struct dvd_layer *layer;
int i;
@@ -2027,7 +2027,7 @@
dvd_read_copyright(struct cd_softc *cd, dvd_struct *s)
{
struct scsipi_generic cmd;
- uint8_t buf[8];
+ u_int8_t buf[8];
int error;
memset(cmd.bytes, 0, 15);
@@ -2050,7 +2050,7 @@
dvd_read_disckey(struct cd_softc *cd, dvd_struct *s)
{
struct scsipi_generic cmd;
- uint8_t *buf;
Home |
Main Index |
Thread Index |
Old Index