diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 18:58:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 18:58:44 -0400 |
commit | 6edad161cd4dfe1df772e7a74ab63cab53b5e8c1 (patch) | |
tree | 389d6daa728b2ba1bd8c2180cab705706449f62a /Documentation | |
parent | 236ee8c33277ab48671995f26dc68a4639936418 (diff) | |
parent | 0dd4b21f517e138ea113db255645fbae1bf5eef3 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (258 commits)
[libata] conversion to new debug scheme, part 1 of $N
[PATCH] libata: Add ata_scsi_dev_disabled
[libata] Add host lock to struct ata_port
[PATCH] libata: implement per-dev EH action mask eh_info->dev_action[]
[PATCH] libata-dev: move the CDB-intr DMA blacklisting
[PATCH] ahci: disable NCQ support on vt8251
[libata] ahci: add JMicron PCI IDs
[libata] sata_nv: add PCI IDs
[libata] ahci: Add NVIDIA PCI IDs.
[PATCH] libata: convert several bmdma-style controllers to new EH, take #3
[PATCH] sata_via: convert to new EH, take #3
[libata] sata_nv: s/spin_lock_irqsave/spin_lock/ in irq handler
[PATCH] sata_nv: add hotplug support
[PATCH] sata_nv: convert to new EH
[PATCH] sata_nv: better irq handlers
[PATCH] sata_nv: simplify constants
[PATCH] sata_nv: kill struct nv_host_desc and nv_host
[PATCH] sata_nv: kill not-working hotplug code
[libata] Update docs to reflect current driver API
[PATCH] libata: add host_set->next for legacy two host_sets case, take #3
...
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/DocBook/libata.tmpl | 104 |
1 files changed, 80 insertions, 24 deletions
diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl index f869b03929db..e97c32314541 100644 --- a/Documentation/DocBook/libata.tmpl +++ b/Documentation/DocBook/libata.tmpl | |||
@@ -169,6 +169,22 @@ void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); | |||
169 | 169 | ||
170 | </sect2> | 170 | </sect2> |
171 | 171 | ||
172 | <sect2><title>PIO data read/write</title> | ||
173 | <programlisting> | ||
174 | void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int); | ||
175 | </programlisting> | ||
176 | |||
177 | <para> | ||
178 | All bmdma-style drivers must implement this hook. This is the low-level | ||
179 | operation that actually copies the data bytes during a PIO data | ||
180 | transfer. | ||
181 | Typically the driver | ||
182 | will choose one of ata_pio_data_xfer_noirq(), ata_pio_data_xfer(), or | ||
183 | ata_mmio_data_xfer(). | ||
184 | </para> | ||
185 | |||
186 | </sect2> | ||
187 | |||
172 | <sect2><title>ATA command execute</title> | 188 | <sect2><title>ATA command execute</title> |
173 | <programlisting> | 189 | <programlisting> |
174 | void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); | 190 | void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); |
@@ -204,11 +220,10 @@ command. | |||
204 | <programlisting> | 220 | <programlisting> |
205 | u8 (*check_status)(struct ata_port *ap); | 221 | u8 (*check_status)(struct ata_port *ap); |
206 | u8 (*check_altstatus)(struct ata_port *ap); | 222 | u8 (*check_altstatus)(struct ata_port *ap); |
207 | u8 (*check_err)(struct ata_port *ap); | ||
208 | </programlisting> | 223 | </programlisting> |
209 | 224 | ||
210 | <para> | 225 | <para> |
211 | Reads the Status/AltStatus/Error ATA shadow register from | 226 | Reads the Status/AltStatus ATA shadow register from |
212 | hardware. On some hardware, reading the Status register has | 227 | hardware. On some hardware, reading the Status register has |
213 | the side effect of clearing the interrupt condition. | 228 | the side effect of clearing the interrupt condition. |
214 | Most drivers for taskfile-based hardware use | 229 | Most drivers for taskfile-based hardware use |
@@ -269,23 +284,6 @@ void (*set_mode) (struct ata_port *ap); | |||
269 | 284 | ||
270 | </sect2> | 285 | </sect2> |
271 | 286 | ||
272 | <sect2><title>Reset ATA bus</title> | ||
273 | <programlisting> | ||
274 | void (*phy_reset) (struct ata_port *ap); | ||
275 | </programlisting> | ||
276 | |||
277 | <para> | ||
278 | The very first step in the probe phase. Actions vary depending | ||
279 | on the bus type, typically. After waking up the device and probing | ||
280 | for device presence (PATA and SATA), typically a soft reset | ||
281 | (SRST) will be performed. Drivers typically use the helper | ||
282 | functions ata_bus_reset() or sata_phy_reset() for this hook. | ||
283 | Many SATA drivers use sata_phy_reset() or call it from within | ||
284 | their own phy_reset() functions. | ||
285 | </para> | ||
286 | |||
287 | </sect2> | ||
288 | |||
289 | <sect2><title>Control PCI IDE BMDMA engine</title> | 287 | <sect2><title>Control PCI IDE BMDMA engine</title> |
290 | <programlisting> | 288 | <programlisting> |
291 | void (*bmdma_setup) (struct ata_queued_cmd *qc); | 289 | void (*bmdma_setup) (struct ata_queued_cmd *qc); |
@@ -354,16 +352,74 @@ int (*qc_issue) (struct ata_queued_cmd *qc); | |||
354 | 352 | ||
355 | </sect2> | 353 | </sect2> |
356 | 354 | ||
357 | <sect2><title>Timeout (error) handling</title> | 355 | <sect2><title>Exception and probe handling (EH)</title> |
358 | <programlisting> | 356 | <programlisting> |
359 | void (*eng_timeout) (struct ata_port *ap); | 357 | void (*eng_timeout) (struct ata_port *ap); |
358 | void (*phy_reset) (struct ata_port *ap); | ||
359 | </programlisting> | ||
360 | |||
361 | <para> | ||
362 | Deprecated. Use ->error_handler() instead. | ||
363 | </para> | ||
364 | |||
365 | <programlisting> | ||
366 | void (*freeze) (struct ata_port *ap); | ||
367 | void (*thaw) (struct ata_port *ap); | ||
368 | </programlisting> | ||
369 | |||
370 | <para> | ||
371 | ata_port_freeze() is called when HSM violations or some other | ||
372 | condition disrupts normal operation of the port. A frozen port | ||
373 | is not allowed to perform any operation until the port is | ||
374 | thawed, which usually follows a successful reset. | ||
375 | </para> | ||
376 | |||
377 | <para> | ||
378 | The optional ->freeze() callback can be used for freezing the port | ||
379 | hardware-wise (e.g. mask interrupt and stop DMA engine). If a | ||
380 | port cannot be frozen hardware-wise, the interrupt handler | ||
381 | must ack and clear interrupts unconditionally while the port | ||
382 | is frozen. | ||
383 | </para> | ||
384 | <para> | ||
385 | The optional ->thaw() callback is called to perform the opposite of ->freeze(): | ||
386 | prepare the port for normal operation once again. Unmask interrupts, | ||
387 | start DMA engine, etc. | ||
388 | </para> | ||
389 | |||
390 | <programlisting> | ||
391 | void (*error_handler) (struct ata_port *ap); | ||
392 | </programlisting> | ||
393 | |||
394 | <para> | ||
395 | ->error_handler() is a driver's hook into probe, hotplug, and recovery | ||
396 | and other exceptional conditions. The primary responsibility of an | ||
397 | implementation is to call ata_do_eh() or ata_bmdma_drive_eh() with a set | ||
398 | of EH hooks as arguments: | ||
399 | </para> | ||
400 | |||
401 | <para> | ||
402 | 'prereset' hook (may be NULL) is called during an EH reset, before any other actions | ||
403 | are taken. | ||
404 | </para> | ||
405 | |||
406 | <para> | ||
407 | 'postreset' hook (may be NULL) is called after the EH reset is performed. Based on | ||
408 | existing conditions, severity of the problem, and hardware capabilities, | ||
409 | </para> | ||
410 | |||
411 | <para> | ||
412 | Either 'softreset' (may be NULL) or 'hardreset' (may be NULL) will be | ||
413 | called to perform the low-level EH reset. | ||
414 | </para> | ||
415 | |||
416 | <programlisting> | ||
417 | void (*post_internal_cmd) (struct ata_queued_cmd *qc); | ||
360 | </programlisting> | 418 | </programlisting> |
361 | 419 | ||
362 | <para> | 420 | <para> |
363 | This is a high level error handling function, called from the | 421 | Perform any hardware-specific actions necessary to finish processing |
364 | error handling thread, when a command times out. Most newer | 422 | after executing a probe-time or EH-time command via ata_exec_internal(). |
365 | hardware will implement its own error handling code here. IDE BMDMA | ||
366 | drivers may use the helper function ata_eng_timeout(). | ||
367 | </para> | 423 | </para> |
368 | 424 | ||
369 | </sect2> | 425 | </sect2> |