ATA
include/drivers/ata.h View source View on GitHubStructs
Section titled “Structs”ide_request
Section titled “ide_request” struct ide_request (15 fields) source
ide_channel
Section titled “ide_channel” struct ide_channel (5 fields) source
ata_drive
Section titled “ata_drive” struct ata_drive (17 fields) source
§
bool actually_exists it picks everything up
§
uint32_t sector_size §
uint16_t io_base §
uint16_t ctrl_base §
uint16_t slave §
void *identify_data §
char model[41] 40 chars + null
§
char serial[21] 20 chars + null
§
char firmware[9] 8 chars + null
§
uint64_t total_sectors §
uint8_t supports_lba48 §
uint8_t supports_dma §
uint8_t udma_mode §
uint8_t pio_mode §
struct ide_channel channel ata_identify
Section titled “ata_identify” struct ata_identify (59 fields) source
NOTE
offsets and sizes asserted in kernel/drivers/ata/layout.c
§
uint16_t config §
uint16_t cylinders §
uint16_t reserved1 §
uint16_t heads §
uint16_t vendor1[2] §
uint16_t sectors_per_track §
uint16_t vendor2[3] §
uint16_t serial_number[10] §
uint16_t vendor3[2] §
uint16_t obsolete1 §
uint16_t firmware_revision[4] §
uint16_t model_number[20] §
uint16_t max_rw_multiple §
uint16_t reserved2 §
uint16_t capabilities[2] §
uint16_t obsolete2[2] §
uint16_t field_validity §
uint16_t current_cylinders §
uint16_t current_heads §
uint16_t current_sectors §
uint16_t current_capacity_lo §
uint16_t current_capacity_hi §
uint16_t rw_multiple §
uint32_t lba28_capacity §
uint16_t dma_supported §
uint16_t advanced_pio_modes §
uint16_t min_dma_cycle_time §
uint16_t recommended_dma_cycle_time §
uint16_t min_pio_cycle_time §
uint16_t min_pio_cycle_time_iordy §
uint16_t additional_supported §
uint16_t reserved3[5] §
uint16_t queue_depth §
uint16_t sata_capabilities §
uint16_t sata_additional §
uint16_t sata_features_supported §
uint16_t sata_features_enabled §
uint16_t major_version §
uint16_t minor_version §
uint16_t command_set_supported[3] §
uint16_t command_set_enabled[3] §
uint16_t features_supported_extension §
uint16_t security_erase_time §
uint16_t enhanced_security_erase_time §
uint16_t current_advanced_power_mgmt §
uint16_t master_password_revision §
uint16_t hardware_reset_result §
uint16_t acoustic_management §
uint16_t stream_min_req_size §
uint16_t stream_transfer_time_dma §
uint16_t stream_access_latency §
uint32_t streaming_performance_gran §
uint64_t lba48_sector_count §
uint16_t streaming_transfer_time §
uint16_t dsm_cap §
uint16_t phys_log_sector_size §
uint16_t inter_seek_delay §
uint16_t world_wide_name[4] §
uint16_t reserved4[144] ide_type
Section titled “ide_type”Functions
Section titled “Functions”ide_read_sector_wrapper
Section titled “ide_read_sector_wrapper”bool ide_read_sector_wrapper(
struct block_device *d,
uint64_t lba,
uint8_t *buf,
uint64_t cnt
) source ide_write_sector_wrapper
Section titled “ide_write_sector_wrapper”bool ide_write_sector_wrapper(
struct block_device *d,
uint64_t lba,
const uint8_t *buf,
uint64_t cnt
) source ide_detect_drives
Section titled “ide_detect_drives”uint8_t ide_detect_drives(void) source ata_setup_drive
Section titled “ata_setup_drive”bool ata_setup_drive(
struct ata_drive *ide,
struct pci_device *devices,
uint64_t count,
int channel,
bool is_slave
) source ide_create_generic
Section titled “ide_create_generic”struct block_device * ide_create_generic(struct ata_drive *ide) source ide_identify
Section titled “ide_identify”ide_print_info
Section titled “ide_print_info”void ide_print_info(struct block_device *d) source ata_ident_print
Section titled “ata_ident_print”void ata_ident_print(struct ata_identify *id) source ata_select_drive
Section titled “ata_select_drive”ata_soft_reset
Section titled “ata_soft_reset”atapi_identify
Section titled “atapi_identify”ata_init
Section titled “ata_init”void ata_init(struct pci_device *devices, uint64_t count) source ide_irq_handler
Section titled “ide_irq_handler”enum irq_result ide_irq_handler(struct irq_context *ct, void *ctx) source ide_reorder
Section titled “ide_reorder”void ide_reorder(struct block_device *disk) source ide_submit_bio_async
Section titled “ide_submit_bio_async”bool ide_submit_bio_async(
struct block_device *d,
struct bio_request *b
) source atapi_create_generic
Section titled “atapi_create_generic”struct block_device * atapi_create_generic(struct ata_drive *d) source atapi_print_info
Section titled “atapi_print_info”void atapi_print_info(struct block_device *disk) source Macros
Section titled “Macros”IDE_CMD_TIMEOUT_MS
Section titled “IDE_CMD_TIMEOUT_MS”#define IDE_CMD_TIMEOUT_MS 5000 source Read/write sector
IDE_IDENT_TIMEOUT_MS
Section titled “IDE_IDENT_TIMEOUT_MS”#define IDE_IDENT_TIMEOUT_MS 10000 source Identify or cache flush
IDE_RESET_TIMEOUT_MS
Section titled “IDE_RESET_TIMEOUT_MS”#define IDE_RESET_TIMEOUT_MS 30000 source Controller reset or spin-up
ATAPI_CMD_TIMEOUT_MS
Section titled “ATAPI_CMD_TIMEOUT_MS”#define ATAPI_CMD_TIMEOUT_MS 8000 source Short packet commands
ATAPI_SPINUP_TIMEOUT_MS
Section titled “ATAPI_SPINUP_TIMEOUT_MS”#define ATAPI_SPINUP_TIMEOUT_MS 15000 source Spinning up disc or loading tray
ATAPI_EJECT_TIMEOUT_MS
Section titled “ATAPI_EJECT_TIMEOUT_MS”#define ATAPI_EJECT_TIMEOUT_MS 20000 source Eject/load tray or seek disc
REG_DATA
Section titled “REG_DATA”REG_ERROR
Section titled “REG_ERROR”REG_FEATURES
Section titled “REG_FEATURES”#define REG_FEATURES(base) source Expansion
#define REG_FEATURES(base) (base + 1) REG_SECTOR_COUNT
Section titled “REG_SECTOR_COUNT”#define REG_SECTOR_COUNT(base) source Expansion
#define REG_SECTOR_COUNT(base) (base + 2) REG_LBA_LOW
Section titled “REG_LBA_LOW”#define REG_LBA_LOW(base) source Expansion
#define REG_LBA_LOW(base) (base + 3) REG_LBA_MID
Section titled “REG_LBA_MID”#define REG_LBA_MID(base) source Expansion
#define REG_LBA_MID(base) (base + 4) REG_LBA_HIGH
Section titled “REG_LBA_HIGH”#define REG_LBA_HIGH(base) source Expansion
#define REG_LBA_HIGH(base) (base + 5) REG_DRIVE_HEAD
Section titled “REG_DRIVE_HEAD”#define REG_DRIVE_HEAD(base) source Expansion
#define REG_DRIVE_HEAD(base) (base + 6) REG_STATUS
Section titled “REG_STATUS”#define REG_STATUS(base) source Expansion
#define REG_STATUS(base) (base + 7) REG_COMMAND
Section titled “REG_COMMAND”#define REG_COMMAND(base) source Expansion
#define REG_COMMAND(base) (base + 7) REG_ALT_STATUS
Section titled “REG_ALT_STATUS”#define REG_ALT_STATUS(ctrl) source Expansion
#define REG_ALT_STATUS(ctrl) (ctrl + 0) REG_CONTROL
Section titled “REG_CONTROL”#define REG_CONTROL(ctrl) source Expansion
#define REG_CONTROL(ctrl) (ctrl + 0) STATUS_BSY
Section titled “STATUS_BSY”#define STATUS_BSY 0x80 source STATUS_DRDY
Section titled “STATUS_DRDY”#define STATUS_DRDY 0x40 source STATUS_DRQ
Section titled “STATUS_DRQ”#define STATUS_DRQ 0x08 source STATUS_ERR
Section titled “STATUS_ERR”#define STATUS_ERR 0x01 source STATUS_DF
Section titled “STATUS_DF”#define STATUS_DF 0x20 source COMMAND_READ
Section titled “COMMAND_READ”#define COMMAND_READ 0x20 source COMMAND_WRITE
Section titled “COMMAND_WRITE”#define COMMAND_WRITE 0x30 source ATA_CMD_READ_PIO
Section titled “ATA_CMD_READ_PIO”#define ATA_CMD_READ_PIO 0x20 source ATA_CMD_READ_PIO_EXT
Section titled “ATA_CMD_READ_PIO_EXT”#define ATA_CMD_READ_PIO_EXT 0x24 source ATA_CMD_READ_DMA
Section titled “ATA_CMD_READ_DMA”#define ATA_CMD_READ_DMA 0xC8 source ATA_CMD_READ_DMA_EXT
Section titled “ATA_CMD_READ_DMA_EXT”#define ATA_CMD_READ_DMA_EXT 0x25 source ATA_CMD_WRITE_PIO
Section titled “ATA_CMD_WRITE_PIO”#define ATA_CMD_WRITE_PIO 0x30 source ATA_CMD_WRITE_PIO_EXT
Section titled “ATA_CMD_WRITE_PIO_EXT”#define ATA_CMD_WRITE_PIO_EXT 0x34 source ATA_CMD_WRITE_DMA
Section titled “ATA_CMD_WRITE_DMA”#define ATA_CMD_WRITE_DMA 0xCA source ATA_CMD_WRITE_DMA_EXT
Section titled “ATA_CMD_WRITE_DMA_EXT”#define ATA_CMD_WRITE_DMA_EXT 0x35 source ATA_CMD_CACHE_FLUSH
Section titled “ATA_CMD_CACHE_FLUSH”#define ATA_CMD_CACHE_FLUSH 0xE7 source ATA_CMD_CACHE_FLUSH_EXT
Section titled “ATA_CMD_CACHE_FLUSH_EXT”#define ATA_CMD_CACHE_FLUSH_EXT 0xEA source ATA_CMD_PACKET
Section titled “ATA_CMD_PACKET”#define ATA_CMD_PACKET 0xA0 source ATA_CMD_IDENTIFY_PACKET
Section titled “ATA_CMD_IDENTIFY_PACKET”#define ATA_CMD_IDENTIFY_PACKET 0xA1 source ATA_CMD_IDENTIFY
Section titled “ATA_CMD_IDENTIFY”#define ATA_CMD_IDENTIFY 0xEC source ATA_PRIMARY_IO
Section titled “ATA_PRIMARY_IO”#define ATA_PRIMARY_IO 0x1F0 source ATA_PRIMARY_CTRL
Section titled “ATA_PRIMARY_CTRL”#define ATA_PRIMARY_CTRL 0x3F6 source ATA_SECONDARY_IO
Section titled “ATA_SECONDARY_IO”#define ATA_SECONDARY_IO 0x170 source ATA_SECONDARY_CTRL
Section titled “ATA_SECONDARY_CTRL”#define ATA_SECONDARY_CTRL 0x376 source IDE_RETRY_COUNT
Section titled “IDE_RETRY_COUNT”#define IDE_RETRY_COUNT 3 source