Deleted Added
full compact
ata.h (238393) ata.h (249115)
1/*-
2 * Copyright (c) 2000 - 2008 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 - 2008 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 238393 2012-07-12 10:09:34Z brueffer $
26 * $FreeBSD: head/sys/sys/ata.h 249115 2013-04-04 23:19:51Z smh $
27 */
28
29#ifndef _SYS_ATA_H_
30#define _SYS_ATA_H_
31
32#include <sys/ioccom.h>
33
34/* ATA/ATAPI device parameters */

--- 149 unchanged lines hidden (view full) ---

184#define ATA_SUPPORT_GENLOG 0x0020
185#define ATA_SUPPORT_WRITEDMAFUAEXT 0x0040
186#define ATA_SUPPORT_WRITEDMAQFUAEXT 0x0080
187#define ATA_SUPPORT_64BITWWN 0x0100
188#define ATA_SUPPORT_UNLOAD 0x2000
189 } __packed support, enabled;
190
191/*088*/ u_int16_t udmamodes; /* UltraDMA modes */
27 */
28
29#ifndef _SYS_ATA_H_
30#define _SYS_ATA_H_
31
32#include <sys/ioccom.h>
33
34/* ATA/ATAPI device parameters */

--- 149 unchanged lines hidden (view full) ---

184#define ATA_SUPPORT_GENLOG 0x0020
185#define ATA_SUPPORT_WRITEDMAFUAEXT 0x0040
186#define ATA_SUPPORT_WRITEDMAQFUAEXT 0x0080
187#define ATA_SUPPORT_64BITWWN 0x0100
188#define ATA_SUPPORT_UNLOAD 0x2000
189 } __packed support, enabled;
190
191/*088*/ u_int16_t udmamodes; /* UltraDMA modes */
192/*089*/ u_int16_t erase_time;
193/*090*/ u_int16_t enhanced_erase_time;
192/*089*/ u_int16_t erase_time; /* time req'd in 2min units */
193/*090*/ u_int16_t enhanced_erase_time; /* time req'd in 2min units */
194/*091*/ u_int16_t apm_value;
194/*091*/ u_int16_t apm_value;
195/*092*/ u_int16_t master_passwd_revision;
195/*092*/ u_int16_t master_passwd_revision; /* password revision code */
196/*093*/ u_int16_t hwres;
197#define ATA_CABLE_ID 0x2000
198
199/*094*/ u_int16_t acoustic;
200#define ATA_ACOUSTIC_CURRENT(x) ((x) & 0x00ff)
201#define ATA_ACOUSTIC_VENDOR(x) (((x) & 0xff00) >> 8)
202
203/*095*/ u_int16_t stream_min_req_size;

--- 20 unchanged lines hidden (view full) ---

224#define ATA_SUPPORT_WRITEUNCORREXT 0x0004
225#define ATA_SUPPORT_RWLOGDMAEXT 0x0008
226#define ATA_SUPPORT_MICROCODE3 0x0010
227#define ATA_SUPPORT_FREEFALL 0x0020
228/*120*/ u_int16_t enabled2;
229 u_int16_t reserved121[6];
230/*127*/ u_int16_t removable_status;
231/*128*/ u_int16_t security_status;
196/*093*/ u_int16_t hwres;
197#define ATA_CABLE_ID 0x2000
198
199/*094*/ u_int16_t acoustic;
200#define ATA_ACOUSTIC_CURRENT(x) ((x) & 0x00ff)
201#define ATA_ACOUSTIC_VENDOR(x) (((x) & 0xff00) >> 8)
202
203/*095*/ u_int16_t stream_min_req_size;

--- 20 unchanged lines hidden (view full) ---

224#define ATA_SUPPORT_WRITEUNCORREXT 0x0004
225#define ATA_SUPPORT_RWLOGDMAEXT 0x0008
226#define ATA_SUPPORT_MICROCODE3 0x0010
227#define ATA_SUPPORT_FREEFALL 0x0020
228/*120*/ u_int16_t enabled2;
229 u_int16_t reserved121[6];
230/*127*/ u_int16_t removable_status;
231/*128*/ u_int16_t security_status;
232#define ATA_SECURITY_LEVEL 0x0100 /* 0: high, 1: maximum */
233#define ATA_SECURITY_ENH_SUPP 0x0020 /* enhanced erase supported */
234#define ATA_SECURITY_COUNT_EXP 0x0010 /* count expired */
235#define ATA_SECURITY_FROZEN 0x0008 /* security config is frozen */
236#define ATA_SECURITY_LOCKED 0x0004 /* drive is locked */
237#define ATA_SECURITY_ENABLED 0x0002 /* ATA Security is enabled */
238#define ATA_SECURITY_SUPPORTED 0x0001 /* ATA Security is supported */
239
232 u_int16_t reserved129[31];
233/*160*/ u_int16_t cfa_powermode1;
234 u_int16_t reserved161;
235/*162*/ u_int16_t cfa_kms_support;
236/*163*/ u_int16_t cfa_trueide_modes;
237/*164*/ u_int16_t cfa_memory_modes;
238 u_int16_t reserved165[4];
239/*169*/ u_int16_t support_dsm;

--- 126 unchanged lines hidden (view full) ---

