Code: Select all
typedef struct fis_reg_h2d
{
// DWORD 0
uint8_t fis_type; // FIS_TYPE_REG_H2D
uint8_t pmport : 4; // Port multiplier
uint8_t reserved0 : 3;
uint8_t c : 1; // 1: Command, 0: Control
uint8_t command; // Command register
uint8_t featurel; // Feature register, 7:0
// DWORD 1
uint8_t lba0; // LBA low register, 7:0
uint8_t lba1; // LBA mid register, 15:8
uint8_t lba2; // LBA high register, 23:16
uint8_t device; // Device register
// DWORD 2
uint8_t lba3; // LBA register, 31:24
uint8_t lba4; // LBA register, 39:32
uint8_t lba5; // LBA register, 47:40
uint8_t featureh; // Feature register, 15:8
// DWORD 3
uint8_t countl; // Count register, 7:0
uint8_t counth; // Count register, 15:8
uint8_t icc; // Isochronous command completion
uint8_t control; // Control register
// DWORD 4
uint8_t reserved1[4];
} __attribute__ ((packed)) fis_reg_h2d_t;
For example, in my old code, I used to set some arbitrary values to the fields pmport, c and device without really knowing the meaning.
Do you have some kind of table or know somewhere I can read about these structures?