[Midnightbsd-cvs] src [10062] trunk/sys/dev/stg: sync up ti and stg

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun May 27 19:01:16 EDT 2018


Revision: 10062
          http://svnweb.midnightbsd.org/src/?rev=10062
Author:   laffer1
Date:     2018-05-27 19:01:15 -0400 (Sun, 27 May 2018)
Log Message:
-----------
sync up ti and stg

Modified Paths:
--------------
    trunk/sys/dev/stg/tmc18c30.c
    trunk/sys/dev/stg/tmc18c30.h
    trunk/sys/dev/stg/tmc18c30_isa.c
    trunk/sys/dev/stg/tmc18c30_pccard.c
    trunk/sys/dev/stg/tmc18c30_pci.c
    trunk/sys/dev/stg/tmc18c30_subr.c
    trunk/sys/dev/stg/tmc18c30reg.h
    trunk/sys/dev/stg/tmc18c30var.h

Modified: trunk/sys/dev/stg/tmc18c30.c
===================================================================
--- trunk/sys/dev/stg/tmc18c30.c	2018-05-27 23:00:59 UTC (rev 10061)
+++ trunk/sys/dev/stg/tmc18c30.c	2018-05-27 23:01:15 UTC (rev 10062)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*	$NecBSD: tmc18c30.c,v 1.28.12.3 2001/06/19 04:35:48 honda Exp $	*/
 /*	$NetBSD$	*/
 
@@ -39,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/stg/tmc18c30.c 250460 2013-05-10 16:41:26Z eadler $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -50,35 +51,12 @@
 #include <sys/malloc.h>
 #include <sys/errno.h>
 
-#ifdef __NetBSD__
-#include <sys/device.h>
-#include <machine/bus.h>
-#include <machine/intr.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 <machine/dvcfg.h>
-#include <machine/physio_proc.h>
-
-#include <i386/Cbus/dev/scsi_low.h>
-#include <i386/Cbus/dev/tmc18c30reg.h>
-#include <i386/Cbus/dev/tmc18c30var.h>
-#endif /* __NetBSD__ */
-
-#ifdef __FreeBSD__
 #include <machine/cpu.h>
 #include <machine/bus.h>
 
-#include <compat/netbsd/dvcfg.h>
-#include <compat/netbsd/physio_proc.h>
-
 #include <cam/scsi/scsi_low.h>
 #include <dev/stg/tmc18c30reg.h>
 #include <dev/stg/tmc18c30var.h>
