parport.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. /*
  2. * Any part of this program may be used in documents licensed under
  3. * the GNU Free Documentation License, Version 1.1 or any later version
  4. * published by the Free Software Foundation.
  5. */
  6. #ifndef _PARPORT_H_
  7. #define _PARPORT_H_
  8. /* Start off with user-visible constants */
  9. /* Maximum of 16 ports per machine */
  10. #define PARPORT_MAX 16
  11. /* Magic numbers */
  12. #define PARPORT_IRQ_NONE -1
  13. #define PARPORT_DMA_NONE -1
  14. #define PARPORT_IRQ_AUTO -2
  15. #define PARPORT_DMA_AUTO -2
  16. #define PARPORT_DMA_NOFIFO -3
  17. #define PARPORT_DISABLE -2
  18. #define PARPORT_IRQ_PROBEONLY -3
  19. #define PARPORT_IOHI_AUTO -1
  20. #define PARPORT_CONTROL_STROBE 0x1
  21. #define PARPORT_CONTROL_AUTOFD 0x2
  22. #define PARPORT_CONTROL_INIT 0x4
  23. #define PARPORT_CONTROL_SELECT 0x8
  24. #define PARPORT_STATUS_ERROR 0x8
  25. #define PARPORT_STATUS_SELECT 0x10
  26. #define PARPORT_STATUS_PAPEROUT 0x20
  27. #define PARPORT_STATUS_ACK 0x40
  28. #define PARPORT_STATUS_BUSY 0x80
  29. /* Type classes for Plug-and-Play probe. */
  30. typedef enum {
  31. PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */
  32. PARPORT_CLASS_PRINTER,
  33. PARPORT_CLASS_MODEM,
  34. PARPORT_CLASS_NET,
  35. PARPORT_CLASS_HDC, /* Hard disk controller */
  36. PARPORT_CLASS_PCMCIA,
  37. PARPORT_CLASS_MEDIA, /* Multimedia device */
  38. PARPORT_CLASS_FDC, /* Floppy disk controller */
  39. PARPORT_CLASS_PORTS,
  40. PARPORT_CLASS_SCANNER,
  41. PARPORT_CLASS_DIGCAM,
  42. PARPORT_CLASS_OTHER, /* Anything else */
  43. PARPORT_CLASS_UNSPEC, /* No CLS field in ID */
  44. PARPORT_CLASS_SCSIADAPTER
  45. } parport_device_class;
  46. /* The "modes" entry in parport is a bit field representing the
  47. capabilities of the hardware. */
  48. #define PARPORT_MODE_PCSPP (1<<0) /* IBM PC registers available. */
  49. #define PARPORT_MODE_TRISTATE (1<<1) /* Can tristate. */
  50. #define PARPORT_MODE_EPP (1<<2) /* Hardware EPP. */
  51. #define PARPORT_MODE_ECP (1<<3) /* Hardware ECP. */
  52. #define PARPORT_MODE_COMPAT (1<<4) /* Hardware 'printer protocol'. */
  53. #define PARPORT_MODE_DMA (1<<5) /* Hardware can DMA. */
  54. #define PARPORT_MODE_SAFEININT (1<<6) /* SPP registers accessible in IRQ. */
  55. /* IEEE1284 modes:
  56. Nibble mode, byte mode, ECP, ECPRLE and EPP are their own
  57. 'extensibility request' values. Others are special.
  58. 'Real' ECP modes must have the IEEE1284_MODE_ECP bit set. */
  59. #define IEEE1284_MODE_NIBBLE 0
  60. #define IEEE1284_MODE_BYTE (1<<0)
  61. #define IEEE1284_MODE_COMPAT (1<<8)
  62. #define IEEE1284_MODE_BECP (1<<9) /* Bounded ECP mode */
  63. #define IEEE1284_MODE_ECP (1<<4)
  64. #define IEEE1284_MODE_ECPRLE (IEEE1284_MODE_ECP | (1<<5))
  65. #define IEEE1284_MODE_ECPSWE (1<<10) /* Software-emulated */
  66. #define IEEE1284_MODE_EPP (1<<6)
  67. #define IEEE1284_MODE_EPPSL (1<<11) /* EPP 1.7 */
  68. #define IEEE1284_MODE_EPPSWE (1<<12) /* Software-emulated */
  69. #define IEEE1284_DEVICEID (1<<2) /* This is a flag */
  70. #define IEEE1284_EXT_LINK (1<<14) /* This flag causes the
  71. * extensibility link to
  72. * be requested, using
  73. * bits 0-6. */
  74. /* For the benefit of parport_read/write, you can use these with
  75. * parport_negotiate to use address operations. They have no effect
  76. * other than to make parport_read/write use address transfers. */
  77. #define IEEE1284_ADDR (1<<13) /* This is a flag */
  78. #define IEEE1284_DATA 0 /* So is this */
  79. /* Flags for block transfer operations. */
  80. #define PARPORT_EPP_FAST (1<<0) /* Unreliable counts. */
  81. #define PARPORT_W91284PIC (1<<1) /* have a Warp9 w91284pic in the device */
  82. /* The rest is for the kernel only */
  83. #ifdef __KERNEL__
  84. #include <linux/jiffies.h>
  85. #include <linux/proc_fs.h>
  86. #include <linux/spinlock.h>
  87. #include <linux/wait.h>
  88. #include <linux/irqreturn.h>
  89. #include <linux/semaphore.h>
  90. #include <asm/ptrace.h>
  91. /* Define this later. */
  92. struct parport;
  93. struct pardevice;
  94. struct pc_parport_state {
  95. unsigned int ctr;
  96. unsigned int ecr;
  97. };
  98. struct ax_parport_state {
  99. unsigned int ctr;
  100. unsigned int ecr;
  101. unsigned int dcsr;
  102. };
  103. /* used by both parport_amiga and parport_mfc3 */
  104. struct amiga_parport_state {
  105. unsigned char data; /* ciaa.prb */
  106. unsigned char datadir; /* ciaa.ddrb */
  107. unsigned char status; /* ciab.pra & 7 */
  108. unsigned char statusdir;/* ciab.ddrb & 7 */
  109. };
  110. struct ax88796_parport_state {
  111. unsigned char cpr;
  112. };
  113. struct ip32_parport_state {
  114. unsigned int dcr;
  115. unsigned int ecr;
  116. };
  117. struct parport_state {
  118. union {
  119. struct pc_parport_state pc;
  120. /* ARC has no state. */
  121. struct ax_parport_state ax;
  122. struct amiga_parport_state amiga;
  123. struct ax88796_parport_state ax88796;
  124. /* Atari has not state. */
  125. struct ip32_parport_state ip32;
  126. void *misc;
  127. } u;
  128. };
  129. struct parport_operations {
  130. /* IBM PC-style virtual registers. */
  131. void (*write_data)(struct parport *, unsigned char);
  132. unsigned char (*read_data)(struct parport *);
  133. void (*write_control)(struct parport *, unsigned char);
  134. unsigned char (*read_control)(struct parport *);
  135. unsigned char (*frob_control)(struct parport *, unsigned char mask,
  136. unsigned char val);
  137. unsigned char (*read_status)(struct parport *);
  138. /* IRQs. */
  139. void (*enable_irq)(struct parport *);
  140. void (*disable_irq)(struct parport *);
  141. /* Data direction. */
  142. void (*data_forward) (struct parport *);
  143. void (*data_reverse) (struct parport *);
  144. /* For core parport code. */
  145. void (*init_state)(struct pardevice *, struct parport_state *);
  146. void (*save_state)(struct parport *, struct parport_state *);
  147. void (*restore_state)(struct parport *, struct parport_state *);
  148. /* Block read/write */
  149. size_t (*epp_write_data) (struct parport *port, const void *buf,
  150. size_t len, int flags);
  151. size_t (*epp_read_data) (struct parport *port, void *buf, size_t len,
  152. int flags);
  153. size_t (*epp_write_addr) (struct parport *port, const void *buf,
  154. size_t len, int flags);
  155. size_t (*epp_read_addr) (struct parport *port, void *buf, size_t len,
  156. int flags);
  157. size_t (*ecp_write_data) (struct parport *port, const void *buf,
  158. size_t len, int flags);
  159. size_t (*ecp_read_data) (struct parport *port, void *buf, size_t len,
  160. int flags);
  161. size_t (*ecp_write_addr) (struct parport *port, const void *buf,
  162. size_t len, int flags);
  163. size_t (*compat_write_data) (struct parport *port, const void *buf,
  164. size_t len, int flags);
  165. size_t (*nibble_read_data) (struct parport *port, void *buf,
  166. size_t len, int flags);
  167. size_t (*byte_read_data) (struct parport *port, void *buf,
  168. size_t len, int flags);
  169. struct module *owner;
  170. };
  171. struct parport_device_info {
  172. parport_device_class class;
  173. const char *class_name;
  174. const char *mfr;
  175. const char *model;
  176. const char *cmdset;
  177. const char *description;
  178. };
  179. /* Each device can have two callback functions:
  180. * 1) a preemption function, called by the resource manager to request
  181. * that the driver relinquish control of the port. The driver should
  182. * return zero if it agrees to release the port, and nonzero if it
  183. * refuses. Do not call parport_release() - the kernel will do this
  184. * implicitly.
  185. *
  186. * 2) a wake-up function, called by the resource manager to tell drivers
  187. * that the port is available to be claimed. If a driver wants to use
  188. * the port, it should call parport_claim() here.
  189. */
  190. /* A parallel port device */
  191. struct pardevice {
  192. const char *name;
  193. struct parport *port;
  194. int daisy;
  195. int (*preempt)(void *);
  196. void (*wakeup)(void *);
  197. void *private;
  198. void (*irq_func)(void *);
  199. unsigned int flags;
  200. struct pardevice *next;
  201. struct pardevice *prev;
  202. struct parport_state *state; /* saved status over preemption */
  203. wait_queue_head_t wait_q;
  204. unsigned long int time;
  205. unsigned long int timeslice;
  206. volatile long int timeout;
  207. unsigned long waiting; /* long req'd for set_bit --RR */
  208. struct pardevice *waitprev;
  209. struct pardevice *waitnext;
  210. void * sysctl_table;
  211. };
  212. /* IEEE1284 information */
  213. /* IEEE1284 phases. These are exposed to userland through ppdev IOCTL
  214. * PP[GS]ETPHASE, so do not change existing values. */
  215. enum ieee1284_phase {
  216. IEEE1284_PH_FWD_DATA,
  217. IEEE1284_PH_FWD_IDLE,
  218. IEEE1284_PH_TERMINATE,
  219. IEEE1284_PH_NEGOTIATION,
  220. IEEE1284_PH_HBUSY_DNA,
  221. IEEE1284_PH_REV_IDLE,
  222. IEEE1284_PH_HBUSY_DAVAIL,
  223. IEEE1284_PH_REV_DATA,
  224. IEEE1284_PH_ECP_SETUP,
  225. IEEE1284_PH_ECP_FWD_TO_REV,
  226. IEEE1284_PH_ECP_REV_TO_FWD,
  227. IEEE1284_PH_ECP_DIR_UNKNOWN,
  228. };
  229. struct ieee1284_info {
  230. int mode;
  231. volatile enum ieee1284_phase phase;
  232. struct semaphore irq;
  233. };
  234. /* A parallel port */
  235. struct parport {
  236. unsigned long base; /* base address */
  237. unsigned long base_hi; /* base address (hi - ECR) */
  238. unsigned int size; /* IO extent */
  239. const char *name;
  240. unsigned int modes;
  241. int irq; /* interrupt (or -1 for none) */
  242. int dma;
  243. int muxport; /* which muxport (if any) this is */
  244. int portnum; /* which physical parallel port (not mux) */
  245. struct device *dev; /* Physical device associated with IO/DMA.
  246. * This may unfortulately be null if the
  247. * port has a legacy driver.
  248. */
  249. struct parport *physport;
  250. /* If this is a non-default mux
  251. parport, i.e. we're a clone of a real
  252. physical port, this is a pointer to that
  253. port. The locking is only done in the
  254. real port. For a clone port, the
  255. following structure members are
  256. meaningless: devices, cad, muxsel,
  257. waithead, waittail, flags, pdir,
  258. dev, ieee1284, *_lock.
  259. It this is a default mux parport, or
  260. there is no mux involved, this points to
  261. ourself. */
  262. struct pardevice *devices;
  263. struct pardevice *cad; /* port owner */
  264. int daisy; /* currently selected daisy addr */
  265. int muxsel; /* currently selected mux port */
  266. struct pardevice *waithead;
  267. struct pardevice *waittail;
  268. struct list_head list;
  269. unsigned int flags;
  270. void *sysctl_table;
  271. struct parport_device_info probe_info[5]; /* 0-3 + non-IEEE1284.3 */
  272. struct ieee1284_info ieee1284;
  273. struct parport_operations *ops;
  274. void *private_data; /* for lowlevel driver */
  275. int number; /* port index - the `n' in `parportn' */
  276. spinlock_t pardevice_lock;
  277. spinlock_t waitlist_lock;
  278. rwlock_t cad_lock;
  279. int spintime;
  280. atomic_t ref_count;
  281. unsigned long devflags;
  282. #define PARPORT_DEVPROC_REGISTERED 0
  283. struct pardevice *proc_device; /* Currently register proc device */
  284. struct list_head full_list;
  285. struct parport *slaves[3];
  286. };
  287. #define DEFAULT_SPIN_TIME 500 /* us */
  288. struct parport_driver {
  289. const char *name;
  290. void (*attach) (struct parport *);
  291. void (*detach) (struct parport *);
  292. struct list_head list;
  293. };
  294. /* parport_register_port registers a new parallel port at the given
  295. address (if one does not already exist) and returns a pointer to it.
  296. This entails claiming the I/O region, IRQ and DMA. NULL is returned
  297. if initialisation fails. */
  298. struct parport *parport_register_port(unsigned long base, int irq, int dma,
  299. struct parport_operations *ops);
  300. /* Once a registered port is ready for high-level drivers to use, the
  301. low-level driver that registered it should announce it. This will
  302. call the high-level drivers' attach() functions (after things like
  303. determining the IEEE 1284.3 topology of the port and collecting
  304. DeviceIDs). */
  305. void parport_announce_port (struct parport *port);
  306. /* Unregister a port. */
  307. extern void parport_remove_port(struct parport *port);
  308. /* Register a new high-level driver. */
  309. extern int parport_register_driver (struct parport_driver *);
  310. /* Unregister a high-level driver. */
  311. extern void parport_unregister_driver (struct parport_driver *);
  312. /* If parport_register_driver doesn't fit your needs, perhaps
  313. * parport_find_xxx does. */
  314. extern struct parport *parport_find_number (int);
  315. extern struct parport *parport_find_base (unsigned long);
  316. /* generic irq handler, if it suits your needs */
  317. extern irqreturn_t parport_irq_handler(int irq, void *dev_id);
  318. /* Reference counting for ports. */
  319. extern struct parport *parport_get_port (struct parport *);
  320. extern void parport_put_port (struct parport *);
  321. /* parport_register_device declares that a device is connected to a
  322. port, and tells the kernel all it needs to know.
  323. - pf is the preemption function (may be NULL for no callback)
  324. - kf is the wake-up function (may be NULL for no callback)
  325. - irq_func is the interrupt handler (may be NULL for no interrupts)
  326. - handle is a user pointer that gets handed to callback functions. */
  327. struct pardevice *parport_register_device(struct parport *port,
  328. const char *name,
  329. int (*pf)(void *), void (*kf)(void *),
  330. void (*irq_func)(void *),
  331. int flags, void *handle);
  332. /* parport_unregister unlinks a device from the chain. */
  333. extern void parport_unregister_device(struct pardevice *dev);
  334. /* parport_claim tries to gain ownership of the port for a particular
  335. driver. This may fail (return non-zero) if another driver is busy.
  336. If this driver has registered an interrupt handler, it will be
  337. enabled. */
  338. extern int parport_claim(struct pardevice *dev);
  339. /* parport_claim_or_block is the same, but sleeps if the port cannot
  340. be claimed. Return value is 1 if it slept, 0 normally and -errno
  341. on error. */
  342. extern int parport_claim_or_block(struct pardevice *dev);
  343. /* parport_release reverses a previous parport_claim. This can never
  344. fail, though the effects are undefined (except that they are bad)
  345. if you didn't previously own the port. Once you have released the
  346. port you should make sure that neither your code nor the hardware
  347. on the port tries to initiate any communication without first
  348. re-claiming the port. If you mess with the port state (enabling
  349. ECP for example) you should clean up before releasing the port. */
  350. extern void parport_release(struct pardevice *dev);
  351. /**
  352. * parport_yield - relinquish a parallel port temporarily
  353. * @dev: a device on the parallel port
  354. *
  355. * This function relinquishes the port if it would be helpful to other
  356. * drivers to do so. Afterwards it tries to reclaim the port using
  357. * parport_claim(), and the return value is the same as for
  358. * parport_claim(). If it fails, the port is left unclaimed and it is
  359. * the driver's responsibility to reclaim the port.
  360. *
  361. * The parport_yield() and parport_yield_blocking() functions are for
  362. * marking points in the driver at which other drivers may claim the
  363. * port and use their devices. Yielding the port is similar to
  364. * releasing it and reclaiming it, but is more efficient because no
  365. * action is taken if there are no other devices needing the port. In
  366. * fact, nothing is done even if there are other devices waiting but
  367. * the current device is still within its "timeslice". The default
  368. * timeslice is half a second, but it can be adjusted via the /proc
  369. * interface.
  370. **/
  371. static __inline__ int parport_yield(struct pardevice *dev)
  372. {
  373. unsigned long int timeslip = (jiffies - dev->time);
  374. if ((dev->port->waithead == NULL) || (timeslip < dev->timeslice))
  375. return 0;
  376. parport_release(dev);
  377. return parport_claim(dev);
  378. }
  379. /**
  380. * parport_yield_blocking - relinquish a parallel port temporarily
  381. * @dev: a device on the parallel port
  382. *
  383. * This function relinquishes the port if it would be helpful to other
  384. * drivers to do so. Afterwards it tries to reclaim the port using
  385. * parport_claim_or_block(), and the return value is the same as for
  386. * parport_claim_or_block().
  387. **/
  388. static __inline__ int parport_yield_blocking(struct pardevice *dev)
  389. {
  390. unsigned long int timeslip = (jiffies - dev->time);
  391. if ((dev->port->waithead == NULL) || (timeslip < dev->timeslice))
  392. return 0;
  393. parport_release(dev);
  394. return parport_claim_or_block(dev);
  395. }
  396. /* Flags used to identify what a device does. */
  397. #define PARPORT_DEV_TRAN 0 /* WARNING !! DEPRECATED !! */
  398. #define PARPORT_DEV_LURK (1<<0) /* WARNING !! DEPRECATED !! */
  399. #define PARPORT_DEV_EXCL (1<<1) /* Need exclusive access. */
  400. #define PARPORT_FLAG_EXCL (1<<1) /* EXCL driver registered. */
  401. /* IEEE1284 functions */
  402. extern void parport_ieee1284_interrupt (void *);
  403. extern int parport_negotiate (struct parport *, int mode);
  404. extern ssize_t parport_write (struct parport *, const void *buf, size_t len);
  405. extern ssize_t parport_read (struct parport *, void *buf, size_t len);
  406. #define PARPORT_INACTIVITY_O_NONBLOCK 1
  407. extern long parport_set_timeout (struct pardevice *, long inactivity);
  408. extern int parport_wait_event (struct parport *, long timeout);
  409. extern int parport_wait_peripheral (struct parport *port,
  410. unsigned char mask,
  411. unsigned char val);
  412. extern int parport_poll_peripheral (struct parport *port,
  413. unsigned char mask,
  414. unsigned char val,
  415. int usec);
  416. /* For architectural drivers */
  417. extern size_t parport_ieee1284_write_compat (struct parport *,
  418. const void *, size_t, int);
  419. extern size_t parport_ieee1284_read_nibble (struct parport *,
  420. void *, size_t, int);
  421. extern size_t parport_ieee1284_read_byte (struct parport *,
  422. void *, size_t, int);
  423. extern size_t parport_ieee1284_ecp_read_data (struct parport *,
  424. void *, size_t, int);
  425. extern size_t parport_ieee1284_ecp_write_data (struct parport *,
  426. const void *, size_t, int);
  427. extern size_t parport_ieee1284_ecp_write_addr (struct parport *,
  428. const void *, size_t, int);
  429. extern size_t parport_ieee1284_epp_write_data (struct parport *,
  430. const void *, size_t, int);
  431. extern size_t parport_ieee1284_epp_read_data (struct parport *,
  432. void *, size_t, int);
  433. extern size_t parport_ieee1284_epp_write_addr (struct parport *,
  434. const void *, size_t, int);
  435. extern size_t parport_ieee1284_epp_read_addr (struct parport *,
  436. void *, size_t, int);
  437. /* IEEE1284.3 functions */
  438. extern int parport_daisy_init (struct parport *port);
  439. extern void parport_daisy_fini (struct parport *port);
  440. extern struct pardevice *parport_open (int devnum, const char *name);
  441. extern void parport_close (struct pardevice *dev);
  442. extern ssize_t parport_device_id (int devnum, char *buffer, size_t len);
  443. extern void parport_daisy_deselect_all (struct parport *port);
  444. extern int parport_daisy_select (struct parport *port, int daisy, int mode);
  445. /* Lowlevel drivers _can_ call this support function to handle irqs. */
  446. static inline void parport_generic_irq(struct parport *port)
  447. {
  448. parport_ieee1284_interrupt (port);
  449. read_lock(&port->cad_lock);
  450. if (port->cad && port->cad->irq_func)
  451. port->cad->irq_func(port->cad->private);
  452. read_unlock(&port->cad_lock);
  453. }
  454. /* Prototypes from parport_procfs */
  455. extern int parport_proc_register(struct parport *pp);
  456. extern int parport_proc_unregister(struct parport *pp);
  457. extern int parport_device_proc_register(struct pardevice *device);
  458. extern int parport_device_proc_unregister(struct pardevice *device);
  459. /* If PC hardware is the only type supported, we can optimise a bit. */
  460. #if !defined(CONFIG_PARPORT_NOT_PC)
  461. #include <linux/parport_pc.h>
  462. #define parport_write_data(p,x) parport_pc_write_data(p,x)
  463. #define parport_read_data(p) parport_pc_read_data(p)
  464. #define parport_write_control(p,x) parport_pc_write_control(p,x)
  465. #define parport_read_control(p) parport_pc_read_control(p)
  466. #define parport_frob_control(p,m,v) parport_pc_frob_control(p,m,v)
  467. #define parport_read_status(p) parport_pc_read_status(p)
  468. #define parport_enable_irq(p) parport_pc_enable_irq(p)
  469. #define parport_disable_irq(p) parport_pc_disable_irq(p)
  470. #define parport_data_forward(p) parport_pc_data_forward(p)
  471. #define parport_data_reverse(p) parport_pc_data_reverse(p)
  472. #else /* !CONFIG_PARPORT_NOT_PC */
  473. /* Generic operations vector through the dispatch table. */
  474. #define parport_write_data(p,x) (p)->ops->write_data(p,x)
  475. #define parport_read_data(p) (p)->ops->read_data(p)
  476. #define parport_write_control(p,x) (p)->ops->write_control(p,x)
  477. #define parport_read_control(p) (p)->ops->read_control(p)
  478. #define parport_frob_control(p,m,v) (p)->ops->frob_control(p,m,v)
  479. #define parport_read_status(p) (p)->ops->read_status(p)
  480. #define parport_enable_irq(p) (p)->ops->enable_irq(p)
  481. #define parport_disable_irq(p) (p)->ops->disable_irq(p)
  482. #define parport_data_forward(p) (p)->ops->data_forward(p)
  483. #define parport_data_reverse(p) (p)->ops->data_reverse(p)
  484. #endif /* !CONFIG_PARPORT_NOT_PC */
  485. extern unsigned long parport_default_timeslice;
  486. extern int parport_default_spintime;
  487. #endif /* __KERNEL__ */
  488. #endif /* _PARPORT_H_ */