From owner-freebsd-current@FreeBSD.ORG Sun Nov 21 20:04:15 2004 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 C2EC216A4CE for ; Sun, 21 Nov 2004 20:04:15 +0000 (GMT) Received: from ms-smtp-04.nyroc.rr.com (ms-smtp-04.nyroc.rr.com [24.24.2.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3552E43D46 for ; Sun, 21 Nov 2004 20:04:15 +0000 (GMT) (envelope-from martines@rochester.rr.com) Received: from domain.crafts4life.com (roc-66-66-65-30.rochester.rr.com [66.66.65.30])iALK40OW001787; Sun, 21 Nov 2004 15:04:00 -0500 (EST) Received: from localhost.crafts4life.com (localhost [127.0.0.1]) by domain.crafts4life.com (Postfix) with ESMTP id 6518A3FC5; Sun, 21 Nov 2004 15:04:00 -0500 (EST) Received: from domain.crafts4life.com (localhost.crafts4life.com [127.0.0.1]) by localhost.crafts4life.com (AvMailGate-2.0.1.16) id 69662-5A2D7059; Sun, 21 Nov 2004 15:04:00 -0500 Received: from sauron.crafts4life.com (sauron.crafts4life.com [192.168.1.247]) by domain.crafts4life.com (Postfix) with ESMTP id E21393F9A; Sun, 21 Nov 2004 15:03:59 -0500 (EST) From: Eduard Martinescu To: =?ISO-8859-1?Q?S=F8ren?= Schmidt In-Reply-To: <41A0835B.9040404@DeepCore.dk> References: <20041119171236.DNZH20678.lakermmtao09.cox.net@smtp.east.cox.net> <41A0835B.9040404@DeepCore.dk> Content-Type: text/plain; charset=ISO-8859-1 Date: Sun, 21 Nov 2004 15:03:59 -0500 Message-Id: <1101067439.10224.3.camel@sauron.crafts4life.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 Content-Transfer-Encoding: quoted-printable X-AntiVirus: checked by AntiVir MailGate (version: 2.0.1.16; AVE: 6.28.0.18; VDF: 6.28.0.83; host: domain.crafts4life.com) X-Virus-Scanned: Symantec AntiVirus Scan Engine cc: m.kucenski@computer.org cc: freebsd-current@freebsd.org Subject: Re: ATAng support for reading from register on ATAREQUEST command? 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: Sun, 21 Nov 2004 20:04:16 -0000 Matt/S=F8ren, I did send S=F8ren a patch to implement an optional READ parameter to the IOCTL, but he decided instead to ALWAYS read back the registers on any ATA_R_CONTROL command. Smartmontools has been updated to take this into account, and the next stable version should be more accurate. Ed On Sun, 2004-11-21 at 13:00 +0100, S=F8ren Schmidt wrote: > Matt Kucenski wrote: > > I am trying to develop a program that will allow modifications to the= Host Protected Area settings and one of the commands (READ NATIVE MAX AD= DRESS) returns the native max address back in the register (LBA high, low= , mid). > >=20 > > I have been looking at the smartmontools project for pointers on how = to write this code and according to that source, this is not possible yet= with ATAng. There is a comment in their code that another command (ATA_= CMD_READ_REG) patch has been submitted to ATAng, but it does not appear t= o have made it into any of the latest sources. > >=20 > > Can anyone offer any information on this? >=20 > The following patch returns the register values in the request you sent= =20 > through ioctl call. That should do the trick without any new calls.. >=20 >=20 > Plain text document attachment (ata-smart-patch) > Index: ata-all.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v > retrieving revision 1.233 > diff -u -r1.233 ata-all.c > --- ata-all.c 19 Oct 2004 20:13:38 -0000 1.233 > +++ ata-all.c 19 Nov 2004 18:59:55 -0000 > @@ -546,10 +546,10 @@ > bcopy(iocmd->u.request.u.atapi.ccb, request->u.atapi.ccb, 16); > } > else { > - request->u.ata.command =3D iocmd->u.request.u.ata.command; > - request->u.ata.feature =3D iocmd->u.request.u.ata.feature; > - request->u.ata.lba =3D iocmd->u.request.u.ata.lba; > - request->u.ata.count =3D iocmd->u.request.u.ata.count; > + request->u.ata.command =3D iocmd->u.request.u.ata.command; > + request->u.ata.feature =3D iocmd->u.request.u.ata.feature; > + request->u.ata.lba =3D iocmd->u.request.u.ata.lba; > + request->u.ata.count =3D iocmd->u.request.u.ata.count; > } > =20 > request->timeout =3D iocmd->u.request.timeout; > @@ -566,6 +566,10 @@ > =20 > ata_queue_request(request); > =20 > + iocmd->u.request.u.ata.command =3D request->u.ata.command; > + iocmd->u.request.u.ata.feature =3D request->u.ata.feature; > + iocmd->u.request.u.ata.lba =3D request->u.ata.lba; > + iocmd->u.request.u.ata.count =3D request->u.ata.count; > if (request->result) > iocmd->u.request.error =3D request->result; > else { > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.o= rg" --=20 Eduard Martinescu