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