···14 </authorgroup>1516 <copyright>17- <year>2003</year>18 <holder>Jeff Garzik</holder>19 </copyright>20···145 </para>146147 <programlisting>148-u8 (*check_status)(struct ata_port *ap);149-void (*dev_select)(struct ata_port *ap, unsigned int device);150 </programlisting>151152 <para>153- Reads the Status ATA shadow register from hardware. On some154- hardware, this has the side effect of clearing the interrupt155- condition.000000000000156 </para>157158 <programlisting>···173 <para>174 Issues the low-level hardware command(s) that causes one of N175 hardware devices to be considered 'selected' (active and176- available for use) on the ATA bus.0177 </para>178179 <programlisting>···192 <programlisting>193void (*bmdma_setup) (struct ata_queued_cmd *qc);194void (*bmdma_start) (struct ata_queued_cmd *qc);00195 </programlisting>196197 <para>198- When setting up an IDE BMDMA transaction, these hooks arm199- (->bmdma_setup) and fire (->bmdma_start) the hardware's DMA200- engine.000000201 </para>202203 <programlisting>···225 ->qc_issue is used to make a command active, once the hardware226 and S/G tables have been prepared. IDE BMDMA drivers use the227 helper function ata_qc_issue_prot() for taskfile protocol-based228- dispatch. More advanced drivers roll their own ->qc_issue229- implementation, using this as the "issue new ATA command to230- hardware" hook.231 </para>232233 <programlisting>···233 </programlisting>234235 <para>236- This is a high level error handling function, called from the237- error handling thread, when a command times out.00238 </para>239240 <programlisting>···275 tasks. 276 </para>277 <para>278- ->host_stop() is called when the rmmod or hot unplug process279- begins. The hook must stop all hardware interrupts, DMA280- engines, etc.281- </para>282- <para>283 ->port_stop() is called after ->host_stop(). It's sole function284 is to release DMA/memory resources, now that they are no longer285 actively being used.00000286 </para>287288 </sect1>
···14 </authorgroup>1516 <copyright>17+ <year>2003-2005</year>18 <holder>Jeff Garzik</holder>19 </copyright>20···145 </para>146147 <programlisting>148+int (*check_atapi_dma) (struct ata_queued_cmd *qc);0149 </programlisting>150151 <para>152+Allow low-level driver to filter ATA PACKET commands, returning a status153+indicating whether or not it is OK to use DMA for the supplied PACKET154+command.155+ </para>156+157+ <programlisting>158+u8 (*check_status)(struct ata_port *ap);159+u8 (*check_altstatus)(struct ata_port *ap);160+u8 (*check_err)(struct ata_port *ap);161+ </programlisting>162+163+ <para>164+ Reads the Status/AltStatus/Error ATA shadow register from165+ hardware. On some hardware, reading the Status register has166+ the side effect of clearing the interrupt condition.167 </para>168169 <programlisting>···162 <para>163 Issues the low-level hardware command(s) that causes one of N164 hardware devices to be considered 'selected' (active and165+ available for use) on the ATA bus. This generally has no166+meaning on FIS-based devices.167 </para>168169 <programlisting>···180 <programlisting>181void (*bmdma_setup) (struct ata_queued_cmd *qc);182void (*bmdma_start) (struct ata_queued_cmd *qc);183+void (*bmdma_stop) (struct ata_port *ap);184+u8 (*bmdma_status) (struct ata_port *ap);185 </programlisting>186187 <para>188+When setting up an IDE BMDMA transaction, these hooks arm189+(->bmdma_setup), fire (->bmdma_start), and halt (->bmdma_stop)190+the hardware's DMA engine. ->bmdma_status is used to read the standard191+PCI IDE DMA Status register.192+ </para>193+194+ <para>195+These hooks are typically either no-ops, or simply not implemented, in196+FIS-based drivers.197 </para>198199 <programlisting>···205 ->qc_issue is used to make a command active, once the hardware206 and S/G tables have been prepared. IDE BMDMA drivers use the207 helper function ata_qc_issue_prot() for taskfile protocol-based208+ dispatch. More advanced drivers implement their own ->qc_issue.00209 </para>210211 <programlisting>···215 </programlisting>216217 <para>218+This is a high level error handling function, called from the219+error handling thread, when a command times out. Most newer220+hardware will implement its own error handling code here. IDE BMDMA221+drivers may use the helper function ata_eng_timeout().222 </para>223224 <programlisting>···255 tasks. 256 </para>257 <para>00000258 ->port_stop() is called after ->host_stop(). It's sole function259 is to release DMA/memory resources, now that they are no longer260 actively being used.261+ </para>262+ <para>263+ ->host_stop() is called after all ->port_stop() calls264+have completed. The hook must finalize hardware shutdown, release DMA265+and other resources, etc.266 </para>267268 </sect1>
+44-13
drivers/scsi/libata-core.c
···1241}12421243/**1244- * __sata_phy_reset -1245- * @ap:1246 *1247- * LOCKING:00001248 *1249 */1250void __sata_phy_reset(struct ata_port *ap)···1293}12941295/**1296- * __sata_phy_reset -1297- * @ap:1298 *1299- * LOCKING:0001300 *1301 */1302void sata_phy_reset(struct ata_port *ap)···1311}13121313/**1314- * ata_port_disable -1315- * @ap:1316 *1317- * LOCKING:0000001318 */13191320void ata_port_disable(struct ata_port *ap)···1429 * ata_set_mode - Program timings and issue SET FEATURES - XFER1430 * @ap: port on which timings will be programmed1431 *1432- * LOCKING:001433 *1434 */1435static void ata_set_mode(struct ata_port *ap)···1482 * @tmout_pat: impatience timeout1483 * @tmout: overall timeout1484 *1485- * LOCKING:0001486 *1487 */1488···1574 * ata_bus_edd -1575 * @ap:1576 *1577- * LOCKING:1578 *1579 */1580···1927 * @ap: Port associated with device @dev1928 * @dev: Device to which command will be sent1929 *1930- * LOCKING:0001931 */19321933static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)···2002 * ata_fill_sg - Fill PCI IDE PRD table2003 * @qc: Metadata associated with taskfile to be transferred2004 *0002005 * LOCKING:02006 *2007 */2008static void ata_fill_sg(struct ata_queued_cmd *qc)···2053 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported2054 * @qc: Metadata associated with taskfile to check2055 *00002056 * LOCKING:2057 * RETURNS: 0 when ATAPI DMA can be used2058 * nonzero otherwise···2074/**2075 * ata_qc_prep - Prepare taskfile for submission2076 * @qc: Metadata associated with taskfile to be prepared002077 *2078 * LOCKING:2079 * spin_lock_irqsave(host_set lock)
···1241}12421243/**1244+ * __sata_phy_reset - Wake/reset a low-level SATA PHY1245+ * @ap: SATA port associated with target SATA PHY.1246 *1247+ * This function issues commands to standard SATA Sxxx1248+ * PHY registers, to wake up the phy (and device), and1249+ * clear any reset condition.1250+ *1251+ * LOCKING: None. Serialized during ata_bus_probe().1252 *1253 */1254void __sata_phy_reset(struct ata_port *ap)···1289}12901291/**1292+ * sata_phy_reset - Reset SATA bus.1293+ * @ap: SATA port associated with target SATA PHY.1294 *1295+ * This function resets the SATA bus, and then probes1296+ * the bus for devices.1297+ *1298+ * LOCKING: None. Serialized during ata_bus_probe().1299 *1300 */1301void sata_phy_reset(struct ata_port *ap)···1304}13051306/**1307+ * ata_port_disable - Disable port.1308+ * @ap: Port to be disabled.1309 *1310+ * Modify @ap data structure such that the system1311+ * thinks that the entire port is disabled, and should1312+ * never attempt to probe or communicate with devices1313+ * on this port.1314+ *1315+ * LOCKING: host_set lock, or some other form of1316+ * serialization.1317 */13181319void ata_port_disable(struct ata_port *ap)···1416 * ata_set_mode - Program timings and issue SET FEATURES - XFER1417 * @ap: port on which timings will be programmed1418 *1419+ * Set ATA device disk transfer mode (PIO3, UDMA6, etc.).1420+ *1421+ * LOCKING: None. Serialized during ata_bus_probe().1422 *1423 */1424static void ata_set_mode(struct ata_port *ap)···1467 * @tmout_pat: impatience timeout1468 * @tmout: overall timeout1469 *1470+ * Sleep until ATA Status register bit BSY clears,1471+ * or a timeout occurs.1472+ *1473+ * LOCKING: None.1474 *1475 */1476···1556 * ata_bus_edd -1557 * @ap:1558 *1559+ * LOCKING: None. Serialized during ata_bus_probe().1560 *1561 */1562···1909 * @ap: Port associated with device @dev1910 * @dev: Device to which command will be sent1911 *1912+ * Issue SET FEATURES - XFER MODE command to device @dev1913+ * on port @ap.1914+ *1915+ * LOCKING: None. Serialized during ata_bus_probe().1916 */19171918static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)···1981 * ata_fill_sg - Fill PCI IDE PRD table1982 * @qc: Metadata associated with taskfile to be transferred1983 *1984+ * Fill PCI IDE PRD (scatter-gather) table with segments1985+ * associated with the current disk command.1986+ *1987 * LOCKING:1988+ * spin_lock_irqsave(host_set lock)1989 *1990 */1991static void ata_fill_sg(struct ata_queued_cmd *qc)···2028 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported2029 * @qc: Metadata associated with taskfile to check2030 *2031+ * Allow low-level driver to filter ATA PACKET commands, returning2032+ * a status indicating whether or not it is OK to use DMA for the2033+ * supplied PACKET command.2034+ *2035 * LOCKING:2036 * RETURNS: 0 when ATAPI DMA can be used2037 * nonzero otherwise···2045/**2046 * ata_qc_prep - Prepare taskfile for submission2047 * @qc: Metadata associated with taskfile to be prepared2048+ *2049+ * Prepare ATA taskfile for submission.2050 *2051 * LOCKING:2052 * spin_lock_irqsave(host_set lock)