From owner-freebsd-current@FreeBSD.ORG Mon Nov 22 15:52:20 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 40FB616A4CE for ; Mon, 22 Nov 2004 15:52:20 +0000 (GMT) Received: from lakermmtao10.cox.net (lakermmtao10.cox.net [68.230.240.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F93043D2D for ; Mon, 22 Nov 2004 15:52:19 +0000 (GMT) (envelope-from mkucenski@cox.net) Received: from smtp.east.cox.net ([172.18.52.53]) by lakermmtao10.cox.net (InterMail vM.6.01.04.00 201-2131-117-20041022) with SMTP <20041122155219.FXMV13256.lakermmtao10.cox.net@smtp.east.cox.net>; Mon, 22 Nov 2004 10:52:19 -0500 X-Mailer: Openwave WebEngine, version 2.8.15 (webedge20-101-1103-20040528) From: Matt Kucenski To: =?ISO-8859-1?B?U/hyZW4=?= Schmidt Date: Mon, 22 Nov 2004 10:52:18 -0500 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=____1101138738449_jKBLwFxi+K" Message-Id: <20041122155219.FXMV13256.lakermmtao10.cox.net@smtp.east.cox.net> cc: freebsd-current@freebsd.org Subject: Re: Re: ATAng support for reading from register on ATAREQUEST command? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: m.kucenski@computer.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2004 15:52:20 -0000 This is a multi-part message in MIME format. ------=____1101138738449_jKBLwFxi+K Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Thanks, I was able to get those changes into my source and they work fine. Unfortunately, I overlooked the fact that Read Native Max Address returns part of the address in the Device register as well as the three lba registers. Evidently bits 27:24 of the native address come back in the bottom 4 bits of the device register. Is that register easily accessible somewhere? -Matt > > From: Søren Schmidt > Date: 2004/11/21 Sun AM 07:00:27 EST > To: m.kucenski@computer.org > CC: freebsd-current@freebsd.org > Subject: Re: ATAng support for reading from register on ATAREQUEST command? > > 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 ADDRESS) returns the native max address back in the register (LBA high, low, mid). > > > > 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 to have made it into any of the latest sources. > > > > Can anyone offer any information on this? > > The following patch returns the register values in the request you sent > through ioctl call. That should do the trick without any new calls.. > > > -- > > -Søren > > > ------=____1101138738449_jKBLwFxi+K Content-Type: text/plain; name="ata-smart-patch" 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 { ------=____1101138738449_jKBLwFxi+K--