-#endif /* __FreeBSD__ */
 
 /***************************************************
  * USER SETTINGS
@@ -85,7 +63,7 @@
  ***************************************************/
 /* DEVICE CONFIGURATION FLAGS (MINOR)
  *
- * 0x01   DISCONECT OFF
+ * 0x01   DISCONNECT OFF
  * 0x02   PARITY LINE OFF
  * 0x04   IDENTIFY MSG OFF ( = single lun)
  * 0x08   SYNC TRANSFER OFF
@@ -299,7 +277,7 @@
 	sc->sc_busc |= BCTL_ATN;
 	sc->sc_busimg |= BCTL_ATN;
 	bus_space_write_1(sc->sc_iot, sc->sc_ioh, tmc_bctl, sc->sc_busimg);
-	SCSI_LOW_DELAY(10);
+	DELAY(10);
 }
 
 static void
@@ -312,7 +290,7 @@
 	bus_space_write_1(iot, ioh, tmc_ictl, 0);
 	bus_space_write_1(iot, ioh, tmc_fctl, 0);
 	stghw_bcr_write_1(sc, BCTL_RST);
-	SCSI_LOW_DELAY(100000);
+	DELAY(100000);
 	stghw_bcr_write_1(sc, BCTL_BUSFREE);
 }
 
@@ -369,7 +347,6 @@
 	scsi_low_bus_reset(slp);
 	stghw_init(sc);
 
-	SOFT_INTR_REQUIRED(slp);
 	return 0;
 }
 
@@ -444,17 +421,6 @@
 	return 0;
 }
 
-int
-stgprint(aux, name)
-	void *aux;
-	const char *name;
-{
-
-	if (name != NULL)
-		printf("%s: scsibus ", name);
-	return UNCONF;
-}
-
 void
 stgattachsubr(sc)
 	struct stg_softc *sc;
@@ -514,8 +480,8 @@
 				else
 				{
 					slp->sl_error |= PDMAERR;
-					printf("%s len %x >= datalen %x\n",
-						slp->sl_xname,
+					device_printf(slp->sl_dev,
+						"len %x >= datalen %x\n",
 						len, slp->sl_scp.scp_datalen);
 				}
 			}
@@ -525,8 +491,8 @@
 			if (len != 0)
 			{
 				slp->sl_error |= PDMAERR;
-				printf("%s: len %x left in fifo\n",
-					slp->sl_xname, len);
+				device_printf(slp->sl_dev,
+				    "len %x left in fifo\n", len);
 			}
 		}
 		scsi_low_data_finish(slp);
@@ -534,7 +500,7 @@
 	else
 	{
 
-		printf("%s data phase miss\n", slp->sl_xname);
+		device_printf(slp->sl_dev, "data phase miss\n");
 		slp->sl_error |= PDMAERR;
 	}
 
@@ -589,7 +555,7 @@
 					break;
 				if (sp->scp_datalen <= 0)
 					break;
-				SCSI_LOW_DELAY(1);
+				DELAY(1);
 				continue;
 			}
 		}
@@ -603,8 +569,8 @@
 			slp->sl_error |= PDMAERR;
 			if ((slp->sl_flags & HW_READ_PADDING) == 0)
 			{
-				printf("%s: read padding required\n",
-					slp->sl_xname);
+				device_printf(slp->sl_dev,
+				    "read padding required\n");
 				break;
 			}
 
@@ -632,7 +598,7 @@
 	}
 
 	if (tout <= 0)
-		printf("%s: pio read timeout\n", slp->sl_xname);
+		device_printf(slp->sl_dev, "pio read timeout\n");
 }
 
 static void
@@ -689,7 +655,7 @@
 			res = bus_space_read_2(iot, ioh, tmc_fdcnt);
 			if (res > sc->sc_maxwsize / 2)
 			{
-				SCSI_LOW_DELAY(1);
+				DELAY(1);
 				continue;
 			}
 		}
@@ -714,7 +680,7 @@
 	}
 
 	if (tout <= 0)
-		printf("%s: pio write timeout\n", slp->sl_xname);
+		device_printf(slp->sl_dev, "pio write timeout\n");
 }
 
 static int
@@ -734,10 +700,10 @@
 		if ((regv & mask) == 0)
 			return 1;
 
-		SCSI_LOW_DELAY(STG_DELAY_INTERVAL);
+		DELAY(STG_DELAY_INTERVAL);
 	}
 
-	printf("%s: %s stg_negate_signal timeout\n", slp->sl_xname, s);
+	device_printf(slp->sl_dev, "%s stg_negate_signal timeout\n", s);
 	return -1;
 }
 
@@ -761,10 +727,10 @@
 		if ((ph & mask) != 0)
 			return 1;
 
-		SCSI_LOW_DELAY(STG_DELAY_INTERVAL);
+		DELAY(STG_DELAY_INTERVAL);
 	}
 
-	printf("%s: stg_expect_signal timeout\n", slp->sl_xname);
+	device_printf(slp->sl_dev, "stg_expect_signal timeout\n");
 	return -1;
 }
 
@@ -839,7 +805,7 @@
 	}
 	else if (slp->sl_Tnexus != NULL)
 	{
-		printf("%s: unexpected termination\n", slp->sl_xname);
+		device_printf(slp->sl_dev, "unexpected termination\n");
 		stg_disconnected(sc, slp->sl_Tnexus);
 	}
 
@@ -855,15 +821,15 @@
 		if ((regv & (BSTAT_IO | BSTAT_SEL | BSTAT_BSY)) == 
 			    (BSTAT_IO | BSTAT_SEL))
 		{
-			SCSI_LOW_DELAY(1);
+			DELAY(1);
 			regv = bus_space_read_1(iot, ioh, tmc_bstat);
 			if ((regv & (BSTAT_IO | BSTAT_SEL | BSTAT_BSY)) == 
 				    (BSTAT_IO | BSTAT_SEL))
 				goto reselect_start;
 		}
-		SCSI_LOW_DELAY(1);
+		DELAY(1);
 	}
-	printf("%s: reselction timeout I\n", slp->sl_xname);
+	device_printf(slp->sl_dev, "reselction timeout I\n");
 	return EJUSTRETURN;
 	
 reselect_start:
@@ -884,9 +850,9 @@
 		regv = bus_space_read_1(iot, ioh, tmc_bstat);
 		if ((regv & (BSTAT_SEL | BSTAT_BSY)) == BSTAT_BSY)
 			goto reselected;
-		SCSI_LOW_DELAY(1);
+		DELAY(1);
 	}
-	printf("%s: reselction timeout II\n", slp->sl_xname);
+	device_printf(slp->sl_dev, "reselction timeout II\n");
 	return EJUSTRETURN;
 
 reselected:
@@ -981,10 +947,10 @@
 	{
 		if ((bus_space_read_1(iot, ioh, tmc_bstat) & BSTAT_BSY) == 0)
 		{
-			SCSI_LOW_DELAY(STGHW_SELECT_INTERVAL);
+			DELAY(STGHW_SELECT_INTERVAL);
 			continue;
 		}
-		SCSI_LOW_DELAY(1);
+		DELAY(1);
 		if ((bus_space_read_1(iot, ioh, tmc_bstat) & BSTAT_BSY) != 0)
 		{
 			return 0;
@@ -1016,7 +982,6 @@
 	bus_space_tag_t iot = sc->sc_iot;
 	bus_space_handle_t ioh = sc->sc_ioh;
 	struct targ_info *ti;
-	struct physio_proc *pp;
 	struct buf *bp;
 	u_int derror, flags;
 	int len, s;
@@ -1054,11 +1019,11 @@
 	if (stg_debug)
 	{
 		scsi_low_print(slp, NULL);
-		printf("%s: st %x ist %x\n\n", slp->sl_xname,
+		device_printf(slp->sl_dev, "st %x ist %x\n\n",
 		       status, astatus);
 #ifdef	KDB
 		if (stg_debug > 1)
-			SCSI_LOW_DEBUGGER("stg");
+			kdb_enter(KDB_WHY_CAM, "stg");
 #endif	/* KDB */
 	}
 #endif	/* STG_DEBUG */
