Module Name: src
Committed By: jakllsch
Date: Sun Jun 21 14:15:38 UTC 2009
Modified Files:
src/sys/dev/ic: siisata.c
Log Message:
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.4 -r1.5 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.4 src/sys/dev/ic/siisata.c:1.5
--- src/sys/dev/ic/siisata.c:1.4 Wed Jun 17 19:12:48 2009
+++ src/sys/dev/ic/siisata.c Sun Jun 21 14:15:38 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.4 2009/06/17 19:12:48 cegger Exp $ */
+/* $NetBSD: siisata.c,v 1.5 2009/06/21 14:15:38 jakllsch 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);