[PATCH] Minor libata documentation patch

I fleshed out libata.tmpl a bit while I was taking notes.

authored by Edward Falk and committed by Jeff Garzik 8b2af8f0 c7b645f9

+93 -3
+93 -3
Documentation/DocBook/libata.tmpl
··· 84 Called from ata_bus_probe() and ata_bus_reset() error paths, 85 as well as when unregistering from the SCSI module (rmmod, hot 86 unplug). 87 </para> 88 89 </sect2> ··· 105 Called after IDENTIFY [PACKET] DEVICE is issued to each device 106 found. Typically used to apply device-specific fixups prior to 107 issue of SET FEATURES - XFER MODE, and prior to operation. 108 </para> 109 110 </sect2> ··· 150 registers / DMA buffers. ->tf_read() is called to read the 151 hardware registers / DMA buffers, to obtain the current set of 152 taskfile register values. 153 </para> 154 155 </sect2> ··· 164 <para> 165 causes an ATA command, previously loaded with 166 ->tf_load(), to be initiated in hardware. 167 </para> 168 169 </sect2> ··· 179 Allow low-level driver to filter ATA PACKET commands, returning a status 180 indicating whether or not it is OK to use DMA for the supplied PACKET 181 command. 182 </para> 183 184 </sect2> ··· 198 Reads the Status/AltStatus/Error ATA shadow register from 199 hardware. On some hardware, reading the Status register has 200 the side effect of clearing the interrupt condition. 201 </para> 202 203 </sect2> ··· 219 Issues the low-level hardware command(s) that causes one of N 220 hardware devices to be considered 'selected' (active and 221 available for use) on the ATA bus. This generally has no 222 - meaning on FIS-based devices. 223 </para> 224 225 </sect2> ··· 241 for device presence (PATA and SATA), typically a soft reset 242 (SRST) will be performed. Drivers typically use the helper 243 functions ata_bus_reset() or sata_phy_reset() for this hook. 244 </para> 245 246 </sect2> ··· 266 These hooks are typically either no-ops, or simply not implemented, in 267 FIS-based drivers. 268 </para> 269 270 </sect2> 271 ··· 307 and S/G tables have been prepared. IDE BMDMA drivers use the 308 helper function ata_qc_issue_prot() for taskfile protocol-based 309 dispatch. More advanced drivers implement their own ->qc_issue. 310 </para> 311 312 </sect2> ··· 341 before the interrupt handler is registered, to be sure hardware 342 is quiet. 343 </para> 344 345 </sect2> 346 ··· 369 <para> 370 Read and write standard SATA phy registers. Currently only used 371 if ->phy_reset hook called the sata_phy_reset() helper function. 372 </para> 373 374 </sect2> ··· 385 ->port_start() is called just after the data structures for each 386 port are initialized. Typically this is used to alloc per-port 387 DMA buffers / tables / rings, enable DMA engines, and similar 388 - tasks. 389 </para> 390 <para> 391 ->port_stop() is called after ->host_stop(). It's sole function 392 is to release DMA/memory resources, now that they are no longer 393 - actively being used. 394 </para> 395 <para> 396 ->host_stop() is called after all ->port_stop() calls 397 have completed. The hook must finalize hardware shutdown, release DMA 398 and other resources, etc. 399 </para> 400 401 </sect2>
··· 84 Called from ata_bus_probe() and ata_bus_reset() error paths, 85 as well as when unregistering from the SCSI module (rmmod, hot 86 unplug). 87 + This function should do whatever needs to be done to take the 88 + port out of use. In most cases, ata_port_disable() can be used 89 + as this hook. 90 + </para> 91 + <para> 92 + Called from ata_bus_probe() on a failed probe. 93 + Called from ata_bus_reset() on a failed bus reset. 94 + Called from ata_scsi_release(). 95 </para> 96 97 </sect2> ··· 97 Called after IDENTIFY [PACKET] DEVICE is issued to each device 98 found. Typically used to apply device-specific fixups prior to 99 issue of SET FEATURES - XFER MODE, and prior to operation. 100 + </para> 101 + <para> 102 + Called by ata_device_add() after ata_dev_identify() determines 103 + a device is present. 104 + </para> 105 + <para> 106 + This entry may be specified as NULL in ata_port_operations. 107 </para> 108 109 </sect2> ··· 135 registers / DMA buffers. ->tf_read() is called to read the 136 hardware registers / DMA buffers, to obtain the current set of 137 taskfile register values. 138 + Most drivers for taskfile-based hardware (PIO or MMIO) use 139 + ata_tf_load() and ata_tf_read() for these hooks. 140 </para> 141 142 </sect2> ··· 147 <para> 148 causes an ATA command, previously loaded with 149 ->tf_load(), to be initiated in hardware. 150 + Most drivers for taskfile-based hardware use ata_exec_command() 151 + for this hook. 152 </para> 153 154 </sect2> ··· 160 Allow low-level driver to filter ATA PACKET commands, returning a status 161 indicating whether or not it is OK to use DMA for the supplied PACKET 162 command. 163 + </para> 164 + <para> 165 + This hook may be specified as NULL, in which case libata will 166 + assume that atapi dma can be supported. 167 </para> 168 169 </sect2> ··· 175 Reads the Status/AltStatus/Error ATA shadow register from 176 hardware. On some hardware, reading the Status register has 177 the side effect of clearing the interrupt condition. 178 + Most drivers for taskfile-based hardware use 179 + ata_check_status() for this hook. 180 + </para> 181 + <para> 182 + Note that because this is called from ata_device_add(), at 183 + least a dummy function that clears device interrupts must be 184 + provided for all drivers, even if the controller doesn't 185 + actually have a taskfile status register. 186 </para> 187 188 </sect2> ··· 188 Issues the low-level hardware command(s) that causes one of N 189 hardware devices to be considered 'selected' (active and 190 available for use) on the ATA bus. This generally has no 191 + meaning on FIS-based devices. 192 + </para> 193 + <para> 194 + Most drivers for taskfile-based hardware use 195 + ata_std_dev_select() for this hook. Controllers which do not 196 + support second drives on a port (such as SATA contollers) will 197 + use ata_noop_dev_select(). 198 </para> 199 200 </sect2> ··· 204 for device presence (PATA and SATA), typically a soft reset 205 (SRST) will be performed. Drivers typically use the helper 206 functions ata_bus_reset() or sata_phy_reset() for this hook. 207 + Many SATA drivers use sata_phy_reset() or call it from within 208 + their own phy_reset() functions. 209 </para> 210 211 </sect2> ··· 227 These hooks are typically either no-ops, or simply not implemented, in 228 FIS-based drivers. 229 </para> 230 + <para> 231 + Most legacy IDE drivers use ata_bmdma_setup() for the bmdma_setup() 232 + hook. ata_bmdma_setup() will write the pointer to the PRD table to 233 + the IDE PRD Table Address register, enable DMA in the DMA Command 234 + register, and call exec_command() to begin the transfer. 235 + </para> 236 + <para> 237 + Most legacy IDE drivers use ata_bmdma_start() for the bmdma_start() 238 + hook. ata_bmdma_start() will write the ATA_DMA_START flag to the DMA 239 + Command register. 240 + </para> 241 + <para> 242 + Many legacy IDE drivers use ata_bmdma_stop() for the bmdma_stop() 243 + hook. ata_bmdma_stop() clears the ATA_DMA_START flag in the DMA 244 + command register. 245 + </para> 246 + <para> 247 + Many legacy IDE drivers use ata_bmdma_status() as the bmdma_status() hook. 248 + </para> 249 250 </sect2> 251 ··· 249 and S/G tables have been prepared. IDE BMDMA drivers use the 250 helper function ata_qc_issue_prot() for taskfile protocol-based 251 dispatch. More advanced drivers implement their own ->qc_issue. 252 + </para> 253 + <para> 254 + ata_qc_issue_prot() calls ->tf_load(), ->bmdma_setup(), and 255 + ->bmdma_start() as necessary to initiate a transfer. 256 </para> 257 258 </sect2> ··· 279 before the interrupt handler is registered, to be sure hardware 280 is quiet. 281 </para> 282 + <para> 283 + The second argument, dev_instance, should be cast to a pointer 284 + to struct ata_host_set. 285 + </para> 286 + <para> 287 + Most legacy IDE drivers use ata_interrupt() for the 288 + irq_handler hook, which scans all ports in the host_set, 289 + determines which queued command was active (if any), and calls 290 + ata_host_intr(ap,qc). 291 + </para> 292 + <para> 293 + Most legacy IDE drivers use ata_bmdma_irq_clear() for the 294 + irq_clear() hook, which simply clears the interrupt and error 295 + flags in the DMA status register. 296 + </para> 297 298 </sect2> 299 ··· 292 <para> 293 Read and write standard SATA phy registers. Currently only used 294 if ->phy_reset hook called the sata_phy_reset() helper function. 295 + sc_reg is one of SCR_STATUS, SCR_CONTROL, SCR_ERROR, or SCR_ACTIVE. 296 </para> 297 298 </sect2> ··· 307 ->port_start() is called just after the data structures for each 308 port are initialized. Typically this is used to alloc per-port 309 DMA buffers / tables / rings, enable DMA engines, and similar 310 + tasks. Some drivers also use this entry point as a chance to 311 + allocate driver-private memory for ap->private_data. 312 + </para> 313 + <para> 314 + Many drivers use ata_port_start() as this hook or call 315 + it from their own port_start() hooks. ata_port_start() 316 + allocates space for a legacy IDE PRD table and returns. 317 </para> 318 <para> 319 ->port_stop() is called after ->host_stop(). It's sole function 320 is to release DMA/memory resources, now that they are no longer 321 + actively being used. Many drivers also free driver-private 322 + data from port at this time. 323 + </para> 324 + <para> 325 + Many drivers use ata_port_stop() as this hook, which frees the 326 + PRD table. 327 </para> 328 <para> 329 ->host_stop() is called after all ->port_stop() calls 330 have completed. The hook must finalize hardware shutdown, release DMA 331 and other resources, etc. 332 + This hook may be specified as NULL, in which case it is not called. 333 </para> 334 335 </sect2>