Date: Sun, 7 Sep 2003 06:19:49 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: sos@freebsd.org Cc: current@freebsd.org Subject: fix for PIO mode detection in ATAng. etc. Message-ID: <20030907055225.V11733@delplex.bde.org>
next in thread | raw e-mail | index | archive | help
Endianness-related cleanups in ATAng broke detection of the PIO mode capabilty
of old drives by getting the bytes in the retired_piomode word backwards.
%%%
Index: ata-all.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v
retrieving revision 1.188
diff -u -2 -r1.188 ata-all.c
--- ata-all.c 1 Sep 2003 11:13:21 -0000 1.188
+++ ata-all.c 6 Sep 2003 19:51:40 -0000
@@ -833,7 +839,9 @@
return ATA_PIO3;
}
- if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 2)
+#undef ATA_RETIRED_PIO_MASK /* is 0x0003 in ata.h, but bits are in msb */
+#define ATA_RETIRED_PIO_MASK 0x0300
+ if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x0200)
return ATA_PIO2;
- if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 1)
+ if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x0100)
return ATA_PIO1;
if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0)
%%%
Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030907055225.V11733>
