Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2012 18:53:33 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r240172 - in head/sys: cam/scsi dev/ct dev/ncv dev/nsp dev/stg sys
Message-ID:  <201209061853.q86IrX9J068367@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Sep  6 18:53:33 2012
New Revision: 240172
URL: http://svn.freebsd.org/changeset/base/240172

Log:
  Remove NetBSD compat shims for drivers originally shared with NetBSD/pc98.
  NetBSD/pc98 was never merged into the main NetBSD tree and is no longer
  developed.  Adding locking to these drivers would have made the compat
  shims hard to impossible to maintain, so remove the shims to ease
  future changes.
  
  These changes were verified by md5.  Some additional shims can be removed
  that do affect the compiled results that I will probably do in another
  round.
  
  Approved by:	nyan (tentatively)

Deleted:
  head/sys/sys/device_port.h
Modified:
  head/sys/cam/scsi/scsi_low.c
  head/sys/cam/scsi/scsi_low.h
  head/sys/cam/scsi/scsi_low_pisa.c
  head/sys/cam/scsi/scsi_low_pisa.h
  head/sys/dev/ct/bshw_machdep.c
  head/sys/dev/ct/ct.c
  head/sys/dev/ct/ct_isa.c
  head/sys/dev/ct/ctvar.h
  head/sys/dev/ncv/ncr53c500.c
  head/sys/dev/ncv/ncr53c500_pccard.c
  head/sys/dev/ncv/ncr53c500var.h
  head/sys/dev/nsp/nsp.c
  head/sys/dev/nsp/nsp_pccard.c
  head/sys/dev/nsp/nspvar.h
  head/sys/dev/stg/tmc18c30.c
  head/sys/dev/stg/tmc18c30_pccard.c
  head/sys/dev/stg/tmc18c30var.h

Modified: head/sys/cam/scsi/scsi_low.c
==============================================================================
--- head/sys/cam/scsi/scsi_low.c	Thu Sep  6 18:31:56 2012	(r240171)
+++ head/sys/cam/scsi/scsi_low.c	Thu Sep  6 18:53:33 2012	(r240172)
@@ -14,13 +14,7 @@ __FBSDID("$FreeBSD$");
 /* #define	SCSI_LOW_QCLEAR_AFTER_CA */
 /* #define	SCSI_LOW_FLAGS_QUIRKS_OK */
 
-#ifdef __NetBSD__
-#define	SCSI_LOW_TARGET_OPEN
-#endif	/* __NetBSD__ */
-
-#ifdef	__FreeBSD__
 #define	SCSI_LOW_FLAGS_QUIRKS_OK
-#endif	/* __FreeBSD__ */
 
 /*-
  * [NetBSD for NEC PC-98 series]
@@ -71,41 +65,12 @@ __FBSDID("$FreeBSD$");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
-
-#ifdef __FreeBSD__
-#if __FreeBSD_version >= 500001
 #include <sys/bio.h>
-#else
-#include <machine/clock.h>
-#endif
-#endif	/* __FreeBSD__ */
-
 #include <sys/buf.h>
 #include <sys/queue.h>
 #include <sys/malloc.h>
 #include <sys/errno.h>
 
-#ifdef	__NetBSD__
-#include <sys/device.h>
-#include <vm/vm.h>
-
-#include <machine/bus.h>
-#include <machine/intr.h>
-#include <machine/dvcfg.h>
-
-#include <dev/cons.h>
-
-#include <dev/scsipi/scsipi_all.h>
-#include <dev/scsipi/scsipiconf.h>
-#include <dev/scsipi/scsipi_disk.h>
-#include <dev/scsipi/scsi_all.h>
-#include <dev/scsipi/scsiconf.h>
-#include <sys/scsiio.h>
-
-#include <i386/Cbus/dev/scsi_low.h>
-#endif	/* __NetBSD__ */
-
-#ifdef __FreeBSD__
 #include <cam/cam.h>
 #include <cam/cam_ccb.h>
 #include <cam/cam_sim.h>
@@ -119,7 +84,6 @@ __FBSDID("$FreeBSD$");
 #include <cam/scsi/scsi_low.h>
 
 #include <sys/cons.h>
