aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook/libata.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/DocBook/libata.tmpl')
-rw-r--r--Documentation/DocBook/libata.tmpl65
1 files changed, 29 insertions, 36 deletions
diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl
index ba9975771503..8c5411cfeaf0 100644
--- a/Documentation/DocBook/libata.tmpl
+++ b/Documentation/DocBook/libata.tmpl
@@ -81,16 +81,14 @@ void (*port_disable) (struct ata_port *);
81 </programlisting> 81 </programlisting>
82 82
83 <para> 83 <para>
84 Called from ata_bus_probe() and ata_bus_reset() error paths, 84 Called from ata_bus_probe() error path, as well as when
85 as well as when unregistering from the SCSI module (rmmod, hot 85 unregistering from the SCSI module (rmmod, hot unplug).
86 unplug).
87 This function should do whatever needs to be done to take the 86 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 87 port out of use. In most cases, ata_port_disable() can be used
89 as this hook. 88 as this hook.
90 </para> 89 </para>
91 <para> 90 <para>
92 Called from ata_bus_probe() on a failed probe. 91 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(). 92 Called from ata_scsi_release().
95 </para> 93 </para>
96 94
@@ -107,10 +105,6 @@ void (*dev_config) (struct ata_port *, struct ata_device *);
107 issue of SET FEATURES - XFER MODE, and prior to operation. 105 issue of SET FEATURES - XFER MODE, and prior to operation.
108 </para> 106 </para>
109 <para> 107 <para>
110 Called by ata_device_add() after ata_dev_identify() determines
111 a device is present.
112 </para>
113 <para>
114 This entry may be specified as NULL in ata_port_operations. 108 This entry may be specified as NULL in ata_port_operations.
115 </para> 109 </para>
116 110
@@ -154,8 +148,8 @@ unsigned int (*mode_filter) (struct ata_port *, struct ata_device *, unsigned in
154 148
155 <sect2><title>Taskfile read/write</title> 149 <sect2><title>Taskfile read/write</title>
156 <programlisting> 150 <programlisting>
157void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); 151void (*sff_tf_load) (struct ata_port *ap, struct ata_taskfile *tf);
158void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); 152void (*sff_tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
159 </programlisting> 153 </programlisting>
160 154
161 <para> 155 <para>
@@ -164,36 +158,35 @@ void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
164 hardware registers / DMA buffers, to obtain the current set of 158 hardware registers / DMA buffers, to obtain the current set of
165 taskfile register values. 159 taskfile register values.
166 Most drivers for taskfile-based hardware (PIO or MMIO) use 160 Most drivers for taskfile-based hardware (PIO or MMIO) use
167 ata_tf_load() and ata_tf_read() for these hooks. 161 ata_sff_tf_load() and ata_sff_tf_read() for these hooks.
168 </para> 162 </para>
169 163
170 </sect2> 164 </sect2>
171 165
172 <sect2><title>PIO data read/write</title> 166 <sect2><title>PIO data read/write</title>
173 <programlisting> 167 <programlisting>
174void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int); 168void (*sff_data_xfer) (struct ata_device *, unsigned char *, unsigned int, int);
175 </programlisting> 169 </programlisting>
176 170
177 <para> 171 <para>
178All bmdma-style drivers must implement this hook. This is the low-level 172All bmdma-style drivers must implement this hook. This is the low-level
179operation that actually copies the data bytes during a PIO data 173operation that actually copies the data bytes during a PIO data
180transfer. 174transfer.
181Typically the driver 175Typically the driver will choose one of ata_sff_data_xfer_noirq(),
182will choose one of ata_pio_data_xfer_noirq(), ata_pio_data_xfer(), or 176ata_sff_data_xfer(), or ata_sff_data_xfer32().
183ata_mmio_data_xfer().
184 </para> 177 </para>
185 178
186 </sect2> 179 </sect2>
187 180
188 <sect2><title>ATA command execute</title> 181 <sect2><title>ATA command execute</title>
189 <programlisting> 182 <programlisting>
190void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); 183void (*sff_exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
191 </programlisting> 184 </programlisting>
192 185
193 <para> 186 <para>
194 causes an ATA command, previously loaded with 187 causes an ATA command, previously loaded with
195 ->tf_load(), to be initiated in hardware. 188 ->tf_load(), to be initiated in hardware.
196 Most drivers for taskfile-based hardware use ata_exec_command() 189 Most drivers for taskfile-based hardware use ata_sff_exec_command()
197 for this hook. 190 for this hook.
198 </para> 191 </para>
199 192
@@ -218,8 +211,8 @@ command.
218 211
219 <sect2><title>Read specific ATA shadow registers</title> 212 <sect2><title>Read specific ATA shadow registers</title>
220 <programlisting> 213 <programlisting>
221u8 (*check_status)(struct ata_port *ap); 214u8 (*sff_check_status)(struct ata_port *ap);
222u8 (*check_altstatus)(struct ata_port *ap); 215u8 (*sff_check_altstatus)(struct ata_port *ap);
223 </programlisting> 216 </programlisting>
224 217
225 <para> 218 <para>
@@ -227,20 +220,26 @@ u8 (*check_altstatus)(struct ata_port *ap);
227 hardware. On some hardware, reading the Status register has 220 hardware. On some hardware, reading the Status register has
228 the side effect of clearing the interrupt condition. 221 the side effect of clearing the interrupt condition.
229 Most drivers for taskfile-based hardware use 222 Most drivers for taskfile-based hardware use
230 ata_check_status() for this hook. 223 ata_sff_check_status() for this hook.
231 </para> 224 </para>
225
226 </sect2>
227
228 <sect2><title>Write specific ATA shadow register</title>
229 <programlisting>
230void (*sff_set_devctl)(struct ata_port *ap, u8 ctl);
231 </programlisting>
232
232 <para> 233 <para>
233 Note that because this is called from ata_device_add(), at 234 Write the device control ATA shadow register to the hardware.
234 least a dummy function that clears device interrupts must be 235 Most drivers don't need to define this.
235 provided for all drivers, even if the controller doesn't
236 actually have a taskfile status register.
237 </para> 236 </para>
238 237
239 </sect2> 238 </sect2>
240 239
241 <sect2><title>Select ATA device on bus</title> 240 <sect2><title>Select ATA device on bus</title>
242 <programlisting> 241 <programlisting>
243void (*dev_select)(struct ata_port *ap, unsigned int device); 242void (*sff_dev_select)(struct ata_port *ap, unsigned int device);
244 </programlisting> 243 </programlisting>
245 244
246 <para> 245 <para>
@@ -251,9 +250,7 @@ void (*dev_select)(struct ata_port *ap, unsigned int device);
251 </para> 250 </para>
252 <para> 251 <para>
253 Most drivers for taskfile-based hardware use 252 Most drivers for taskfile-based hardware use
254 ata_std_dev_select() for this hook. Controllers which do not 253 ata_sff_dev_select() for this hook.
255 support second drives on a port (such as SATA contollers) will
256 use ata_noop_dev_select().
257 </para> 254 </para>
258 255
259 </sect2> 256 </sect2>
@@ -441,13 +438,13 @@ void (*irq_clear) (struct ata_port *);
441 to struct ata_host_set. 438 to struct ata_host_set.
442 </para> 439 </para>
443 <para> 440 <para>
444 Most legacy IDE drivers use ata_interrupt() for the 441 Most legacy IDE drivers use ata_sff_interrupt() for the
445 irq_handler hook, which scans all ports in the host_set, 442 irq_handler hook, which scans all ports in the host_set,
446 determines which queued command was active (if any), and calls 443 determines which queued command was active (if any), and calls
447 ata_host_intr(ap,qc). 444 ata_sff_host_intr(ap,qc).
448 </para> 445 </para>
449 <para> 446 <para>
450 Most legacy IDE drivers use ata_bmdma_irq_clear() for the 447 Most legacy IDE drivers use ata_sff_irq_clear() for the
451 irq_clear() hook, which simply clears the interrupt and error 448 irq_clear() hook, which simply clears the interrupt and error
452 flags in the DMA status register. 449 flags in the DMA status register.
453 </para> 450 </para>
@@ -490,16 +487,12 @@ void (*host_stop) (struct ata_host_set *host_set);
490 allocates space for a legacy IDE PRD table and returns. 487 allocates space for a legacy IDE PRD table and returns.
491 </para> 488 </para>
492 <para> 489 <para>
493 ->port_stop() is called after ->host_stop(). It's sole function 490 ->port_stop() is called after ->host_stop(). Its sole function
494 is to release DMA/memory resources, now that they are no longer 491 is to release DMA/memory resources, now that they are no longer
495 actively being used. Many drivers also free driver-private 492 actively being used. Many drivers also free driver-private
496 data from port at this time. 493 data from port at this time.
497 </para> 494 </para>
498 <para> 495 <para>
499 Many drivers use ata_port_stop() as this hook, which frees the
500 PRD table.
501 </para>
502 <para>
503 ->host_stop() is called after all ->port_stop() calls 496 ->host_stop() is called after all ->port_stop() calls
504have completed. The hook must finalize hardware shutdown, release DMA 497have completed. The hook must finalize hardware shutdown, release DMA
505and other resources, etc. 498and other resources, etc.