2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2008 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_SCSICMD_H
20 #define GRUB_SCSICMD_H 1
22 #include <grub/types.h>
24 #define GRUB_SCSI_DEVTYPE_MASK 31
25 #define GRUB_SCSI_REMOVABLE_BIT 7
26 #define GRUB_SCSI_LUN_SHIFT 5
28 struct grub_scsi_inquiry
32 grub_uint16_t reserved
;
33 grub_uint16_t alloc_length
;
34 grub_uint8_t reserved2
;
36 } __attribute__((packed
));
38 struct grub_scsi_inquiry_data
42 grub_uint16_t reserved
;
44 grub_uint8_t reserved2
[3];
48 } __attribute__((packed
));
50 struct grub_scsi_read_capacity
54 grub_uint8_t reserved
[8];
56 } __attribute__((packed
));
58 struct grub_scsi_read_capacity_data
61 grub_uint32_t blocksize
;
62 } __attribute__((packed
));
64 struct grub_scsi_read10
69 grub_uint8_t reserved
;
71 grub_uint8_t reserved2
;
73 } __attribute__((packed
));
75 struct grub_scsi_read12
81 grub_uint8_t reserved
;
83 } __attribute__((packed
));
85 struct grub_scsi_write10
90 grub_uint8_t reserved
;
92 grub_uint8_t reserved2
;
94 } __attribute__((packed
));
96 struct grub_scsi_write12
102 grub_uint8_t reserved
;
103 grub_uint8_t control
;
104 } __attribute__((packed
));
108 grub_scsi_cmd_inquiry
= 0x12,
109 grub_scsi_cmd_read_capacity
= 0x25,
110 grub_scsi_cmd_read10
= 0x28,
111 grub_scsi_cmd_write10
= 0x2a,
112 grub_scsi_cmd_read12
= 0xa8,
113 grub_scsi_cmd_write12
= 0xaa
118 grub_scsi_devtype_direct
= 0x00,
119 grub_scsi_devtype_cdrom
= 0x05
120 } grub_scsi_devtype_t
;
122 #endif /* GRUB_SCSICMD_H */