@@ -1171,8 +1136,8 @@
 		stg_target_nexus_establish(sc);
 		if ((status & PHASE_MASK) != MESSAGE_IN_PHASE)
 		{
-			printf("%s: unexpected phase after reselect\n",
-			       slp->sl_xname);
+			device_printf(slp->sl_dev,
+			    "unexpected phase after reselect\n");
 			slp->sl_error |= FATALIO;
 			scsi_low_assert_msg(slp, ti, SCSI_LOW_MSG_ABORT, 1);
 			goto out;
@@ -1209,7 +1174,7 @@
 		if (stg_xfer(sc, slp->sl_scp.scp_cmd, slp->sl_scp.scp_cmdlen,
 			     COMMAND_PHASE, 0) != 0)
 		{
-			printf("%s: CMDOUT short\n", slp->sl_xname);
+			device_printf(slp->sl_dev, "CMDOUT short\n");
 		}
 		break;
 
@@ -1220,12 +1185,10 @@
 			scsi_low_attention(slp);
 		}
 
-		pp = physio_proc_enter(bp);
 		if ((sc->sc_icinit & ICTL_FIFO) != 0)
 			stg_pio_write(sc, ti, sc->sc_wthold);
 		else
 			stg_pio_write(sc, ti, 0);
-		physio_proc_leave(pp);
 		break;
 
 	case DATA_IN_PHASE:
@@ -1235,12 +1198,10 @@
 			scsi_low_attention(slp);
 		}
 
-		pp = physio_proc_enter(bp);
 		if ((sc->sc_icinit & ICTL_FIFO) != 0)
 			stg_pio_read(sc, ti, sc->sc_rthold);
 		else
 			stg_pio_read(sc, ti, 0);
-		physio_proc_leave(pp);
 		break;
 
 	case STATUS_PHASE:
@@ -1256,7 +1217,7 @@
 		}
 		if (regv != bus_space_read_1(iot, ioh, tmc_rdata))
 		{
-			printf("%s: STATIN: data mismatch\n", slp->sl_xname);
+			device_printf(slp->sl_dev, "STATIN: data mismatch\n");
 		}
 		stg_negate_signal(sc, BSTAT_ACK, "statin<ACK>");
 		break;
@@ -1278,7 +1239,7 @@
 		if (stg_xfer(sc, ti->ti_msgoutstr, len, MESSAGE_OUT_PHASE,
 			     slp->sl_clear_atten) != 0)
 		{
-			printf("%s: MSGOUT short\n", slp->sl_xname);
+			device_printf(slp->sl_dev, "MSGOUT short\n");
 		}
 		else
 		{
@@ -1310,7 +1271,7 @@
 		/* read data with ACK */
 		if (regv != bus_space_read_1(iot, ioh, tmc_rdata))
 		{
-			printf("%s: MSGIN: data mismatch\n", slp->sl_xname);
+			device_printf(slp->sl_dev, "MSGIN: data mismatch\n");
 		}
 
 		/* wait for the ack negated */
@@ -1323,14 +1284,14 @@
 		break;
 
 	case BUSFREE_PHASE:
-		printf("%s: unexpected disconnect\n", slp->sl_xname);
+		device_printf(slp->sl_dev, "unexpected disconnect\n");
 		stg_disconnected(sc, ti);
 		break;
 
 	default:
 		slp->sl_error |= FATALIO;
-		printf("%s: unknown phase bus %x intr %x\n",
-			slp->sl_xname, status, astatus);
+		device_printf(slp->sl_dev, "unknown phase bus %x intr %x\n",
+		    status, astatus);
 		break;
 	}
 