-#endif	/* __FreeBSD__ */
 
 /**************************************************************
  * Constants
@@ -392,501 +356,6 @@ scsi_low_translate_error_code(cb, tp)
 	return tp->error_code;
 }
 
-#ifdef SCSI_LOW_INTERFACE_XS
-/**************************************************************
- * SCSI INTERFACE (XS)
- **************************************************************/
-#define	SCSI_LOW_MINPHYS		0x10000
-#define	SCSI_LOW_MALLOC(size)		malloc((size), M_SCSILOW, M_NOWAIT)
-#define	SCSI_LOW_FREE(pt)		free((pt), M_SCSILOW)
-#define	SCSI_LOW_ALLOC_CCB(flags)	scsi_low_get_ccb((flags))
-#define	SCSI_LOW_XS_POLL_HZ		1000
-
-static int scsi_low_poll_xs(struct scsi_low_softc *, struct slccb *);
-static void scsi_low_scsi_minphys_xs(struct buf *);
-#ifdef	SCSI_LOW_TARGET_OPEN
-static int scsi_low_target_open(struct scsipi_link *, struct cfdata *);
-#endif	/* SCSI_LOW_TARGET_OPEN */
-static int scsi_low_scsi_cmd_xs(struct scsipi_xfer *);
-static int scsi_low_enable_xs(void *, int);
-static int scsi_low_ioctl_xs(struct scsipi_link *, u_long, caddr_t, int, struct proc *);
-
-static int scsi_low_attach_xs(struct scsi_low_softc *);
-static int scsi_low_world_start_xs(struct scsi_low_softc *);
-static int scsi_low_dettach_xs(struct scsi_low_softc *);
-static int scsi_low_ccb_setup_xs(struct scsi_low_softc *, struct slccb *);
-static int scsi_low_done_xs(struct scsi_low_softc *, struct slccb *);
-static void scsi_low_timeout_xs(struct scsi_low_softc *, int, int);
-static u_int scsi_low_translate_quirks_xs(u_int);
-static void scsi_low_setup_quirks_xs(struct targ_info *, struct lun_info *, u_int);
-
-struct scsi_low_osdep_funcs scsi_low_osdep_funcs_xs = {
-	scsi_low_attach_xs,
-	scsi_low_world_start_xs,
-	scsi_low_dettach_xs,
-	scsi_low_ccb_setup_xs,
-	scsi_low_done_xs,
-	scsi_low_timeout_xs
-};
-	
-struct scsipi_device scsi_low_dev = {
-	NULL,	/* Use default error handler */
-	NULL,	/* have a queue, served by this */
-	NULL,	/* have no async handler */
-	NULL,	/* Use default 'done' routine */
-};
-
-struct scsi_low_error_code scsi_low_error_code_xs[] = {
-	{0,		XS_NOERROR},
-	{SENSEIO,	XS_SENSE},
-	{BUSYERR,	XS_BUSY	},
-	{SELTIMEOUTIO,	XS_SELTIMEOUT},
-	{TIMEOUTIO,	XS_TIMEOUT},
-	{-1,		XS_DRIVER_STUFFUP}
-};
-
-static int
-scsi_low_ioctl_xs(link, cmd, addr, flag, p)
-	struct scsipi_link *link;
-	u_long cmd;
-	caddr_t addr;
-	int flag;
-	struct proc *p;
-{
-	struct scsi_low_softc *slp;
-	int s, error = ENOTTY;
-
-	slp = (struct scsi_low_softc *) link->adapter_softc;
-	if ((slp->sl_flags & HW_INACTIVE) != 0)
-		return ENXIO;
-
-	if (cmd == SCBUSIORESET)
-	{
-		s = SCSI_LOW_SPLSCSI();
-		scsi_low_restart(slp, SCSI_LOW_RESTART_HARD, NULL);
-		splx(s);
-		error = 0;
-	}
-	else if (slp->sl_funcs->scsi_low_ioctl != 0)
-	{
-		error = (*slp->sl_funcs->scsi_low_ioctl)
-				(slp, cmd, addr, flag, p);
-	}
-
-	return error;
-}
-
-static int
-scsi_low_enable_xs(arg, enable)
-	void *arg;
-	int enable;
-{
-	struct scsi_low_softc *slp = arg;
-
-	if (enable != 0)
-	{
-		if ((slp->sl_flags & HW_INACTIVE) != 0)
-			return ENXIO;
-	}
-	else
-	{
-		if ((slp->sl_flags & HW_INACTIVE) != 0 ||
-		    (slp->sl_flags & HW_POWERCTRL) == 0)
-			return 0;
-
-		slp->sl_flags |= HW_POWDOWN;
-		if (slp->sl_funcs->scsi_low_power != NULL)
-		{
-			(*slp->sl_funcs->scsi_low_power)
-					(slp, SCSI_LOW_POWDOWN);
-		}
-	}
-	return 0;
-}
-
-static void
-scsi_low_scsi_minphys_xs(bp)
-	struct buf *bp;
-{
-
-	if (bp->b_bcount > SCSI_LOW_MINPHYS)
-		bp->b_bcount = SCSI_LOW_MINPHYS;
-	minphys(bp);
-}
-
-static int
-scsi_low_poll_xs(slp, cb)
-	struct scsi_low_softc *slp;
-	struct slccb *cb;
-{
-	struct scsipi_xfer *xs = cb->osdep;
-	int tcount;
-
-	cb->ccb_flags |= CCB_NOSDONE;
-	tcount = 0;
-
-	while (slp->sl_nio > 0)
-	{
-		SCSI_LOW_DELAY((1000 * 1000) / SCSI_LOW_XS_POLL_HZ);
-
-		(*slp->sl_funcs->scsi_low_poll) (slp);
-
-		if ((slp->sl_flags & (HW_INACTIVE | HW_INITIALIZING)) != 0)
-		{
-			cb->ccb_flags |= CCB_NORETRY;
-			cb->ccb_error |= FATALIO;
-			(void) scsi_low_revoke_ccb(slp, cb, 1);
-			printf("%s: hardware inactive in poll mode\n", 
-				slp->sl_xname);
-		}
-
-		if ((xs->flags & ITSDONE) != 0)
-			break;
-
-		if (tcount ++ < SCSI_LOW_XS_POLL_HZ / SCSI_LOW_TIMEOUT_HZ)
-			continue;
-
-		tcount = 0;
-		scsi_low_timeout_check(slp);
-	}
-
-	xs->flags |= ITSDONE;
-	scsipi_done(xs);
-	return COMPLETE;
-}
-
-static int
-scsi_low_scsi_cmd_xs(xs)
-	struct scsipi_xfer *xs;
-{
-	struct scsipi_link *splp = xs->sc_link;
-	struct scsi_low_softc *slp = splp->adapter_softc;
-	struct targ_info *ti;
-	struct lun_info *li;
-	struct slccb *cb;
-	int s, targ, lun, flags, rv;
-
-	if ((cb = SCSI_LOW_ALLOC_CCB(xs->flags & SCSI_NOSLEEP)) == NULL)
-		return TRY_AGAIN_LATER;
-
-	targ = splp->scsipi_scsi.target,
-	lun = splp->scsipi_scsi.lun;
-	ti = slp->sl_ti[targ];
-
-	cb->osdep = xs;
-	cb->bp = xs->bp;
-
-	if ((xs->flags & SCSI_POLL) == 0)
-		flags = CCB_AUTOSENSE;
-	else
-		flags = CCB_AUTOSENSE | CCB_POLLED;
-		
-
-	s = SCSI_LOW_SPLSCSI();
-	li = scsi_low_alloc_li(ti, lun, 1);
-	if ((u_int) splp->quirks != li->li_sloi.sloi_quirks)
-	{
-		scsi_low_setup_quirks_xs(ti, li, (u_int) splp->quirks);
-	}
-
-	if ((xs->flags & SCSI_RESET) != 0)
-	{
-		flags |= CCB_NORETRY | CCB_URGENT;
-		scsi_low_enqueue(slp, ti, li, cb, flags, SCSI_LOW_MSG_RESET);
-	}
-	else
-	{
-		if (ti->ti_setup_msg != 0)
-		{
-			scsi_low_message_enqueue(slp, ti, li, flags);
-		}
-
-		flags |= CCB_SCSIIO;
-		scsi_low_enqueue(slp, ti, li, cb, flags, 0);
-	}
-
-#ifdef	SCSI_LOW_DEBUG
-	if (SCSI_LOW_DEBUG_TEST_GO(SCSI_LOW_ABORT_CHECK, ti->ti_id) != 0)
-	{
-		scsi_low_test_abort(slp, ti, li);
-	}
-#endif	/* SCSI_LOW_DEBUG */
-
-	if ((cb->ccb_flags & CCB_POLLED) != 0)
-	{
-		rv = scsi_low_poll_xs(slp, cb);
-	}
-	else
-	{
-		rv = SUCCESSFULLY_QUEUED;
-	}
-	splx(s);
-	return rv;
-}
-
-static int
-scsi_low_attach_xs(slp)
-	struct scsi_low_softc *slp;
-{
-	struct scsipi_adapter *sap;
-	struct scsipi_link *splp;
-
-	strncpy(slp->sl_xname, slp->sl_dev.dv_xname, 16);
-
-	sap = SCSI_LOW_MALLOC(sizeof(*sap));
-	if (sap == NULL)
-		return ENOMEM;
-	splp = SCSI_LOW_MALLOC(sizeof(*splp));
-	if (splp == NULL)
-	{
-		SCSI_LOW_FREE(sap);
-		return ENOMEM;
-	}
-
-	SCSI_LOW_BZERO(sap, sizeof(*sap));
-	SCSI_LOW_BZERO(splp, sizeof(*splp));
-
-	sap->scsipi_cmd = scsi_low_scsi_cmd_xs;
-	sap->scsipi_minphys = scsi_low_scsi_minphys_xs;
-	sap->scsipi_enable = scsi_low_enable_xs;
-	sap->scsipi_ioctl = scsi_low_ioctl_xs;
-#ifdef	SCSI_LOW_TARGET_OPEN
-	sap->open_target_lu = scsi_low_target_open;
-#endif	/* SCSI_LOW_TARGET_OPEN */
-
-	splp->adapter_softc = slp;
-	splp->scsipi_scsi.adapter_target = slp->sl_hostid;
-	splp->scsipi_scsi.max_target = slp->sl_ntargs - 1;
-	splp->scsipi_scsi.max_lun = slp->sl_nluns - 1;
-	splp->scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
-	splp->openings = slp->sl_openings;
-	splp->type = BUS_SCSI;
-	splp->adapter_softc = slp;
-	splp->adapter = sap;
-	splp->device = &scsi_low_dev;
-
-	slp->sl_si.si_splp = splp;
-	slp->sl_show_result = SHOW_ALL_NEG;
-	return 0;
-}
-
-static int
-scsi_low_world_start_xs(slp)
-	struct scsi_low_softc *slp;
-{
-
-	return 0;
-}
-
-static int
-scsi_low_dettach_xs(slp)
-	struct scsi_low_softc *slp;
-{
-
-	/*
-	 * scsipi does not have dettach bus fucntion.
-	 *
-	scsipi_dettach_scsibus(slp->sl_si.si_splp);
-	*/
-	return 0;
-}
-
-static int
-scsi_low_ccb_setup_xs(slp, cb)
-	struct scsi_low_softc *slp;
-	struct slccb *cb;
-{
-	struct scsipi_xfer *xs = (struct scsipi_xfer *) cb->osdep;
-
-	if ((cb->ccb_flags & CCB_SCSIIO) != 0)
-	{
-		cb->ccb_scp.scp_cmd = (u_int8_t *) xs->cmd;
-		cb->ccb_scp.scp_cmdlen = xs->cmdlen;
-		cb->ccb_scp.scp_data = xs->data;
-		cb->ccb_scp.scp_datalen = xs->datalen;
-		cb->ccb_scp.scp_direction = (xs->flags & SCSI_DATA_OUT) ? 
-					SCSI_LOW_WRITE : SCSI_LOW_READ;
-		cb->ccb_tcmax = xs->timeout / 1000;
-	}
-	else
-	{
-		scsi_low_unit_ready_cmd(cb);
-	}
-	return SCSI_LOW_START_QTAG;
-}
-
-static int
-scsi_low_done_xs(slp, cb)
-	struct scsi_low_softc *slp;
-	struct slccb *cb;
-{
-	struct scsipi_xfer *xs;
-
-	xs = (struct scsipi_xfer *) cb->osdep;
-	if (cb->ccb_error == 0)
-	{
-		xs->error = XS_NOERROR;
-		xs->resid = 0;
-	}
-	else 	
-	{
-	        if (cb->ccb_rcnt >= slp->sl_max_retry)
-			cb->ccb_error |= ABORTIO;
-
-		if ((cb->ccb_flags & CCB_NORETRY) == 0 &&
-		    (cb->ccb_error & ABORTIO) == 0)
-			return EJUSTRETURN;
-
-		if ((cb->ccb_error & SENSEIO) != 0)
-		{
-			xs->sense.scsi_sense = cb->ccb_sense;
-		}
-
-		xs->error = scsi_low_translate_error_code(cb,
-				&scsi_low_error_code_xs[0]);
-	
-#ifdef	SCSI_LOW_DIAGNOSTIC
-		if ((cb->ccb_flags & CCB_SILENT) == 0 &&
-		    cb->ccb_scp.scp_cmdlen > 0 &&
-		    (scsi_low_cmd_flags[cb->ccb_scp.scp_cmd[0]] &
-		     SCSI_LOW_CMD_ABORT_WARNING) != 0)
-		{
-			printf("%s: WARNING: scsi_low IO abort\n",
-				slp->sl_xname);
-			scsi_low_print(slp, NULL);
-		}
-#endif	/* SCSI_LOW_DIAGNOSTIC */
-	}
-
-	if (cb->ccb_scp.scp_status == ST_UNKNOWN)
-		xs->status = 0;	/* XXX */
-	else
-		xs->status = cb->ccb_scp.scp_status;
-
-	xs->flags |= ITSDONE;
-	if ((cb->ccb_flags & CCB_NOSDONE) == 0)
-		scsipi_done(xs);
-
-	return 0;
-}
-
-static void
-scsi_low_timeout_xs(slp, ch, action)
-	struct scsi_low_softc *slp;
-	int ch;
-	int action;
-{
-
-	switch (ch)
-	{
-	case SCSI_LOW_TIMEOUT_CH_IO:
-		switch (action)
-		{
-		case SCSI_LOW_TIMEOUT_START:
-			timeout(scsi_low_timeout, slp,
-				hz / SCSI_LOW_TIMEOUT_HZ);
-			break;
-		case SCSI_LOW_TIMEOUT_STOP:
-			untimeout(scsi_low_timeout, slp);
-			break;
-		}
-		break;
-
-	case SCSI_LOW_TIMEOUT_CH_ENGAGE:
-		switch (action)
-		{
-		case SCSI_LOW_TIMEOUT_START:
-			timeout(scsi_low_engage, slp, 1);
-			break;
-		case SCSI_LOW_TIMEOUT_STOP:
-			untimeout(scsi_low_engage, slp);
-			break;
-		}
-		break;
-
-	case SCSI_LOW_TIMEOUT_CH_RECOVER:
-		break;
-	}
-}
-
-u_int
-scsi_low_translate_quirks_xs(quirks)
-	u_int quirks;
-{
-	u_int flags;
-	
-	flags = SCSI_LOW_DISK_LFLAGS | SCSI_LOW_DISK_TFLAGS;
-
-#ifdef	SDEV_NODISC
-	if (quirks & SDEV_NODISC)
-		flags &= ~SCSI_LOW_DISK_DISC;
-#endif	/* SDEV_NODISC */
-#ifdef	SDEV_NOPARITY
-	if (quirks & SDEV_NOPARITY)
-		flags &= ~SCSI_LOW_DISK_PARITY;
-#endif	/* SDEV_NOPARITY */
-#ifdef	SDEV_NOCMDLNK
-	if (quirks & SDEV_NOCMDLNK)
-		flags &= ~SCSI_LOW_DISK_LINK;
-#endif	/* SDEV_NOCMDLNK */
-#ifdef	SDEV_NOTAG
-	if (quirks & SDEV_NOTAG)
-		flags &= ~SCSI_LOW_DISK_QTAG;
-#endif	/* SDEV_NOTAG */
-#ifdef	SDEV_NOSYNC
-	if (quirks & SDEV_NOSYNC)
-		flags &= ~SCSI_LOW_DISK_SYNC;
-#endif	/* SDEV_NOSYNC */
-
-	return flags;
-}
-
-static void
-scsi_low_setup_quirks_xs(ti, li, flags)
-	struct targ_info *ti;
-	struct lun_info *li;
-	u_int flags;
-{
-	u_int quirks;
-
-	li->li_sloi.sloi_quirks = flags;
-	quirks = scsi_low_translate_quirks_xs(flags);
-	ti->ti_quirks = quirks & SCSI_LOW_DISK_TFLAGS;
-	li->li_quirks = quirks & SCSI_LOW_DISK_LFLAGS;
-	ti->ti_flags_valid |= SCSI_LOW_TARG_FLAGS_QUIRKS_VALID;
-	li->li_flags_valid |= SCSI_LOW_LUN_FLAGS_QUIRKS_VALID;
-	scsi_low_calcf_target(ti);
-	scsi_low_calcf_lun(li);
-	scsi_low_calcf_show(li);
-}
-
-#ifdef	SCSI_LOW_TARGET_OPEN
-static int
-scsi_low_target_open(link, cf)
-	struct scsipi_link *link;
-	struct cfdata *cf;
-{
-	u_int target = link->scsipi_scsi.target;
-	u_int lun = link->scsipi_scsi.lun;
-	struct scsi_low_softc *slp;
-	struct targ_info *ti;
-	struct lun_info *li;
-
-	slp = (struct scsi_low_softc *) link->adapter_softc;
-	ti = slp->sl_ti[target];
-	li = scsi_low_alloc_li(ti, lun, 0);
-	if (li == NULL)
-		return 0;
-
-	li->li_cfgflags = cf->cf_flags;
-	scsi_low_setup_quirks_xs(ti, li, (u_int) link->quirks);
-	return 0;
-}
-#endif	/* SCSI_LOW_TARGET_OPEN */
-
-#endif	/* SCSI_LOW_INTERFACE_XS */
-
-#ifdef SCSI_LOW_INTERFACE_CAM
 /**************************************************************
  * SCSI INTERFACE (CAM)
  **************************************************************/
