blob: cc6e973662f8c8c745c2777dd032172468f68d65 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_EDD_H
20#define _UAPI_LINUX_EDD_H
21#include <linux/types.h>
22#define EDDNR 0x1e9
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define EDDBUF 0xd00
24#define EDDMAXNR 6
25#define EDDEXTSIZE 8
26#define EDDPARMSIZE 74
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define CHECKEXTENSIONSPRESENT 0x41
28#define GETDEVICEPARAMETERS 0x48
29#define LEGACYGETDEVICEPARAMETERS 0x08
30#define EDDMAGIC1 0x55AA
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define EDDMAGIC2 0xAA55
32#define READ_SECTORS 0x02
33#define EDD_MBR_SIG_OFFSET 0x1B8
34#define EDD_MBR_SIG_BUF 0x290
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define EDD_MBR_SIG_MAX 16
36#define EDD_MBR_SIG_NR_BUF 0x1ea
37#ifndef __ASSEMBLY__
38#define EDD_EXT_FIXED_DISK_ACCESS (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define EDD_EXT_DEVICE_LOCKING_AND_EJECTING (1 << 1)
40#define EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT (1 << 2)
41#define EDD_EXT_64BIT_EXTENSIONS (1 << 3)
42#define EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define EDD_INFO_GEOMETRY_VALID (1 << 1)
44#define EDD_INFO_REMOVABLE (1 << 2)
45#define EDD_INFO_WRITE_VERIFY (1 << 3)
46#define EDD_INFO_MEDIA_CHANGE_NOTIFICATION (1 << 4)
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define EDD_INFO_LOCKABLE (1 << 5)
48#define EDD_INFO_NO_MEDIA_PRESENT (1 << 6)
49#define EDD_INFO_USE_INT13_FN50 (1 << 7)
50struct edd_device_params {
Tao Baod7db5942015-01-28 10:07:51 -080051 __u16 length;
52 __u16 info_flags;
53 __u32 num_default_cylinders;
54 __u32 num_default_heads;
Tao Baod7db5942015-01-28 10:07:51 -080055 __u32 sectors_per_track;
56 __u64 number_of_sectors;
57 __u16 bytes_per_sector;
58 __u32 dpte_ptr;
Tao Baod7db5942015-01-28 10:07:51 -080059 __u16 key;
60 __u8 device_path_info_length;
61 __u8 reserved2;
62 __u16 reserved3;
Tao Baod7db5942015-01-28 10:07:51 -080063 __u8 host_bus_type[4];
64 __u8 interface_type[8];
65 union {
66 struct {
Tao Baod7db5942015-01-28 10:07:51 -080067 __u16 base_address;
68 __u16 reserved1;
69 __u32 reserved2;
70 } __attribute__((packed)) isa;
Tao Baod7db5942015-01-28 10:07:51 -080071 struct {
72 __u8 bus;
73 __u8 slot;
74 __u8 function;
Tao Baod7db5942015-01-28 10:07:51 -080075 __u8 channel;
76 __u32 reserved;
77 } __attribute__((packed)) pci;
78 struct {
Tao Baod7db5942015-01-28 10:07:51 -080079 __u64 reserved;
80 } __attribute__((packed)) ibnd;
81 struct {
82 __u64 reserved;
Tao Baod7db5942015-01-28 10:07:51 -080083 } __attribute__((packed)) xprs;
84 struct {
85 __u64 reserved;
86 } __attribute__((packed)) htpt;
Tao Baod7db5942015-01-28 10:07:51 -080087 struct {
88 __u64 reserved;
89 } __attribute__((packed)) unknown;
90 } interface_path;
Tao Baod7db5942015-01-28 10:07:51 -080091 union {
92 struct {
93 __u8 device;
94 __u8 reserved1;
Tao Baod7db5942015-01-28 10:07:51 -080095 __u16 reserved2;
96 __u32 reserved3;
97 __u64 reserved4;
98 } __attribute__((packed)) ata;
Tao Baod7db5942015-01-28 10:07:51 -080099 struct {
100 __u8 device;
101 __u8 lun;
102 __u8 reserved1;
Tao Baod7db5942015-01-28 10:07:51 -0800103 __u8 reserved2;
104 __u32 reserved3;
105 __u64 reserved4;
106 } __attribute__((packed)) atapi;
Tao Baod7db5942015-01-28 10:07:51 -0800107 struct {
108 __u16 id;
109 __u64 lun;
110 __u16 reserved1;
Tao Baod7db5942015-01-28 10:07:51 -0800111 __u32 reserved2;
112 } __attribute__((packed)) scsi;
113 struct {
114 __u64 serial_number;
Tao Baod7db5942015-01-28 10:07:51 -0800115 __u64 reserved;
116 } __attribute__((packed)) usb;
117 struct {
118 __u64 eui;
Tao Baod7db5942015-01-28 10:07:51 -0800119 __u64 reserved;
120 } __attribute__((packed)) i1394;
121 struct {
122 __u64 wwid;
Tao Baod7db5942015-01-28 10:07:51 -0800123 __u64 lun;
124 } __attribute__((packed)) fibre;
125 struct {
126 __u64 identity_tag;
Tao Baod7db5942015-01-28 10:07:51 -0800127 __u64 reserved;
128 } __attribute__((packed)) i2o;
129 struct {
130 __u32 array_number;
Tao Baod7db5942015-01-28 10:07:51 -0800131 __u32 reserved1;
132 __u64 reserved2;
133 } __attribute__((packed)) raid;
134 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800135 __u8 device;
136 __u8 reserved1;
137 __u16 reserved2;
138 __u32 reserved3;
Tao Baod7db5942015-01-28 10:07:51 -0800139 __u64 reserved4;
140 } __attribute__((packed)) sata;
141 struct {
142 __u64 reserved1;
Tao Baod7db5942015-01-28 10:07:51 -0800143 __u64 reserved2;
144 } __attribute__((packed)) unknown;
145 } device_path;
146 __u8 reserved4;
Tao Baod7db5942015-01-28 10:07:51 -0800147 __u8 checksum;
148} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700149struct edd_info {
Tao Baod7db5942015-01-28 10:07:51 -0800150 __u8 device;
Tao Baod7db5942015-01-28 10:07:51 -0800151 __u8 version;
152 __u16 interface_support;
153 __u16 legacy_max_cylinder;
154 __u8 legacy_max_head;
Tao Baod7db5942015-01-28 10:07:51 -0800155 __u8 legacy_sectors_per_track;
156 struct edd_device_params params;
157} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700158struct edd {
Tao Baod7db5942015-01-28 10:07:51 -0800159 unsigned int mbr_signature[EDD_MBR_SIG_MAX];
160 struct edd_info edd_info[EDDMAXNR];
161 unsigned char mbr_signature_nr;
162 unsigned char edd_info_nr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700163};
164#endif
165#endif