From owner-freebsd-current@FreeBSD.ORG Sun Nov 21 12:00:40 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 087D016A4CE for ; Sun, 21 Nov 2004 12:00:40 +0000 (GMT) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30CBA43D31 for ; Sun, 21 Nov 2004 12:00:39 +0000 (GMT) (envelope-from sos@DeepCore.dk) Received: from [194.192.25.143] (laptop.deepcore.dk [194.192.25.143]) by spider.deepcore.dk (8.12.11/8.12.10) with ESMTP id iALC0UEn045442; Sun, 21 Nov 2004 13:00:33 +0100 (CET) (envelope-from sos@DeepCore.dk) Message-ID: <41A0835B.9040404@DeepCore.dk> Date: Sun, 21 Nov 2004 13:00:27 +0100 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= User-Agent: Mozilla Thunderbird 0.7.2 (X11/20040802) X-Accept-Language: en-us, en MIME-Version: 1.0 To: m.kucenski@computer.org References: <20041119171236.DNZH20678.lakermmtao09.cox.net@smtp.east.cox.net> In-Reply-To: <20041119171236.DNZH20678.lakermmtao09.cox.net@smtp.east.cox.net> Content-Type: multipart/mixed; boundary="------------060904080909000102080101" X-mail-scanned: by DeepCore Virus & Spam killer v1.4 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 12:00:40 -0000 This is a multi-part message in MIME format. --------------060904080909000102080101 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Matt Kucenski wrote: > I am trying to develop a program that will allow modifications to the H= ost Protected Area settings and one of the commands (READ NATIVE MAX ADDR= ESS) 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 w= ith ATAng. There is a comment in their code that another command (ATA_CM= D_READ_REG) patch has been submitted to ATAng, but it does not appear to = have made it into any of the latest sources. >=20 > Can anyone offer any information on this? 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 -S=F8ren --------------060904080909000102080101 Content-Type: text/plain; name="ata-smart-patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ata-smart-patch" Index: ata-all.c =================================================================== 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 = iocmd->u.request.u.ata.command; - request->u.ata.feature = iocmd->u.request.u.ata.feature; - request->u.ata.lba = iocmd->u.request.u.ata.lba; - request->u.ata.count = iocmd->u.request.u.ata.count; + request->u.ata.command = iocmd->u.request.u.ata.command; + request->u.ata.feature = iocmd->u.request.u.ata.feature; + request->u.ata.lba = iocmd->u.request.u.ata.lba; + request->u.ata.count = iocmd->u.request.u.ata.count; } request->timeout = iocmd->u.request.timeout; @@ -566,6 +566,10 @@ ata_queue_request(request); + iocmd->u.request.u.ata.command = request->u.ata.command; + iocmd->u.request.u.ata.feature = request->u.ata.feature; + iocmd->u.request.u.ata.lba = request->u.ata.lba; + iocmd->u.request.u.ata.count = request->u.ata.count; if (request->result) iocmd->u.request.error = request->result; else { --------------060904080909000102080101--