diff options
Diffstat (limited to 'Documentation/DocBook/libata.tmpl')
-rw-r--r-- | Documentation/DocBook/libata.tmpl | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl index d260d92089ad..5bcbb6ee3bc0 100644 --- a/Documentation/DocBook/libata.tmpl +++ b/Documentation/DocBook/libata.tmpl | |||
@@ -120,14 +120,27 @@ void (*dev_config) (struct ata_port *, struct ata_device *); | |||
120 | <programlisting> | 120 | <programlisting> |
121 | void (*set_piomode) (struct ata_port *, struct ata_device *); | 121 | void (*set_piomode) (struct ata_port *, struct ata_device *); |
122 | void (*set_dmamode) (struct ata_port *, struct ata_device *); | 122 | void (*set_dmamode) (struct ata_port *, struct ata_device *); |
123 | void (*post_set_mode) (struct ata_port *ap); | 123 | void (*post_set_mode) (struct ata_port *); |
124 | unsigned int (*mode_filter) (struct ata_port *, struct ata_device *, unsigned int); | ||
124 | </programlisting> | 125 | </programlisting> |
125 | 126 | ||
126 | <para> | 127 | <para> |
127 | Hooks called prior to the issue of SET FEATURES - XFER MODE | 128 | Hooks called prior to the issue of SET FEATURES - XFER MODE |
128 | command. dev->pio_mode is guaranteed to be valid when | 129 | command. The optional ->mode_filter() hook is called when libata |
129 | ->set_piomode() is called, and dev->dma_mode is guaranteed to be | 130 | has built a mask of the possible modes. This is passed to the |
130 | valid when ->set_dmamode() is called. ->post_set_mode() is | 131 | ->mode_filter() function which should return a mask of valid modes |
132 | after filtering those unsuitable due to hardware limits. It is not | ||
133 | valid to use this interface to add modes. | ||
134 | </para> | ||
135 | <para> | ||
136 | dev->pio_mode and dev->dma_mode are guaranteed to be valid when | ||
137 | ->set_piomode() and when ->set_dmamode() is called. The timings for | ||
138 | any other drive sharing the cable will also be valid at this point. | ||
139 | That is the library records the decisions for the modes of each | ||
140 | drive on a channel before it attempts to set any of them. | ||
141 | </para> | ||
142 | <para> | ||
143 | ->post_set_mode() is | ||
131 | called unconditionally, after the SET FEATURES - XFER MODE | 144 | called unconditionally, after the SET FEATURES - XFER MODE |
132 | command completes successfully. | 145 | command completes successfully. |
133 | </para> | 146 | </para> |
@@ -230,6 +243,32 @@ void (*dev_select)(struct ata_port *ap, unsigned int device); | |||
230 | 243 | ||
231 | </sect2> | 244 | </sect2> |
232 | 245 | ||
246 | <sect2><title>Private tuning method</title> | ||
247 | <programlisting> | ||
248 | void (*set_mode) (struct ata_port *ap); | ||
249 | </programlisting> | ||
250 | |||
251 | <para> | ||
252 | By default libata performs drive and controller tuning in | ||
253 | accordance with the ATA timing rules and also applies blacklists | ||
254 | and cable limits. Some controllers need special handling and have | ||
255 | custom tuning rules, typically raid controllers that use ATA | ||
256 | commands but do not actually do drive timing. | ||
257 | </para> | ||
258 | |||
259 | <warning> | ||
260 | <para> | ||
261 | This hook should not be used to replace the standard controller | ||
262 | tuning logic when a controller has quirks. Replacing the default | ||
263 | tuning logic in that case would bypass handling for drive and | ||
264 | bridge quirks that may be important to data reliability. If a | ||
265 | controller needs to filter the mode selection it should use the | ||
266 | mode_filter hook instead. | ||
267 | </para> | ||
268 | </warning> | ||
269 | |||
270 | </sect2> | ||
271 | |||
233 | <sect2><title>Reset ATA bus</title> | 272 | <sect2><title>Reset ATA bus</title> |
234 | <programlisting> | 273 | <programlisting> |
235 | void (*phy_reset) (struct ata_port *ap); | 274 | void (*phy_reset) (struct ata_port *ap); |