libATA Developer's Guide

Jeff Garzik


Table of Contents
Thanks
libata Library
ata_tf_load_pio --  send taskfile registers to host controller
ata_tf_load_mmio --  send taskfile registers to host controller
ata_exec_command_pio --  issue ATA command to host controller
ata_exec_command_mmio --  issue ATA command to host controller
ata_tf_read_pio --  input device's ATA taskfile shadow registers
ata_tf_read_mmio --  input device's ATA taskfile shadow registers
ata_check_status_pio --  Read device status reg & clear interrupt
ata_check_status_mmio --  Read device status reg & clear interrupt
ata_port_probe -- 
sata_phy_reset -- 
ata_port_disable -- 
pata_phy_config -- 
ata_bus_reset --  reset host port and associated ATA channel
ata_fill_sg -- 
ata_eng_timeout --  Handle timeout of queued command
ata_qc_complete -- 
ata_bmdma_start_mmio -- 
ata_bmdma_start_pio -- 
ata_interrupt -- 
ata_device_add -- 
ata_scsi_detect -- 
ata_scsi_release --  SCSI layer callback hook for host unload
ata_std_ports --  initialize ioaddr with standard port offsets.
ata_pci_init_one -- 
ata_pci_remove_one --  PCI layer callback for device removal
ata_add_to_probe_list --  add an entry to the list of things
ata_std_bios_param --  generic bios head/sector/cylinder calculator
ata_scsi_error --  SCSI layer error handler callback
ata_scsi_queuecmd --  Issue SCSI cdb to libata-managed device
libata Internals
ata_thr_state_name --  convert thread state enum to string
msleep --  sleep for a number of milliseconds
ata_exec --  issue ATA command to host controller
ata_tf_to_host --  issue ATA taskfile to host controller
ata_tf_to_host_nolock --  issue ATA taskfile to host controller
ata_udma_string --  convert UDMA bit offset to string
ata_pio_devchk -- 
ata_mmio_devchk -- 
ata_dev_devchk -- 
ata_dev_classify --  determine device type based on ATA-spec signature
ata_dev_try_classify -- 
ata_dev_id_string -- 
ata_dev_parse_strings -- 
__ata_dev_select -- 
ata_dev_select -- 
ata_dump_id -- 
ata_dev_identify --  obtain IDENTIFY x DEVICE page
ata_port_reset -- 
ata_busy_sleep --  sleep until BSY clears, or timeout
ata_bus_edd -- 
ata_host_set_pio -- 
ata_host_set_udma -- 
ata_dev_set_xfermode -- 
ata_dev_set_udma -- 
ata_dev_set_pio -- 
ata_sg_clean -- 
ata_sg_setup_one -- 
ata_sg_setup -- 
ata_pio_poll -- 
ata_pio_start -- 
ata_pio_complete -- 
ata_pio_sector -- 
ata_eng_schedule --  run an iteration of the pio/dma/whatever engine
ata_qc_new -- 
ata_qc_new_init -- 
ata_qc_push -- 
ata_qc_issue -- 
ata_dma_complete -- 
ata_host_intr --  Handle host interrupt for given (port, task)
ata_thread_wake -- 
ata_thread_timer -- 
ata_thread_iter -- 
ata_thread -- 
ata_thread_kill --  kill per-port kernel thread
atapi_cdb_send --  Write CDB bytes to hardware
ata_host_remove -- 
ata_host_init -- 
ata_host_add -- 
ata_init -- 
ata_to_sense_error -- 
ata_scsi_rw_xlat -- 
ata_scsi_rw_queue -- 
ata_scsi_rbuf_get --  Map response buffer.
ata_scsi_rbuf_put --  Unmap response buffer.
ata_scsi_rbuf_fill --  wrapper for SCSI command simulators
ata_scsiop_inq_std --  Simulate INQUIRY command
ata_scsiop_inq_00 --  Simulate INQUIRY EVPD page 0, list of pages
ata_scsiop_inq_80 --  Simulate INQUIRY EVPD page 80, device serial number
ata_scsiop_inq_83 --  Simulate INQUIRY EVPD page 83, device identity
ata_scsiop_noop -- 
ata_scsiop_sync_cache --  Simulate SYNCHRONIZE CACHE command
ata_msense_push --  Push data onto MODE SENSE data output buffer
ata_msense_caching --  Simulate MODE SENSE caching info page
ata_msense_ctl_mode --  Simulate MODE SENSE control mode page
ata_scsiop_mode_sense --  Simulate MODE SENSE 6, 10 commands
ata_scsiop_read_cap --  Simulate READ CAPACITY[ 16] commands
ata_scsiop_report_luns --  Simulate REPORT LUNS command
ata_scsi_badcmd -- 
atapi_scsi_queuecmd --  Send CDB to ATAPI device
ata_piix Internals
piix_pata_cbl_detect --  Probe host controller cable detect info
piix_pata_phy_reset --  Probe specified port on PATA host controller
piix_pcs_probe --  Probe SATA port configuration and status register
piix_pcs_disable --  Disable SATA port
piix_sata_phy_reset --  Probe specified port on SATA host controller
piix_sata_port_disable --  Disable SATA port
piix_set_piomode --  Initialize host controller PATA PIO timings
piix_set_udmamode --  Initialize host controller PATA PIO timings
piix_probe_combined --  Determine if PATA and SATA are combined
piix_init_one --  Register PIIX ATA PCI device with kernel services
piix_init -- 
piix_exit -- 
ata_sil Internals
sil_dev_config --  Apply device/host-specific errata fixups
ata_via Internals
svia_sata_phy_reset -- 
svia_port_disable -- 
svia_set_piomode -- 
svia_set_udmamode -- 
svia_init_one -- 
svia_init -- 
svia_exit --