@@ -1358,7 +1319,7 @@
 		if (sc->sc_ubf_timeout ++ == 0)
 			return 0;
 
-		printf("%s: unexpected bus free detected\n", slp->sl_xname);
+		device_printf(slp->sl_dev, "unexpected bus free detected\n");
 		slp->sl_error |= FATALIO;
 		scsi_low_print(slp, slp->sl_Tnexus);
 		stg_disconnected(sc, slp->sl_Tnexus);
@@ -1380,8 +1341,7 @@
 	        slp->sl_error |= PDMAERR;
 		if ((slp->sl_flags & HW_WRITE_PADDING) == 0)
 		{
-			printf("%s: write padding required\n",
-				slp->sl_xname);
+			device_printf(slp->sl_dev, "write padding required\n");
 			break;
 		}	
 
@@ -1396,7 +1356,7 @@
 
 			if (bus_space_read_2(iot, ioh, tmc_fdcnt) != 0)
 			{
-				SCSI_LOW_DELAY(1);
+				DELAY(1);
 				continue;
 			}
 

Modified: trunk/sys/dev/stg/tmc18c30.h
===================================================================
--- trunk/sys/dev/stg/tmc18c30.h	2018-05-27 23:00:59 UTC (rev 10061)
+++ trunk/sys/dev/stg/tmc18c30.h	2018-05-27 23:01:15 UTC (rev 10062)
@@ -1,5 +1,6 @@
+/* $MidnightBSD$ */
 /*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/dev/stg/tmc18c30.h 194023 2009-06-11 17:14:28Z avg $
  */
 
 extern devclass_t stg_devclass;

Modified: trunk/sys/dev/stg/tmc18c30_isa.c
===================================================================
--- trunk/sys/dev/stg/tmc18c30_isa.c	2018-05-27 23:00:59 UTC (rev 10061)
+++ trunk/sys/dev/stg/tmc18c30_isa.c	2018-05-27 23:01:15 UTC (rev 10062)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*	$NecBSD: tmc18c30_pisa.c,v 1.22 1998/11/26 01:59:21 honda Exp $	*/
 /*	$NetBSD$	*/
 
@@ -39,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/stg/tmc18c30_isa.c 240325 2012-09-10 18:49:49Z jhb $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -54,7 +55,6 @@
 #include <sys/rman.h>
 
 #include <cam/scsi/scsi_low.h>
-#include <cam/scsi/scsi_low_pisa.h>
 
 #include <dev/stg/tmc18c30reg.h>
 #include <dev/stg/tmc18c30var.h>

Modified: trunk/sys/dev/stg/tmc18c30_pccard.c
===================================================================
--- trunk/sys/dev/stg/tmc18c30_pccard.c	2018-05-27 23:00:59 UTC (rev 10061)
+++ trunk/sys/dev/stg/tmc18c30_pccard.c	2018-05-27 23:01:15 UTC (rev 10062)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*	$NecBSD: tmc18c30_pisa.c,v 1.22 1998/11/26 01:59:21 honda Exp $	*/
 /*	$NetBSD$	*/
 
@@ -39,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/stg/tmc18c30_pccard.c 240325 2012-09-10 18:49:49Z jhb $");
 
 #include <sys/param.h>
 #include <sys/errno.h>
@@ -49,14 +50,12 @@
 #include <sys/systm.h>
 
 #include <machine/bus.h>
-#include <compat/netbsd/dvcfg.h>
 
-#include <sys/device_port.h>
+#include <sys/bus.h>
 
 #include <dev/pccard/pccardvar.h>
 
 #include <cam/scsi/scsi_low.h>
-#include <cam/scsi/scsi_low_pisa.h>
 
 #include <dev/stg/tmc18c30reg.h>
 #include <dev/stg/tmc18c30var.h>

Modified: trunk/sys/dev/stg/tmc18c30_pci.c
===================================================================
--- trunk/sys/dev/stg/tmc18c30_pci.c	2018-05-27 23:00:59 UTC (rev 10061)
+++ trunk/sys/dev/stg/tmc18c30_pci.c	2018-05-27 23:01:15 UTC (rev 10062)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  *	Copyright (c) 2003 Bob Bishop
  *      All rights reserved.
