diff options
-rw-r--r-- | Documentation/DocBook/libata.tmpl | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl index 77b4a223a86c..6df1dfd18b65 100644 --- a/Documentation/DocBook/libata.tmpl +++ b/Documentation/DocBook/libata.tmpl | |||
@@ -60,9 +60,22 @@ | |||
60 | 60 | ||
61 | <chapter id="libataDriverApi"> | 61 | <chapter id="libataDriverApi"> |
62 | <title>libata Driver API</title> | 62 | <title>libata Driver API</title> |
63 | <para> | ||
64 | struct ata_port_operations is defined for every low-level libata | ||
65 | hardware driver, and it controls how the low-level driver | ||
66 | interfaces with the ATA and SCSI layers. | ||
67 | </para> | ||
68 | <para> | ||
69 | FIS-based drivers will hook into the system with ->qc_prep() and | ||
70 | ->qc_issue() high-level hooks. Hardware which behaves in a manner | ||
71 | similar to PCI IDE hardware may utilize several generic helpers, | ||
72 | defining at a bare minimum the bus I/O addresses of the ATA shadow | ||
73 | register blocks. | ||
74 | </para> | ||
63 | <sect1> | 75 | <sect1> |
64 | <title>struct ata_port_operations</title> | 76 | <title>struct ata_port_operations</title> |
65 | 77 | ||
78 | <sect2><title>Disable ATA port</title> | ||
66 | <programlisting> | 79 | <programlisting> |
67 | void (*port_disable) (struct ata_port *); | 80 | void (*port_disable) (struct ata_port *); |
68 | </programlisting> | 81 | </programlisting> |
@@ -73,6 +86,9 @@ void (*port_disable) (struct ata_port *); | |||
73 | unplug). | 86 | unplug). |
74 | </para> | 87 | </para> |
75 | 88 | ||
89 | </sect2> | ||
90 | |||
91 | <sect2><title>Post-IDENTIFY device configuration</title> | ||
76 | <programlisting> | 92 | <programlisting> |
77 | void (*dev_config) (struct ata_port *, struct ata_device *); | 93 | void (*dev_config) (struct ata_port *, struct ata_device *); |
78 | </programlisting> | 94 | </programlisting> |
@@ -83,6 +99,9 @@ void (*dev_config) (struct ata_port *, struct ata_device *); | |||
83 | issue of SET FEATURES - XFER MODE, and prior to operation. | 99 | issue of SET FEATURES - XFER MODE, and prior to operation. |
84 | </para> | 100 | </para> |
85 | 101 | ||
102 | </sect2> | ||
103 | |||
104 | <sect2><title>Set PIO/DMA mode</title> | ||
86 | <programlisting> | 105 | <programlisting> |
87 | void (*set_piomode) (struct ata_port *, struct ata_device *); | 106 | void (*set_piomode) (struct ata_port *, struct ata_device *); |
88 | void (*set_dmamode) (struct ata_port *, struct ata_device *); | 107 | void (*set_dmamode) (struct ata_port *, struct ata_device *); |
@@ -103,6 +122,9 @@ void (*post_set_mode) (struct ata_port *ap); | |||
103 | ->set_dma_mode() is only called if DMA is possible. | 122 | ->set_dma_mode() is only called if DMA is possible. |
104 | </para> | 123 | </para> |
105 | 124 | ||
125 | </sect2> | ||
126 | |||
127 | <sect2><title>Taskfile read/write</title> | ||
106 | <programlisting> | 128 | <programlisting> |
107 | void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); | 129 | void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); |
108 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); | 130 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); |
@@ -115,6 +137,9 @@ void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); | |||
115 | taskfile register values. | 137 | taskfile register values. |
116 | </para> | 138 | </para> |
117 | 139 | ||
140 | </sect2> | ||
141 | |||
142 | <sect2><title>ATA command execute</title> | ||
118 | <programlisting> | 143 | <programlisting> |
119 | void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); | 144 | void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); |
120 | </programlisting> | 145 | </programlisting> |
@@ -124,6 +149,9 @@ void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); | |||
124 | ->tf_load(), to be initiated in hardware. | 149 | ->tf_load(), to be initiated in hardware. |
125 | </para> | 150 | </para> |
126 | 151 | ||
152 | </sect2> | ||
153 | |||
154 | <sect2><title>Per-cmd ATAPI DMA capabilities filter</title> | ||
127 | <programlisting> | 155 | <programlisting> |
128 | int (*check_atapi_dma) (struct ata_queued_cmd *qc); | 156 | int (*check_atapi_dma) (struct ata_queued_cmd *qc); |
129 | </programlisting> | 157 | </programlisting> |
@@ -134,6 +162,9 @@ indicating whether or not it is OK to use DMA for the supplied PACKET | |||
134 | command. | 162 | command. |
135 | </para> | 163 | </para> |
136 | 164 | ||
165 | </sect2> | ||
166 | |||
167 | <sect2><title>Read specific ATA shadow registers</title> | ||
137 | <programlisting> | 168 | <programlisting> |
138 | u8 (*check_status)(struct ata_port *ap); | 169 | u8 (*check_status)(struct ata_port *ap); |
139 | u8 (*check_altstatus)(struct ata_port *ap); | 170 | u8 (*check_altstatus)(struct ata_port *ap); |
@@ -146,6 +177,9 @@ u8 (*check_err)(struct ata_port *ap); | |||
146 | the side effect of clearing the interrupt condition. | 177 | the side effect of clearing the interrupt condition. |
147 | </para> | 178 | </para> |
148 | 179 | ||
180 | </sect2> | ||
181 | |||
182 | <sect2><title>Select ATA device on bus</title> | ||
149 | <programlisting> | 183 | <programlisting> |
150 | void (*dev_select)(struct ata_port *ap, unsigned int device); | 184 | void (*dev_select)(struct ata_port *ap, unsigned int device); |
151 | </programlisting> | 185 | </programlisting> |
@@ -157,6 +191,9 @@ void (*dev_select)(struct ata_port *ap, unsigned int device); | |||
157 | meaning on FIS-based devices. | 191 | meaning on FIS-based devices. |
158 | </para> | 192 | </para> |
159 | 193 | ||
194 | </sect2> | ||
195 | |||
196 | <sect2><title>Reset ATA bus</title> | ||
160 | <programlisting> | 197 | <programlisting> |
161 | void (*phy_reset) (struct ata_port *ap); | 198 | void (*phy_reset) (struct ata_port *ap); |
162 | </programlisting> | 199 | </programlisting> |
@@ -169,6 +206,9 @@ void (*phy_reset) (struct ata_port *ap); | |||
169 | functions ata_bus_reset() or sata_phy_reset() for this hook. | 206 | functions ata_bus_reset() or sata_phy_reset() for this hook. |
170 | </para> | 207 | </para> |
171 | 208 | ||
209 | </sect2> | ||
210 | |||
211 | <sect2><title>Control PCI IDE BMDMA engine</title> | ||
172 | <programlisting> | 212 | <programlisting> |
173 | void (*bmdma_setup) (struct ata_queued_cmd *qc); | 213 | void (*bmdma_setup) (struct ata_queued_cmd *qc); |
174 | void (*bmdma_start) (struct ata_queued_cmd *qc); | 214 | void (*bmdma_start) (struct ata_queued_cmd *qc); |
@@ -188,6 +228,9 @@ These hooks are typically either no-ops, or simply not implemented, in | |||
188 | FIS-based drivers. | 228 | FIS-based drivers. |
189 | </para> | 229 | </para> |
190 | 230 | ||
231 | </sect2> | ||
232 | |||
233 | <sect2><title>High-level taskfile hooks</title> | ||
191 | <programlisting> | 234 | <programlisting> |
192 | void (*qc_prep) (struct ata_queued_cmd *qc); | 235 | void (*qc_prep) (struct ata_queued_cmd *qc); |
193 | int (*qc_issue) (struct ata_queued_cmd *qc); | 236 | int (*qc_issue) (struct ata_queued_cmd *qc); |
@@ -208,6 +251,9 @@ int (*qc_issue) (struct ata_queued_cmd *qc); | |||
208 | dispatch. More advanced drivers implement their own ->qc_issue. | 251 | dispatch. More advanced drivers implement their own ->qc_issue. |
209 | </para> | 252 | </para> |
210 | 253 | ||
254 | </sect2> | ||
255 | |||
256 | <sect2><title>Timeout (error) handling</title> | ||
211 | <programlisting> | 257 | <programlisting> |
212 | void (*eng_timeout) (struct ata_port *ap); | 258 | void (*eng_timeout) (struct ata_port *ap); |
213 | </programlisting> | 259 | </programlisting> |
@@ -219,6 +265,9 @@ hardware will implement its own error handling code here. IDE BMDMA | |||
219 | drivers may use the helper function ata_eng_timeout(). | 265 | drivers may use the helper function ata_eng_timeout(). |
220 | </para> | 266 | </para> |
221 | 267 | ||
268 | </sect2> | ||
269 | |||
270 | <sect2><title>Hardware interrupt handling</title> | ||
222 | <programlisting> | 271 | <programlisting> |
223 | irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); | 272 | irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); |
224 | void (*irq_clear) (struct ata_port *); | 273 | void (*irq_clear) (struct ata_port *); |
@@ -231,6 +280,9 @@ void (*irq_clear) (struct ata_port *); | |||
231 | is quiet. | 280 | is quiet. |
232 | </para> | 281 | </para> |
233 | 282 | ||
283 | </sect2> | ||
284 | |||
285 | <sect2><title>SATA phy read/write</title> | ||
234 | <programlisting> | 286 | <programlisting> |
235 | u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); | 287 | u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); |
236 | void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, | 288 | void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, |
@@ -242,6 +294,9 @@ void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, | |||
242 | if ->phy_reset hook called the sata_phy_reset() helper function. | 294 | if ->phy_reset hook called the sata_phy_reset() helper function. |
243 | </para> | 295 | </para> |
244 | 296 | ||
297 | </sect2> | ||
298 | |||
299 | <sect2><title>Init and shutdown</title> | ||
245 | <programlisting> | 300 | <programlisting> |
246 | int (*port_start) (struct ata_port *ap); | 301 | int (*port_start) (struct ata_port *ap); |
247 | void (*port_stop) (struct ata_port *ap); | 302 | void (*port_stop) (struct ata_port *ap); |
@@ -265,6 +320,8 @@ have completed. The hook must finalize hardware shutdown, release DMA | |||
265 | and other resources, etc. | 320 | and other resources, etc. |
266 | </para> | 321 | </para> |
267 | 322 | ||
323 | </sect2> | ||
324 | |||
268 | </sect1> | 325 | </sect1> |
269 | </chapter> | 326 | </chapter> |
270 | 327 | ||