ata.h (156325) | ata.h (157329) |
---|---|
1/*- 2 * Copyright (c) 2000 - 2006 S�ren Schmidt <sos@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2000 - 2006 S�ren Schmidt <sos@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/sys/ata.h 156325 2006-03-05 21:32:38Z sos $ | 26 * $FreeBSD: head/sys/sys/ata.h 157329 2006-03-31 08:09:05Z sos $ |
27 */ 28 29#ifndef _SYS_ATA_H_ 30#define _SYS_ATA_H_ 31 32#include <sys/ioccom.h> 33 34/* ATA/ATAPI device parameters */ --- 309 unchanged lines hidden (view full) --- 344 345/* pr channel ATA ioctl calls */ 346#define IOCATAGMAXCHANNEL _IOR('a', 1, int) 347#define IOCATAREINIT _IOW('a', 2, int) 348#define IOCATAATTACH _IOW('a', 3, int) 349#define IOCATADETACH _IOW('a', 4, int) 350#define IOCATADEVICES _IOWR('a', 5, struct ata_ioc_devices) 351 | 27 */ 28 29#ifndef _SYS_ATA_H_ 30#define _SYS_ATA_H_ 31 32#include <sys/ioccom.h> 33 34/* ATA/ATAPI device parameters */ --- 309 unchanged lines hidden (view full) --- 344 345/* pr channel ATA ioctl calls */ 346#define IOCATAGMAXCHANNEL _IOR('a', 1, int) 347#define IOCATAREINIT _IOW('a', 2, int) 348#define IOCATAATTACH _IOW('a', 3, int) 349#define IOCATADETACH _IOW('a', 4, int) 350#define IOCATADEVICES _IOWR('a', 5, struct ata_ioc_devices) 351 |
352/* ATAPI request sense structure */ 353struct atapi_sense { 354 u_int8_t error; /* current or deferred errors */ 355#define ATA_SENSE_VALID 0x80 356 357 u_int8_t segment; /* segment number */ 358 u_int8_t key; /* sense key */ 359#define ATA_SENSE_KEY_MASK 0x0f /* sense key mask */ 360#define ATA_SENSE_NO_SENSE 0x00 /* no specific sense key info */ 361#define ATA_SENSE_RECOVERED_ERROR 0x01 /* command OK, data recovered */ 362#define ATA_SENSE_NOT_READY 0x02 /* no access to drive */ 363#define ATA_SENSE_MEDIUM_ERROR 0x03 /* non-recovered data error */ 364#define ATA_SENSE_HARDWARE_ERROR 0x04 /* non-recoverable HW failure */ 365#define ATA_SENSE_ILLEGAL_REQUEST 0x05 /* invalid command param(s) */ 366#define ATA_SENSE_UNIT_ATTENTION 0x06 /* media changed */ 367#define ATA_SENSE_DATA_PROTECT 0x07 /* write protect */ 368#define ATA_SENSE_BLANK_CHECK 0x08 /* blank check */ 369#define ATA_SENSE_VENDOR_SPECIFIC 0x09 /* vendor specific skey */ 370#define ATA_SENSE_COPY_ABORTED 0x0a /* copy aborted */ 371#define ATA_SENSE_ABORTED_COMMAND 0x0b /* command aborted, try again */ 372#define ATA_SENSE_EQUAL 0x0c /* equal */ 373#define ATA_SENSE_VOLUME_OVERFLOW 0x0d /* volume overflow */ 374#define ATA_SENSE_MISCOMPARE 0x0e /* data dont match the medium */ 375#define ATA_SENSE_RESERVED 0x0f 376#define ATA_SENSE_ILI 0x20; 377#define ATA_SENSE_EOM 0x40; 378#define ATA_SENSE_FILEMARK 0x80; 379 380 u_int32_t cmd_info; /* cmd information */ 381 u_int8_t sense_length; /* additional sense len (n-7) */ 382 u_int32_t cmd_specific_info; /* additional cmd spec info */ 383 u_int8_t asc; /* additional sense code */ 384 u_int8_t ascq; /* additional sense code qual */ 385 u_int8_t replaceable_unit_code; /* replaceable unit code */ 386 u_int8_t specific; /* sense key specific */ 387#define ATA_SENSE_SPEC_VALID 0x80 388#define ATA_SENSE_SPEC_MASK 0x7f 389 390 u_int8_t specific1; /* sense key specific */ 391 u_int8_t specific2; /* sense key specific */ 392} __packed; 393 |
|
352struct ata_ioc_request { 353 union { 354 struct { 355 u_int8_t command; 356 u_int8_t feature; 357 u_int64_t lba; 358 u_int16_t count; 359 } ata; 360 struct { 361 char ccb[16]; | 394struct ata_ioc_request { 395 union { 396 struct { 397 u_int8_t command; 398 u_int8_t feature; 399 u_int64_t lba; 400 u_int16_t count; 401 } ata; 402 struct { 403 char ccb[16]; |
404 struct atapi_sense sense; |
|
362 } atapi; 363 } u; 364 caddr_t data; 365 int count; 366 int flags; 367#define ATA_CMD_CONTROL 0x01 368#define ATA_CMD_READ 0x02 369#define ATA_CMD_WRITE 0x04 --- 44 unchanged lines hidden --- | 405 } atapi; 406 } u; 407 caddr_t data; 408 int count; 409 int flags; 410#define ATA_CMD_CONTROL 0x01 411#define ATA_CMD_READ 0x02 412#define ATA_CMD_WRITE 0x04 --- 44 unchanged lines hidden --- |