diff options
Diffstat (limited to 'Documentation/DocBook/libata.tmpl')
-rw-r--r-- | Documentation/DocBook/libata.tmpl | 58 |
1 files changed, 39 insertions, 19 deletions
diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl index 773ae9fd99dc..41053aed41f4 100644 --- a/Documentation/DocBook/libata.tmpl +++ b/Documentation/DocBook/libata.tmpl | |||
@@ -14,7 +14,7 @@ | |||
14 | </authorgroup> | 14 | </authorgroup> |
15 | 15 | ||
16 | <copyright> | 16 | <copyright> |
17 | <year>2003</year> | 17 | <year>2003-2005</year> |
18 | <holder>Jeff Garzik</holder> | 18 | <holder>Jeff Garzik</holder> |
19 | </copyright> | 19 | </copyright> |
20 | 20 | ||
@@ -145,14 +145,25 @@ void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); | |||
145 | </para> | 145 | </para> |
146 | 146 | ||
147 | <programlisting> | 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> | ||
148 | u8 (*check_status)(struct ata_port *ap); | 158 | u8 (*check_status)(struct ata_port *ap); |
149 | void (*dev_select)(struct ata_port *ap, unsigned int device); | 159 | u8 (*check_altstatus)(struct ata_port *ap); |
160 | u8 (*check_err)(struct ata_port *ap); | ||
150 | </programlisting> | 161 | </programlisting> |
151 | 162 | ||
152 | <para> | 163 | <para> |
153 | Reads the Status ATA shadow register from hardware. On some | 164 | Reads the Status/AltStatus/Error ATA shadow register from |
154 | hardware, this has the side effect of clearing the interrupt | 165 | hardware. On some hardware, reading the Status register has |
155 | condition. | 166 | the side effect of clearing the interrupt condition. |
156 | </para> | 167 | </para> |
157 | 168 | ||
158 | <programlisting> | 169 | <programlisting> |
@@ -162,7 +173,8 @@ void (*dev_select)(struct ata_port *ap, unsigned int device); | |||
162 | <para> | 173 | <para> |
163 | Issues the low-level hardware command(s) that causes one of N | 174 | Issues the low-level hardware command(s) that causes one of N |
164 | hardware devices to be considered 'selected' (active and | 175 | hardware devices to be considered 'selected' (active and |
165 | available for use) on the ATA bus. | 176 | available for use) on the ATA bus. This generally has no |
177 | meaning on FIS-based devices. | ||
166 | </para> | 178 | </para> |
167 | 179 | ||
168 | <programlisting> | 180 | <programlisting> |
@@ -180,12 +192,20 @@ void (*phy_reset) (struct ata_port *ap); | |||
180 | <programlisting> | 192 | <programlisting> |
181 | void (*bmdma_setup) (struct ata_queued_cmd *qc); | 193 | void (*bmdma_setup) (struct ata_queued_cmd *qc); |
182 | void (*bmdma_start) (struct ata_queued_cmd *qc); | 194 | void (*bmdma_start) (struct ata_queued_cmd *qc); |
195 | void (*bmdma_stop) (struct ata_port *ap); | ||
196 | u8 (*bmdma_status) (struct ata_port *ap); | ||
183 | </programlisting> | 197 | </programlisting> |
184 | 198 | ||
185 | <para> | 199 | <para> |
186 | When setting up an IDE BMDMA transaction, these hooks arm | 200 | When setting up an IDE BMDMA transaction, these hooks arm |
187 | (->bmdma_setup) and fire (->bmdma_start) the hardware's DMA | 201 | (->bmdma_setup), fire (->bmdma_start), and halt (->bmdma_stop) |
188 | engine. | 202 | the hardware's DMA engine. ->bmdma_status is used to read the standard |
203 | PCI IDE DMA Status register. | ||
204 | </para> | ||
205 | |||
206 | <para> | ||
207 | These hooks are typically either no-ops, or simply not implemented, in | ||
208 | FIS-based drivers. | ||
189 | </para> | 209 | </para> |
190 | 210 | ||
191 | <programlisting> | 211 | <programlisting> |
@@ -205,9 +225,7 @@ int (*qc_issue) (struct ata_queued_cmd *qc); | |||
205 | ->qc_issue is used to make a command active, once the hardware | 225 | ->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 | 226 | and S/G tables have been prepared. IDE BMDMA drivers use the |
207 | helper function ata_qc_issue_prot() for taskfile protocol-based | 227 | helper function ata_qc_issue_prot() for taskfile protocol-based |
208 | dispatch. More advanced drivers roll their own ->qc_issue | 228 | dispatch. More advanced drivers implement their own ->qc_issue. |
209 | implementation, using this as the "issue new ATA command to | ||
210 | hardware" hook. | ||
211 | </para> | 229 | </para> |
212 | 230 | ||
213 | <programlisting> | 231 | <programlisting> |
@@ -215,8 +233,10 @@ void (*eng_timeout) (struct ata_port *ap); | |||
215 | </programlisting> | 233 | </programlisting> |
216 | 234 | ||
217 | <para> | 235 | <para> |
218 | This is a high level error handling function, called from the | 236 | This is a high level error handling function, called from the |
219 | error handling thread, when a command times out. | 237 | error handling thread, when a command times out. Most newer |
238 | hardware will implement its own error handling code here. IDE BMDMA | ||
239 | drivers may use the helper function ata_eng_timeout(). | ||
220 | </para> | 240 | </para> |
221 | 241 | ||
222 | <programlisting> | 242 | <programlisting> |
@@ -255,15 +275,15 @@ void (*host_stop) (struct ata_host_set *host_set); | |||
255 | tasks. | 275 | tasks. |
256 | </para> | 276 | </para> |
257 | <para> | 277 | <para> |
258 | ->host_stop() is called when the rmmod or hot unplug process | ||
259 | begins. The hook must stop all hardware interrupts, DMA | ||
260 | engines, etc. | ||
261 | </para> | ||
262 | <para> | ||
263 | ->port_stop() is called after ->host_stop(). It's sole function | 278 | ->port_stop() is called after ->host_stop(). It's sole function |
264 | is to release DMA/memory resources, now that they are no longer | 279 | is to release DMA/memory resources, now that they are no longer |
265 | actively being used. | 280 | actively being used. |
266 | </para> | 281 | </para> |
282 | <para> | ||
283 | ->host_stop() is called after all ->port_stop() calls | ||
284 | have completed. The hook must finalize hardware shutdown, release DMA | ||
285 | and other resources, etc. | ||
286 | </para> | ||
267 | 287 | ||
268 | </sect1> | 288 | </sect1> |
269 | </chapter> | 289 | </chapter> |