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.


added atapi handlers
[palacios.git] / palacios / src / devices / atapi-types.h
1 /* 
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> 
11  * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
12  * All rights reserved.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20
21 #ifndef __DEVICES_ATAPI_TYPES_H__
22 #define __DEVICES_ATAPI_TYPES_H__
23
24 #ifdef __V3VEE__
25
26 #include <palacios/vmm_types.h>
27
28 typedef enum {
29     ATAPI_SEN_NONE = 0, 
30     ATAPI_SEN_NOT_RDY = 2, 
31     ATAPI_SEN_ILL_REQ = 5,
32     ATAPI_SEN_UNIT_ATTNT = 6
33 } atapi_sense_key_t ;
34
35 typedef enum  {
36     ASC_INV_CMD_FIELD = 0x24,
37     ASC_MEDIA_NOT_PRESENT = 0x3a,
38     ASC_SAVE_PARAM_NOT_SUPPORTED = 0x39,    
39     ASC_LOG_BLK_OOR = 0x21                  /* LOGICAL BLOCK OUT OF RANGE */
40 } atapi_add_sense_code_t ; 
41
42
43 struct atapi_sense_data {
44     union {
45         uint8_t buf[18];
46         struct {
47             uint8_t header;
48             uint8_t rsvd1;
49             uint8_t sense_key; // atapi_sense_key_t
50             uint8_t info[4];
51             uint8_t read_len; // num bytes past this point
52             uint8_t spec_info[4];
53             uint8_t asc;   // atapi_add_sense_code_t
54             uint8_t ascq; // ??
55             uint8_t fruc; // ??
56             uint8_t key_spec[3];
57         } __attribute__((packed));
58     } __attribute__((packed));
59 } __attribute__((packed));
60
61
62
63
64 struct atapi_read10_cmd {
65     uint8_t atapi_cmd;
66     uint8_t rel_addr       : 1;
67     uint8_t rsvd1          : 2;
68     uint8_t force_access   : 1; // can't use cache for data
69     uint8_t disable_pg_out : 1;
70     uint8_t lun            : 3;
71     uint32_t lba;
72     uint8_t rsvd2;
73     uint16_t xfer_len;
74     uint8_t ctrl;
75 } __attribute__((packed));
76
77
78 #endif
79
80 #endif