diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2020-02-13 15:11:33 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2020-02-13 15:11:33 +0000 |
commit | 7b60674d0db5f49b38d2c4271b21bbf832656506 (patch) | |
tree | 4accf8c4f865a6d4585088dab4a63e7eb3e4e9bc | |
parent | e64373b4ded2b91a9f749989ea9d551444b082c4 (diff) |
Nuke *_minphys() functions that either simply apply MAXPHYS or do
nothing at all. MAXPHYS will be applied in minphys() and nothing at
all, well, doesn't do anything.
Also remove any '#define <blah> MAXPHYS' statements used solely to
disguise MAXPHYS in said functions.
-rw-r--r-- | sys/dev/atapiscsi/atapiscsi.c | 13 | ||||
-rw-r--r-- | sys/dev/ic/ciss.c | 15 | ||||
-rw-r--r-- | sys/dev/ic/mfi.c | 17 | ||||
-rw-r--r-- | sys/dev/ic/mfireg.h | 3 | ||||
-rw-r--r-- | sys/dev/ic/mpi.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/arc.c | 12 | ||||
-rw-r--r-- | sys/dev/softraid.c | 15 | ||||
-rw-r--r-- | sys/dev/softraidvar.h | 3 | ||||
-rw-r--r-- | sys/dev/usb/umass_scsi.c | 12 |
9 files changed, 17 insertions, 86 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c index 4fb5a83c24c..a68172798ba 100644 --- a/sys/dev/atapiscsi/atapiscsi.c +++ b/sys/dev/atapiscsi/atapiscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atapiscsi.c,v 1.108 2020/01/25 21:48:42 krw Exp $ */ +/* $OpenBSD: atapiscsi.c,v 1.109 2020/02/13 15:11:32 krw Exp $ */ /* * This code is derived from code with the copyright below. @@ -133,7 +133,6 @@ void wdc_atapi_reset_2(struct channel_softc *, struct wdc_xfer *, void wdc_atapi_tape_done(struct channel_softc *, struct wdc_xfer *, int, struct atapi_return_args *); -#define MAX_SIZE MAXPHYS struct atapiscsi_softc; struct atapiscsi_xfer; @@ -155,12 +154,11 @@ struct atapiscsi_softc { int drive; }; -void wdc_atapi_minphys(struct buf *bp, struct scsi_link *sl); int wdc_atapi_ioctl(struct scsi_link *, u_long, caddr_t, int); void wdc_atapi_send_cmd(struct scsi_xfer *sc_xfer); static struct scsi_adapter atapiscsi_switch = { - wdc_atapi_send_cmd, wdc_atapi_minphys, NULL, NULL, wdc_atapi_ioctl + wdc_atapi_send_cmd, NULL, NULL, NULL, wdc_atapi_ioctl }; /* Inital version shares bus_link structure so it can easily @@ -420,13 +418,6 @@ wdc_atapi_send_cmd(struct scsi_xfer *sc_xfer) splx(s); } -void -wdc_atapi_minphys (struct buf *bp, struct scsi_link *sl) -{ - if (bp->b_bcount > MAX_SIZE) - bp->b_bcount = MAX_SIZE; -} - int wdc_atapi_ioctl (struct scsi_link *sc_link, u_long cmd, caddr_t addr, int flag) { diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c index 44cd8cead25..522ea1a4aaa 100644 --- a/sys/dev/ic/ciss.c +++ b/sys/dev/ic/ciss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciss.c,v 1.80 2020/01/26 00:53:31 krw Exp $ */ +/* $OpenBSD: ciss.c,v 1.81 2020/02/13 15:11:32 krw Exp $ */ /* * Copyright (c) 2005,2006 Michael Shalayeff @@ -68,10 +68,9 @@ struct cfdriver ciss_cd = { void ciss_scsi_cmd(struct scsi_xfer *xs); int ciss_scsi_ioctl(struct scsi_link *, u_long, caddr_t, int); -void ciss_minphys(struct buf *bp, struct scsi_link *sl); struct scsi_adapter ciss_switch = { - ciss_scsi_cmd, ciss_minphys, NULL, NULL, ciss_scsi_ioctl + ciss_scsi_cmd, NULL, NULL, NULL, ciss_scsi_ioctl }; #if NBIO > 0 @@ -422,16 +421,6 @@ ciss_shutdown(void *v) ciss_sync(sc); } -void -ciss_minphys(struct buf *bp, struct scsi_link *sl) -{ -#if 0 /* TODO */ -#define CISS_MAXFER (PAGE_SIZE * (sc->maxsg + 1)) - if (bp->b_bcount > CISS_MAXFER) - bp->b_bcount = CISS_MAXFER; -#endif -} - /* * submit a command and optionally wait for completition. * wait arg abuses SCSI_POLL|SCSI_NOSLEEP flags to request diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c index e64b3b358c3..04c69d13c22 100644 --- a/sys/dev/ic/mfi.c +++ b/sys/dev/ic/mfi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfi.c,v 1.174 2020/01/26 00:53:31 krw Exp $ */ +/* $OpenBSD: mfi.c,v 1.175 2020/02/13 15:11:32 krw Exp $ */ /* * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> * @@ -58,17 +58,16 @@ struct cfdriver mfi_cd = { void mfi_scsi_cmd(struct scsi_xfer *); int mfi_scsi_ioctl(struct scsi_link *, u_long, caddr_t, int); int mfi_ioctl_cache(struct scsi_link *, u_long, struct dk_cache *); -void mfi_minphys(struct buf *bp, struct scsi_link *sl); void mfi_pd_scsi_cmd(struct scsi_xfer *); int mfi_pd_scsi_probe(struct scsi_link *); struct scsi_adapter mfi_switch = { - mfi_scsi_cmd, mfi_minphys, NULL, NULL, mfi_scsi_ioctl + mfi_scsi_cmd, NULL, NULL, NULL, mfi_scsi_ioctl }; struct scsi_adapter mfi_pd_switch = { - mfi_pd_scsi_cmd, mfi_minphys, mfi_pd_scsi_probe, NULL, mfi_scsi_ioctl + mfi_pd_scsi_cmd, NULL, mfi_pd_scsi_probe, NULL, mfi_scsi_ioctl }; void * mfi_get_ccb(void *); @@ -659,16 +658,6 @@ mfi_get_info(struct mfi_softc *sc) return (0); } -void -mfi_minphys(struct buf *bp, struct scsi_link *sl) -{ - DNPRINTF(MFI_D_MISC, "mfi_minphys: %d\n", bp->b_bcount); - - /* XXX currently using MFI_MAXFER = MAXPHYS */ - if (bp->b_bcount > MFI_MAXFER) - bp->b_bcount = MFI_MAXFER; -} - int mfi_attach(struct mfi_softc *sc, enum mfi_iop iop) { diff --git a/sys/dev/ic/mfireg.h b/sys/dev/ic/mfireg.h index 455b0fe3957..0513928bfa0 100644 --- a/sys/dev/ic/mfireg.h +++ b/sys/dev/ic/mfireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mfireg.h,v 1.49 2018/05/18 05:17:40 jmatthew Exp $ */ +/* $OpenBSD: mfireg.h,v 1.50 2020/02/13 15:11:32 krw Exp $ */ /* * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> * @@ -27,7 +27,6 @@ #define MFI_OSTS_GEN2_INTR_VALID (0x00000001 | 0x00000004) #define MFI_INVALID_CTX 0xffffffff #define MFI_ENABLE_INTR 0x01 -#define MFI_MAXFER MAXPHYS /* XXX bogus */ /* register offsets */ #define MFI_IMSG0 0x10 /* inbound msg 0 */ diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index 45f27fc36b8..276f540c9e2 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpi.c,v 1.211 2020/01/27 03:35:05 krw Exp $ */ +/* $OpenBSD: mpi.c,v 1.212 2020/02/13 15:11:32 krw Exp $ */ /* * Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org> @@ -64,13 +64,12 @@ struct cfdriver mpi_cd = { void mpi_scsi_cmd(struct scsi_xfer *); void mpi_scsi_cmd_done(struct mpi_ccb *); -void mpi_minphys(struct buf *, struct scsi_link *); int mpi_scsi_probe(struct scsi_link *); int mpi_scsi_ioctl(struct scsi_link *, u_long, caddr_t, int); struct scsi_adapter mpi_switch = { - mpi_scsi_cmd, mpi_minphys, mpi_scsi_probe, NULL, mpi_scsi_ioctl + mpi_scsi_cmd, NULL, mpi_scsi_probe, NULL, mpi_scsi_ioctl }; struct mpi_dmamem *mpi_dmamem_alloc(struct mpi_softc *, size_t); @@ -1600,14 +1599,6 @@ mpi_load_xs(struct mpi_ccb *ccb) return (0); } -void -mpi_minphys(struct buf *bp, struct scsi_link *sl) -{ - /* XXX */ - if (bp->b_bcount > MAXPHYS) - bp->b_bcount = MAXPHYS; -} - int mpi_scsi_probe_virtual(struct scsi_link *link) { diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c index eaa01bb2b08..d297d601560 100644 --- a/sys/dev/pci/arc.c +++ b/sys/dev/pci/arc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc.c,v 1.109 2020/01/25 21:48:42 krw Exp $ */ +/* $OpenBSD: arc.c,v 1.110 2020/02/13 15:11:32 krw Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -604,7 +604,6 @@ int arc_intr_D(void *); /* interface for scsi midlayer to talk to */ void arc_scsi_cmd(struct scsi_xfer *); -void arc_minphys(struct buf *, struct scsi_link *); /* code to deal with getting bits in and out of the bus space */ u_int32_t arc_read(struct arc_softc *, bus_size_t); @@ -689,7 +688,7 @@ struct cfdriver arc_cd = { }; struct scsi_adapter arc_switch = { - arc_scsi_cmd, arc_minphys, NULL, NULL, NULL + arc_scsi_cmd, NULL, NULL, NULL, NULL }; /* real stuff for dealing with the hardware */ @@ -1404,13 +1403,6 @@ Loop0: } void -arc_minphys(struct buf *bp, struct scsi_link *sl) -{ - if (bp->b_bcount > MAXPHYS) - bp->b_bcount = MAXPHYS; -} - -void arc_enable_all_intr(struct arc_softc *sc) { u_int32_t int_mask; diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 746e740eabd..83667e7eda9 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.397 2020/01/25 21:48:42 krw Exp $ */ +/* $OpenBSD: softraid.c,v 1.398 2020/02/13 15:11:32 krw Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -93,7 +93,6 @@ struct cfdriver softraid_cd = { /* scsi & discipline */ void sr_scsi_cmd(struct scsi_xfer *); -void sr_minphys(struct buf *, struct scsi_link *); int sr_scsi_probe(struct scsi_link *); void sr_copy_internal_data(struct scsi_xfer *, void *, size_t); @@ -179,7 +178,7 @@ extern void (*softraid_disk_attach)(struct disk *, int); /* scsi glue */ struct scsi_adapter sr_switch = { - sr_scsi_cmd, sr_minphys, sr_scsi_probe, NULL, sr_scsi_ioctl + sr_scsi_cmd, NULL, sr_scsi_probe, NULL, sr_scsi_ioctl }; /* native metadata format */ @@ -1887,16 +1886,6 @@ sr_error(struct sr_softc *sc, const char *fmt, ...) } void -sr_minphys(struct buf *bp, struct scsi_link *sl) -{ - DNPRINTF(SR_D_MISC, "sr_minphys: %ld\n", bp->b_bcount); - - /* XXX currently using SR_MAXFER = MAXPHYS */ - if (bp->b_bcount > SR_MAXFER) - bp->b_bcount = SR_MAXFER; -} - -void sr_copy_internal_data(struct scsi_xfer *xs, void *v, size_t size) { size_t copy_cnt; diff --git a/sys/dev/softraidvar.h b/sys/dev/softraidvar.h index da1fbad4a6f..0ac90d16d1a 100644 --- a/sys/dev/softraidvar.h +++ b/sys/dev/softraidvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: softraidvar.h,v 1.169 2019/07/04 18:09:17 bluhm Exp $ */ +/* $OpenBSD: softraidvar.h,v 1.170 2020/02/13 15:11:32 krw Exp $ */ /* * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -328,7 +328,6 @@ extern u_int32_t sr_debug; #define DNPRINTF(n,x...) #endif -#define SR_MAXFER MAXPHYS #define SR_MAX_LD 256 #define SR_MAX_CMDS 16 #define SR_MAX_STATES 7 diff --git a/sys/dev/usb/umass_scsi.c b/sys/dev/usb/umass_scsi.c index 6eeb12ba931..9deb1f6f3b6 100644 --- a/sys/dev/usb/umass_scsi.c +++ b/sys/dev/usb/umass_scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass_scsi.c,v 1.49 2020/01/26 00:53:31 krw Exp $ */ +/* $OpenBSD: umass_scsi.c,v 1.50 2020/02/13 15:11:32 krw Exp $ */ /* $NetBSD: umass_scsipi.c,v 1.9 2003/02/16 23:14:08 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -66,10 +66,9 @@ struct umass_scsi_softc { int umass_scsi_probe(struct scsi_link *); void umass_scsi_cmd(struct scsi_xfer *); -void umass_minphys(struct buf *, struct scsi_link *); struct scsi_adapter umass_scsi_switch = { - umass_scsi_cmd, umass_minphys, umass_scsi_probe, NULL, NULL + umass_scsi_cmd, NULL, umass_scsi_probe, NULL, NULL }; void umass_scsi_cb(struct umass_softc *sc, void *priv, int residue, @@ -264,13 +263,6 @@ umass_scsi_cmd(struct scsi_xfer *xs) } void -umass_minphys(struct buf *bp, struct scsi_link *sl) -{ - if (bp->b_bcount > UMASS_MAX_TRANSFER_SIZE) - bp->b_bcount = UMASS_MAX_TRANSFER_SIZE; -} - -void umass_scsi_cb(struct umass_softc *sc, void *priv, int residue, int status) { struct umass_scsi_softc *scbus = sc->bus; |