···8484 Called from ata_bus_probe() and ata_bus_reset() error paths,8585 as well as when unregistering from the SCSI module (rmmod, hot8686 unplug).8787+ This function should do whatever needs to be done to take the8888+ port out of use. In most cases, ata_port_disable() can be used8989+ as this hook.9090+ </para>9191+ <para>9292+ Called from ata_bus_probe() on a failed probe.9393+ Called from ata_bus_reset() on a failed bus reset.9494+ Called from ata_scsi_release().8795 </para>88968997 </sect2>···10597 Called after IDENTIFY [PACKET] DEVICE is issued to each device10698 found. Typically used to apply device-specific fixups prior to10799 issue of SET FEATURES - XFER MODE, and prior to operation.100100+ </para>101101+ <para>102102+ Called by ata_device_add() after ata_dev_identify() determines103103+ a device is present.104104+ </para>105105+ <para>106106+ This entry may be specified as NULL in ata_port_operations.108107 </para>109108110109 </sect2>···150135 registers / DMA buffers. ->tf_read() is called to read the151136 hardware registers / DMA buffers, to obtain the current set of152137 taskfile register values.138138+ Most drivers for taskfile-based hardware (PIO or MMIO) use139139+ ata_tf_load() and ata_tf_read() for these hooks.153140 </para>154141155142 </sect2>···164147 <para>165148 causes an ATA command, previously loaded with166149 ->tf_load(), to be initiated in hardware.150150+ Most drivers for taskfile-based hardware use ata_exec_command()151151+ for this hook.167152 </para>168153169154 </sect2>···179160Allow low-level driver to filter ATA PACKET commands, returning a status180161indicating whether or not it is OK to use DMA for the supplied PACKET181162command.163163+ </para>164164+ <para>165165+ This hook may be specified as NULL, in which case libata will166166+ assume that atapi dma can be supported.182167 </para>183168184169 </sect2>···198175 Reads the Status/AltStatus/Error ATA shadow register from199176 hardware. On some hardware, reading the Status register has200177 the side effect of clearing the interrupt condition.178178+ Most drivers for taskfile-based hardware use179179+ ata_check_status() for this hook.180180+ </para>181181+ <para>182182+ Note that because this is called from ata_device_add(), at183183+ least a dummy function that clears device interrupts must be184184+ provided for all drivers, even if the controller doesn't185185+ actually have a taskfile status register.201186 </para>202187203188 </sect2>···219188 Issues the low-level hardware command(s) that causes one of N220189 hardware devices to be considered 'selected' (active and221190 available for use) on the ATA bus. This generally has no222222-meaning on FIS-based devices.191191+ meaning on FIS-based devices.192192+ </para>193193+ <para>194194+ Most drivers for taskfile-based hardware use195195+ ata_std_dev_select() for this hook. Controllers which do not196196+ support second drives on a port (such as SATA contollers) will197197+ use ata_noop_dev_select().223198 </para>224199225200 </sect2>···241204 for device presence (PATA and SATA), typically a soft reset242205 (SRST) will be performed. Drivers typically use the helper243206 functions ata_bus_reset() or sata_phy_reset() for this hook.207207+ Many SATA drivers use sata_phy_reset() or call it from within208208+ their own phy_reset() functions.244209 </para>245210246211 </sect2>···266227These hooks are typically either no-ops, or simply not implemented, in267228FIS-based drivers.268229 </para>230230+ <para>231231+Most legacy IDE drivers use ata_bmdma_setup() for the bmdma_setup()232232+hook. ata_bmdma_setup() will write the pointer to the PRD table to233233+the IDE PRD Table Address register, enable DMA in the DMA Command234234+register, and call exec_command() to begin the transfer.235235+ </para>236236+ <para>237237+Most legacy IDE drivers use ata_bmdma_start() for the bmdma_start()238238+hook. ata_bmdma_start() will write the ATA_DMA_START flag to the DMA239239+Command register.240240+ </para>241241+ <para>242242+Many legacy IDE drivers use ata_bmdma_stop() for the bmdma_stop()243243+hook. ata_bmdma_stop() clears the ATA_DMA_START flag in the DMA244244+command register.245245+ </para>246246+ <para>247247+Many legacy IDE drivers use ata_bmdma_status() as the bmdma_status() hook.248248+ </para>269249270250 </sect2>271251···307249 and S/G tables have been prepared. IDE BMDMA drivers use the308250 helper function ata_qc_issue_prot() for taskfile protocol-based309251 dispatch. More advanced drivers implement their own ->qc_issue.252252+ </para>253253+ <para>254254+ ata_qc_issue_prot() calls ->tf_load(), ->bmdma_setup(), and255255+ ->bmdma_start() as necessary to initiate a transfer.310256 </para>311257312258 </sect2>···341279 before the interrupt handler is registered, to be sure hardware342280 is quiet.343281 </para>282282+ <para>283283+ The second argument, dev_instance, should be cast to a pointer284284+ to struct ata_host_set.285285+ </para>286286+ <para>287287+ Most legacy IDE drivers use ata_interrupt() for the288288+ irq_handler hook, which scans all ports in the host_set,289289+ determines which queued command was active (if any), and calls290290+ ata_host_intr(ap,qc).291291+ </para>292292+ <para>293293+ Most legacy IDE drivers use ata_bmdma_irq_clear() for the294294+ irq_clear() hook, which simply clears the interrupt and error295295+ flags in the DMA status register.296296+ </para>344297345298 </sect2>346299···369292 <para>370293 Read and write standard SATA phy registers. Currently only used371294 if ->phy_reset hook called the sata_phy_reset() helper function.295295+ sc_reg is one of SCR_STATUS, SCR_CONTROL, SCR_ERROR, or SCR_ACTIVE.372296 </para>373297374298 </sect2>···385307 ->port_start() is called just after the data structures for each386308 port are initialized. Typically this is used to alloc per-port387309 DMA buffers / tables / rings, enable DMA engines, and similar388388- tasks. 310310+ tasks. Some drivers also use this entry point as a chance to311311+ allocate driver-private memory for ap->private_data.312312+ </para>313313+ <para>314314+ Many drivers use ata_port_start() as this hook or call315315+ it from their own port_start() hooks. ata_port_start()316316+ allocates space for a legacy IDE PRD table and returns.389317 </para>390318 <para>391319 ->port_stop() is called after ->host_stop(). It's sole function392320 is to release DMA/memory resources, now that they are no longer393393- actively being used.321321+ actively being used. Many drivers also free driver-private322322+ data from port at this time.323323+ </para>324324+ <para>325325+ Many drivers use ata_port_stop() as this hook, which frees the326326+ PRD table.394327 </para>395328 <para>396329 ->host_stop() is called after all ->port_stop() calls397330have completed. The hook must finalize hardware shutdown, release DMA398331and other resources, etc.332332+ This hook may be specified as NULL, in which case it is not called.399333 </para>400334401335 </sect2>