Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/ahci/ahci_sata.h

    rae3ff9f5 r730dce77  
    3636#include <sys/types.h>
    3737
    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 
    6138/** Standard Command frame. */
    6239typedef struct {
    63         /** FIS type - always SATA_CMD_FIS_TYPE. */
     40        /** FIS type - always 0x27. */
    6441        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. */
    6643        unsigned int c : 8;
    6744        /** Command - Identity device - 0xec, Set fetures - 0xef. */
     
    8562        /** Reserved. */
    8663        unsigned int reserved2 : 32;
    87 } sata_std_command_frame_t;
     64} std_command_frame_t;
    8865
    8966/** Command frame for NCQ data operation. */
     
    9168        /** FIS type - always 0x27. */
    9269        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. */
    9471        uint8_t c;
    9572        /** Command - FPDMA Read - 0x60, FPDMA Write - 0x61. */
     
    128105        /** Reserved. */
    129106        uint8_t reserved6;
    130 } sata_ncq_command_frame_t;
    131 
    132 /*----------------------------------------------------------------------------*/
    133 /*-- SATA Identify device ----------------------------------------------------*/
    134 /*----------------------------------------------------------------------------*/
     107} ncq_command_frame_t;
    135108
    136109/** Data returned from identify device and identify packet device command. */
     
    156129        uint16_t max_rw_multiple;
    157130        uint16_t reserved48;
    158         /* Different meaning for packet device. */
     131        /** Different meaning for packet device. */
    159132        uint16_t caps;
    160133        uint16_t reserved50;
     
    210183        uint16_t total_lba48_3;
    211184       
    212         uint16_t reserved104[1 + 105 - 104];
    213         uint16_t physical_logic_sector_size;
    214185        /* Note: more fields are defined in ATA/ATAPI-7. */
    215         uint16_t reserved107[1 + 127 - 107];
    216         uint16_t reserved128[1 + 159 - 128];
     186        uint16_t reserved104[1 + 127 - 104];
     187        uint16_t _vs128[1 + 159 - 128];
    217188        uint16_t reserved160[1 + 255 - 160];
    218 } sata_identify_data_t;
     189} identify_data_t;
    219190
    220191/** 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 = 0x0100
     192enum ata_regdev_caps {
     193        rd_cap_iordy = 0x0800,
     194        rd_cap_iordy_cbd = 0x0400,
     195        rd_cap_lba = 0x0200,
     196        rd_cap_dma = 0x0100
    226197};
    227198
    228199/** Bits of @c identify_data_t.cmd_set1. */
    229 enum sata_cs1 {
     200enum ata_cs1 {
    230201        /** 48-bit address feature set. */
    231         sata_cs1_addr48 = 0x0400
     202        cs1_addr48 = 0x0400
    232203};
    233204
    234205/** SATA capatibilities for not packet device - Serial ATA revision 3_1. */
    235 enum sata_np_caps {
     206enum sata_np_cap {
    236207        /** Supports READ LOG DMA EXT. */
    237         sata_np_cap_log_ext = 0x8000,
     208        np_cap_log_ext = 0x8000,
    238209        /** Supports Device Automatic Partial to Slumber transitions. */
    239         sata_np_cap_dev_slm = 0x4000,
     210        np_cap_dev_slm = 0x4000,
    240211        /** Supports Host Automatic Partial to Slumber transitions. */
    241         sata_np_cap_host_slm = 0x2000,
     212        np_cap_host_slm = 0x2000,
    242213        /** Supports NCQ priority information. */
    243         sata_np_cap_ncq_prio = 0x1000,
     214        np_cap_ncq_prio = 0x1000,
    244215        /** Supports Unload while NCQ command outstanding. */
    245         sata_np_cap_unload_ncq = 0x0800,
     216        np_cap_unload_ncq = 0x0800,
    246217        /** Supports Phy event counters. */
    247         sata_np_cap_phy_ctx = 0x0400,
     218        np_cap_phy_ctx = 0x0400,
    248219        /** Supports recepits of host-initiated interface power management. */
    249         sata_np_cap_host_pmngmnt = 0x0200,
     220        np_cap_host_pmngmnt = 0x0200,
    250221       
    251222        /** Supports NCQ. */
    252         sata_np_cap_ncq = 0x0100,
     223        np_cap_ncq = 0x0100,
    253224       
    254225        /** Supports SATA 3. */
    255         sata_np_cap_sata_3 = 0x0008,
     226        np_cap_sata_3 = 0x0008,
    256227        /** Supports SATA 2. */
    257         sata_np_cap_sata_2 = 0x0004,
     228        np_cap_sata_2 = 0x0004,
    258229        /** Supports SATA 1. */
    259         sata_np_cap_sata_1 = 0x0002
     230        np_cap_sata_1 = 0x0002
    260231};
    261232
    262233/** SATA capatibilities for packet device - Serial ATA revision 3_1. */
    263 enum sata_pt_caps {
     234enum sata_pt_cap {
    264235        /** Supports READ LOG DMA EXT. */
    265         sata_pt_cap_log_ext = 0x8000,
     236        pt_cap_log_ext = 0x8000,
    266237        /** Supports Device Automatic Partial to Slumber transitions. */
    267         sata_pt_cap_dev_slm = 0x4000,
     238        pt_cap_dev_slm = 0x4000,
    268239        /** Supports Host Automatic Partial to Slumber transitions. */
    269         sata_pt_cap_host_slm = 0x2000,
     240        pt_cap_host_slm = 0x2000,
    270241        /** Supports Phy event counters. */
    271         sata_pt_cap_phy_ctx = 0x0400,
     242        pt_cap_phy_ctx = 0x0400,
    272243        /** Supports recepits of host-initiated interface power management. */
    273         sata_pt_cap_host_pmngmnt = 0x0200,
     244        pt_cap_host_pmngmnt = 0x0200,
    274245       
    275246        /** Supports SATA 3. */
    276         sata_pt_cap_sat_3 = 0x0008,
     247        pt_cap_sat_3 = 0x0008,
    277248        /** Supports SATA 2. */
    278         sata_pt_cap_sat_2 = 0x0004,
     249        pt_cap_sat_2 = 0x0004,
    279250        /** Supports SATA 1. */
    280         sata_pt_cap_sat_1 = 0x0002
     251        pt_cap_sat_1 = 0x0002
    281252};
    282253
Note: See TracChangeset for help on using the changeset viewer.