libata: more doc updates

Document recently-added ata_port_operations hooks.

Fill several doc stubs in libata-core.c.

+84 -33
+40 -20
Documentation/DocBook/libata.tmpl
··· 14 </authorgroup> 15 16 <copyright> 17 - <year>2003</year> 18 <holder>Jeff Garzik</holder> 19 </copyright> 20 ··· 145 </para> 146 147 <programlisting> 148 - u8 (*check_status)(struct ata_port *ap); 149 - void (*dev_select)(struct ata_port *ap, unsigned int device); 150 </programlisting> 151 152 <para> 153 - Reads the Status ATA shadow register from hardware. On some 154 - hardware, this has the side effect of clearing the interrupt 155 - condition. 156 </para> 157 158 <programlisting> ··· 173 <para> 174 Issues the low-level hardware command(s) that causes one of N 175 hardware devices to be considered 'selected' (active and 176 - available for use) on the ATA bus. 177 </para> 178 179 <programlisting> ··· 192 <programlisting> 193 void (*bmdma_setup) (struct ata_queued_cmd *qc); 194 void (*bmdma_start) (struct ata_queued_cmd *qc); 195 </programlisting> 196 197 <para> 198 - When setting up an IDE BMDMA transaction, these hooks arm 199 - (->bmdma_setup) and fire (->bmdma_start) the hardware's DMA 200 - engine. 201 </para> 202 203 <programlisting> ··· 225 ->qc_issue is used to make a command active, once the hardware 226 and S/G tables have been prepared. IDE BMDMA drivers use the 227 helper function ata_qc_issue_prot() for taskfile protocol-based 228 - dispatch. More advanced drivers roll their own ->qc_issue 229 - implementation, using this as the "issue new ATA command to 230 - hardware" hook. 231 </para> 232 233 <programlisting> ··· 233 </programlisting> 234 235 <para> 236 - This is a high level error handling function, called from the 237 - error handling thread, when a command times out. 238 </para> 239 240 <programlisting> ··· 275 tasks. 276 </para> 277 <para> 278 - ->host_stop() is called when the rmmod or hot unplug process 279 - begins. The hook must stop all hardware interrupts, DMA 280 - engines, etc. 281 - </para> 282 - <para> 283 ->port_stop() is called after ->host_stop(). It's sole function 284 is to release DMA/memory resources, now that they are no longer 285 actively being used. 286 </para> 287 288 </sect1>
··· 14 </authorgroup> 15 16 <copyright> 17 + <year>2003-2005</year> 18 <holder>Jeff Garzik</holder> 19 </copyright> 20 ··· 145 </para> 146 147 <programlisting> 148 + int (*check_atapi_dma) (struct ata_queued_cmd *qc); 149 </programlisting> 150 151 <para> 152 + Allow low-level driver to filter ATA PACKET commands, returning a status 153 + indicating whether or not it is OK to use DMA for the supplied PACKET 154 + 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 from 165 + hardware. On some hardware, reading the Status register has 166 + the side effect of clearing the interrupt condition. 167 </para> 168 169 <programlisting> ··· 162 <para> 163 Issues the low-level hardware command(s) that causes one of N 164 hardware devices to be considered 'selected' (active and 165 + available for use) on the ATA bus. This generally has no 166 + meaning on FIS-based devices. 167 </para> 168 169 <programlisting> ··· 180 <programlisting> 181 void (*bmdma_setup) (struct ata_queued_cmd *qc); 182 void (*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> 186 187 <para> 188 + When setting up an IDE BMDMA transaction, these hooks arm 189 + (->bmdma_setup), fire (->bmdma_start), and halt (->bmdma_stop) 190 + the hardware's DMA engine. ->bmdma_status is used to read the standard 191 + PCI IDE DMA Status register. 192 + </para> 193 + 194 + <para> 195 + These hooks are typically either no-ops, or simply not implemented, in 196 + FIS-based drivers. 197 </para> 198 199 <programlisting> ··· 205 ->qc_issue is used to make a command active, once the hardware 206 and S/G tables have been prepared. IDE BMDMA drivers use the 207 helper function ata_qc_issue_prot() for taskfile protocol-based 208 + dispatch. More advanced drivers implement their own ->qc_issue. 209 </para> 210 211 <programlisting> ··· 215 </programlisting> 216 217 <para> 218 + This is a high level error handling function, called from the 219 + error handling thread, when a command times out. Most newer 220 + hardware will implement its own error handling code here. IDE BMDMA 221 + drivers may use the helper function ata_eng_timeout(). 222 </para> 223 224 <programlisting> ··· 255 tasks. 256 </para> 257 <para> 258 ->port_stop() is called after ->host_stop(). It's sole function 259 is to release DMA/memory resources, now that they are no longer 260 actively being used. 261 + </para> 262 + <para> 263 + ->host_stop() is called after all ->port_stop() calls 264 + have completed. The hook must finalize hardware shutdown, release DMA 265 + and other resources, etc. 266 </para> 267 268 </sect1>
+44 -13
drivers/scsi/libata-core.c
··· 1241 } 1242 1243 /** 1244 - * __sata_phy_reset - 1245 - * @ap: 1246 * 1247 - * LOCKING: 1248 * 1249 */ 1250 void __sata_phy_reset(struct ata_port *ap) ··· 1293 } 1294 1295 /** 1296 - * __sata_phy_reset - 1297 - * @ap: 1298 * 1299 - * LOCKING: 1300 * 1301 */ 1302 void sata_phy_reset(struct ata_port *ap) ··· 1311 } 1312 1313 /** 1314 - * ata_port_disable - 1315 - * @ap: 1316 * 1317 - * LOCKING: 1318 */ 1319 1320 void ata_port_disable(struct ata_port *ap) ··· 1429 * ata_set_mode - Program timings and issue SET FEATURES - XFER 1430 * @ap: port on which timings will be programmed 1431 * 1432 - * LOCKING: 1433 * 1434 */ 1435 static void ata_set_mode(struct ata_port *ap) ··· 1482 * @tmout_pat: impatience timeout 1483 * @tmout: overall timeout 1484 * 1485 - * LOCKING: 1486 * 1487 */ 1488 ··· 1574 * ata_bus_edd - 1575 * @ap: 1576 * 1577 - * LOCKING: 1578 * 1579 */ 1580 ··· 1927 * @ap: Port associated with device @dev 1928 * @dev: Device to which command will be sent 1929 * 1930 - * LOCKING: 1931 */ 1932 1933 static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev) ··· 2002 * ata_fill_sg - Fill PCI IDE PRD table 2003 * @qc: Metadata associated with taskfile to be transferred 2004 * 2005 * LOCKING: 2006 * 2007 */ 2008 static void ata_fill_sg(struct ata_queued_cmd *qc) ··· 2053 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported 2054 * @qc: Metadata associated with taskfile to check 2055 * 2056 * LOCKING: 2057 * RETURNS: 0 when ATAPI DMA can be used 2058 * nonzero otherwise ··· 2074 /** 2075 * ata_qc_prep - Prepare taskfile for submission 2076 * @qc: Metadata associated with taskfile to be prepared 2077 * 2078 * LOCKING: 2079 * spin_lock_irqsave(host_set lock)
··· 1241 } 1242 1243 /** 1244 + * __sata_phy_reset - Wake/reset a low-level SATA PHY 1245 + * @ap: SATA port associated with target SATA PHY. 1246 * 1247 + * This function issues commands to standard SATA Sxxx 1248 + * PHY registers, to wake up the phy (and device), and 1249 + * clear any reset condition. 1250 + * 1251 + * LOCKING: None. Serialized during ata_bus_probe(). 1252 * 1253 */ 1254 void __sata_phy_reset(struct ata_port *ap) ··· 1289 } 1290 1291 /** 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 probes 1296 + * the bus for devices. 1297 + * 1298 + * LOCKING: None. Serialized during ata_bus_probe(). 1299 * 1300 */ 1301 void sata_phy_reset(struct ata_port *ap) ··· 1304 } 1305 1306 /** 1307 + * ata_port_disable - Disable port. 1308 + * @ap: Port to be disabled. 1309 * 1310 + * Modify @ap data structure such that the system 1311 + * thinks that the entire port is disabled, and should 1312 + * never attempt to probe or communicate with devices 1313 + * on this port. 1314 + * 1315 + * LOCKING: host_set lock, or some other form of 1316 + * serialization. 1317 */ 1318 1319 void ata_port_disable(struct ata_port *ap) ··· 1416 * ata_set_mode - Program timings and issue SET FEATURES - XFER 1417 * @ap: port on which timings will be programmed 1418 * 1419 + * Set ATA device disk transfer mode (PIO3, UDMA6, etc.). 1420 + * 1421 + * LOCKING: None. Serialized during ata_bus_probe(). 1422 * 1423 */ 1424 static void ata_set_mode(struct ata_port *ap) ··· 1467 * @tmout_pat: impatience timeout 1468 * @tmout: overall timeout 1469 * 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 @dev 1910 * @dev: Device to which command will be sent 1911 * 1912 + * Issue SET FEATURES - XFER MODE command to device @dev 1913 + * on port @ap. 1914 + * 1915 + * LOCKING: None. Serialized during ata_bus_probe(). 1916 */ 1917 1918 static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev) ··· 1981 * ata_fill_sg - Fill PCI IDE PRD table 1982 * @qc: Metadata associated with taskfile to be transferred 1983 * 1984 + * Fill PCI IDE PRD (scatter-gather) table with segments 1985 + * associated with the current disk command. 1986 + * 1987 * LOCKING: 1988 + * spin_lock_irqsave(host_set lock) 1989 * 1990 */ 1991 static void ata_fill_sg(struct ata_queued_cmd *qc) ··· 2028 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported 2029 * @qc: Metadata associated with taskfile to check 2030 * 2031 + * Allow low-level driver to filter ATA PACKET commands, returning 2032 + * a status indicating whether or not it is OK to use DMA for the 2033 + * supplied PACKET command. 2034 + * 2035 * LOCKING: 2036 * RETURNS: 0 when ATAPI DMA can be used 2037 * nonzero otherwise ··· 2045 /** 2046 * ata_qc_prep - Prepare taskfile for submission 2047 * @qc: Metadata associated with taskfile to be prepared 2048 + * 2049 + * Prepare ATA taskfile for submission. 2050 * 2051 * LOCKING: 2052 * spin_lock_irqsave(host_set lock)