@@ -1001,7 +470,7 @@ scsi_low_scsi_action_cam(sim, ccb)
 		else
 			flags = CCB_SCSIIO;
 
-		s = SCSI_LOW_SPLSCSI();
+		s = splcam();
 		li = scsi_low_alloc_li(ti, lun, 1);
 
 		if (ti->ti_setup_msg != 0)
@@ -1040,7 +509,7 @@ scsi_low_scsi_action_cam(sim, ccb)
 		}
 #endif	/* SCSI_LOW_DIAGNOSTIC */
 
-		s = SCSI_LOW_SPLSCSI();
+		s = splcam();
 		cb = scsi_low_find_ccb(slp, target, lun, ccb->cab.abort_ccb);
 		rv = scsi_low_abort_ccb(slp, cb);
 		splx(s);
@@ -1072,7 +541,7 @@ scsi_low_scsi_action_cam(sim, ccb)
 		if (lun == CAM_LUN_WILDCARD)
 			lun = 0;
 
-		s = SCSI_LOW_SPLSCSI();
+		s = splcam();
 		scsi = &cts->proto_specific.scsi;
 		spi = &cts->xport_specific.spi;
 		if ((spi->valid & (CTS_SPI_VALID_BUS_WIDTH |
@@ -1144,7 +613,7 @@ scsi_low_scsi_action_cam(sim, ccb)
 		if (lun == CAM_LUN_WILDCARD)
 			lun = 0;
 
-		s = SCSI_LOW_SPLSCSI();
+		s = splcam();
 		li = scsi_low_alloc_li(ti, lun, 1);
 		if (li != NULL && cts->type == CTS_TYPE_CURRENT_SETTINGS) {
 			struct ccb_trans_settings_scsi *scsi =
@@ -1202,7 +671,7 @@ settings_out:
 	}
 
 	case XPT_RESET_BUS:		/* Reset the specified SCSI bus */
-		s = SCSI_LOW_SPLSCSI();
+		s = splcam();
 		scsi_low_restart(slp, SCSI_LOW_RESTART_HARD, NULL);
 		splx(s);
 		ccb->ccb_h.status = CAM_REQ_CMP;
@@ -1243,7 +712,7 @@ settings_out:
 		else
 			flags = CCB_NORETRY | CCB_URGENT;
 
-		s = SCSI_LOW_SPLSCSI();
+		s = splcam();
 		li = scsi_low_alloc_li(ti, lun, 1);
 		scsi_low_enqueue(slp, ti, li, cb, flags, msg);
 		splx(s);
@@ -1299,7 +768,7 @@ scsi_low_attach_cam(slp)
 	int tagged_openings;
 
 	sprintf(slp->sl_xname, "%s%d",
-		DEVPORT_DEVNAME(slp->sl_dev), DEVPORT_DEVUNIT(slp->sl_dev));
+		device_get_name(slp->sl_dev), device_get_unit(slp->sl_dev));
 
 	devq = cam_simq_alloc(SCSI_LOW_NCCB);
 	if (devq == NULL)
@@ -1311,8 +780,8 @@ scsi_low_attach_cam(slp)
 	tagged_openings = min(slp->sl_openings, SCSI_LOW_MAXNEXUS);
 	slp->sl_si.sim = cam_sim_alloc(scsi_low_scsi_action_cam,
 				scsi_low_poll_cam,
-				DEVPORT_DEVNAME(slp->sl_dev), slp,
-				DEVPORT_DEVUNIT(slp->sl_dev), &Giant,
+				device_get_name(slp->sl_dev), slp,
+				device_get_unit(slp->sl_dev), &Giant,
 				slp->sl_openings, tagged_openings, devq);
 
 	if (slp->sl_si.sim == NULL) {
@@ -1479,8 +948,6 @@ scsi_low_timeout_cam(slp, ch, action)
 	}
 }
 
-#endif	/* SCSI_LOW_INTERFACE_CAM */
-
 /*=============================================================
  * END OF OS switch  (All OS depend fucntions should be above)
  =============================================================*/
@@ -1504,7 +971,7 @@ scsi_low_deactivate(slp)
 {
 	int s;
 
-	s = SCSI_LOW_SPLSCSI();
+	s = splcam();
 	slp->sl_flags |= HW_INACTIVE;
 	(*slp->sl_osdep_fp->scsi_low_osdep_timeout)
 		(slp, SCSI_LOW_TIMEOUT_CH_IO, SCSI_LOW_TIMEOUT_STOP);
@@ -1520,7 +987,7 @@ scsi_low_activate(slp)
 {
 	int error, s;
 
-	s = SCSI_LOW_SPLSCSI();
+	s = splcam();
 	slp->sl_flags &= ~HW_INACTIVE;
 	if ((error = scsi_low_restart(slp, SCSI_LOW_RESTART_HARD, NULL)) != 0)
 	{
@@ -1600,7 +1067,7 @@ scsi_low_engage(arg)
 	void *arg;
 {
 	struct scsi_low_softc *slp = arg;
-	int s = SCSI_LOW_SPLSCSI();
+	int s = splcam();
 
 	switch (slp->sl_rstep)
 	{
@@ -1696,7 +1163,7 @@ scsi_low_alloc_li(ti, lun, alloc)
 	if (li == NULL)
 		panic("no lun info mem");
 
-	SCSI_LOW_BZERO(li, ti->ti_lunsize);
+	bzero(li, ti->ti_lunsize);
 	li->li_lun = lun;
 	li->li_ti = ti;
 
@@ -1738,7 +1205,7 @@ scsi_low_alloc_ti(slp, targ)
 	if (ti == NULL)
 		panic("%s short of memory", slp->sl_xname);
 
-	SCSI_LOW_BZERO(ti, slp->sl_targsize);
+	bzero(ti, slp->sl_targsize);
 	ti->ti_id = targ;
 	ti->ti_sc = slp;
 
@@ -1812,7 +1279,7 @@ scsi_low_timeout(arg)
 	struct scsi_low_softc *slp = arg;
 	int s;
 
-	s = SCSI_LOW_SPLSCSI();
+	s = splcam();
 	(void) scsi_low_timeout_check(slp);
 	(*slp->sl_osdep_fp->scsi_low_osdep_timeout)
 		(slp, SCSI_LOW_TIMEOUT_CH_IO, SCSI_LOW_TIMEOUT_START);
@@ -1995,12 +1462,7 @@ scsi_low_attach(slp, openings, ntargs, n
 	struct lun_info *li;
 	int s, i, nccb, rv;
 
-#ifdef	SCSI_LOW_INTERFACE_XS
-	slp->sl_osdep_fp = &scsi_low_osdep_funcs_xs;
-#endif	/* SCSI_LOW_INTERFACE_XS */
-#ifdef	SCSI_LOW_INTERFACE_CAM
 	slp->sl_osdep_fp = &scsi_low_osdep_funcs_cam;
-#endif	/* SCSI_LOW_INTERFACE_CAM */
 
 	if (slp->sl_osdep_fp == NULL)
 		panic("scsi_low: interface not spcified");
@@ -2042,7 +1504,7 @@ scsi_low_attach(slp, openings, ntargs, n
 	TAILQ_INIT(&slp->sl_start);
 
 	/* call os depend attach */
-	s = SCSI_LOW_SPLSCSI();
+	s = splcam();
 	rv = (*slp->sl_osdep_fp->scsi_low_osdep_attach) (slp);
 	if (rv != 0)
 	{
@@ -2053,7 +1515,7 @@ scsi_low_attach(slp, openings, ntargs, n
 	}
 
 	/* check hardware */
-	SCSI_LOW_DELAY(1000);	/* wait for 1ms */
+	DELAY(1000);	/* wait for 1ms */
 	if (scsi_low_init(slp, SCSI_LOW_RESTART_HARD) != 0)
 	{
 		splx(s);
@@ -2088,7 +1550,7 @@ scsi_low_dettach(slp)
 {
 	int s, rv;
 
-	s = SCSI_LOW_SPLSCSI();
+	s = splcam();
 	if (scsi_low_is_busy(slp) != 0)
 	{
 		splx(s);
@@ -2208,7 +1670,7 @@ scsi_low_sense_abort_start(slp, ti, li, 
 {
 
 	cb->ccb_scp.scp_cmdlen = 6;
-	SCSI_LOW_BZERO(cb->ccb_scsi_cmd, cb->ccb_scp.scp_cmdlen);
+	bzero(cb->ccb_scsi_cmd, cb->ccb_scp.scp_cmdlen);
 	cb->ccb_scsi_cmd[0] = REQUEST_SENSE;
 	cb->ccb_scsi_cmd[4] = sizeof(cb->ccb_sense);
 	cb->ccb_scp.scp_cmd = cb->ccb_scsi_cmd;
@@ -2223,7 +1685,7 @@ scsi_low_sense_abort_start(slp, ti, li, 
 	}
 	else
 	{
-		SCSI_LOW_BZERO(&cb->ccb_sense, sizeof(cb->ccb_sense));
+		bzero(&cb->ccb_sense, sizeof(cb->ccb_sense));
 #ifdef	SCSI_LOW_NEGOTIATE_BEFORE_SENSE
 		scsi_low_assert_msg(slp, ti, ti->ti_setup_msg_done, 0);
 #endif	/* SCSI_LOW_NEGOTIATE_BEFORE_SENSE */
@@ -2883,7 +2345,7 @@ scsi_low_twiddle_wait(void)
 	cnputc('\b');
 	cnputc(tw_chars[tw_pos++]);
 	tw_pos %= (sizeof(tw_chars) - 1);
-	SCSI_LOW_DELAY(TWIDDLEWAIT);
+	DELAY(TWIDDLEWAIT);
 }
 
 void
@@ -4632,7 +4094,7 @@ scsi_low_poll(slp, cb)
 	tcount = 0;
 	while (slp->sl_nio > 0)
 	{
-		SCSI_LOW_DELAY((1000 * 1000) / SCSI_LOW_POLL_HZ);
+		DELAY((1000 * 1000) / SCSI_LOW_POLL_HZ);
 
 		(*slp->sl_funcs->scsi_low_poll) (slp);
 		if (tcount ++ < SCSI_LOW_POLL_HZ / SCSI_LOW_TIMEOUT_HZ)

Modified: head/sys/cam/scsi/scsi_low.h
==============================================================================
--- head/sys/cam/scsi/scsi_low.h	Thu Sep  6 18:31:56 2012	(r240171)
+++ head/sys/cam/scsi/scsi_low.h	Thu Sep  6 18:53:33 2012	(r240172)
@@ -48,24 +48,9 @@
  * Scsi low OSDEP 
  * (All os depend structures should be here!)
  ================================================*/
-/******** interface ******************************/
-#ifdef	__NetBSD__
-#define	SCSI_LOW_INTERFACE_XS
-#endif	/* __NetBSD__ */
-
-#ifdef	__FreeBSD__
-#define	SCSI_LOW_INTERFACE_CAM
-#define	CAM
-#endif	/* __FreeBSD__ */
-
 /******** includes *******************************/
-#ifdef	__NetBSD__
-#include <i386/Cbus/dev/scsi_dvcfg.h>
-#include <dev/isa/ccbque.h>
-#endif	/* __NetBSD__ */
 
-#ifdef	__FreeBSD__
-#include <sys/device_port.h>
+#include <sys/bus.h>
 #include <sys/kdb.h>
 #include <cam/cam.h>
 #include <cam/cam_ccb.h>
@@ -75,47 +60,16 @@
 
 #include <cam/scsi/scsi_dvcfg.h>
 #include <i386/isa/ccbque.h>
-#endif	/* __FreeBSD__ */
 
 /******** functions macro ************************/
-#ifdef	__NetBSD__
-#define	SCSI_LOW_DEBUGGER(dev)	Debugger()
-#define	SCSI_LOW_DELAY(mu)	delay((mu))
-#define	SCSI_LOW_SPLSCSI	splbio
-#define	SCSI_LOW_BZERO(pt, size)	memset((pt), 0, (size))
-#endif	/* __NetBSD__ */
 
-#ifdef	__FreeBSD__
 #undef	MSG_IDENTIFY
-#define	SCSI_LOW_DEBUGGER(dev)	kdb_enter(KDB_WHY_CAM, dev)
-#define	SCSI_LOW_DELAY(mu)	DELAY((mu))
-#define	SCSI_LOW_SPLSCSI	splcam
-#define	SCSI_LOW_BZERO(pt, size)	bzero((pt), (size))
-#endif	/* __FreeBSD__ */
 
 /******** os depend interface structures **********/
-#ifdef	__NetBSD__
-typedef	struct scsipi_sense_data scsi_low_osdep_sense_data_t;
-
-struct scsi_low_osdep_interface {
-	struct device si_dev;
-
-	struct scsipi_link *si_splp;
-};
-
-struct scsi_low_osdep_targ_interface {
-};
-
-struct scsi_low_osdep_lun_interface {
-	u_int sloi_quirks;
-};
-#endif	/* __NetBSD__ */
-
-#ifdef	__FreeBSD__
 typedef	struct scsi_sense_data scsi_low_osdep_sense_data_t;
 
 struct scsi_low_osdep_interface {
-	DEVPORT_DEVICE si_dev;
+	device_t si_dev;
 
 	struct cam_sim *sim;
 	struct cam_path *path;
@@ -134,7 +88,6 @@ struct scsi_low_osdep_targ_interface {
 
 struct scsi_low_osdep_lun_interface {
 };
-#endif	/* __FreeBSD__ */
 
 /******** os depend interface functions *************/
 struct slccb;

Modified: head/sys/cam/scsi/scsi_low_pisa.c
==============================================================================
--- head/sys/cam/scsi/scsi_low_pisa.c	Thu Sep  6 18:31:56 2012	(r240171)
+++ head/sys/cam/scsi/scsi_low_pisa.c	Thu Sep  6 18:53:33 2012	(r240172)
@@ -34,99 +34,13 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#ifdef	__NetBSD__
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
-#include <sys/device.h>
-#include <sys/errno.h>
-
-#include <machine/bus.h>
-#include <machine/intr.h>
-
-#include <dev/isa/isareg.h>
-#include <dev/isa/isavar.h>
-
-#include <dev/isa/pisaif.h>
-
-#include <machine/dvcfg.h>
-
-#include <dev/scsipi/scsi_all.h>
-#include <dev/scsipi/scsipi_all.h>
-#include <dev/scsipi/scsiconf.h>
-#include <dev/scsipi/scsi_disk.h>
-
-#include <i386/Cbus/dev/scsi_low.h>
-#include <i386/Cbus/dev/scsi_low_pisa.h>
-
-#define	SCSIBUS_RESCAN
-
-int
-scsi_low_deactivate_pisa(dh)
-	pisa_device_handle_t dh;
-{
-	struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh);
-
-	if (scsi_low_deactivate(sc) != 0)
-		return EBUSY;
-	return 0;
-}
-
-int
-scsi_low_activate_pisa(dh)
-	pisa_device_handle_t dh;
-{
-	struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh);
-	slot_device_res_t dr = PISA_RES_DR(dh);
-
-	sc->sl_cfgflags = DVCFG_MKCFG(DVCFG_MAJOR(sc->sl_cfgflags), \
-				      DVCFG_MINOR(PISA_DR_DVCFG(dr)));
-	sc->sl_irq = PISA_DR_IRQ(dr);
-
-	if (scsi_low_activate(sc) != 0)
-		return EBUSY;
-
-	/* rescan the scsi bus */
-#ifdef	SCSIBUS_RESCAN
-	if (scsi_low_is_busy(sc) == 0 &&
-	    PISA_RES_EVENT(dh) == PISA_EVENT_INSERT)
-		scsi_probe_busses((int) sc->sl_si.si_splp->scsipi_scsi.scsibus,
-				  -1, -1);
-#endif
-	return 0;
-}
-
-int
-scsi_low_notify_pisa(dh, ev)
-	pisa_device_handle_t dh;
-	pisa_event_t ev;
-{
-	struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh);
-
-	switch(ev)
-	{
-	case PISA_EVENT_QUERY_SUSPEND:
-		if (scsi_low_is_busy(sc) != 0)
-			return SD_EVENT_STATUS_BUSY;
-		break;
-
-	default:
-		break;
-	}
-	return 0;
-}
-#endif	/* __NetBSD__ */
-
-#ifdef	__FreeBSD__ 
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#if __FreeBSD_version >= 500001
 #include <sys/bio.h>
-#endif
 #include <sys/buf.h>
 #include <sys/queue.h>
-#include <sys/device_port.h>
+#include <sys/bus.h>
 #include <sys/module.h>
 
 #include <cam/scsi/scsi_low.h>
@@ -165,4 +79,3 @@ static moduledata_t scsi_low_moduledata 
 DECLARE_MODULE(scsi_low, scsi_low_moduledata, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
 MODULE_VERSION(scsi_low, 1);
 MODULE_DEPEND(scsi_low, cam, 1, 1, 1);
-#endif	/* __FreeBSD__ */

Modified: head/sys/cam/scsi/scsi_low_pisa.h
==============================================================================
--- head/sys/cam/scsi/scsi_low_pisa.h	Thu Sep  6 18:31:56 2012	(r240171)
+++ head/sys/cam/scsi/scsi_low_pisa.h	Thu Sep  6 18:53:33 2012	(r240172)
@@ -34,14 +34,7 @@
 #ifndef	_SCSI_LOW_PISA_H_
 #define	_SCSI_LOW_PISA_H_
 
-#ifdef	__NetBSD__
-int scsi_low_activate_pisa(pisa_device_handle_t);
-int scsi_low_deactivate_pisa(pisa_device_handle_t);
-int scsi_low_notify_pisa(pisa_device_handle_t, pisa_event_t);
-#endif	/* __NetBSD__ */
-
-#ifdef	__FreeBSD__
 int scsi_low_activate_pisa(struct scsi_low_softc *, int);
 int scsi_low_deactivate_pisa(struct scsi_low_softc *);
-#endif	/* __FreeBSD__ */
+
 #endif	/* !_SCSI_LOW_PISA_H_ */

Modified: head/sys/dev/ct/bshw_machdep.c
==============================================================================
--- head/sys/dev/ct/bshw_machdep.c	Thu Sep  6 18:31:56 2012	(r240171)
+++ head/sys/dev/ct/bshw_machdep.c	Thu Sep  6 18:53:33 2012	(r240172)
@@ -41,9 +41,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
-#if defined(__FreeBSD__) && __FreeBSD_version > 500001
 #include <sys/bio.h>

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209061853.q86IrX9J068367>