From owner-freebsd-current@FreeBSD.ORG Sat Sep 6 13:19:53 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D255416A4BF; Sat, 6 Sep 2003 13:19:53 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 713D444008; Sat, 6 Sep 2003 13:19:52 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id GAA05128; Sun, 7 Sep 2003 06:19:50 +1000 Date: Sun, 7 Sep 2003 06:19:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: sos@freebsd.org Message-ID: <20030907055225.V11733@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org Subject: fix for PIO mode detection in ATAng. etc. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2003 20:19:53 -0000 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