Date: Mon, 15 Feb 2010 23:13:37 +0100 From: Alex Samorukov <ml@os2.kiev.ua> To: freebsd-arch@freebsd.org Cc: Alexander Motin <mav@FreeBSD.org> Subject: changes to the IOCATAREQUEST request Message-ID: <4B79C711.3060907@os2.kiev.ua>
next in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B79C711.3060907>