2008年11月4日 星期二

Linux SATA

ata_init
subsys_initcall(ata_init);
--do nothing but simply create a workqueue "ata"(ata_wq) and a single thread workqueue "ata_aux"(ata_aux_wq)

struct pci_driver ahci_pci_driver::probe=ahci_init_one
--each host driver would register a pci_driver to kernel, once the devid/vendorid matches, the probe function will be ran, which is ahci_init_one in this case

ahci_init_one
--if any host controller found, it would register devices with scsi layer

ata_host_activate(ahci_sht)
ata_host_activate(scsi_host_template )
--It would call scsi_host_add to get hooked into scsi layer


--Upon used to queue up a scsi command block to the low-level device driver (LLDD)
struct scsi_host_template ahci_sht::queuecommand = ata_scsi_queuecmd
ata_scsi_queuecmd

ata_qc_issue
struct ata_port_operation ahci_ops::qc_prep = ahci_qc_prep
--write command slot


ahci_qc_prep
--convert taskfile to fis, and fill the command slot


ata_port_operations inherits relations

SFF: Small Form Factor committee
http://en.wikipedia.org/wiki/Small_Form_Factor_committee

沒有留言: