diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-05-17 10:21:45 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2017-07-14 15:57:57 -0400 |
commit | be9d0411f1608ad62c2334d3a289a68e4259e48c (patch) | |
tree | 7cacbb213713d7081b16580a6fcb2b0cc1349a0c | |
parent | 7576b2b98dc9aa8a3ce8921df4a5fbb354269ed8 (diff) |
parport-lowlevel.txt: standardize document format
Each text file under Documentation follows a different
format. This one uses a man-page like approach.
Change its representation to be closer to the adopted standard,
using ReST markups for it to be parseable by Sphinx:
- Mark titles;
- Mark literals and literal blocks;
- Adjust identation.
Still, the best would be to move its contents to kernel-docs.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r-- | Documentation/parport-lowlevel.txt | 1321 |
1 files changed, 841 insertions, 480 deletions
diff --git a/Documentation/parport-lowlevel.txt b/Documentation/parport-lowlevel.txt index 120eb20dbb09..0633d70ffda7 100644 --- a/Documentation/parport-lowlevel.txt +++ b/Documentation/parport-lowlevel.txt | |||
@@ -1,11 +1,12 @@ | |||
1 | =============================== | ||
1 | PARPORT interface documentation | 2 | PARPORT interface documentation |
2 | ------------------------------- | 3 | =============================== |
3 | 4 | ||
4 | Time-stamp: <2000-02-24 13:30:20 twaugh> | 5 | :Time-stamp: <2000-02-24 13:30:20 twaugh> |
5 | 6 | ||
6 | Described here are the following functions: | 7 | Described here are the following functions: |
7 | 8 | ||
8 | Global functions: | 9 | Global functions:: |
9 | parport_register_driver | 10 | parport_register_driver |
10 | parport_unregister_driver | 11 | parport_unregister_driver |
11 | parport_enumerate | 12 | parport_enumerate |
@@ -31,7 +32,8 @@ Global functions: | |||
31 | parport_set_timeout | 32 | parport_set_timeout |
32 | 33 | ||
33 | Port functions (can be overridden by low-level drivers): | 34 | Port functions (can be overridden by low-level drivers): |
34 | SPP: | 35 | |
36 | SPP:: | ||
35 | port->ops->read_data | 37 | port->ops->read_data |
36 | port->ops->write_data | 38 | port->ops->write_data |
37 | port->ops->read_status | 39 | port->ops->read_status |
@@ -43,23 +45,23 @@ Port functions (can be overridden by low-level drivers): | |||
43 | port->ops->data_forward | 45 | port->ops->data_forward |
44 | port->ops->data_reverse | 46 | port->ops->data_reverse |
45 | 47 | ||
46 | EPP: | 48 | EPP:: |
47 | port->ops->epp_write_data | 49 | port->ops->epp_write_data |
48 | port->ops->epp_read_data | 50 | port->ops->epp_read_data |
49 | port->ops->epp_write_addr | 51 | port->ops->epp_write_addr |
50 | port->ops->epp_read_addr | 52 | port->ops->epp_read_addr |
51 | 53 | ||
52 | ECP: | 54 | ECP:: |
53 | port->ops->ecp_write_data | 55 | port->ops->ecp_write_data |
54 | port->ops->ecp_read_data | 56 | port->ops->ecp_read_data |
55 | port->ops->ecp_write_addr | 57 | port->ops->ecp_write_addr |
56 | 58 | ||
57 | Other: | 59 | Other:: |
58 | port->ops->nibble_read_data | 60 | port->ops->nibble_read_data |
59 | port->ops->byte_read_data | 61 | port->ops->byte_read_data |
60 | port->ops->compat_write_data | 62 | port->ops->compat_write_data |
61 | 63 | ||
62 | The parport subsystem comprises 'parport' (the core port-sharing | 64 | The parport subsystem comprises ``parport`` (the core port-sharing |
63 | code), and a variety of low-level drivers that actually do the port | 65 | code), and a variety of low-level drivers that actually do the port |
64 | accesses. Each low-level driver handles a particular style of port | 66 | accesses. Each low-level driver handles a particular style of port |
65 | (PC, Amiga, and so on). | 67 | (PC, Amiga, and so on). |
@@ -70,14 +72,14 @@ into global functions and port functions. | |||
70 | The global functions are mostly for communicating between the device | 72 | The global functions are mostly for communicating between the device |
71 | driver and the parport subsystem: acquiring a list of available ports, | 73 | driver and the parport subsystem: acquiring a list of available ports, |
72 | claiming a port for exclusive use, and so on. They also include | 74 | claiming a port for exclusive use, and so on. They also include |
73 | 'generic' functions for doing standard things that will work on any | 75 | ``generic`` functions for doing standard things that will work on any |
74 | IEEE 1284-capable architecture. | 76 | IEEE 1284-capable architecture. |
75 | 77 | ||
76 | The port functions are provided by the low-level drivers, although the | 78 | The port functions are provided by the low-level drivers, although the |
77 | core parport module provides generic 'defaults' for some routines. | 79 | core parport module provides generic ``defaults`` for some routines. |
78 | The port functions can be split into three groups: SPP, EPP, and ECP. | 80 | The port functions can be split into three groups: SPP, EPP, and ECP. |
79 | 81 | ||
80 | SPP (Standard Parallel Port) functions modify so-called 'SPP' | 82 | SPP (Standard Parallel Port) functions modify so-called ``SPP`` |
81 | registers: data, status, and control. The hardware may not actually | 83 | registers: data, status, and control. The hardware may not actually |
82 | have registers exactly like that, but the PC does and this interface is | 84 | have registers exactly like that, but the PC does and this interface is |
83 | modelled after common PC implementations. Other low-level drivers may | 85 | modelled after common PC implementations. Other low-level drivers may |
@@ -95,58 +97,63 @@ to cope with peripherals that only tenuously support IEEE 1284, a | |||
95 | low-level driver specific function is provided, for altering 'fudge | 97 | low-level driver specific function is provided, for altering 'fudge |
96 | factors'. | 98 | factors'. |
97 | 99 | ||
98 | GLOBAL FUNCTIONS | 100 | Global functions |
99 | ---------------- | 101 | ================ |
100 | 102 | ||
101 | parport_register_driver - register a device driver with parport | 103 | parport_register_driver - register a device driver with parport |
102 | ----------------------- | 104 | --------------------------------------------------------------- |
103 | 105 | ||
104 | SYNOPSIS | 106 | SYNOPSIS |
107 | ^^^^^^^^ | ||
108 | |||
109 | :: | ||
105 | 110 | ||
106 | #include <linux/parport.h> | 111 | #include <linux/parport.h> |
107 | 112 | ||
108 | struct parport_driver { | 113 | struct parport_driver { |
109 | const char *name; | 114 | const char *name; |
110 | void (*attach) (struct parport *); | 115 | void (*attach) (struct parport *); |
111 | void (*detach) (struct parport *); | 116 | void (*detach) (struct parport *); |
112 | struct parport_driver *next; | 117 | struct parport_driver *next; |
113 | }; | 118 | }; |
114 | int parport_register_driver (struct parport_driver *driver); | 119 | int parport_register_driver (struct parport_driver *driver); |
115 | 120 | ||
116 | DESCRIPTION | 121 | DESCRIPTION |
122 | ^^^^^^^^^^^ | ||
117 | 123 | ||
118 | In order to be notified about parallel ports when they are detected, | 124 | In order to be notified about parallel ports when they are detected, |
119 | parport_register_driver should be called. Your driver will | 125 | parport_register_driver should be called. Your driver will |
120 | immediately be notified of all ports that have already been detected, | 126 | immediately be notified of all ports that have already been detected, |
121 | and of each new port as low-level drivers are loaded. | 127 | and of each new port as low-level drivers are loaded. |
122 | 128 | ||
123 | A 'struct parport_driver' contains the textual name of your driver, | 129 | A ``struct parport_driver`` contains the textual name of your driver, |
124 | a pointer to a function to handle new ports, and a pointer to a | 130 | a pointer to a function to handle new ports, and a pointer to a |
125 | function to handle ports going away due to a low-level driver | 131 | function to handle ports going away due to a low-level driver |
126 | unloading. Ports will only be detached if they are not being used | 132 | unloading. Ports will only be detached if they are not being used |
127 | (i.e. there are no devices registered on them). | 133 | (i.e. there are no devices registered on them). |
128 | 134 | ||
129 | The visible parts of the 'struct parport *' argument given to | 135 | The visible parts of the ``struct parport *`` argument given to |
130 | attach/detach are: | 136 | attach/detach are:: |
131 | 137 | ||
132 | struct parport | 138 | struct parport |
133 | { | 139 | { |
134 | struct parport *next; /* next parport in list */ | 140 | struct parport *next; /* next parport in list */ |
135 | const char *name; /* port's name */ | 141 | const char *name; /* port's name */ |
136 | unsigned int modes; /* bitfield of hardware modes */ | 142 | unsigned int modes; /* bitfield of hardware modes */ |
137 | struct parport_device_info probe_info; | 143 | struct parport_device_info probe_info; |
138 | /* IEEE1284 info */ | 144 | /* IEEE1284 info */ |
139 | int number; /* parport index */ | 145 | int number; /* parport index */ |
140 | struct parport_operations *ops; | 146 | struct parport_operations *ops; |
141 | ... | 147 | ... |
142 | }; | 148 | }; |
143 | 149 | ||
144 | There are other members of the structure, but they should not be | 150 | There are other members of the structure, but they should not be |
145 | touched. | 151 | touched. |
146 | 152 | ||
147 | The 'modes' member summarises the capabilities of the underlying | 153 | The ``modes`` member summarises the capabilities of the underlying |
148 | hardware. It consists of flags which may be bitwise-ored together: | 154 | hardware. It consists of flags which may be bitwise-ored together: |
149 | 155 | ||
156 | ============================= =============================================== | ||
150 | PARPORT_MODE_PCSPP IBM PC registers are available, | 157 | PARPORT_MODE_PCSPP IBM PC registers are available, |
151 | i.e. functions that act on data, | 158 | i.e. functions that act on data, |
152 | control and status registers are | 159 | control and status registers are |
@@ -169,297 +176,351 @@ hardware. It consists of flags which may be bitwise-ored together: | |||
169 | GFP_DMA flag with kmalloc) to the | 176 | GFP_DMA flag with kmalloc) to the |
170 | low-level driver in order to take | 177 | low-level driver in order to take |
171 | advantage of it. | 178 | advantage of it. |
179 | ============================= =============================================== | ||
172 | 180 | ||
173 | There may be other flags in 'modes' as well. | 181 | There may be other flags in ``modes`` as well. |
174 | 182 | ||
175 | The contents of 'modes' is advisory only. For example, if the | 183 | The contents of ``modes`` is advisory only. For example, if the |
176 | hardware is capable of DMA, and PARPORT_MODE_DMA is in 'modes', it | 184 | hardware is capable of DMA, and PARPORT_MODE_DMA is in ``modes``, it |
177 | doesn't necessarily mean that DMA will always be used when possible. | 185 | doesn't necessarily mean that DMA will always be used when possible. |
178 | Similarly, hardware that is capable of assisting ECP transfers won't | 186 | Similarly, hardware that is capable of assisting ECP transfers won't |
179 | necessarily be used. | 187 | necessarily be used. |
180 | 188 | ||
181 | RETURN VALUE | 189 | RETURN VALUE |
190 | ^^^^^^^^^^^^ | ||
182 | 191 | ||
183 | Zero on success, otherwise an error code. | 192 | Zero on success, otherwise an error code. |
184 | 193 | ||
185 | ERRORS | 194 | ERRORS |
195 | ^^^^^^ | ||
186 | 196 | ||
187 | None. (Can it fail? Why return int?) | 197 | None. (Can it fail? Why return int?) |
188 | 198 | ||
189 | EXAMPLE | 199 | EXAMPLE |
200 | ^^^^^^^ | ||
190 | 201 | ||
191 | static void lp_attach (struct parport *port) | 202 | :: |
192 | { | ||
193 | ... | ||
194 | private = kmalloc (...); | ||
195 | dev[count++] = parport_register_device (...); | ||
196 | ... | ||
197 | } | ||
198 | 203 | ||
199 | static void lp_detach (struct parport *port) | 204 | static void lp_attach (struct parport *port) |
200 | { | 205 | { |
201 | ... | 206 | ... |
202 | } | 207 | private = kmalloc (...); |
208 | dev[count++] = parport_register_device (...); | ||
209 | ... | ||
210 | } | ||
203 | 211 | ||
204 | static struct parport_driver lp_driver = { | 212 | static void lp_detach (struct parport *port) |
205 | "lp", | 213 | { |
206 | lp_attach, | 214 | ... |
207 | lp_detach, | 215 | } |
208 | NULL /* always put NULL here */ | ||
209 | }; | ||
210 | 216 | ||
211 | int lp_init (void) | 217 | static struct parport_driver lp_driver = { |
212 | { | 218 | "lp", |
213 | ... | 219 | lp_attach, |
214 | if (parport_register_driver (&lp_driver)) { | 220 | lp_detach, |
215 | /* Failed; nothing we can do. */ | 221 | NULL /* always put NULL here */ |
216 | return -EIO; | 222 | }; |
223 | |||
224 | int lp_init (void) | ||
225 | { | ||
226 | ... | ||
227 | if (parport_register_driver (&lp_driver)) { | ||
228 | /* Failed; nothing we can do. */ | ||
229 | return -EIO; | ||
230 | } | ||
231 | ... | ||
217 | } | 232 | } |
218 | ... | 233 | |
219 | } | ||
220 | 234 | ||
221 | SEE ALSO | 235 | SEE ALSO |
236 | ^^^^^^^^ | ||
222 | 237 | ||
223 | parport_unregister_driver, parport_register_device, parport_enumerate | 238 | parport_unregister_driver, parport_register_device, parport_enumerate |
224 | 239 | ||
240 | |||
241 | |||
225 | parport_unregister_driver - tell parport to forget about this driver | 242 | parport_unregister_driver - tell parport to forget about this driver |
226 | ------------------------- | 243 | -------------------------------------------------------------------- |
227 | 244 | ||
228 | SYNOPSIS | 245 | SYNOPSIS |
246 | ^^^^^^^^ | ||
229 | 247 | ||
230 | #include <linux/parport.h> | 248 | :: |
231 | 249 | ||
232 | struct parport_driver { | 250 | #include <linux/parport.h> |
233 | const char *name; | 251 | |
234 | void (*attach) (struct parport *); | 252 | struct parport_driver { |
235 | void (*detach) (struct parport *); | 253 | const char *name; |
236 | struct parport_driver *next; | 254 | void (*attach) (struct parport *); |
237 | }; | 255 | void (*detach) (struct parport *); |
238 | void parport_unregister_driver (struct parport_driver *driver); | 256 | struct parport_driver *next; |
257 | }; | ||
258 | void parport_unregister_driver (struct parport_driver *driver); | ||
239 | 259 | ||
240 | DESCRIPTION | 260 | DESCRIPTION |
261 | ^^^^^^^^^^^ | ||
241 | 262 | ||
242 | This tells parport not to notify the device driver of new ports or of | 263 | This tells parport not to notify the device driver of new ports or of |
243 | ports going away. Registered devices belonging to that driver are NOT | 264 | ports going away. Registered devices belonging to that driver are NOT |
244 | unregistered: parport_unregister_device must be used for each one. | 265 | unregistered: parport_unregister_device must be used for each one. |
245 | 266 | ||
246 | EXAMPLE | 267 | EXAMPLE |
268 | ^^^^^^^ | ||
247 | 269 | ||
248 | void cleanup_module (void) | 270 | :: |
249 | { | ||
250 | ... | ||
251 | /* Stop notifications. */ | ||
252 | parport_unregister_driver (&lp_driver); | ||
253 | 271 | ||
254 | /* Unregister devices. */ | 272 | void cleanup_module (void) |
255 | for (i = 0; i < NUM_DEVS; i++) | 273 | { |
256 | parport_unregister_device (dev[i]); | 274 | ... |
257 | ... | 275 | /* Stop notifications. */ |
258 | } | 276 | parport_unregister_driver (&lp_driver); |
277 | |||
278 | /* Unregister devices. */ | ||
279 | for (i = 0; i < NUM_DEVS; i++) | ||
280 | parport_unregister_device (dev[i]); | ||
281 | ... | ||
282 | } | ||
259 | 283 | ||
260 | SEE ALSO | 284 | SEE ALSO |
285 | ^^^^^^^^ | ||
261 | 286 | ||
262 | parport_register_driver, parport_enumerate | 287 | parport_register_driver, parport_enumerate |
263 | 288 | ||
289 | |||
290 | |||
264 | parport_enumerate - retrieve a list of parallel ports (DEPRECATED) | 291 | parport_enumerate - retrieve a list of parallel ports (DEPRECATED) |
265 | ----------------- | 292 | ------------------------------------------------------------------ |
266 | 293 | ||
267 | SYNOPSIS | 294 | SYNOPSIS |
295 | ^^^^^^^^ | ||
268 | 296 | ||
269 | #include <linux/parport.h> | 297 | :: |
270 | 298 | ||
271 | struct parport *parport_enumerate (void); | 299 | #include <linux/parport.h> |
300 | |||
301 | struct parport *parport_enumerate (void); | ||
272 | 302 | ||
273 | DESCRIPTION | 303 | DESCRIPTION |
304 | ^^^^^^^^^^^ | ||
274 | 305 | ||
275 | Retrieve the first of a list of valid parallel ports for this machine. | 306 | Retrieve the first of a list of valid parallel ports for this machine. |
276 | Successive parallel ports can be found using the 'struct parport | 307 | Successive parallel ports can be found using the ``struct parport |
277 | *next' element of the 'struct parport *' that is returned. If 'next' | 308 | *next`` element of the ``struct parport *`` that is returned. If ``next`` |
278 | is NULL, there are no more parallel ports in the list. The number of | 309 | is NULL, there are no more parallel ports in the list. The number of |
279 | ports in the list will not exceed PARPORT_MAX. | 310 | ports in the list will not exceed PARPORT_MAX. |
280 | 311 | ||
281 | RETURN VALUE | 312 | RETURN VALUE |
313 | ^^^^^^^^^^^^ | ||
282 | 314 | ||
283 | A 'struct parport *' describing a valid parallel port for the machine, | 315 | A ``struct parport *`` describing a valid parallel port for the machine, |
284 | or NULL if there are none. | 316 | or NULL if there are none. |
285 | 317 | ||
286 | ERRORS | 318 | ERRORS |
319 | ^^^^^^ | ||
287 | 320 | ||
288 | This function can return NULL to indicate that there are no parallel | 321 | This function can return NULL to indicate that there are no parallel |
289 | ports to use. | 322 | ports to use. |
290 | 323 | ||
291 | EXAMPLE | 324 | EXAMPLE |
325 | ^^^^^^^ | ||
326 | |||
327 | :: | ||
292 | 328 | ||
293 | int detect_device (void) | 329 | int detect_device (void) |
294 | { | 330 | { |
295 | struct parport *port; | 331 | struct parport *port; |
332 | |||
333 | for (port = parport_enumerate (); | ||
334 | port != NULL; | ||
335 | port = port->next) { | ||
336 | /* Try to detect a device on the port... */ | ||
337 | ... | ||
338 | } | ||
339 | } | ||
296 | 340 | ||
297 | for (port = parport_enumerate (); | ||
298 | port != NULL; | ||
299 | port = port->next) { | ||
300 | /* Try to detect a device on the port... */ | ||
301 | ... | 341 | ... |
302 | } | ||
303 | } | 342 | } |
304 | 343 | ||
305 | ... | ||
306 | } | ||
307 | |||
308 | NOTES | 344 | NOTES |
345 | ^^^^^ | ||
309 | 346 | ||
310 | parport_enumerate is deprecated; parport_register_driver should be | 347 | parport_enumerate is deprecated; parport_register_driver should be |
311 | used instead. | 348 | used instead. |
312 | 349 | ||
313 | SEE ALSO | 350 | SEE ALSO |
351 | ^^^^^^^^ | ||
314 | 352 | ||
315 | parport_register_driver, parport_unregister_driver | 353 | parport_register_driver, parport_unregister_driver |
316 | 354 | ||
355 | |||
356 | |||
317 | parport_register_device - register to use a port | 357 | parport_register_device - register to use a port |
318 | ----------------------- | 358 | ------------------------------------------------ |
319 | 359 | ||
320 | SYNOPSIS | 360 | SYNOPSIS |
361 | ^^^^^^^^ | ||
321 | 362 | ||
322 | #include <linux/parport.h> | 363 | :: |
323 | 364 | ||
324 | typedef int (*preempt_func) (void *handle); | 365 | #include <linux/parport.h> |
325 | typedef void (*wakeup_func) (void *handle); | ||
326 | typedef int (*irq_func) (int irq, void *handle, struct pt_regs *); | ||
327 | 366 | ||
328 | struct pardevice *parport_register_device(struct parport *port, | 367 | typedef int (*preempt_func) (void *handle); |
329 | const char *name, | 368 | typedef void (*wakeup_func) (void *handle); |
330 | preempt_func preempt, | 369 | typedef int (*irq_func) (int irq, void *handle, struct pt_regs *); |
331 | wakeup_func wakeup, | 370 | |
332 | irq_func irq, | 371 | struct pardevice *parport_register_device(struct parport *port, |
333 | int flags, | 372 | const char *name, |
334 | void *handle); | 373 | preempt_func preempt, |
374 | wakeup_func wakeup, | ||
375 | irq_func irq, | ||
376 | int flags, | ||
377 | void *handle); | ||
335 | 378 | ||
336 | DESCRIPTION | 379 | DESCRIPTION |
380 | ^^^^^^^^^^^ | ||
337 | 381 | ||
338 | Use this function to register your device driver on a parallel port | 382 | Use this function to register your device driver on a parallel port |
339 | ('port'). Once you have done that, you will be able to use | 383 | (``port``). Once you have done that, you will be able to use |
340 | parport_claim and parport_release in order to use the port. | 384 | parport_claim and parport_release in order to use the port. |
341 | 385 | ||
342 | The ('name') argument is the name of the device that appears in /proc | 386 | The (``name``) argument is the name of the device that appears in /proc |
343 | filesystem. The string must be valid for the whole lifetime of the | 387 | filesystem. The string must be valid for the whole lifetime of the |
344 | device (until parport_unregister_device is called). | 388 | device (until parport_unregister_device is called). |
345 | 389 | ||
346 | This function will register three callbacks into your driver: | 390 | This function will register three callbacks into your driver: |
347 | 'preempt', 'wakeup' and 'irq'. Each of these may be NULL in order to | 391 | ``preempt``, ``wakeup`` and ``irq``. Each of these may be NULL in order to |
348 | indicate that you do not want a callback. | 392 | indicate that you do not want a callback. |
349 | 393 | ||
350 | When the 'preempt' function is called, it is because another driver | 394 | When the ``preempt`` function is called, it is because another driver |
351 | wishes to use the parallel port. The 'preempt' function should return | 395 | wishes to use the parallel port. The ``preempt`` function should return |
352 | non-zero if the parallel port cannot be released yet -- if zero is | 396 | non-zero if the parallel port cannot be released yet -- if zero is |
353 | returned, the port is lost to another driver and the port must be | 397 | returned, the port is lost to another driver and the port must be |
354 | re-claimed before use. | 398 | re-claimed before use. |
355 | 399 | ||
356 | The 'wakeup' function is called once another driver has released the | 400 | The ``wakeup`` function is called once another driver has released the |
357 | port and no other driver has yet claimed it. You can claim the | 401 | port and no other driver has yet claimed it. You can claim the |
358 | parallel port from within the 'wakeup' function (in which case the | 402 | parallel port from within the ``wakeup`` function (in which case the |
359 | claim is guaranteed to succeed), or choose not to if you don't need it | 403 | claim is guaranteed to succeed), or choose not to if you don't need it |
360 | now. | 404 | now. |
361 | 405 | ||
362 | If an interrupt occurs on the parallel port your driver has claimed, | 406 | If an interrupt occurs on the parallel port your driver has claimed, |
363 | the 'irq' function will be called. (Write something about shared | 407 | the ``irq`` function will be called. (Write something about shared |
364 | interrupts here.) | 408 | interrupts here.) |
365 | 409 | ||
366 | The 'handle' is a pointer to driver-specific data, and is passed to | 410 | The ``handle`` is a pointer to driver-specific data, and is passed to |
367 | the callback functions. | 411 | the callback functions. |
368 | 412 | ||
369 | 'flags' may be a bitwise combination of the following flags: | 413 | ``flags`` may be a bitwise combination of the following flags: |
370 | 414 | ||
415 | ===================== ================================================= | ||
371 | Flag Meaning | 416 | Flag Meaning |
417 | ===================== ================================================= | ||
372 | PARPORT_DEV_EXCL The device cannot share the parallel port at all. | 418 | PARPORT_DEV_EXCL The device cannot share the parallel port at all. |
373 | Use this only when absolutely necessary. | 419 | Use this only when absolutely necessary. |
420 | ===================== ================================================= | ||
374 | 421 | ||
375 | The typedefs are not actually defined -- they are only shown in order | 422 | The typedefs are not actually defined -- they are only shown in order |
376 | to make the function prototype more readable. | 423 | to make the function prototype more readable. |
377 | 424 | ||
378 | The visible parts of the returned 'struct pardevice' are: | 425 | The visible parts of the returned ``struct pardevice`` are:: |
379 | 426 | ||
380 | struct pardevice { | 427 | struct pardevice { |
381 | struct parport *port; /* Associated port */ | 428 | struct parport *port; /* Associated port */ |
382 | void *private; /* Device driver's 'handle' */ | 429 | void *private; /* Device driver's 'handle' */ |
383 | ... | 430 | ... |
384 | }; | 431 | }; |
385 | 432 | ||
386 | RETURN VALUE | 433 | RETURN VALUE |
434 | ^^^^^^^^^^^^ | ||
387 | 435 | ||
388 | A 'struct pardevice *': a handle to the registered parallel port | 436 | A ``struct pardevice *``: a handle to the registered parallel port |
389 | device that can be used for parport_claim, parport_release, etc. | 437 | device that can be used for parport_claim, parport_release, etc. |
390 | 438 | ||
391 | ERRORS | 439 | ERRORS |
440 | ^^^^^^ | ||
392 | 441 | ||
393 | A return value of NULL indicates that there was a problem registering | 442 | A return value of NULL indicates that there was a problem registering |
394 | a device on that port. | 443 | a device on that port. |
395 | 444 | ||
396 | EXAMPLE | 445 | EXAMPLE |
446 | ^^^^^^^ | ||
447 | |||
448 | :: | ||
449 | |||
450 | static int preempt (void *handle) | ||
451 | { | ||
452 | if (busy_right_now) | ||
453 | return 1; | ||
454 | |||
455 | must_reclaim_port = 1; | ||
456 | return 0; | ||
457 | } | ||
458 | |||
459 | static void wakeup (void *handle) | ||
460 | { | ||
461 | struct toaster *private = handle; | ||
462 | struct pardevice *dev = private->dev; | ||
463 | if (!dev) return; /* avoid races */ | ||
464 | |||
465 | if (want_port) | ||
466 | parport_claim (dev); | ||
467 | } | ||
468 | |||
469 | static int toaster_detect (struct toaster *private, struct parport *port) | ||
470 | { | ||
471 | private->dev = parport_register_device (port, "toaster", preempt, | ||
472 | wakeup, NULL, 0, | ||
473 | private); | ||
474 | if (!private->dev) | ||
475 | /* Couldn't register with parport. */ | ||
476 | return -EIO; | ||
397 | 477 | ||
398 | static int preempt (void *handle) | ||
399 | { | ||
400 | if (busy_right_now) | ||
401 | return 1; | ||
402 | |||
403 | must_reclaim_port = 1; | ||
404 | return 0; | ||
405 | } | ||
406 | |||
407 | static void wakeup (void *handle) | ||
408 | { | ||
409 | struct toaster *private = handle; | ||
410 | struct pardevice *dev = private->dev; | ||
411 | if (!dev) return; /* avoid races */ | ||
412 | |||
413 | if (want_port) | ||
414 | parport_claim (dev); | ||
415 | } | ||
416 | |||
417 | static int toaster_detect (struct toaster *private, struct parport *port) | ||
418 | { | ||
419 | private->dev = parport_register_device (port, "toaster", preempt, | ||
420 | wakeup, NULL, 0, | ||
421 | private); | ||
422 | if (!private->dev) | ||
423 | /* Couldn't register with parport. */ | ||
424 | return -EIO; | ||
425 | |||
426 | must_reclaim_port = 0; | ||
427 | busy_right_now = 1; | ||
428 | parport_claim_or_block (private->dev); | ||
429 | ... | ||
430 | /* Don't need the port while the toaster warms up. */ | ||
431 | busy_right_now = 0; | ||
432 | ... | ||
433 | busy_right_now = 1; | ||
434 | if (must_reclaim_port) { | ||
435 | parport_claim_or_block (private->dev); | ||
436 | must_reclaim_port = 0; | 478 | must_reclaim_port = 0; |
479 | busy_right_now = 1; | ||
480 | parport_claim_or_block (private->dev); | ||
481 | ... | ||
482 | /* Don't need the port while the toaster warms up. */ | ||
483 | busy_right_now = 0; | ||
484 | ... | ||
485 | busy_right_now = 1; | ||
486 | if (must_reclaim_port) { | ||
487 | parport_claim_or_block (private->dev); | ||
488 | must_reclaim_port = 0; | ||
489 | } | ||
490 | ... | ||
437 | } | 491 | } |
438 | ... | ||
439 | } | ||
440 | 492 | ||
441 | SEE ALSO | 493 | SEE ALSO |
494 | ^^^^^^^^ | ||
442 | 495 | ||
443 | parport_unregister_device, parport_claim | 496 | parport_unregister_device, parport_claim |
497 | |||
498 | |||
444 | 499 | ||
445 | parport_unregister_device - finish using a port | 500 | parport_unregister_device - finish using a port |
446 | ------------------------- | 501 | ----------------------------------------------- |
447 | 502 | ||
448 | SYNPOPSIS | 503 | SYNPOPSIS |
449 | 504 | ||
450 | #include <linux/parport.h> | 505 | :: |
506 | |||
507 | #include <linux/parport.h> | ||
451 | 508 | ||
452 | void parport_unregister_device (struct pardevice *dev); | 509 | void parport_unregister_device (struct pardevice *dev); |
453 | 510 | ||
454 | DESCRIPTION | 511 | DESCRIPTION |
512 | ^^^^^^^^^^^ | ||
455 | 513 | ||
456 | This function is the opposite of parport_register_device. After using | 514 | This function is the opposite of parport_register_device. After using |
457 | parport_unregister_device, 'dev' is no longer a valid device handle. | 515 | parport_unregister_device, ``dev`` is no longer a valid device handle. |
458 | 516 | ||
459 | You should not unregister a device that is currently claimed, although | 517 | You should not unregister a device that is currently claimed, although |
460 | if you do it will be released automatically. | 518 | if you do it will be released automatically. |
461 | 519 | ||
462 | EXAMPLE | 520 | EXAMPLE |
521 | ^^^^^^^ | ||
522 | |||
523 | :: | ||
463 | 524 | ||
464 | ... | 525 | ... |
465 | kfree (dev->private); /* before we lose the pointer */ | 526 | kfree (dev->private); /* before we lose the pointer */ |
@@ -467,460 +528,602 @@ EXAMPLE | |||
467 | ... | 528 | ... |
468 | 529 | ||
469 | SEE ALSO | 530 | SEE ALSO |
531 | ^^^^^^^^ | ||
532 | |||
470 | 533 | ||
471 | parport_unregister_driver | 534 | parport_unregister_driver |
472 | 535 | ||
473 | parport_claim, parport_claim_or_block - claim the parallel port for a device | 536 | parport_claim, parport_claim_or_block - claim the parallel port for a device |
474 | ------------------------------------- | 537 | ---------------------------------------------------------------------------- |
475 | 538 | ||
476 | SYNOPSIS | 539 | SYNOPSIS |
540 | ^^^^^^^^ | ||
541 | |||
542 | :: | ||
477 | 543 | ||
478 | #include <linux/parport.h> | 544 | #include <linux/parport.h> |
479 | 545 | ||
480 | int parport_claim (struct pardevice *dev); | 546 | int parport_claim (struct pardevice *dev); |
481 | int parport_claim_or_block (struct pardevice *dev); | 547 | int parport_claim_or_block (struct pardevice *dev); |
482 | 548 | ||
483 | DESCRIPTION | 549 | DESCRIPTION |
550 | ^^^^^^^^^^^ | ||
484 | 551 | ||
485 | These functions attempt to gain control of the parallel port on which | 552 | These functions attempt to gain control of the parallel port on which |
486 | 'dev' is registered. 'parport_claim' does not block, but | 553 | ``dev`` is registered. ``parport_claim`` does not block, but |
487 | 'parport_claim_or_block' may do. (Put something here about blocking | 554 | ``parport_claim_or_block`` may do. (Put something here about blocking |
488 | interruptibly or non-interruptibly.) | 555 | interruptibly or non-interruptibly.) |
489 | 556 | ||
490 | You should not try to claim a port that you have already claimed. | 557 | You should not try to claim a port that you have already claimed. |
491 | 558 | ||
492 | RETURN VALUE | 559 | RETURN VALUE |
560 | ^^^^^^^^^^^^ | ||
493 | 561 | ||
494 | A return value of zero indicates that the port was successfully | 562 | A return value of zero indicates that the port was successfully |
495 | claimed, and the caller now has possession of the parallel port. | 563 | claimed, and the caller now has possession of the parallel port. |
496 | 564 | ||
497 | If 'parport_claim_or_block' blocks before returning successfully, the | 565 | If ``parport_claim_or_block`` blocks before returning successfully, the |
498 | return value is positive. | 566 | return value is positive. |
499 | 567 | ||
500 | ERRORS | 568 | ERRORS |
569 | ^^^^^^ | ||
501 | 570 | ||
571 | ========== ========================================================== | ||
502 | -EAGAIN The port is unavailable at the moment, but another attempt | 572 | -EAGAIN The port is unavailable at the moment, but another attempt |
503 | to claim it may succeed. | 573 | to claim it may succeed. |
574 | ========== ========================================================== | ||
504 | 575 | ||
505 | SEE ALSO | 576 | SEE ALSO |
577 | ^^^^^^^^ | ||
578 | |||
506 | 579 | ||
507 | parport_release | 580 | parport_release |
508 | 581 | ||
509 | parport_release - release the parallel port | 582 | parport_release - release the parallel port |
510 | --------------- | 583 | ------------------------------------------- |
511 | 584 | ||
512 | SYNOPSIS | 585 | SYNOPSIS |
586 | ^^^^^^^^ | ||
587 | |||
588 | :: | ||
513 | 589 | ||
514 | #include <linux/parport.h> | 590 | #include <linux/parport.h> |
515 | 591 | ||
516 | void parport_release (struct pardevice *dev); | 592 | void parport_release (struct pardevice *dev); |
517 | 593 | ||
518 | DESCRIPTION | 594 | DESCRIPTION |
595 | ^^^^^^^^^^^ | ||
519 | 596 | ||
520 | Once a parallel port device has been claimed, it can be released using | 597 | Once a parallel port device has been claimed, it can be released using |
521 | 'parport_release'. It cannot fail, but you should not release a | 598 | ``parport_release``. It cannot fail, but you should not release a |
522 | device that you do not have possession of. | 599 | device that you do not have possession of. |
523 | 600 | ||
524 | EXAMPLE | 601 | EXAMPLE |
602 | ^^^^^^^ | ||
525 | 603 | ||
526 | static size_t write (struct pardevice *dev, const void *buf, | 604 | :: |
527 | size_t len) | 605 | |
528 | { | 606 | static size_t write (struct pardevice *dev, const void *buf, |
529 | ... | 607 | size_t len) |
530 | written = dev->port->ops->write_ecp_data (dev->port, buf, | 608 | { |
531 | len); | 609 | ... |
532 | parport_release (dev); | 610 | written = dev->port->ops->write_ecp_data (dev->port, buf, |
533 | ... | 611 | len); |
534 | } | 612 | parport_release (dev); |
613 | ... | ||
614 | } | ||
535 | 615 | ||
536 | 616 | ||
537 | SEE ALSO | 617 | SEE ALSO |
618 | ^^^^^^^^ | ||
538 | 619 | ||
539 | change_mode, parport_claim, parport_claim_or_block, parport_yield | 620 | change_mode, parport_claim, parport_claim_or_block, parport_yield |
540 | 621 | ||
622 | |||
623 | |||
541 | parport_yield, parport_yield_blocking - temporarily release a parallel port | 624 | parport_yield, parport_yield_blocking - temporarily release a parallel port |
542 | ------------------------------------- | 625 | --------------------------------------------------------------------------- |
543 | 626 | ||
544 | SYNOPSIS | 627 | SYNOPSIS |
628 | ^^^^^^^^ | ||
629 | |||
630 | :: | ||
545 | 631 | ||
546 | #include <linux/parport.h> | 632 | #include <linux/parport.h> |
547 | 633 | ||
548 | int parport_yield (struct pardevice *dev) | 634 | int parport_yield (struct pardevice *dev) |
549 | int parport_yield_blocking (struct pardevice *dev); | 635 | int parport_yield_blocking (struct pardevice *dev); |
550 | 636 | ||
551 | DESCRIPTION | 637 | DESCRIPTION |
638 | ^^^^^^^^^^^ | ||
552 | 639 | ||
553 | When a driver has control of a parallel port, it may allow another | 640 | When a driver has control of a parallel port, it may allow another |
554 | driver to temporarily 'borrow' it. 'parport_yield' does not block; | 641 | driver to temporarily ``borrow`` it. ``parport_yield`` does not block; |
555 | 'parport_yield_blocking' may do. | 642 | ``parport_yield_blocking`` may do. |
556 | 643 | ||
557 | RETURN VALUE | 644 | RETURN VALUE |
645 | ^^^^^^^^^^^^ | ||
558 | 646 | ||
559 | A return value of zero indicates that the caller still owns the port | 647 | A return value of zero indicates that the caller still owns the port |
560 | and the call did not block. | 648 | and the call did not block. |
561 | 649 | ||
562 | A positive return value from 'parport_yield_blocking' indicates that | 650 | A positive return value from ``parport_yield_blocking`` indicates that |
563 | the caller still owns the port and the call blocked. | 651 | the caller still owns the port and the call blocked. |
564 | 652 | ||
565 | A return value of -EAGAIN indicates that the caller no longer owns the | 653 | A return value of -EAGAIN indicates that the caller no longer owns the |
566 | port, and it must be re-claimed before use. | 654 | port, and it must be re-claimed before use. |
567 | 655 | ||
568 | ERRORS | 656 | ERRORS |
657 | ^^^^^^ | ||
569 | 658 | ||
659 | ========= ========================================================== | ||
570 | -EAGAIN Ownership of the parallel port was given away. | 660 | -EAGAIN Ownership of the parallel port was given away. |
661 | ========= ========================================================== | ||
571 | 662 | ||
572 | SEE ALSO | 663 | SEE ALSO |
664 | ^^^^^^^^ | ||
573 | 665 | ||
574 | parport_release | 666 | parport_release |
667 | |||
668 | |||
575 | 669 | ||
576 | parport_wait_peripheral - wait for status lines, up to 35ms | 670 | parport_wait_peripheral - wait for status lines, up to 35ms |
577 | ----------------------- | 671 | ----------------------------------------------------------- |
578 | 672 | ||
579 | SYNOPSIS | 673 | SYNOPSIS |
674 | ^^^^^^^^ | ||
675 | |||
676 | :: | ||
580 | 677 | ||
581 | #include <linux/parport.h> | 678 | #include <linux/parport.h> |
582 | 679 | ||
583 | int parport_wait_peripheral (struct parport *port, | 680 | int parport_wait_peripheral (struct parport *port, |
584 | unsigned char mask, | 681 | unsigned char mask, |
585 | unsigned char val); | 682 | unsigned char val); |
586 | 683 | ||
587 | DESCRIPTION | 684 | DESCRIPTION |
685 | ^^^^^^^^^^^ | ||
588 | 686 | ||
589 | Wait for the status lines in mask to match the values in val. | 687 | Wait for the status lines in mask to match the values in val. |
590 | 688 | ||
591 | RETURN VALUE | 689 | RETURN VALUE |
690 | ^^^^^^^^^^^^ | ||
592 | 691 | ||
692 | ======== ========================================================== | ||
593 | -EINTR a signal is pending | 693 | -EINTR a signal is pending |
594 | 0 the status lines in mask have values in val | 694 | 0 the status lines in mask have values in val |
595 | 1 timed out while waiting (35ms elapsed) | 695 | 1 timed out while waiting (35ms elapsed) |
696 | ======== ========================================================== | ||
596 | 697 | ||
597 | SEE ALSO | 698 | SEE ALSO |
699 | ^^^^^^^^ | ||
598 | 700 | ||
599 | parport_poll_peripheral | 701 | parport_poll_peripheral |
702 | |||
703 | |||
600 | 704 | ||
601 | parport_poll_peripheral - wait for status lines, in usec | 705 | parport_poll_peripheral - wait for status lines, in usec |
602 | ----------------------- | 706 | -------------------------------------------------------- |
603 | 707 | ||
604 | SYNOPSIS | 708 | SYNOPSIS |
709 | ^^^^^^^^ | ||
710 | |||
711 | :: | ||
605 | 712 | ||
606 | #include <linux/parport.h> | 713 | #include <linux/parport.h> |
607 | 714 | ||
608 | int parport_poll_peripheral (struct parport *port, | 715 | int parport_poll_peripheral (struct parport *port, |
609 | unsigned char mask, | 716 | unsigned char mask, |
610 | unsigned char val, | 717 | unsigned char val, |
611 | int usec); | 718 | int usec); |
612 | 719 | ||
613 | DESCRIPTION | 720 | DESCRIPTION |
721 | ^^^^^^^^^^^ | ||
614 | 722 | ||
615 | Wait for the status lines in mask to match the values in val. | 723 | Wait for the status lines in mask to match the values in val. |
616 | 724 | ||
617 | RETURN VALUE | 725 | RETURN VALUE |
726 | ^^^^^^^^^^^^ | ||
618 | 727 | ||
728 | ======== ========================================================== | ||
619 | -EINTR a signal is pending | 729 | -EINTR a signal is pending |
620 | 0 the status lines in mask have values in val | 730 | 0 the status lines in mask have values in val |
621 | 1 timed out while waiting (usec microseconds have elapsed) | 731 | 1 timed out while waiting (usec microseconds have elapsed) |
732 | ======== ========================================================== | ||
622 | 733 | ||
623 | SEE ALSO | 734 | SEE ALSO |
735 | ^^^^^^^^ | ||
624 | 736 | ||
625 | parport_wait_peripheral | 737 | parport_wait_peripheral |
626 | 738 | ||
739 | |||
740 | |||
627 | parport_wait_event - wait for an event on a port | 741 | parport_wait_event - wait for an event on a port |
628 | ------------------ | 742 | ------------------------------------------------ |
629 | 743 | ||
630 | SYNOPSIS | 744 | SYNOPSIS |
745 | ^^^^^^^^ | ||
631 | 746 | ||
632 | #include <linux/parport.h> | 747 | :: |
633 | 748 | ||
634 | int parport_wait_event (struct parport *port, signed long timeout) | 749 | #include <linux/parport.h> |
750 | |||
751 | int parport_wait_event (struct parport *port, signed long timeout) | ||
635 | 752 | ||
636 | DESCRIPTION | 753 | DESCRIPTION |
754 | ^^^^^^^^^^^ | ||
637 | 755 | ||
638 | Wait for an event (e.g. interrupt) on a port. The timeout is in | 756 | Wait for an event (e.g. interrupt) on a port. The timeout is in |
639 | jiffies. | 757 | jiffies. |
640 | 758 | ||
641 | RETURN VALUE | 759 | RETURN VALUE |
760 | ^^^^^^^^^^^^ | ||
642 | 761 | ||
762 | ======= ========================================================== | ||
643 | 0 success | 763 | 0 success |
644 | <0 error (exit as soon as possible) | 764 | <0 error (exit as soon as possible) |
645 | >0 timed out | 765 | >0 timed out |
646 | 766 | ======= ========================================================== | |
767 | |||
647 | parport_negotiate - perform IEEE 1284 negotiation | 768 | parport_negotiate - perform IEEE 1284 negotiation |
648 | ----------------- | 769 | ------------------------------------------------- |
649 | 770 | ||
650 | SYNOPSIS | 771 | SYNOPSIS |
772 | ^^^^^^^^ | ||
773 | |||
774 | :: | ||
651 | 775 | ||
652 | #include <linux/parport.h> | 776 | #include <linux/parport.h> |
653 | 777 | ||
654 | int parport_negotiate (struct parport *, int mode); | 778 | int parport_negotiate (struct parport *, int mode); |
655 | 779 | ||
656 | DESCRIPTION | 780 | DESCRIPTION |
781 | ^^^^^^^^^^^ | ||
657 | 782 | ||
658 | Perform IEEE 1284 negotiation. | 783 | Perform IEEE 1284 negotiation. |
659 | 784 | ||
660 | RETURN VALUE | 785 | RETURN VALUE |
786 | ^^^^^^^^^^^^ | ||
661 | 787 | ||
788 | ======= ========================================================== | ||
662 | 0 handshake OK; IEEE 1284 peripheral and mode available | 789 | 0 handshake OK; IEEE 1284 peripheral and mode available |
663 | -1 handshake failed; peripheral not compliant (or none present) | 790 | -1 handshake failed; peripheral not compliant (or none present) |
664 | 1 handshake OK; IEEE 1284 peripheral present but mode not | 791 | 1 handshake OK; IEEE 1284 peripheral present but mode not |
665 | available | 792 | available |
793 | ======= ========================================================== | ||
666 | 794 | ||
667 | SEE ALSO | 795 | SEE ALSO |
796 | ^^^^^^^^ | ||
668 | 797 | ||
669 | parport_read, parport_write | 798 | parport_read, parport_write |
670 | 799 | ||
800 | |||
801 | |||
671 | parport_read - read data from device | 802 | parport_read - read data from device |
672 | ------------ | 803 | ------------------------------------ |
673 | 804 | ||
674 | SYNOPSIS | 805 | SYNOPSIS |
806 | ^^^^^^^^ | ||
807 | |||
808 | :: | ||
675 | 809 | ||
676 | #include <linux/parport.h> | 810 | #include <linux/parport.h> |
677 | 811 | ||
678 | ssize_t parport_read (struct parport *, void *buf, size_t len); | 812 | ssize_t parport_read (struct parport *, void *buf, size_t len); |
679 | 813 | ||
680 | DESCRIPTION | 814 | DESCRIPTION |
815 | ^^^^^^^^^^^ | ||
681 | 816 | ||
682 | Read data from device in current IEEE 1284 transfer mode. This only | 817 | Read data from device in current IEEE 1284 transfer mode. This only |
683 | works for modes that support reverse data transfer. | 818 | works for modes that support reverse data transfer. |
684 | 819 | ||
685 | RETURN VALUE | 820 | RETURN VALUE |
821 | ^^^^^^^^^^^^ | ||
686 | 822 | ||
687 | If negative, an error code; otherwise the number of bytes transferred. | 823 | If negative, an error code; otherwise the number of bytes transferred. |
688 | 824 | ||
689 | SEE ALSO | 825 | SEE ALSO |
826 | ^^^^^^^^ | ||
690 | 827 | ||
691 | parport_write, parport_negotiate | 828 | parport_write, parport_negotiate |
692 | 829 | ||
830 | |||
831 | |||
693 | parport_write - write data to device | 832 | parport_write - write data to device |
694 | ------------- | 833 | ------------------------------------ |
695 | 834 | ||
696 | SYNOPSIS | 835 | SYNOPSIS |
836 | ^^^^^^^^ | ||
837 | |||
838 | :: | ||
697 | 839 | ||
698 | #include <linux/parport.h> | 840 | #include <linux/parport.h> |
699 | 841 | ||
700 | ssize_t parport_write (struct parport *, const void *buf, size_t len); | 842 | ssize_t parport_write (struct parport *, const void *buf, size_t len); |
701 | 843 | ||
702 | DESCRIPTION | 844 | DESCRIPTION |
845 | ^^^^^^^^^^^ | ||
703 | 846 | ||
704 | Write data to device in current IEEE 1284 transfer mode. This only | 847 | Write data to device in current IEEE 1284 transfer mode. This only |
705 | works for modes that support forward data transfer. | 848 | works for modes that support forward data transfer. |
706 | 849 | ||
707 | RETURN VALUE | 850 | RETURN VALUE |
851 | ^^^^^^^^^^^^ | ||
708 | 852 | ||
709 | If negative, an error code; otherwise the number of bytes transferred. | 853 | If negative, an error code; otherwise the number of bytes transferred. |
710 | 854 | ||
711 | SEE ALSO | 855 | SEE ALSO |
856 | ^^^^^^^^ | ||
712 | 857 | ||
713 | parport_read, parport_negotiate | 858 | parport_read, parport_negotiate |
859 | |||
860 | |||
714 | 861 | ||
715 | parport_open - register device for particular device number | 862 | parport_open - register device for particular device number |
716 | ------------ | 863 | ----------------------------------------------------------- |
717 | 864 | ||
718 | SYNOPSIS | 865 | SYNOPSIS |
866 | ^^^^^^^^ | ||
719 | 867 | ||
720 | #include <linux/parport.h> | 868 | :: |
721 | 869 | ||
722 | struct pardevice *parport_open (int devnum, const char *name, | 870 | #include <linux/parport.h> |
723 | int (*pf) (void *), | 871 | |
724 | void (*kf) (void *), | 872 | struct pardevice *parport_open (int devnum, const char *name, |
725 | void (*irqf) (int, void *, | 873 | int (*pf) (void *), |
726 | struct pt_regs *), | 874 | void (*kf) (void *), |
727 | int flags, void *handle); | 875 | void (*irqf) (int, void *, |
876 | struct pt_regs *), | ||
877 | int flags, void *handle); | ||
728 | 878 | ||
729 | DESCRIPTION | 879 | DESCRIPTION |
880 | ^^^^^^^^^^^ | ||
730 | 881 | ||
731 | This is like parport_register_device but takes a device number instead | 882 | This is like parport_register_device but takes a device number instead |
732 | of a pointer to a struct parport. | 883 | of a pointer to a struct parport. |
733 | 884 | ||
734 | RETURN VALUE | 885 | RETURN VALUE |
886 | ^^^^^^^^^^^^ | ||
735 | 887 | ||
736 | See parport_register_device. If no device is associated with devnum, | 888 | See parport_register_device. If no device is associated with devnum, |
737 | NULL is returned. | 889 | NULL is returned. |
738 | 890 | ||
739 | SEE ALSO | 891 | SEE ALSO |
892 | ^^^^^^^^ | ||
740 | 893 | ||
741 | parport_register_device | 894 | parport_register_device |
742 | 895 | ||
896 | |||
897 | |||
743 | parport_close - unregister device for particular device number | 898 | parport_close - unregister device for particular device number |
744 | ------------- | 899 | -------------------------------------------------------------- |
745 | 900 | ||
746 | SYNOPSIS | 901 | SYNOPSIS |
902 | ^^^^^^^^ | ||
903 | |||
904 | :: | ||
747 | 905 | ||
748 | #include <linux/parport.h> | 906 | #include <linux/parport.h> |
749 | 907 | ||
750 | void parport_close (struct pardevice *dev); | 908 | void parport_close (struct pardevice *dev); |
751 | 909 | ||
752 | DESCRIPTION | 910 | DESCRIPTION |
911 | ^^^^^^^^^^^ | ||
753 | 912 | ||
754 | This is the equivalent of parport_unregister_device for parport_open. | 913 | This is the equivalent of parport_unregister_device for parport_open. |
755 | 914 | ||
756 | SEE ALSO | 915 | SEE ALSO |
916 | ^^^^^^^^ | ||
757 | 917 | ||
758 | parport_unregister_device, parport_open | 918 | parport_unregister_device, parport_open |
759 | 919 | ||
920 | |||
921 | |||
760 | parport_device_id - obtain IEEE 1284 Device ID | 922 | parport_device_id - obtain IEEE 1284 Device ID |
761 | ----------------- | 923 | ---------------------------------------------- |
762 | 924 | ||
763 | SYNOPSIS | 925 | SYNOPSIS |
926 | ^^^^^^^^ | ||
927 | |||
928 | :: | ||
764 | 929 | ||
765 | #include <linux/parport.h> | 930 | #include <linux/parport.h> |
766 | 931 | ||
767 | ssize_t parport_device_id (int devnum, char *buffer, size_t len); | 932 | ssize_t parport_device_id (int devnum, char *buffer, size_t len); |
768 | 933 | ||
769 | DESCRIPTION | 934 | DESCRIPTION |
935 | ^^^^^^^^^^^ | ||
770 | 936 | ||
771 | Obtains the IEEE 1284 Device ID associated with a given device. | 937 | Obtains the IEEE 1284 Device ID associated with a given device. |
772 | 938 | ||
773 | RETURN VALUE | 939 | RETURN VALUE |
940 | ^^^^^^^^^^^^ | ||
774 | 941 | ||
775 | If negative, an error code; otherwise, the number of bytes of buffer | 942 | If negative, an error code; otherwise, the number of bytes of buffer |
776 | that contain the device ID. The format of the device ID is as | 943 | that contain the device ID. The format of the device ID is as |
777 | follows: | 944 | follows:: |
778 | 945 | ||
779 | [length][ID] | 946 | [length][ID] |
780 | 947 | ||
781 | The first two bytes indicate the inclusive length of the entire Device | 948 | The first two bytes indicate the inclusive length of the entire Device |
782 | ID, and are in big-endian order. The ID is a sequence of pairs of the | 949 | ID, and are in big-endian order. The ID is a sequence of pairs of the |
783 | form: | 950 | form:: |
784 | 951 | ||
785 | key:value; | 952 | key:value; |
786 | 953 | ||
787 | NOTES | 954 | NOTES |
955 | ^^^^^ | ||
788 | 956 | ||
789 | Many devices have ill-formed IEEE 1284 Device IDs. | 957 | Many devices have ill-formed IEEE 1284 Device IDs. |
790 | 958 | ||
791 | SEE ALSO | 959 | SEE ALSO |
960 | ^^^^^^^^ | ||
792 | 961 | ||
793 | parport_find_class, parport_find_device | 962 | parport_find_class, parport_find_device |
794 | 963 | ||
964 | |||
965 | |||
795 | parport_device_coords - convert device number to device coordinates | 966 | parport_device_coords - convert device number to device coordinates |
796 | ------------------ | 967 | ------------------------------------------------------------------- |
797 | 968 | ||
798 | SYNOPSIS | 969 | SYNOPSIS |
970 | ^^^^^^^^ | ||
971 | |||
972 | :: | ||
799 | 973 | ||
800 | #include <linux/parport.h> | 974 | #include <linux/parport.h> |
801 | 975 | ||
802 | int parport_device_coords (int devnum, int *parport, int *mux, | 976 | int parport_device_coords (int devnum, int *parport, int *mux, |
803 | int *daisy); | 977 | int *daisy); |
804 | 978 | ||
805 | DESCRIPTION | 979 | DESCRIPTION |
980 | ^^^^^^^^^^^ | ||
806 | 981 | ||
807 | Convert between device number (zero-based) and device coordinates | 982 | Convert between device number (zero-based) and device coordinates |
808 | (port, multiplexor, daisy chain address). | 983 | (port, multiplexor, daisy chain address). |
809 | 984 | ||
810 | RETURN VALUE | 985 | RETURN VALUE |
986 | ^^^^^^^^^^^^ | ||
811 | 987 | ||
812 | Zero on success, in which case the coordinates are (*parport, *mux, | 988 | Zero on success, in which case the coordinates are (``*parport``, ``*mux``, |
813 | *daisy). | 989 | ``*daisy``). |
814 | 990 | ||
815 | SEE ALSO | 991 | SEE ALSO |
992 | ^^^^^^^^ | ||
816 | 993 | ||
817 | parport_open, parport_device_id | 994 | parport_open, parport_device_id |
818 | 995 | ||
996 | |||
997 | |||
819 | parport_find_class - find a device by its class | 998 | parport_find_class - find a device by its class |
820 | ------------------ | 999 | ----------------------------------------------- |
821 | 1000 | ||
822 | SYNOPSIS | 1001 | SYNOPSIS |
823 | 1002 | ^^^^^^^^ | |
824 | #include <linux/parport.h> | 1003 | |
825 | 1004 | :: | |
826 | typedef enum { | 1005 | |
827 | PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */ | 1006 | #include <linux/parport.h> |
828 | PARPORT_CLASS_PRINTER, | 1007 | |
829 | PARPORT_CLASS_MODEM, | 1008 | typedef enum { |
830 | PARPORT_CLASS_NET, | 1009 | PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */ |
831 | PARPORT_CLASS_HDC, /* Hard disk controller */ | 1010 | PARPORT_CLASS_PRINTER, |
832 | PARPORT_CLASS_PCMCIA, | 1011 | PARPORT_CLASS_MODEM, |
833 | PARPORT_CLASS_MEDIA, /* Multimedia device */ | 1012 | PARPORT_CLASS_NET, |
834 | PARPORT_CLASS_FDC, /* Floppy disk controller */ | 1013 | PARPORT_CLASS_HDC, /* Hard disk controller */ |
835 | PARPORT_CLASS_PORTS, | 1014 | PARPORT_CLASS_PCMCIA, |
836 | PARPORT_CLASS_SCANNER, | 1015 | PARPORT_CLASS_MEDIA, /* Multimedia device */ |
837 | PARPORT_CLASS_DIGCAM, | 1016 | PARPORT_CLASS_FDC, /* Floppy disk controller */ |
838 | PARPORT_CLASS_OTHER, /* Anything else */ | 1017 | PARPORT_CLASS_PORTS, |
839 | PARPORT_CLASS_UNSPEC, /* No CLS field in ID */ | 1018 | PARPORT_CLASS_SCANNER, |
840 | PARPORT_CLASS_SCSIADAPTER | 1019 | PARPORT_CLASS_DIGCAM, |
841 | } parport_device_class; | 1020 | PARPORT_CLASS_OTHER, /* Anything else */ |
842 | 1021 | PARPORT_CLASS_UNSPEC, /* No CLS field in ID */ | |
843 | int parport_find_class (parport_device_class cls, int from); | 1022 | PARPORT_CLASS_SCSIADAPTER |
1023 | } parport_device_class; | ||
1024 | |||
1025 | int parport_find_class (parport_device_class cls, int from); | ||
844 | 1026 | ||
845 | DESCRIPTION | 1027 | DESCRIPTION |
1028 | ^^^^^^^^^^^ | ||
846 | 1029 | ||
847 | Find a device by class. The search starts from device number from+1. | 1030 | Find a device by class. The search starts from device number from+1. |
848 | 1031 | ||
849 | RETURN VALUE | 1032 | RETURN VALUE |
1033 | ^^^^^^^^^^^^ | ||
850 | 1034 | ||
851 | The device number of the next device in that class, or -1 if no such | 1035 | The device number of the next device in that class, or -1 if no such |
852 | device exists. | 1036 | device exists. |
853 | 1037 | ||
854 | NOTES | 1038 | NOTES |
1039 | ^^^^^ | ||
855 | 1040 | ||
856 | Example usage: | 1041 | Example usage:: |
857 | 1042 | ||
858 | int devnum = -1; | 1043 | int devnum = -1; |
859 | while ((devnum = parport_find_class (PARPORT_CLASS_DIGCAM, devnum)) != -1) { | 1044 | while ((devnum = parport_find_class (PARPORT_CLASS_DIGCAM, devnum)) != -1) { |
860 | struct pardevice *dev = parport_open (devnum, ...); | 1045 | struct pardevice *dev = parport_open (devnum, ...); |
861 | ... | 1046 | ... |
862 | } | 1047 | } |
863 | 1048 | ||
864 | SEE ALSO | 1049 | SEE ALSO |
1050 | ^^^^^^^^ | ||
865 | 1051 | ||
866 | parport_find_device, parport_open, parport_device_id | 1052 | parport_find_device, parport_open, parport_device_id |
867 | 1053 | ||
1054 | |||
1055 | |||
868 | parport_find_device - find a device by its class | 1056 | parport_find_device - find a device by its class |
869 | ------------------ | 1057 | ------------------------------------------------ |
870 | 1058 | ||
871 | SYNOPSIS | 1059 | SYNOPSIS |
1060 | ^^^^^^^^ | ||
872 | 1061 | ||
873 | #include <linux/parport.h> | 1062 | :: |
874 | 1063 | ||
875 | int parport_find_device (const char *mfg, const char *mdl, int from); | 1064 | #include <linux/parport.h> |
1065 | |||
1066 | int parport_find_device (const char *mfg, const char *mdl, int from); | ||
876 | 1067 | ||
877 | DESCRIPTION | 1068 | DESCRIPTION |
1069 | ^^^^^^^^^^^ | ||
878 | 1070 | ||
879 | Find a device by vendor and model. The search starts from device | 1071 | Find a device by vendor and model. The search starts from device |
880 | number from+1. | 1072 | number from+1. |
881 | 1073 | ||
882 | RETURN VALUE | 1074 | RETURN VALUE |
1075 | ^^^^^^^^^^^^ | ||
883 | 1076 | ||
884 | The device number of the next device matching the specifications, or | 1077 | The device number of the next device matching the specifications, or |
885 | -1 if no such device exists. | 1078 | -1 if no such device exists. |
886 | 1079 | ||
887 | NOTES | 1080 | NOTES |
1081 | ^^^^^ | ||
888 | 1082 | ||
889 | Example usage: | 1083 | Example usage:: |
890 | 1084 | ||
891 | int devnum = -1; | 1085 | int devnum = -1; |
892 | while ((devnum = parport_find_device ("IOMEGA", "ZIP+", devnum)) != -1) { | 1086 | while ((devnum = parport_find_device ("IOMEGA", "ZIP+", devnum)) != -1) { |
893 | struct pardevice *dev = parport_open (devnum, ...); | 1087 | struct pardevice *dev = parport_open (devnum, ...); |
894 | ... | 1088 | ... |
895 | } | 1089 | } |
896 | 1090 | ||
897 | SEE ALSO | 1091 | SEE ALSO |
1092 | ^^^^^^^^ | ||
898 | 1093 | ||
899 | parport_find_class, parport_open, parport_device_id | 1094 | parport_find_class, parport_open, parport_device_id |
1095 | |||
1096 | |||
900 | 1097 | ||
901 | parport_set_timeout - set the inactivity timeout | 1098 | parport_set_timeout - set the inactivity timeout |
902 | ------------------- | 1099 | ------------------------------------------------ |
903 | 1100 | ||
904 | SYNOPSIS | 1101 | SYNOPSIS |
1102 | ^^^^^^^^ | ||
1103 | |||
1104 | :: | ||
905 | 1105 | ||
906 | #include <linux/parport.h> | 1106 | #include <linux/parport.h> |
907 | 1107 | ||
908 | long parport_set_timeout (struct pardevice *dev, long inactivity); | 1108 | long parport_set_timeout (struct pardevice *dev, long inactivity); |
909 | 1109 | ||
910 | DESCRIPTION | 1110 | DESCRIPTION |
1111 | ^^^^^^^^^^^ | ||
911 | 1112 | ||
912 | Set the inactivity timeout, in jiffies, for a registered device. The | 1113 | Set the inactivity timeout, in jiffies, for a registered device. The |
913 | previous timeout is returned. | 1114 | previous timeout is returned. |
914 | 1115 | ||
915 | RETURN VALUE | 1116 | RETURN VALUE |
1117 | ^^^^^^^^^^^^ | ||
916 | 1118 | ||
917 | The previous timeout, in jiffies. | 1119 | The previous timeout, in jiffies. |
918 | 1120 | ||
919 | NOTES | 1121 | NOTES |
1122 | ^^^^^ | ||
920 | 1123 | ||
921 | Some of the port->ops functions for a parport may take time, owing to | 1124 | Some of the port->ops functions for a parport may take time, owing to |
922 | delays at the peripheral. After the peripheral has not responded for | 1125 | delays at the peripheral. After the peripheral has not responded for |
923 | 'inactivity' jiffies, a timeout will occur and the blocking function | 1126 | ``inactivity`` jiffies, a timeout will occur and the blocking function |
924 | will return. | 1127 | will return. |
925 | 1128 | ||
926 | A timeout of 0 jiffies is a special case: the function must do as much | 1129 | A timeout of 0 jiffies is a special case: the function must do as much |
@@ -932,29 +1135,37 @@ Once set for a registered device, the timeout will remain at the set | |||
932 | value until set again. | 1135 | value until set again. |
933 | 1136 | ||
934 | SEE ALSO | 1137 | SEE ALSO |
1138 | ^^^^^^^^ | ||
935 | 1139 | ||
936 | port->ops->xxx_read/write_yyy | 1140 | port->ops->xxx_read/write_yyy |
937 | 1141 | ||
1142 | |||
1143 | |||
1144 | |||
938 | PORT FUNCTIONS | 1145 | PORT FUNCTIONS |
939 | -------------- | 1146 | ============== |
940 | 1147 | ||
941 | The functions in the port->ops structure (struct parport_operations) | 1148 | The functions in the port->ops structure (struct parport_operations) |
942 | are provided by the low-level driver responsible for that port. | 1149 | are provided by the low-level driver responsible for that port. |
943 | 1150 | ||
944 | port->ops->read_data - read the data register | 1151 | port->ops->read_data - read the data register |
945 | -------------------- | 1152 | --------------------------------------------- |
946 | 1153 | ||
947 | SYNOPSIS | 1154 | SYNOPSIS |
1155 | ^^^^^^^^ | ||
948 | 1156 | ||
949 | #include <linux/parport.h> | 1157 | :: |
950 | 1158 | ||
951 | struct parport_operations { | 1159 | #include <linux/parport.h> |
952 | ... | 1160 | |
953 | unsigned char (*read_data) (struct parport *port); | 1161 | struct parport_operations { |
954 | ... | 1162 | ... |
955 | }; | 1163 | unsigned char (*read_data) (struct parport *port); |
1164 | ... | ||
1165 | }; | ||
956 | 1166 | ||
957 | DESCRIPTION | 1167 | DESCRIPTION |
1168 | ^^^^^^^^^^^ | ||
958 | 1169 | ||
959 | If port->modes contains the PARPORT_MODE_TRISTATE flag and the | 1170 | If port->modes contains the PARPORT_MODE_TRISTATE flag and the |
960 | PARPORT_CONTROL_DIRECTION bit in the control register is set, this | 1171 | PARPORT_CONTROL_DIRECTION bit in the control register is set, this |
@@ -964,45 +1175,59 @@ not set, the return value _may_ be the last value written to the data | |||
964 | register. Otherwise the return value is undefined. | 1175 | register. Otherwise the return value is undefined. |
965 | 1176 | ||
966 | SEE ALSO | 1177 | SEE ALSO |
1178 | ^^^^^^^^ | ||
967 | 1179 | ||
968 | write_data, read_status, write_control | 1180 | write_data, read_status, write_control |
1181 | |||
1182 | |||
969 | 1183 | ||
970 | port->ops->write_data - write the data register | 1184 | port->ops->write_data - write the data register |
971 | --------------------- | 1185 | ----------------------------------------------- |
972 | 1186 | ||
973 | SYNOPSIS | 1187 | SYNOPSIS |
1188 | ^^^^^^^^ | ||
974 | 1189 | ||
975 | #include <linux/parport.h> | 1190 | :: |
976 | 1191 | ||
977 | struct parport_operations { | 1192 | #include <linux/parport.h> |
978 | ... | 1193 | |
979 | void (*write_data) (struct parport *port, unsigned char d); | 1194 | struct parport_operations { |
980 | ... | 1195 | ... |
981 | }; | 1196 | void (*write_data) (struct parport *port, unsigned char d); |
1197 | ... | ||
1198 | }; | ||
982 | 1199 | ||
983 | DESCRIPTION | 1200 | DESCRIPTION |
1201 | ^^^^^^^^^^^ | ||
984 | 1202 | ||
985 | Writes to the data register. May have side-effects (a STROBE pulse, | 1203 | Writes to the data register. May have side-effects (a STROBE pulse, |
986 | for instance). | 1204 | for instance). |
987 | 1205 | ||
988 | SEE ALSO | 1206 | SEE ALSO |
1207 | ^^^^^^^^ | ||
989 | 1208 | ||
990 | read_data, read_status, write_control | 1209 | read_data, read_status, write_control |
1210 | |||
1211 | |||
991 | 1212 | ||
992 | port->ops->read_status - read the status register | 1213 | port->ops->read_status - read the status register |
993 | ---------------------- | 1214 | ------------------------------------------------- |
994 | 1215 | ||
995 | SYNOPSIS | 1216 | SYNOPSIS |
1217 | ^^^^^^^^ | ||
996 | 1218 | ||
997 | #include <linux/parport.h> | 1219 | :: |
998 | 1220 | ||
999 | struct parport_operations { | 1221 | #include <linux/parport.h> |
1000 | ... | 1222 | |
1001 | unsigned char (*read_status) (struct parport *port); | 1223 | struct parport_operations { |
1002 | ... | 1224 | ... |
1003 | }; | 1225 | unsigned char (*read_status) (struct parport *port); |
1226 | ... | ||
1227 | }; | ||
1004 | 1228 | ||
1005 | DESCRIPTION | 1229 | DESCRIPTION |
1230 | ^^^^^^^^^^^ | ||
1006 | 1231 | ||
1007 | Reads from the status register. This is a bitmask: | 1232 | Reads from the status register. This is a bitmask: |
1008 | 1233 | ||
@@ -1015,76 +1240,98 @@ Reads from the status register. This is a bitmask: | |||
1015 | There may be other bits set. | 1240 | There may be other bits set. |
1016 | 1241 | ||
1017 | SEE ALSO | 1242 | SEE ALSO |
1243 | ^^^^^^^^ | ||
1018 | 1244 | ||
1019 | read_data, write_data, write_control | 1245 | read_data, write_data, write_control |
1246 | |||
1247 | |||
1020 | 1248 | ||
1021 | port->ops->read_control - read the control register | 1249 | port->ops->read_control - read the control register |
1022 | ----------------------- | 1250 | --------------------------------------------------- |
1023 | 1251 | ||
1024 | SYNOPSIS | 1252 | SYNOPSIS |
1253 | ^^^^^^^^ | ||
1025 | 1254 | ||
1026 | #include <linux/parport.h> | 1255 | :: |
1027 | 1256 | ||
1028 | struct parport_operations { | 1257 | #include <linux/parport.h> |
1029 | ... | 1258 | |
1030 | unsigned char (*read_control) (struct parport *port); | 1259 | struct parport_operations { |
1031 | ... | 1260 | ... |
1032 | }; | 1261 | unsigned char (*read_control) (struct parport *port); |
1262 | ... | ||
1263 | }; | ||
1033 | 1264 | ||
1034 | DESCRIPTION | 1265 | DESCRIPTION |
1266 | ^^^^^^^^^^^ | ||
1035 | 1267 | ||
1036 | Returns the last value written to the control register (either from | 1268 | Returns the last value written to the control register (either from |
1037 | write_control or frob_control). No port access is performed. | 1269 | write_control or frob_control). No port access is performed. |
1038 | 1270 | ||
1039 | SEE ALSO | 1271 | SEE ALSO |
1272 | ^^^^^^^^ | ||
1040 | 1273 | ||
1041 | read_data, write_data, read_status, write_control | 1274 | read_data, write_data, read_status, write_control |
1275 | |||
1276 | |||
1042 | 1277 | ||
1043 | port->ops->write_control - write the control register | 1278 | port->ops->write_control - write the control register |
1044 | ------------------------ | 1279 | ----------------------------------------------------- |
1045 | 1280 | ||
1046 | SYNOPSIS | 1281 | SYNOPSIS |
1282 | ^^^^^^^^ | ||
1047 | 1283 | ||
1048 | #include <linux/parport.h> | 1284 | :: |
1049 | 1285 | ||
1050 | struct parport_operations { | 1286 | #include <linux/parport.h> |
1051 | ... | 1287 | |
1052 | void (*write_control) (struct parport *port, unsigned char s); | 1288 | struct parport_operations { |
1053 | ... | 1289 | ... |
1054 | }; | 1290 | void (*write_control) (struct parport *port, unsigned char s); |
1291 | ... | ||
1292 | }; | ||
1055 | 1293 | ||
1056 | DESCRIPTION | 1294 | DESCRIPTION |
1295 | ^^^^^^^^^^^ | ||
1057 | 1296 | ||
1058 | Writes to the control register. This is a bitmask: | 1297 | Writes to the control register. This is a bitmask:: |
1059 | _______ | 1298 | |
1060 | - PARPORT_CONTROL_STROBE (nStrobe) | 1299 | _______ |
1061 | _______ | 1300 | - PARPORT_CONTROL_STROBE (nStrobe) |
1062 | - PARPORT_CONTROL_AUTOFD (nAutoFd) | 1301 | _______ |
1063 | _____ | 1302 | - PARPORT_CONTROL_AUTOFD (nAutoFd) |
1064 | - PARPORT_CONTROL_INIT (nInit) | 1303 | _____ |
1065 | _________ | 1304 | - PARPORT_CONTROL_INIT (nInit) |
1066 | - PARPORT_CONTROL_SELECT (nSelectIn) | 1305 | _________ |
1306 | - PARPORT_CONTROL_SELECT (nSelectIn) | ||
1067 | 1307 | ||
1068 | SEE ALSO | 1308 | SEE ALSO |
1309 | ^^^^^^^^ | ||
1069 | 1310 | ||
1070 | read_data, write_data, read_status, frob_control | 1311 | read_data, write_data, read_status, frob_control |
1312 | |||
1313 | |||
1071 | 1314 | ||
1072 | port->ops->frob_control - write control register bits | 1315 | port->ops->frob_control - write control register bits |
1073 | ----------------------- | 1316 | ----------------------------------------------------- |
1074 | 1317 | ||
1075 | SYNOPSIS | 1318 | SYNOPSIS |
1319 | ^^^^^^^^ | ||
1076 | 1320 | ||
1077 | #include <linux/parport.h> | 1321 | :: |
1078 | 1322 | ||
1079 | struct parport_operations { | 1323 | #include <linux/parport.h> |
1080 | ... | 1324 | |
1081 | unsigned char (*frob_control) (struct parport *port, | 1325 | struct parport_operations { |
1082 | unsigned char mask, | 1326 | ... |
1083 | unsigned char val); | 1327 | unsigned char (*frob_control) (struct parport *port, |
1084 | ... | 1328 | unsigned char mask, |
1085 | }; | 1329 | unsigned char val); |
1330 | ... | ||
1331 | }; | ||
1086 | 1332 | ||
1087 | DESCRIPTION | 1333 | DESCRIPTION |
1334 | ^^^^^^^^^^^ | ||
1088 | 1335 | ||
1089 | This is equivalent to reading from the control register, masking out | 1336 | This is equivalent to reading from the control register, masking out |
1090 | the bits in mask, exclusive-or'ing with the bits in val, and writing | 1337 | the bits in mask, exclusive-or'ing with the bits in val, and writing |
@@ -1095,23 +1342,30 @@ of its contents is maintained, so frob_control is in fact only one | |||
1095 | port access. | 1342 | port access. |
1096 | 1343 | ||
1097 | SEE ALSO | 1344 | SEE ALSO |
1345 | ^^^^^^^^ | ||
1098 | 1346 | ||
1099 | read_data, write_data, read_status, write_control | 1347 | read_data, write_data, read_status, write_control |
1348 | |||
1349 | |||
1100 | 1350 | ||
1101 | port->ops->enable_irq - enable interrupt generation | 1351 | port->ops->enable_irq - enable interrupt generation |
1102 | --------------------- | 1352 | --------------------------------------------------- |
1103 | 1353 | ||
1104 | SYNOPSIS | 1354 | SYNOPSIS |
1355 | ^^^^^^^^ | ||
1105 | 1356 | ||
1106 | #include <linux/parport.h> | 1357 | :: |
1107 | 1358 | ||
1108 | struct parport_operations { | 1359 | #include <linux/parport.h> |
1109 | ... | 1360 | |
1110 | void (*enable_irq) (struct parport *port); | 1361 | struct parport_operations { |
1111 | ... | 1362 | ... |
1112 | }; | 1363 | void (*enable_irq) (struct parport *port); |
1364 | ... | ||
1365 | }; | ||
1113 | 1366 | ||
1114 | DESCRIPTION | 1367 | DESCRIPTION |
1368 | ^^^^^^^^^^^ | ||
1115 | 1369 | ||
1116 | The parallel port hardware is instructed to generate interrupts at | 1370 | The parallel port hardware is instructed to generate interrupts at |
1117 | appropriate moments, although those moments are | 1371 | appropriate moments, although those moments are |
@@ -1119,353 +1373,460 @@ architecture-specific. For the PC architecture, interrupts are | |||
1119 | commonly generated on the rising edge of nAck. | 1373 | commonly generated on the rising edge of nAck. |
1120 | 1374 | ||
1121 | SEE ALSO | 1375 | SEE ALSO |
1376 | ^^^^^^^^ | ||
1122 | 1377 | ||
1123 | disable_irq | 1378 | disable_irq |
1379 | |||
1380 | |||
1124 | 1381 | ||
1125 | port->ops->disable_irq - disable interrupt generation | 1382 | port->ops->disable_irq - disable interrupt generation |
1126 | ---------------------- | 1383 | ----------------------------------------------------- |
1127 | 1384 | ||
1128 | SYNOPSIS | 1385 | SYNOPSIS |
1386 | ^^^^^^^^ | ||
1129 | 1387 | ||
1130 | #include <linux/parport.h> | 1388 | :: |
1131 | 1389 | ||
1132 | struct parport_operations { | 1390 | #include <linux/parport.h> |
1133 | ... | 1391 | |
1134 | void (*disable_irq) (struct parport *port); | 1392 | struct parport_operations { |
1135 | ... | 1393 | ... |
1136 | }; | 1394 | void (*disable_irq) (struct parport *port); |
1395 | ... | ||
1396 | }; | ||
1137 | 1397 | ||
1138 | DESCRIPTION | 1398 | DESCRIPTION |
1399 | ^^^^^^^^^^^ | ||
1139 | 1400 | ||
1140 | The parallel port hardware is instructed not to generate interrupts. | 1401 | The parallel port hardware is instructed not to generate interrupts. |
1141 | The interrupt itself is not masked. | 1402 | The interrupt itself is not masked. |
1142 | 1403 | ||
1143 | SEE ALSO | 1404 | SEE ALSO |
1405 | ^^^^^^^^ | ||
1144 | 1406 | ||
1145 | enable_irq | 1407 | enable_irq |
1146 | 1408 | ||
1409 | |||
1410 | |||
1147 | port->ops->data_forward - enable data drivers | 1411 | port->ops->data_forward - enable data drivers |
1148 | ----------------------- | 1412 | --------------------------------------------- |
1149 | 1413 | ||
1150 | SYNOPSIS | 1414 | SYNOPSIS |
1415 | ^^^^^^^^ | ||
1151 | 1416 | ||
1152 | #include <linux/parport.h> | 1417 | :: |
1153 | 1418 | ||
1154 | struct parport_operations { | 1419 | #include <linux/parport.h> |
1155 | ... | 1420 | |
1156 | void (*data_forward) (struct parport *port); | 1421 | struct parport_operations { |
1157 | ... | 1422 | ... |
1158 | }; | 1423 | void (*data_forward) (struct parport *port); |
1424 | ... | ||
1425 | }; | ||
1159 | 1426 | ||
1160 | DESCRIPTION | 1427 | DESCRIPTION |
1428 | ^^^^^^^^^^^ | ||
1161 | 1429 | ||
1162 | Enables the data line drivers, for 8-bit host-to-peripheral | 1430 | Enables the data line drivers, for 8-bit host-to-peripheral |
1163 | communications. | 1431 | communications. |
1164 | 1432 | ||
1165 | SEE ALSO | 1433 | SEE ALSO |
1434 | ^^^^^^^^ | ||
1166 | 1435 | ||
1167 | data_reverse | 1436 | data_reverse |
1437 | |||
1438 | |||
1168 | 1439 | ||
1169 | port->ops->data_reverse - tristate the buffer | 1440 | port->ops->data_reverse - tristate the buffer |
1170 | ----------------------- | 1441 | --------------------------------------------- |
1171 | 1442 | ||
1172 | SYNOPSIS | 1443 | SYNOPSIS |
1444 | ^^^^^^^^ | ||
1173 | 1445 | ||
1174 | #include <linux/parport.h> | 1446 | :: |
1175 | 1447 | ||
1176 | struct parport_operations { | 1448 | #include <linux/parport.h> |
1177 | ... | 1449 | |
1178 | void (*data_reverse) (struct parport *port); | 1450 | struct parport_operations { |
1179 | ... | 1451 | ... |
1180 | }; | 1452 | void (*data_reverse) (struct parport *port); |
1453 | ... | ||
1454 | }; | ||
1181 | 1455 | ||
1182 | DESCRIPTION | 1456 | DESCRIPTION |
1457 | ^^^^^^^^^^^ | ||
1183 | 1458 | ||
1184 | Places the data bus in a high impedance state, if port->modes has the | 1459 | Places the data bus in a high impedance state, if port->modes has the |
1185 | PARPORT_MODE_TRISTATE bit set. | 1460 | PARPORT_MODE_TRISTATE bit set. |
1186 | 1461 | ||
1187 | SEE ALSO | 1462 | SEE ALSO |
1463 | ^^^^^^^^ | ||
1188 | 1464 | ||
1189 | data_forward | 1465 | data_forward |
1190 | 1466 | ||
1467 | |||
1468 | |||
1191 | port->ops->epp_write_data - write EPP data | 1469 | port->ops->epp_write_data - write EPP data |
1192 | ------------------------- | 1470 | ------------------------------------------ |
1193 | 1471 | ||
1194 | SYNOPSIS | 1472 | SYNOPSIS |
1473 | ^^^^^^^^ | ||
1195 | 1474 | ||
1196 | #include <linux/parport.h> | 1475 | :: |
1197 | 1476 | ||
1198 | struct parport_operations { | 1477 | #include <linux/parport.h> |
1199 | ... | 1478 | |
1200 | size_t (*epp_write_data) (struct parport *port, const void *buf, | 1479 | struct parport_operations { |
1201 | size_t len, int flags); | 1480 | ... |
1202 | ... | 1481 | size_t (*epp_write_data) (struct parport *port, const void *buf, |
1203 | }; | 1482 | size_t len, int flags); |
1483 | ... | ||
1484 | }; | ||
1204 | 1485 | ||
1205 | DESCRIPTION | 1486 | DESCRIPTION |
1487 | ^^^^^^^^^^^ | ||
1206 | 1488 | ||
1207 | Writes data in EPP mode, and returns the number of bytes written. | 1489 | Writes data in EPP mode, and returns the number of bytes written. |
1208 | 1490 | ||
1209 | The 'flags' parameter may be one or more of the following, | 1491 | The ``flags`` parameter may be one or more of the following, |
1210 | bitwise-or'ed together: | 1492 | bitwise-or'ed together: |
1211 | 1493 | ||
1494 | ======================= ================================================= | ||
1212 | PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and | 1495 | PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and |
1213 | 32-bit registers. However, if a transfer | 1496 | 32-bit registers. However, if a transfer |
1214 | times out, the return value may be unreliable. | 1497 | times out, the return value may be unreliable. |
1498 | ======================= ================================================= | ||
1215 | 1499 | ||
1216 | SEE ALSO | 1500 | SEE ALSO |
1501 | ^^^^^^^^ | ||
1217 | 1502 | ||
1218 | epp_read_data, epp_write_addr, epp_read_addr | 1503 | epp_read_data, epp_write_addr, epp_read_addr |
1504 | |||
1505 | |||
1219 | 1506 | ||
1220 | port->ops->epp_read_data - read EPP data | 1507 | port->ops->epp_read_data - read EPP data |
1221 | ------------------------ | 1508 | ---------------------------------------- |
1222 | 1509 | ||
1223 | SYNOPSIS | 1510 | SYNOPSIS |
1511 | ^^^^^^^^ | ||
1224 | 1512 | ||
1225 | #include <linux/parport.h> | 1513 | :: |
1226 | 1514 | ||
1227 | struct parport_operations { | 1515 | #include <linux/parport.h> |
1228 | ... | 1516 | |
1229 | size_t (*epp_read_data) (struct parport *port, void *buf, | 1517 | struct parport_operations { |
1230 | size_t len, int flags); | 1518 | ... |
1231 | ... | 1519 | size_t (*epp_read_data) (struct parport *port, void *buf, |
1232 | }; | 1520 | size_t len, int flags); |
1521 | ... | ||
1522 | }; | ||
1233 | 1523 | ||
1234 | DESCRIPTION | 1524 | DESCRIPTION |
1525 | ^^^^^^^^^^^ | ||
1235 | 1526 | ||
1236 | Reads data in EPP mode, and returns the number of bytes read. | 1527 | Reads data in EPP mode, and returns the number of bytes read. |
1237 | 1528 | ||
1238 | The 'flags' parameter may be one or more of the following, | 1529 | The ``flags`` parameter may be one or more of the following, |
1239 | bitwise-or'ed together: | 1530 | bitwise-or'ed together: |
1240 | 1531 | ||
1532 | ======================= ================================================= | ||
1241 | PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and | 1533 | PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and |
1242 | 32-bit registers. However, if a transfer | 1534 | 32-bit registers. However, if a transfer |
1243 | times out, the return value may be unreliable. | 1535 | times out, the return value may be unreliable. |
1536 | ======================= ================================================= | ||
1244 | 1537 | ||
1245 | SEE ALSO | 1538 | SEE ALSO |
1539 | ^^^^^^^^ | ||
1246 | 1540 | ||
1247 | epp_write_data, epp_write_addr, epp_read_addr | 1541 | epp_write_data, epp_write_addr, epp_read_addr |
1248 | 1542 | ||
1543 | |||
1544 | |||
1249 | port->ops->epp_write_addr - write EPP address | 1545 | port->ops->epp_write_addr - write EPP address |
1250 | ------------------------- | 1546 | --------------------------------------------- |
1251 | 1547 | ||
1252 | SYNOPSIS | 1548 | SYNOPSIS |
1549 | ^^^^^^^^ | ||
1253 | 1550 | ||
1254 | #include <linux/parport.h> | 1551 | :: |
1255 | 1552 | ||
1256 | struct parport_operations { | 1553 | #include <linux/parport.h> |
1257 | ... | 1554 | |
1258 | size_t (*epp_write_addr) (struct parport *port, | 1555 | struct parport_operations { |
1259 | const void *buf, size_t len, int flags); | 1556 | ... |
1260 | ... | 1557 | size_t (*epp_write_addr) (struct parport *port, |
1261 | }; | 1558 | const void *buf, size_t len, int flags); |
1559 | ... | ||
1560 | }; | ||
1262 | 1561 | ||
1263 | DESCRIPTION | 1562 | DESCRIPTION |
1563 | ^^^^^^^^^^^ | ||
1264 | 1564 | ||
1265 | Writes EPP addresses (8 bits each), and returns the number written. | 1565 | Writes EPP addresses (8 bits each), and returns the number written. |
1266 | 1566 | ||
1267 | The 'flags' parameter may be one or more of the following, | 1567 | The ``flags`` parameter may be one or more of the following, |
1268 | bitwise-or'ed together: | 1568 | bitwise-or'ed together: |
1269 | 1569 | ||
1570 | ======================= ================================================= | ||
1270 | PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and | 1571 | PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and |
1271 | 32-bit registers. However, if a transfer | 1572 | 32-bit registers. However, if a transfer |
1272 | times out, the return value may be unreliable. | 1573 | times out, the return value may be unreliable. |
1574 | ======================= ================================================= | ||
1273 | 1575 | ||
1274 | (Does PARPORT_EPP_FAST make sense for this function?) | 1576 | (Does PARPORT_EPP_FAST make sense for this function?) |
1275 | 1577 | ||
1276 | SEE ALSO | 1578 | SEE ALSO |
1579 | ^^^^^^^^ | ||
1277 | 1580 | ||
1278 | epp_write_data, epp_read_data, epp_read_addr | 1581 | epp_write_data, epp_read_data, epp_read_addr |
1582 | |||
1583 | |||
1279 | 1584 | ||
1280 | port->ops->epp_read_addr - read EPP address | 1585 | port->ops->epp_read_addr - read EPP address |
1281 | ------------------------ | 1586 | ------------------------------------------- |
1282 | 1587 | ||
1283 | SYNOPSIS | 1588 | SYNOPSIS |
1589 | ^^^^^^^^ | ||
1284 | 1590 | ||
1285 | #include <linux/parport.h> | 1591 | :: |
1286 | 1592 | ||
1287 | struct parport_operations { | 1593 | #include <linux/parport.h> |
1288 | ... | 1594 | |
1289 | size_t (*epp_read_addr) (struct parport *port, void *buf, | 1595 | struct parport_operations { |
1290 | size_t len, int flags); | 1596 | ... |
1291 | ... | 1597 | size_t (*epp_read_addr) (struct parport *port, void *buf, |
1292 | }; | 1598 | size_t len, int flags); |
1599 | ... | ||
1600 | }; | ||
1293 | 1601 | ||
1294 | DESCRIPTION | 1602 | DESCRIPTION |
1603 | ^^^^^^^^^^^ | ||
1295 | 1604 | ||
1296 | Reads EPP addresses (8 bits each), and returns the number read. | 1605 | Reads EPP addresses (8 bits each), and returns the number read. |
1297 | 1606 | ||
1298 | The 'flags' parameter may be one or more of the following, | 1607 | The ``flags`` parameter may be one or more of the following, |
1299 | bitwise-or'ed together: | 1608 | bitwise-or'ed together: |
1300 | 1609 | ||
1610 | ======================= ================================================= | ||
1301 | PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and | 1611 | PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and |
1302 | 32-bit registers. However, if a transfer | 1612 | 32-bit registers. However, if a transfer |
1303 | times out, the return value may be unreliable. | 1613 | times out, the return value may be unreliable. |
1614 | ======================= ================================================= | ||
1304 | 1615 | ||
1305 | (Does PARPORT_EPP_FAST make sense for this function?) | 1616 | (Does PARPORT_EPP_FAST make sense for this function?) |
1306 | 1617 | ||
1307 | SEE ALSO | 1618 | SEE ALSO |
1619 | ^^^^^^^^ | ||
1308 | 1620 | ||
1309 | epp_write_data, epp_read_data, epp_write_addr | 1621 | epp_write_data, epp_read_data, epp_write_addr |
1622 | |||
1623 | |||
1310 | 1624 | ||
1311 | port->ops->ecp_write_data - write a block of ECP data | 1625 | port->ops->ecp_write_data - write a block of ECP data |
1312 | ------------------------- | 1626 | ----------------------------------------------------- |
1313 | 1627 | ||
1314 | SYNOPSIS | 1628 | SYNOPSIS |
1629 | ^^^^^^^^ | ||
1315 | 1630 | ||
1316 | #include <linux/parport.h> | 1631 | :: |
1317 | 1632 | ||
1318 | struct parport_operations { | 1633 | #include <linux/parport.h> |
1319 | ... | 1634 | |
1320 | size_t (*ecp_write_data) (struct parport *port, | 1635 | struct parport_operations { |
1321 | const void *buf, size_t len, int flags); | 1636 | ... |
1322 | ... | 1637 | size_t (*ecp_write_data) (struct parport *port, |
1323 | }; | 1638 | const void *buf, size_t len, int flags); |
1639 | ... | ||
1640 | }; | ||
1324 | 1641 | ||
1325 | DESCRIPTION | 1642 | DESCRIPTION |
1643 | ^^^^^^^^^^^ | ||
1326 | 1644 | ||
1327 | Writes a block of ECP data. The 'flags' parameter is ignored. | 1645 | Writes a block of ECP data. The ``flags`` parameter is ignored. |
1328 | 1646 | ||
1329 | RETURN VALUE | 1647 | RETURN VALUE |
1648 | ^^^^^^^^^^^^ | ||
1330 | 1649 | ||
1331 | The number of bytes written. | 1650 | The number of bytes written. |
1332 | 1651 | ||
1333 | SEE ALSO | 1652 | SEE ALSO |
1653 | ^^^^^^^^ | ||
1334 | 1654 | ||
1335 | ecp_read_data, ecp_write_addr | 1655 | ecp_read_data, ecp_write_addr |
1336 | 1656 | ||
1657 | |||
1658 | |||
1337 | port->ops->ecp_read_data - read a block of ECP data | 1659 | port->ops->ecp_read_data - read a block of ECP data |
1338 | ------------------------ | 1660 | --------------------------------------------------- |
1339 | 1661 | ||
1340 | SYNOPSIS | 1662 | SYNOPSIS |
1663 | ^^^^^^^^ | ||
1341 | 1664 | ||
1342 | #include <linux/parport.h> | 1665 | :: |
1343 | 1666 | ||
1344 | struct parport_operations { | 1667 | #include <linux/parport.h> |
1345 | ... | 1668 | |
1346 | size_t (*ecp_read_data) (struct parport *port, | 1669 | struct parport_operations { |
1347 | void *buf, size_t len, int flags); | 1670 | ... |
1348 | ... | 1671 | size_t (*ecp_read_data) (struct parport *port, |
1349 | }; | 1672 | void *buf, size_t len, int flags); |
1673 | ... | ||
1674 | }; | ||
1350 | 1675 | ||
1351 | DESCRIPTION | 1676 | DESCRIPTION |
1677 | ^^^^^^^^^^^ | ||
1352 | 1678 | ||
1353 | Reads a block of ECP data. The 'flags' parameter is ignored. | 1679 | Reads a block of ECP data. The ``flags`` parameter is ignored. |
1354 | 1680 | ||
1355 | RETURN VALUE | 1681 | RETURN VALUE |
1682 | ^^^^^^^^^^^^ | ||
1356 | 1683 | ||
1357 | The number of bytes read. NB. There may be more unread data in a | 1684 | The number of bytes read. NB. There may be more unread data in a |
1358 | FIFO. Is there a way of stunning the FIFO to prevent this? | 1685 | FIFO. Is there a way of stunning the FIFO to prevent this? |
1359 | 1686 | ||
1360 | SEE ALSO | 1687 | SEE ALSO |
1688 | ^^^^^^^^ | ||
1361 | 1689 | ||
1362 | ecp_write_block, ecp_write_addr | 1690 | ecp_write_block, ecp_write_addr |
1363 | 1691 | ||
1692 | |||
1693 | |||
1364 | port->ops->ecp_write_addr - write a block of ECP addresses | 1694 | port->ops->ecp_write_addr - write a block of ECP addresses |
1365 | ------------------------- | 1695 | ---------------------------------------------------------- |
1366 | 1696 | ||
1367 | SYNOPSIS | 1697 | SYNOPSIS |
1698 | ^^^^^^^^ | ||
1368 | 1699 | ||
1369 | #include <linux/parport.h> | 1700 | :: |
1370 | 1701 | ||
1371 | struct parport_operations { | 1702 | #include <linux/parport.h> |
1372 | ... | 1703 | |
1373 | size_t (*ecp_write_addr) (struct parport *port, | 1704 | struct parport_operations { |
1374 | const void *buf, size_t len, int flags); | 1705 | ... |
1375 | ... | 1706 | size_t (*ecp_write_addr) (struct parport *port, |
1376 | }; | 1707 | const void *buf, size_t len, int flags); |
1708 | ... | ||
1709 | }; | ||
1377 | 1710 | ||
1378 | DESCRIPTION | 1711 | DESCRIPTION |
1712 | ^^^^^^^^^^^ | ||
1379 | 1713 | ||
1380 | Writes a block of ECP addresses. The 'flags' parameter is ignored. | 1714 | Writes a block of ECP addresses. The ``flags`` parameter is ignored. |
1381 | 1715 | ||
1382 | RETURN VALUE | 1716 | RETURN VALUE |
1717 | ^^^^^^^^^^^^ | ||
1383 | 1718 | ||
1384 | The number of bytes written. | 1719 | The number of bytes written. |
1385 | 1720 | ||
1386 | NOTES | 1721 | NOTES |
1722 | ^^^^^ | ||
1387 | 1723 | ||
1388 | This may use a FIFO, and if so shall not return until the FIFO is empty. | 1724 | This may use a FIFO, and if so shall not return until the FIFO is empty. |
1389 | 1725 | ||
1390 | SEE ALSO | 1726 | SEE ALSO |
1727 | ^^^^^^^^ | ||
1391 | 1728 | ||
1392 | ecp_read_data, ecp_write_data | 1729 | ecp_read_data, ecp_write_data |
1393 | 1730 | ||
1731 | |||
1732 | |||
1394 | port->ops->nibble_read_data - read a block of data in nibble mode | 1733 | port->ops->nibble_read_data - read a block of data in nibble mode |
1395 | --------------------------- | 1734 | ----------------------------------------------------------------- |
1396 | 1735 | ||
1397 | SYNOPSIS | 1736 | SYNOPSIS |
1737 | ^^^^^^^^ | ||
1398 | 1738 | ||
1399 | #include <linux/parport.h> | 1739 | :: |
1400 | 1740 | ||
1401 | struct parport_operations { | 1741 | #include <linux/parport.h> |
1402 | ... | 1742 | |
1403 | size_t (*nibble_read_data) (struct parport *port, | 1743 | struct parport_operations { |
1404 | void *buf, size_t len, int flags); | 1744 | ... |
1405 | ... | 1745 | size_t (*nibble_read_data) (struct parport *port, |
1406 | }; | 1746 | void *buf, size_t len, int flags); |
1747 | ... | ||
1748 | }; | ||
1407 | 1749 | ||
1408 | DESCRIPTION | 1750 | DESCRIPTION |
1751 | ^^^^^^^^^^^ | ||
1409 | 1752 | ||
1410 | Reads a block of data in nibble mode. The 'flags' parameter is ignored. | 1753 | Reads a block of data in nibble mode. The ``flags`` parameter is ignored. |
1411 | 1754 | ||
1412 | RETURN VALUE | 1755 | RETURN VALUE |
1756 | ^^^^^^^^^^^^ | ||
1413 | 1757 | ||
1414 | The number of whole bytes read. | 1758 | The number of whole bytes read. |
1415 | 1759 | ||
1416 | SEE ALSO | 1760 | SEE ALSO |
1761 | ^^^^^^^^ | ||
1417 | 1762 | ||
1418 | byte_read_data, compat_write_data | 1763 | byte_read_data, compat_write_data |
1764 | |||
1765 | |||
1419 | 1766 | ||
1420 | port->ops->byte_read_data - read a block of data in byte mode | 1767 | port->ops->byte_read_data - read a block of data in byte mode |
1421 | ------------------------- | 1768 | ------------------------------------------------------------- |
1422 | 1769 | ||
1423 | SYNOPSIS | 1770 | SYNOPSIS |
1771 | ^^^^^^^^ | ||
1424 | 1772 | ||
1425 | #include <linux/parport.h> | 1773 | :: |
1426 | 1774 | ||
1427 | struct parport_operations { | 1775 | #include <linux/parport.h> |
1428 | ... | 1776 | |
1429 | size_t (*byte_read_data) (struct parport *port, | 1777 | struct parport_operations { |
1430 | void *buf, size_t len, int flags); | 1778 | ... |
1431 | ... | 1779 | size_t (*byte_read_data) (struct parport *port, |
1432 | }; | 1780 | void *buf, size_t len, int flags); |
1781 | ... | ||
1782 | }; | ||
1433 | 1783 | ||
1434 | DESCRIPTION | 1784 | DESCRIPTION |
1785 | ^^^^^^^^^^^ | ||
1435 | 1786 | ||
1436 | Reads a block of data in byte mode. The 'flags' parameter is ignored. | 1787 | Reads a block of data in byte mode. The ``flags`` parameter is ignored. |
1437 | 1788 | ||
1438 | RETURN VALUE | 1789 | RETURN VALUE |
1790 | ^^^^^^^^^^^^ | ||
1439 | 1791 | ||
1440 | The number of bytes read. | 1792 | The number of bytes read. |
1441 | 1793 | ||
1442 | SEE ALSO | 1794 | SEE ALSO |
1795 | ^^^^^^^^ | ||
1443 | 1796 | ||
1444 | nibble_read_data, compat_write_data | 1797 | nibble_read_data, compat_write_data |
1798 | |||
1799 | |||
1445 | 1800 | ||
1446 | port->ops->compat_write_data - write a block of data in compatibility mode | 1801 | port->ops->compat_write_data - write a block of data in compatibility mode |
1447 | ---------------------------- | 1802 | -------------------------------------------------------------------------- |
1448 | 1803 | ||
1449 | SYNOPSIS | 1804 | SYNOPSIS |
1805 | ^^^^^^^^ | ||
1450 | 1806 | ||
1451 | #include <linux/parport.h> | 1807 | :: |
1452 | 1808 | ||
1453 | struct parport_operations { | 1809 | #include <linux/parport.h> |
1454 | ... | 1810 | |
1455 | size_t (*compat_write_data) (struct parport *port, | 1811 | struct parport_operations { |
1456 | const void *buf, size_t len, int flags); | 1812 | ... |
1457 | ... | 1813 | size_t (*compat_write_data) (struct parport *port, |
1458 | }; | 1814 | const void *buf, size_t len, int flags); |
1815 | ... | ||
1816 | }; | ||
1459 | 1817 | ||
1460 | DESCRIPTION | 1818 | DESCRIPTION |
1819 | ^^^^^^^^^^^ | ||
1461 | 1820 | ||
1462 | Writes a block of data in compatibility mode. The 'flags' parameter | 1821 | Writes a block of data in compatibility mode. The ``flags`` parameter |
1463 | is ignored. | 1822 | is ignored. |
1464 | 1823 | ||
1465 | RETURN VALUE | 1824 | RETURN VALUE |
1825 | ^^^^^^^^^^^^ | ||
1466 | 1826 | ||
1467 | The number of bytes written. | 1827 | The number of bytes written. |
1468 | 1828 | ||
1469 | SEE ALSO | 1829 | SEE ALSO |
1830 | ^^^^^^^^ | ||
1470 | 1831 | ||
1471 | nibble_read_data, byte_read_data | 1832 | nibble_read_data, byte_read_data |