libATA Developer's Guide

Jeff Garzik


Table of Contents
Thanks
libata Driver API
struct ata_port_operations
libata Library
ata_tf_to_fis --  Convert ATA taskfile to SATA FIS structure
ata_tf_from_fis --  Convert SATA FIS to ATA taskfile
ata_dev_classify --  determine device type based on ATA-spec signature
ata_dev_id_string --  Convert IDENTIFY DEVICE page into string
ata_std_dev_select --  Select device 0/1 on ATA bus
ata_port_probe -- 
__sata_phy_reset -- 
sata_phy_reset -- 
ata_port_disable -- 
ata_bus_reset --  reset host port and associated ATA channel
ata_qc_prep --  Prepare taskfile for submission
ata_eng_timeout --  Handle timeout of queued command
ata_qc_complete --  Complete an active ATA command
ata_qc_issue_prot --  issue taskfile to device in proto-dependent manner
ata_host_intr --  Handle host interrupt for given (port, task)
ata_interrupt --  Default ATA host interrupt handler
ata_device_add -- 
ata_scsi_release --  SCSI layer callback hook for host unload
ata_std_ports --  initialize ioaddr with standard port offsets.
ata_pci_init_one --  Initialize/register PCI IDE host controller
ata_pci_remove_one --  PCI layer callback for device removal
libata Core Internals
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_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_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_prot_to_cmd --  determine which read/write opcodes to use
ata_dev_set_protocol --  set taskfile protocol and r/w commands
ata_mode_string --  convert UDMA bit offset to string
ata_pio_devchk --  PATA device presence detection
ata_mmio_devchk --  PATA device presence detection
ata_devchk --  PATA device presence detection
ata_dev_try_classify --  Parse returned ATA device signature
ata_dev_select --  Select device 0/1 on ATA bus
ata_dump_id --  IDENTIFY DEVICE info debugging output
ata_dev_identify --  obtain IDENTIFY x DEVICE page
ata_bus_probe --  Reset and probe ATA bus
ata_set_mode --  Program timings and issue SET FEATURES - XFER
ata_busy_sleep --  sleep until BSY clears, or timeout
ata_bus_edd -- 
ata_choose_xfer_mode --  attempt to find best transfer mode
ata_dev_set_xfermode --  Issue SET FEATURES - XFER MODE command
ata_sg_clean -- 
ata_fill_sg --  Fill PCI IDE PRD table
ata_check_atapi_dma --  Check whether ATAPI DMA can be supported
ata_sg_setup_one -- 
ata_sg_setup -- 
ata_pio_poll -- 
ata_pio_complete -- 
ata_pio_block -- 
ata_qc_timeout --  Handle timeout of queued command
ata_qc_new --  Request an available ATA command, for queueing
ata_qc_new_init --  Request an available ATA command, and initialize it
ata_qc_free --  free unused ata_queued_cmd
ata_qc_issue --  issue taskfile to device
ata_bmdma_setup_mmio --  Set up PCI IDE BMDMA transaction
ata_bmdma_start_mmio --  Start a PCI IDE BMDMA transaction
ata_bmdma_setup_pio --  Set up PCI IDE BMDMA transaction (PIO)
ata_bmdma_start_pio --  Start a PCI IDE BMDMA transaction (PIO)
atapi_packet_task --  Write CDB bytes to hardware
ata_host_remove --  Unregister SCSI host structure with upper layers
ata_host_init --  Initialize an ata_port structure
ata_host_add --  Attach low-level ATA driver to system
ata_init -- 
libata SCSI translation/emulation
ata_std_bios_param --  generic bios head/sector/cylinder calculator used by sd.
ata_scsi_slave_config --  Set SCSI device attributes
ata_scsi_error --  SCSI layer error handler callback
ata_scsi_queuecmd --  Issue SCSI cdb to libata-managed device
ata_scsi_simulate --  simulate SCSI command on ATA device
ata_scsi_qc_new --  acquire new ata_queued_cmd reference
ata_to_sense_error --  convert ATA error to SCSI error
ata_scsi_flush_xlat --  Translate SCSI SYNCHRONIZE CACHE command
ata_scsi_verify_xlat --  Translate SCSI VERIFY command into an ATA one
ata_scsi_rw_xlat --  Translate SCSI r/w command into an ATA one
ata_scsi_translate --  Translate then issue SCSI command to ATA device
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_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_msense_rw_recovery --  Simulate MODE SENSE r/w error recovery 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 --  End a SCSI request with an error
atapi_xlat --  Initialize PACKET taskfile
ata_scsi_find_dev --  lookup ata_device from scsi_cmnd
ata_get_xlat_func --  check if SCSI to ATA translation is possible
ata_scsi_dump_cdb --  dump SCSI command contents to dmesg
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_sata_probe --  Probe PCI device for present SATA devices
piix_sata_phy_reset --  Probe specified port on SATA host controller
piix_set_piomode --  Initialize host controller PATA PIO timings
piix_set_dmamode --  Initialize host controller PATA PIO timings
piix_init_one --  Register PIIX ATA PCI device with kernel services
piix_init -- 
piix_exit -- 
sata_sil Internals
sil_dev_config --  Apply device/host-specific errata fixups