Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


imported SEABIOS source tree
[palacios.git] / bios / seabios / src / blockcmd.h
1 // Definitions for SCSI style command data blocks.
2 #ifndef __BLOCKCMD_H
3 #define __BLOCKCMD_H
4
5 #include "types.h" // u8
6
7 #define CDB_CMD_READ_10 0x28
8 #define CDB_CMD_VERIFY_10 0x2f
9 #define CDB_CMD_WRITE_10 0x2a
10
11 struct cdb_rwdata_10 {
12     u8 command;
13     u8 flags;
14     u32 lba;
15     u8 resreved_06;
16     u16 count;
17     u8 reserved_09;
18     u8 pad[6];
19 } PACKED;
20
21 #define CDB_CMD_READ_CAPACITY 0x25
22
23 struct cdb_read_capacity {
24     u8 command;
25     u8 flags;
26     u8 resreved_02[8];
27     u8 pad[6];
28 } PACKED;
29
30 struct cdbres_read_capacity {
31     u32 sectors;
32     u32 blksize;
33 } PACKED;
34
35 #define CDB_CMD_INQUIRY 0x12
36 #define CDB_CMD_REQUEST_SENSE 0x03
37
38 struct cdb_request_sense {
39     u8 command;
40     u8 flags;
41     u16 reserved_02;
42     u8 length;
43     u8 reserved_05;
44     u8 pad[10];
45 } PACKED;
46
47 struct cdbres_request_sense {
48     u8 errcode;
49     u8 segment;
50     u8 flags;
51     u32 info;
52     u8 additional;
53     u32 specific;
54     u8 asc;
55     u8 ascq;
56     u32 reserved_0e;
57 } PACKED;
58
59 struct cdbres_inquiry {
60     u8 pdt;
61     u8 removable;
62     u8 reserved_02[2];
63     u8 additional;
64     u8 reserved_05[3];
65     char vendor[8];
66     char product[16];
67     char rev[4];
68 } PACKED;
69
70 // blockcmd.c
71 int cdb_get_inquiry(struct disk_op_s *op, struct cdbres_inquiry *data);
72 int cdb_get_sense(struct disk_op_s *op, struct cdbres_request_sense *data);
73 int cdb_read_capacity(struct disk_op_s *op, struct cdbres_read_capacity *data);
74 int cdb_inquiry(struct disk_op_s *op, struct cdbres_inquiry *data);
75 int cdb_read(struct disk_op_s *op);
76
77 #endif // blockcmd.h