Date: Fri, 19 Feb 2010 18:54:57 +0200 From: Alexander Motin <mav@FreeBSD.org> To: Alex Samorukov <samm@os2.kiev.ua> Cc: freebsd-arch@freebsd.org Subject: Re: changes to the IOCATAREQUEST request Message-ID: <4B7EC261.5000103@FreeBSD.org> In-Reply-To: <4B79C711.3060907@os2.kiev.ua> References: <4B79C711.3060907@os2.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------010506020101090202080601 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi. Alex Samorukov wrote: > 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; > }; The only who really knows command format and meaning are the application and the device. SCSI is more standardized there, but ATA isn't. I think submitting flags from user-level is the only way. I did the same in CAM ATA. > 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. Alike approach with hardware command decoding is used in SiliconImage SATA controllers. Adding new DSM commands in ACS-2 broke them, requiring right protocol to be specifically enforced for that commands. So compiling this into stack is probably a bad idea also. Small attached patch should handle the issue. PS: Not very understand what do you mean by ATA_CMD_NO_MULTIPLE. -- Alexander Motin --------------010506020101090202080601 Content-Type: text/plain; name="ata.flags.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="ata.flags.patch" KysrIHN5cy9hdGEuaC5wcmV2CTIwMTAtMDItMDMgMTI6MjA6MzYuMDAwMDAwMDAwICswMjAw Ci0tLSBzeXMvYXRhL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BBVEFfUl80OEJJVDsKIAlhdGFfcXVldWVfcmVxdWVz dChyZXF1ZXN0KTsKIAlpZiAocmVxdWVzdC0+ZmxhZ3MgJiBBVEFfUl9BVEFQSSkgewogCSAg ICBiY29weSgmcmVxdWVzdC0+dS5hdGFwaS5zZW5zZSwgJmlvY19yZXF1ZXN0LT51LmF0YXBp LnNlbnNlLAo= --------------010506020101090202080601--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B7EC261.5000103>