@@ -38,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/stg/tmc18c30_pci.c 240325 2012-09-10 18:49:49Z jhb $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -56,7 +57,6 @@
 #include <dev/pci/pcivar.h>
 
 #include <cam/scsi/scsi_low.h>
-#include <cam/scsi/scsi_low_pisa.h>
 
 #include <dev/stg/tmc18c30reg.h>
 #include <dev/stg/tmc18c30var.h>

Modified: trunk/sys/dev/stg/tmc18c30_subr.c
===================================================================
--- trunk/sys/dev/stg/tmc18c30_subr.c	2018-05-27 23:00:59 UTC (rev 10061)
+++ trunk/sys/dev/stg/tmc18c30_subr.c	2018-05-27 23:01:15 UTC (rev 10062)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * [Ported for FreeBSD]
  *  Copyright (c) 2000
@@ -37,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/stg/tmc18c30_subr.c 240325 2012-09-10 18:49:49Z jhb $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -52,7 +53,6 @@
 #include <sys/rman.h> 
 
 #include <cam/scsi/scsi_low.h>
-#include <cam/scsi/scsi_low_pisa.h>
 
 #include <dev/stg/tmc18c30reg.h>
 #include <dev/stg/tmc18c30var.h>

Modified: trunk/sys/dev/stg/tmc18c30reg.h
===================================================================
--- trunk/sys/dev/stg/tmc18c30reg.h	2018-05-27 23:00:59 UTC (rev 10061)
+++ trunk/sys/dev/stg/tmc18c30reg.h	2018-05-27 23:01:15 UTC (rev 10062)
@@ -1,4 +1,5 @@
-/*	$MidnightBSD$	*/
+/* $MidnightBSD$ */
+/*	$FreeBSD: stable/10/sys/dev/stg/tmc18c30reg.h 139749 2005-01-06 01:43:34Z imp $	*/
 /*	$NecBSD: tmc18c30reg.h,v 1.4.24.1 2001/06/08 06:27:50 honda Exp $	*/
 /*	$NetBSD$	*/
 

Modified: trunk/sys/dev/stg/tmc18c30var.h
===================================================================
--- trunk/sys/dev/stg/tmc18c30var.h	2018-05-27 23:00:59 UTC (rev 10061)
+++ trunk/sys/dev/stg/tmc18c30var.h	2018-05-27 23:01:15 UTC (rev 10062)
@@ -1,4 +1,5 @@
-/*	$MidnightBSD$	*/
+/* $MidnightBSD$ */
+/*	$FreeBSD: stable/10/sys/dev/stg/tmc18c30var.h 240325 2012-09-10 18:49:49Z jhb $	*/
 /*	$NecBSD: tmc18c30var.h,v 1.12.18.2 2001/06/13 05:51:23 honda Exp $	*/
 /*	$NetBSD$	*/
 
@@ -44,19 +45,10 @@
 struct stg_softc {
 	struct scsi_low_softc sc_sclow;	/* generic data */
 
-#ifdef	__NetBSD__
 	bus_space_tag_t sc_iot;
 	bus_space_tag_t sc_memt;
 	bus_space_handle_t sc_ioh;
 
-	void *sc_ih;
-#endif	/* __NetBSD__ */
-
-#ifdef	__FreeBSD__
-	bus_space_tag_t sc_iot;
-	bus_space_tag_t sc_memt;
-	bus_space_handle_t sc_ioh;
-
 	int port_rid;
 	int irq_rid;
 	int mem_rid;
@@ -65,7 +57,6 @@
 	struct resource *mem_res;
 
 	void *stg_intrhand;
-#endif	/* __FreeBSD__ */
 
 	int sc_tmaxcnt;
 	u_int sc_chip;			/* chip type */
@@ -100,12 +91,6 @@
  *****************************************************************/
 int stgprobesubr(bus_space_tag_t, bus_space_handle_t, u_int);
 void stgattachsubr(struct stg_softc *);
-int stgprint(void *, const char *);
 int stgintr(void *);
 
-#if	defined(__i386__) && 0
-#define	SOFT_INTR_REQUIRED(slp)	(softintr((slp)->sl_irq))
-#else	/* !__i386__ */
-#define	SOFT_INTR_REQUIRED(slp)
-#endif	/* !__i386__ */
 #endif	/* !_TMC18C30VAR_H_ */



More information about the Midnightbsd-cvs mailing list