0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef _UAPI_LINUX_EDD_H
0032 #define _UAPI_LINUX_EDD_H
0033
0034 #include <linux/types.h>
0035
0036 #define EDDNR 0x1e9
0037
0038 #define EDDBUF 0xd00
0039 #define EDDMAXNR 6
0040 #define EDDEXTSIZE 8
0041 #define EDDPARMSIZE 74
0042 #define CHECKEXTENSIONSPRESENT 0x41
0043 #define GETDEVICEPARAMETERS 0x48
0044 #define LEGACYGETDEVICEPARAMETERS 0x08
0045 #define EDDMAGIC1 0x55AA
0046 #define EDDMAGIC2 0xAA55
0047
0048
0049 #define READ_SECTORS 0x02
0050 #define EDD_MBR_SIG_OFFSET 0x1B8
0051 #define EDD_MBR_SIG_BUF 0x290
0052 #define EDD_MBR_SIG_MAX 16
0053 #define EDD_MBR_SIG_NR_BUF 0x1ea
0054
0055
0056 #ifndef __ASSEMBLY__
0057
0058 #define EDD_EXT_FIXED_DISK_ACCESS (1 << 0)
0059 #define EDD_EXT_DEVICE_LOCKING_AND_EJECTING (1 << 1)
0060 #define EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT (1 << 2)
0061 #define EDD_EXT_64BIT_EXTENSIONS (1 << 3)
0062
0063 #define EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT (1 << 0)
0064 #define EDD_INFO_GEOMETRY_VALID (1 << 1)
0065 #define EDD_INFO_REMOVABLE (1 << 2)
0066 #define EDD_INFO_WRITE_VERIFY (1 << 3)
0067 #define EDD_INFO_MEDIA_CHANGE_NOTIFICATION (1 << 4)
0068 #define EDD_INFO_LOCKABLE (1 << 5)
0069 #define EDD_INFO_NO_MEDIA_PRESENT (1 << 6)
0070 #define EDD_INFO_USE_INT13_FN50 (1 << 7)
0071
0072 struct edd_device_params {
0073 __u16 length;
0074 __u16 info_flags;
0075 __u32 num_default_cylinders;
0076 __u32 num_default_heads;
0077 __u32 sectors_per_track;
0078 __u64 number_of_sectors;
0079 __u16 bytes_per_sector;
0080 __u32 dpte_ptr;
0081 __u16 key;
0082 __u8 device_path_info_length;
0083 __u8 reserved2;
0084 __u16 reserved3;
0085 __u8 host_bus_type[4];
0086 __u8 interface_type[8];
0087 union {
0088 struct {
0089 __u16 base_address;
0090 __u16 reserved1;
0091 __u32 reserved2;
0092 } __attribute__ ((packed)) isa;
0093 struct {
0094 __u8 bus;
0095 __u8 slot;
0096 __u8 function;
0097 __u8 channel;
0098 __u32 reserved;
0099 } __attribute__ ((packed)) pci;
0100
0101 struct {
0102 __u64 reserved;
0103 } __attribute__ ((packed)) ibnd;
0104 struct {
0105 __u64 reserved;
0106 } __attribute__ ((packed)) xprs;
0107 struct {
0108 __u64 reserved;
0109 } __attribute__ ((packed)) htpt;
0110 struct {
0111 __u64 reserved;
0112 } __attribute__ ((packed)) unknown;
0113 } interface_path;
0114 union {
0115 struct {
0116 __u8 device;
0117 __u8 reserved1;
0118 __u16 reserved2;
0119 __u32 reserved3;
0120 __u64 reserved4;
0121 } __attribute__ ((packed)) ata;
0122 struct {
0123 __u8 device;
0124 __u8 lun;
0125 __u8 reserved1;
0126 __u8 reserved2;
0127 __u32 reserved3;
0128 __u64 reserved4;
0129 } __attribute__ ((packed)) atapi;
0130 struct {
0131 __u16 id;
0132 __u64 lun;
0133 __u16 reserved1;
0134 __u32 reserved2;
0135 } __attribute__ ((packed)) scsi;
0136 struct {
0137 __u64 serial_number;
0138 __u64 reserved;
0139 } __attribute__ ((packed)) usb;
0140 struct {
0141 __u64 eui;
0142 __u64 reserved;
0143 } __attribute__ ((packed)) i1394;
0144 struct {
0145 __u64 wwid;
0146 __u64 lun;
0147 } __attribute__ ((packed)) fibre;
0148 struct {
0149 __u64 identity_tag;
0150 __u64 reserved;
0151 } __attribute__ ((packed)) i2o;
0152 struct {
0153 __u32 array_number;
0154 __u32 reserved1;
0155 __u64 reserved2;
0156 } __attribute__ ((packed)) raid;
0157 struct {
0158 __u8 device;
0159 __u8 reserved1;
0160 __u16 reserved2;
0161 __u32 reserved3;
0162 __u64 reserved4;
0163 } __attribute__ ((packed)) sata;
0164 struct {
0165 __u64 reserved1;
0166 __u64 reserved2;
0167 } __attribute__ ((packed)) unknown;
0168 } device_path;
0169 __u8 reserved4;
0170 __u8 checksum;
0171 } __attribute__ ((packed));
0172
0173 struct edd_info {
0174 __u8 device;
0175 __u8 version;
0176 __u16 interface_support;
0177 __u16 legacy_max_cylinder;
0178 __u8 legacy_max_head;
0179 __u8 legacy_sectors_per_track;
0180 struct edd_device_params params;
0181 } __attribute__ ((packed));
0182
0183 struct edd {
0184 unsigned int mbr_signature[EDD_MBR_SIG_MAX];
0185 struct edd_info edd_info[EDDMAXNR];
0186 unsigned char mbr_signature_nr;
0187 unsigned char edd_info_nr;
0188 };
0189
0190 #endif
0191
0192 #endif