From owner-freebsd-arch@FreeBSD.ORG Mon Feb 15 22:44:57 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73B731065697 for ; Mon, 15 Feb 2010 22:44:57 +0000 (UTC) (envelope-from ml@os2.kiev.ua) Received: from s1.sdv.com.ua (s1.sdv.com.ua [77.120.97.61]) by mx1.freebsd.org (Postfix) with ESMTP id 1EEE58FC20 for ; Mon, 15 Feb 2010 22:44:56 +0000 (UTC) Received: from 241-101-243-80.cust.centrio.cz ([80.243.101.241] helo=[192.168.100.104]) by s1.sdv.com.ua with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1Nh9CD-000OSF-6d; Tue, 16 Feb 2010 00:13:39 +0200 Message-ID: <4B79C711.3060907@os2.kiev.ua> Date: Mon, 15 Feb 2010 23:13:37 +0100 From: Alex Samorukov User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: freebsd-arch@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.0 (---) X-Spam-Report: Spam detection software, running on the system "s1.sdv.com.ua", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Hi, I am working on FreeBSD support for smartmontools project. Current (SVN) version uses 48bit ATA command READ LOG EXT to query some drive information. I found that it is not possible to send this command to the ATA device using IOCATAREQUEST in FreeBSD. [...] Content analysis details: (-3.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP 1.9 TVD_RCVD_IP TVD_RCVD_IP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] -0.5 AWL AWL: From: address is in the auto white-list Cc: Alexander Motin Subject: changes to the IOCATAREQUEST request X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alex Samorukov List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 22:44:57 -0000 Hi, I am working on FreeBSD support for smartmontools project. Current (SVN) version uses 48bit ATA command READ LOG EXT to query some drive information. I found that it is not possible to send this command to the ATA device using IOCATAREQUEST in FreeBSD. As far as I understand sys/dev/ata/ata-all.c, the IOCATAREQUEST has no support to set the internal ATA_D_48BIT_ACTIVE flag. This flag is set later by ata_modify_if_48bit() function for some common commands (READ, WRITE, ...) only, it is not set for READ_LOG_EXT. It is not possible to set 48bit flag with current ioctl. The following additions are required for a reasonable pass-through ioctl: sys/ata.h: struct ata_ioc_request { ... int count; int flags; #define ATA_CMD_CONTROL 0x01 #define ATA_CMD_READ 0x02 #define ATA_CMD_WRITE 0x04 #define ATA_CMD_ATAPI 0x08 +#define ATA_CMD_48BIT 0x10 // 48-bit command +#define ATA_CMD_NO_MULTIPLE 0x20 // one DRQ/sector int timeout; int error; }; Here a list of 48-bit commands (provided by Christian Franke from latest ACS 2 draft (T13/2015-D Revision 2). The FreeBSD function ata_modify_if_48bit() selects commands marked with *** if their 28-bit variants are requested and 48 bit addressing is actually required. Only in this case ATA_D_48BIT_ACTIVE is set. The other commands are not supported, I presume. mandatory, 28-bit variants exist: FLUSH CACHE EXT *** READ DMA EXT *** READ MULTIPLE EXT *** READ SECTOR(S) EXT *** READ VERIFY SECTOR(S) EXT *** WRITE DMA EXT *** WRITE DMA FUA EXT WRITE MULTIPLE EXT *** WRITE MULTIPLE FUA EXT WRITE SECTOR(S) EXT *** optional, 28-bit variants exist: READ NATIVE MAX ADDRESS EXT *** SET MAX ADDRESS EXT *** WRITE UNCORRECTABLE EXT optional, 48-bit only: CONFIGURE STREAM DATA SET MANAGEMENT READ FPDMA QUEUED READ LOG DMA EXT READ LOG EXT READ STREAM DMA EXT READ STREAM EXT REQUEST SENSE DATA EXT WRITE FPDMA QUEUED WRITE LOG DMA EXT WRITE LOG EXT WRITE STREAM DMA EXT WRITE STREAM EXT NV Cache (7 subcommands, possible vendor specific commands) Sanitize Device (5 subcommands) There might also be 48-bit commands not defined by ATA ACS in the command ranges reserved for other standards (Compact Flash, SATA, Media Card, Vendor specific). Please, tell me if it is possible to extend this ioctl to support 48bit commands, or if there is another solution for this.