Module Name:    src
Committed By:   snj
Date:           Mon Sep 28 00:19:37 UTC 2009

Modified Files:
        src/sys/dev/ic [netbsd-5]: siisata.c

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1023):
        sys/dev/ic/siisata.c: revision 1.5
Use PRO_PS and PRO_PCS correctly.
>From Wolfgang Stukenbrock as part of kern/41579.
While here, remove a line of whitespace, and add an else case to
the ATAPI command length toggle.


To generate a diff of this commit:
cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/sys/dev/ic/siisata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.2.4.2 src/sys/dev/ic/siisata.c:1.2.4.3
--- src/sys/dev/ic/siisata.c:1.2.4.2	Mon Sep 28 00:18:39 2009
+++ src/sys/dev/ic/siisata.c	Mon Sep 28 00:19:37 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.2.4.2 2009/09/28 00:18:39 snj Exp $ */
+/* $NetBSD: siisata.c,v 1.2.4.3 2009/09/28 00:19:37 snj Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -524,7 +524,7 @@
 	wait = wait ? wait : 1;
 
 	/* wait for ready */
-	while (!(PRREAD(sc, PRX(chp->ch_channel, PRO_PCS)) & PR_PS_PORT_READY))
+	while (!(PRREAD(sc, PRX(chp->ch_channel, PRO_PS)) & PR_PS_PORT_READY))
 		DELAY(10);
 
 	prb = schp->sch_prb[slot];
@@ -593,7 +593,7 @@
 		/* XXX and then ? */
 	}
 	/* wait for ready */
-	while (!(PRREAD(sc, PRX(chp->ch_channel, PRO_PCS)) & PR_PS_PORT_READY))
+	while (!(PRREAD(sc, PRX(chp->ch_channel, PRO_PS)) & PR_PS_PORT_READY))
 		DELAY(10);
 	PRWRITE(sc, PRX(chp->ch_channel, PRO_SERROR),
 	    PRREAD(sc, PRX(chp->ch_channel, PRO_SERROR)));
@@ -656,7 +656,7 @@
 		schp->sch_sstatus)) {
 	case SStatus_DET_DEV:
 		/* wait for ready */
-		while (!(PRREAD(sc, PRX(chp->ch_channel, PRO_PCS))
+		while (!(PRREAD(sc, PRX(chp->ch_channel, PRO_PS))
 		    & PR_PS_PORT_READY))
 			DELAY(10);
 
@@ -890,7 +890,6 @@
 	else
 		callout_stop(&chp->ch_callout);
 
-
 	if (chp->ch_drive[xfer->c_drive].drive_flags & DRIVE_WAITDRAIN) {
 		siisata_cmd_kill_xfer(chp, xfer, KILL_GONE);
 		chp->ch_drive[xfer->c_drive].drive_flags &= ~DRIVE_WAITDRAIN;
@@ -1254,9 +1253,8 @@
 {
 	struct siisata_softc *sc = (struct siisata_softc *)chp->ch_atac;
 
-	PRWRITE(sc, PRX(chp->ch_channel, PRO_PCS),
-	    PRREAD(sc, PRX(chp->ch_channel, PRO_PCS)) | PR_PC_PORT_INITIALIZE);
-	while (!(PRREAD(sc, PRX(chp->ch_channel, PRO_PCS)) & PR_PS_PORT_READY))
+	PRWRITE(sc, PRX(chp->ch_channel, PRO_PCS), PR_PC_PORT_INITIALIZE);
+	while (!(PRREAD(sc, PRX(chp->ch_channel, PRO_PS)) & PR_PS_PORT_READY))
 		DELAY(10);
 }
 
@@ -1265,9 +1263,8 @@
 {
 	struct siisata_softc *sc = (struct siisata_softc *)chp->ch_atac;
 
-	PRWRITE(sc, PRX(chp->ch_channel, PRO_PCS),
-	    PRREAD(sc, PRX(chp->ch_channel, PRO_PCS)) | PR_PC_DEVICE_RESET);
-	while (!(PRREAD(sc, PRX(chp->ch_channel, PRO_PCS)) & PR_PS_PORT_READY))
+	PRWRITE(sc, PRX(chp->ch_channel, PRO_PCS), PR_PC_DEVICE_RESET);
+	while (!(PRREAD(sc, PRX(chp->ch_channel, PRO_PS)) & PR_PS_PORT_READY))
 		DELAY(10);
 }
 
@@ -1441,9 +1438,12 @@
 		
 			/* configure port for packet length */
 			PRWRITE(siic, PRX(chp->ch_channel, PRO_PCS),
-			    PRREAD(siic, PRX(chp->ch_channel, PRO_PCS)) |
+			    PR_PC_PACKET_LENGTH);
+		} else {
+			PRWRITE(siic, PRX(chp->ch_channel, PRO_PCC),
 			    PR_PC_PACKET_LENGTH);
 		}
+
 		/* XXX This is gross. */
 		periph->periph_cap |= (id->atap_config & ATAPI_CFG_DRQ_MASK);
 

Reply via email to