366#define ATA_SF_DIS_PUIS 0x86 /* disable PUIS */
367#define ATA_SF_PUIS_SPINUP 0x07 /* PUIS spin-up */
368#define ATA_SF_ENAB_RCACHE 0xaa /* enable readahead cache */
369#define ATA_SF_DIS_RCACHE 0x55 /* disable readahead cache */
370#define ATA_SF_ENAB_RELIRQ 0x5d /* enable release interrupt */
371#define ATA_SF_DIS_RELIRQ 0xdd /* disable release interrupt */
372#define ATA_SF_ENAB_SRVIRQ 0x5e /* enable service interrupt */
373#define ATA_SF_DIS_SRVIRQ 0xde /* disable service interrupt */
240 u_int16_t reserved129[31];
241/*160*/ u_int16_t cfa_powermode1;
242 u_int16_t reserved161;
243/*162*/ u_int16_t cfa_kms_support;
244/*163*/ u_int16_t cfa_trueide_modes;
245/*164*/ u_int16_t cfa_memory_modes;
246 u_int16_t reserved165[4];
247/*169*/ u_int16_t support_dsm;

--- 126 unchanged lines hidden (view full) ---

374#define ATA_SF_DIS_PUIS 0x86 /* disable PUIS */
375#define ATA_SF_PUIS_SPINUP 0x07 /* PUIS spin-up */
376#define ATA_SF_ENAB_RCACHE 0xaa /* enable readahead cache */
377#define ATA_SF_DIS_RCACHE 0x55 /* disable readahead cache */
378#define ATA_SF_ENAB_RELIRQ 0x5d /* enable release interrupt */
379#define ATA_SF_DIS_RELIRQ 0xdd /* disable release interrupt */
380#define ATA_SF_ENAB_SRVIRQ 0x5e /* enable service interrupt */
381#define ATA_SF_DIS_SRVIRQ 0xde /* disable service interrupt */
374#define ATA_SECURITY_FREEE_LOCK 0xf5 /* freeze security config */
382#define ATA_SECURITY_SET_PASSWORD 0xf1 /* set drive password */
383#define ATA_SECURITY_UNLOCK 0xf2 /* unlock drive using passwd */
384#define ATA_SECURITY_ERASE_PREPARE 0xf3 /* prepare to erase drive */
385#define ATA_SECURITY_ERASE_UNIT 0xf4 /* erase all blocks on drive */
386#define ATA_SECURITY_FREEZE_LOCK 0xf5 /* freeze security config */
387#define ATA_SECURITY_DISABLE_PASSWORD 0xf6 /* disable drive password */
375#define ATA_READ_NATIVE_MAX_ADDRESS 0xf8 /* read native max address */
376#define ATA_SET_MAX_ADDRESS 0xf9 /* set max address */
377
378
379/* ATAPI commands */
380#define ATAPI_TEST_UNIT_READY 0x00 /* check if device is ready */
381#define ATAPI_REZERO 0x01 /* rewind */
382#define ATAPI_REQUEST_SENSE 0x03 /* get sense data */

--- 129 unchanged lines hidden (view full) ---

512#define ATA_CMD_READ 0x02
513#define ATA_CMD_WRITE 0x04
514#define ATA_CMD_ATAPI 0x08
515
516 int timeout;
517 int error;
518};
519
388#define ATA_READ_NATIVE_MAX_ADDRESS 0xf8 /* read native max address */
389#define ATA_SET_MAX_ADDRESS 0xf9 /* set max address */
390
391
392/* ATAPI commands */
393#define ATAPI_TEST_UNIT_READY 0x00 /* check if device is ready */
394#define ATAPI_REZERO 0x01 /* rewind */
395#define ATAPI_REQUEST_SENSE 0x03 /* get sense data */

--- 129 unchanged lines hidden (view full) ---

525#define ATA_CMD_READ 0x02
526#define ATA_CMD_WRITE 0x04
527#define ATA_CMD_ATAPI 0x08
528
529 int timeout;
530 int error;
531};
532
533struct ata_security_password {
534 u_int16_t ctrl;
535#define ATA_SECURITY_PASSWORD_USER 0x0000
536#define ATA_SECURITY_PASSWORD_MASTER 0x0001
537#define ATA_SECURITY_ERASE_NORMAL 0x0000
538#define ATA_SECURITY_ERASE_ENHANCED 0x0002
539#define ATA_SECURITY_LEVEL_HIGH 0x0000
540#define ATA_SECURITY_LEVEL_MAXIMUM 0x0100
541
542 u_int8_t password[32];
543 u_int16_t revision;
544 u_int16_t reserved[238];
545};
546
520/* pr device ATA ioctl calls */
521#define IOCATAREQUEST _IOWR('a', 100, struct ata_ioc_request)
522#define IOCATAGPARM _IOR('a', 101, struct ata_params)
523#define IOCATAGMODE _IOR('a', 102, int)
524#define IOCATASMODE _IOW('a', 103, int)
525
526#define IOCATAGSPINDOWN _IOR('a', 104, int)
527#define IOCATASSPINDOWN _IOW('a', 105, int)

--- 49 unchanged lines hidden ---
547/* pr device ATA ioctl calls */
548#define IOCATAREQUEST _IOWR('a', 100, struct ata_ioc_request)
549#define IOCATAGPARM _IOR('a', 101, struct ata_params)
550#define IOCATAGMODE _IOR('a', 102, int)
551#define IOCATASMODE _IOW('a', 103, int)
552
553#define IOCATAGSPINDOWN _IOR('a', 104, int)
554#define IOCATASSPINDOWN _IOW('a', 105, int)

--- 49 unchanged lines hidden ---