···1414 </authorgroup>15151616 <copyright>1717- <year>2003</year>1717+ <year>2003-2005</year>1818 <holder>Jeff Garzik</holder>1919 </copyright>2020···145145 </para>146146147147 <programlisting>148148-u8 (*check_status)(struct ata_port *ap);149149-void (*dev_select)(struct ata_port *ap, unsigned int device);148148+int (*check_atapi_dma) (struct ata_queued_cmd *qc);150149 </programlisting>151150152151 <para>153153- Reads the Status ATA shadow register from hardware. On some154154- hardware, this has the side effect of clearing the interrupt155155- condition.152152+Allow low-level driver to filter ATA PACKET commands, returning a status153153+indicating whether or not it is OK to use DMA for the supplied PACKET154154+command.155155+ </para>156156+157157+ <programlisting>158158+u8 (*check_status)(struct ata_port *ap);159159+u8 (*check_altstatus)(struct ata_port *ap);160160+u8 (*check_err)(struct ata_port *ap);161161+ </programlisting>162162+163163+ <para>164164+ Reads the Status/AltStatus/Error ATA shadow register from165165+ hardware. On some hardware, reading the Status register has166166+ the side effect of clearing the interrupt condition.156167 </para>157168158169 <programlisting>···173162 <para>174163 Issues the low-level hardware command(s) that causes one of N175164 hardware devices to be considered 'selected' (active and176176- available for use) on the ATA bus.165165+ available for use) on the ATA bus. This generally has no166166+meaning on FIS-based devices.177167 </para>178168179169 <programlisting>···192180 <programlisting>193181void (*bmdma_setup) (struct ata_queued_cmd *qc);194182void (*bmdma_start) (struct ata_queued_cmd *qc);183183+void (*bmdma_stop) (struct ata_port *ap);184184+u8 (*bmdma_status) (struct ata_port *ap);195185 </programlisting>196186197187 <para>198198- When setting up an IDE BMDMA transaction, these hooks arm199199- (->bmdma_setup) and fire (->bmdma_start) the hardware's DMA200200- engine.188188+When setting up an IDE BMDMA transaction, these hooks arm189189+(->bmdma_setup), fire (->bmdma_start), and halt (->bmdma_stop)190190+the hardware's DMA engine. ->bmdma_status is used to read the standard191191+PCI IDE DMA Status register.192192+ </para>193193+194194+ <para>195195+These hooks are typically either no-ops, or simply not implemented, in196196+FIS-based drivers.201197 </para>202198203199 <programlisting>···225205 ->qc_issue is used to make a command active, once the hardware226206 and S/G tables have been prepared. IDE BMDMA drivers use the227207 helper function ata_qc_issue_prot() for taskfile protocol-based228228- dispatch. More advanced drivers roll their own ->qc_issue229229- implementation, using this as the "issue new ATA command to230230- hardware" hook.208208+ dispatch. More advanced drivers implement their own ->qc_issue.231209 </para>232210233211 <programlisting>···233215 </programlisting>234216235217 <para>236236- This is a high level error handling function, called from the237237- error handling thread, when a command times out.218218+This is a high level error handling function, called from the219219+error handling thread, when a command times out. Most newer220220+hardware will implement its own error handling code here. IDE BMDMA221221+drivers may use the helper function ata_eng_timeout().238222 </para>239223240224 <programlisting>···275255 tasks. 276256 </para>277257 <para>278278- ->host_stop() is called when the rmmod or hot unplug process279279- begins. The hook must stop all hardware interrupts, DMA280280- engines, etc.281281- </para>282282- <para>283258 ->port_stop() is called after ->host_stop(). It's sole function284259 is to release DMA/memory resources, now that they are no longer285260 actively being used.261261+ </para>262262+ <para>263263+ ->host_stop() is called after all ->port_stop() calls264264+have completed. The hook must finalize hardware shutdown, release DMA265265+and other resources, etc.286266 </para>287267288268 </sect1>
+44-13
drivers/scsi/libata-core.c
···12411241}1242124212431243/**12441244- * __sata_phy_reset -12451245- * @ap:12441244+ * __sata_phy_reset - Wake/reset a low-level SATA PHY12451245+ * @ap: SATA port associated with target SATA PHY.12461246 *12471247- * LOCKING:12471247+ * This function issues commands to standard SATA Sxxx12481248+ * PHY registers, to wake up the phy (and device), and12491249+ * clear any reset condition.12501250+ *12511251+ * LOCKING: None. Serialized during ata_bus_probe().12481252 *12491253 */12501254void __sata_phy_reset(struct ata_port *ap)···12931289}1294129012951291/**12961296- * __sata_phy_reset -12971297- * @ap:12921292+ * sata_phy_reset - Reset SATA bus.12931293+ * @ap: SATA port associated with target SATA PHY.12981294 *12991299- * LOCKING:12951295+ * This function resets the SATA bus, and then probes12961296+ * the bus for devices.12971297+ *12981298+ * LOCKING: None. Serialized during ata_bus_probe().13001299 *13011300 */13021301void sata_phy_reset(struct ata_port *ap)···13111304}1312130513131306/**13141314- * ata_port_disable -13151315- * @ap:13071307+ * ata_port_disable - Disable port.13081308+ * @ap: Port to be disabled.13161309 *13171317- * LOCKING:13101310+ * Modify @ap data structure such that the system13111311+ * thinks that the entire port is disabled, and should13121312+ * never attempt to probe or communicate with devices13131313+ * on this port.13141314+ *13151315+ * LOCKING: host_set lock, or some other form of13161316+ * serialization.13181317 */1319131813201319void ata_port_disable(struct ata_port *ap)···14291416 * ata_set_mode - Program timings and issue SET FEATURES - XFER14301417 * @ap: port on which timings will be programmed14311418 *14321432- * LOCKING:14191419+ * Set ATA device disk transfer mode (PIO3, UDMA6, etc.).14201420+ *14211421+ * LOCKING: None. Serialized during ata_bus_probe().14331422 *14341423 */14351424static void ata_set_mode(struct ata_port *ap)···14821467 * @tmout_pat: impatience timeout14831468 * @tmout: overall timeout14841469 *14851485- * LOCKING:14701470+ * Sleep until ATA Status register bit BSY clears,14711471+ * or a timeout occurs.14721472+ *14731473+ * LOCKING: None.14861474 *14871475 */14881476···15741556 * ata_bus_edd -15751557 * @ap:15761558 *15771577- * LOCKING:15591559+ * LOCKING: None. Serialized during ata_bus_probe().15781560 *15791561 */15801562···19271909 * @ap: Port associated with device @dev19281910 * @dev: Device to which command will be sent19291911 *19301930- * LOCKING:19121912+ * Issue SET FEATURES - XFER MODE command to device @dev19131913+ * on port @ap.19141914+ *19151915+ * LOCKING: None. Serialized during ata_bus_probe().19311916 */1932191719331918static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)···20021981 * ata_fill_sg - Fill PCI IDE PRD table20031982 * @qc: Metadata associated with taskfile to be transferred20041983 *19841984+ * Fill PCI IDE PRD (scatter-gather) table with segments19851985+ * associated with the current disk command.19861986+ *20051987 * LOCKING:19881988+ * spin_lock_irqsave(host_set lock)20061989 *20071990 */20081991static void ata_fill_sg(struct ata_queued_cmd *qc)···20532028 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported20542029 * @qc: Metadata associated with taskfile to check20552030 *20312031+ * Allow low-level driver to filter ATA PACKET commands, returning20322032+ * a status indicating whether or not it is OK to use DMA for the20332033+ * supplied PACKET command.20342034+ *20562035 * LOCKING:20572036 * RETURNS: 0 when ATAPI DMA can be used20582037 * nonzero otherwise···20742045/**20752046 * ata_qc_prep - Prepare taskfile for submission20762047 * @qc: Metadata associated with taskfile to be prepared20482048+ *20492049+ * Prepare ATA taskfile for submission.20772050 *20782051 * LOCKING:20792052 * spin_lock_irqsave(host_set lock)