Changes in uspace/drv/block/ahci/ahci_sata.h [730dce77:ae3ff9f5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/ahci/ahci_sata.h
r730dce77 rae3ff9f5 36 36 #include <sys/types.h> 37 37 38 /*----------------------------------------------------------------------------*/ 39 /*-- SATA Buffer Lengths -----------------------------------------------------*/ 40 /*----------------------------------------------------------------------------*/ 41 42 /** Default sector size in bytes. */ 43 #define SATA_DEFAULT_SECTOR_SIZE 512 44 45 /** Size for set feature command buffer in bytes. */ 46 #define SATA_SET_FEATURE_BUFFER_LENGTH 512 47 48 /** Size for indentify (packet) device buffer in bytes. */ 49 #define SATA_IDENTIFY_DEVICE_BUFFER_LENGTH 512 50 51 /*----------------------------------------------------------------------------*/ 52 /*-- SATA Fis Frames ---------------------------------------------------------*/ 53 /*----------------------------------------------------------------------------*/ 54 55 /** Sata FIS Type number. */ 56 #define SATA_CMD_FIS_TYPE 0x27 57 58 /** Sata FIS Type command indicator. */ 59 #define SATA_CMD_FIS_COMMAND_INDICATOR 0x80 60 38 61 /** Standard Command frame. */ 39 62 typedef struct { 40 /** FIS type - always 0x27. */63 /** FIS type - always SATA_CMD_FIS_TYPE. */ 41 64 unsigned int fis_type : 8; 42 /** Indicate that FIS is a Command - always 0x80. */65 /** Indicate that FIS is a Command - always SATA_CMD_FIS_COMMAND_INDICATOR. */ 43 66 unsigned int c : 8; 44 67 /** Command - Identity device - 0xec, Set fetures - 0xef. */ … … 62 85 /** Reserved. */ 63 86 unsigned int reserved2 : 32; 64 } s td_command_frame_t;87 } sata_std_command_frame_t; 65 88 66 89 /** Command frame for NCQ data operation. */ … … 68 91 /** FIS type - always 0x27. */ 69 92 uint8_t fis_type; 70 /** Indicate that FIS is a Command - always 0x80. */93 /** Indicate that FIS is a Command - always SATA_CMD_FIS_COMMAND_INDICATOR. */ 71 94 uint8_t c; 72 95 /** Command - FPDMA Read - 0x60, FPDMA Write - 0x61. */ … … 105 128 /** Reserved. */ 106 129 uint8_t reserved6; 107 } ncq_command_frame_t; 130 } sata_ncq_command_frame_t; 131 132 /*----------------------------------------------------------------------------*/ 133 /*-- SATA Identify device ----------------------------------------------------*/ 134 /*----------------------------------------------------------------------------*/ 108 135 109 136 /** Data returned from identify device and identify packet device command. */ … … 129 156 uint16_t max_rw_multiple; 130 157 uint16_t reserved48; 131 /* *Different meaning for packet device. */158 /* Different meaning for packet device. */ 132 159 uint16_t caps; 133 160 uint16_t reserved50; … … 183 210 uint16_t total_lba48_3; 184 211 212 uint16_t reserved104[1 + 105 - 104]; 213 uint16_t physical_logic_sector_size; 185 214 /* Note: more fields are defined in ATA/ATAPI-7. */ 186 uint16_t reserved10 4[1 + 127 - 104];187 uint16_t _vs128[1 + 159 - 128];215 uint16_t reserved107[1 + 127 - 107]; 216 uint16_t reserved128[1 + 159 - 128]; 188 217 uint16_t reserved160[1 + 255 - 160]; 189 } identify_data_t;218 } sata_identify_data_t; 190 219 191 220 /** Capability bits for register device. */ 192 enum ata_regdev_caps {193 rd_cap_iordy = 0x0800,194 rd_cap_iordy_cbd = 0x0400,195 rd_cap_lba = 0x0200,196 rd_cap_dma = 0x0100221 enum sata_rd_caps { 222 sata_rd_cap_iordy = 0x0800, 223 sata_rd_cap_iordy_cbd = 0x0400, 224 sata_rd_cap_lba = 0x0200, 225 sata_rd_cap_dma = 0x0100 197 226 }; 198 227 199 228 /** Bits of @c identify_data_t.cmd_set1. */ 200 enum ata_cs1 {229 enum sata_cs1 { 201 230 /** 48-bit address feature set. */ 202 cs1_addr48 = 0x0400231 sata_cs1_addr48 = 0x0400 203 232 }; 204 233 205 234 /** SATA capatibilities for not packet device - Serial ATA revision 3_1. */ 206 enum sata_np_cap {235 enum sata_np_caps { 207 236 /** Supports READ LOG DMA EXT. */ 208 np_cap_log_ext = 0x8000,237 sata_np_cap_log_ext = 0x8000, 209 238 /** Supports Device Automatic Partial to Slumber transitions. */ 210 np_cap_dev_slm = 0x4000,239 sata_np_cap_dev_slm = 0x4000, 211 240 /** Supports Host Automatic Partial to Slumber transitions. */ 212 np_cap_host_slm = 0x2000,241 sata_np_cap_host_slm = 0x2000, 213 242 /** Supports NCQ priority information. */ 214 np_cap_ncq_prio = 0x1000,243 sata_np_cap_ncq_prio = 0x1000, 215 244 /** Supports Unload while NCQ command outstanding. */ 216 np_cap_unload_ncq = 0x0800,245 sata_np_cap_unload_ncq = 0x0800, 217 246 /** Supports Phy event counters. */ 218 np_cap_phy_ctx = 0x0400,247 sata_np_cap_phy_ctx = 0x0400, 219 248 /** Supports recepits of host-initiated interface power management. */ 220 np_cap_host_pmngmnt = 0x0200,249 sata_np_cap_host_pmngmnt = 0x0200, 221 250 222 251 /** Supports NCQ. */ 223 np_cap_ncq = 0x0100,252 sata_np_cap_ncq = 0x0100, 224 253 225 254 /** Supports SATA 3. */ 226 np_cap_sata_3 = 0x0008,255 sata_np_cap_sata_3 = 0x0008, 227 256 /** Supports SATA 2. */ 228 np_cap_sata_2 = 0x0004,257 sata_np_cap_sata_2 = 0x0004, 229 258 /** Supports SATA 1. */ 230 np_cap_sata_1 = 0x0002259 sata_np_cap_sata_1 = 0x0002 231 260 }; 232 261 233 262 /** SATA capatibilities for packet device - Serial ATA revision 3_1. */ 234 enum sata_pt_cap {263 enum sata_pt_caps { 235 264 /** Supports READ LOG DMA EXT. */ 236 pt_cap_log_ext = 0x8000,265 sata_pt_cap_log_ext = 0x8000, 237 266 /** Supports Device Automatic Partial to Slumber transitions. */ 238 pt_cap_dev_slm = 0x4000,267 sata_pt_cap_dev_slm = 0x4000, 239 268 /** Supports Host Automatic Partial to Slumber transitions. */ 240 pt_cap_host_slm = 0x2000,269 sata_pt_cap_host_slm = 0x2000, 241 270 /** Supports Phy event counters. */ 242 pt_cap_phy_ctx = 0x0400,271 sata_pt_cap_phy_ctx = 0x0400, 243 272 /** Supports recepits of host-initiated interface power management. */ 244 pt_cap_host_pmngmnt = 0x0200,273 sata_pt_cap_host_pmngmnt = 0x0200, 245 274 246 275 /** Supports SATA 3. */ 247 pt_cap_sat_3 = 0x0008,276 sata_pt_cap_sat_3 = 0x0008, 248 277 /** Supports SATA 2. */ 249 pt_cap_sat_2 = 0x0004,278 sata_pt_cap_sat_2 = 0x0004, 250 279 /** Supports SATA 1. */ 251 pt_cap_sat_1 = 0x0002280 sata_pt_cap_sat_1 = 0x0002 252 281 }; 253 282
Note:
See TracChangeset
for help on using the changeset viewer.