99 lines · c
1/*2 * Any part of this program may be used in documents licensed under3 * the GNU Free Documentation License, Version 1.1 or any later version4 * published by the Free Software Foundation.5 */6 7#ifndef _UAPI_PARPORT_H_8#define _UAPI_PARPORT_H_9 10/* Start off with user-visible constants */11 12/* Maximum of 16 ports per machine */13#define PARPORT_MAX 1614 15/* Magic numbers */16#define PARPORT_IRQ_NONE -117#define PARPORT_DMA_NONE -118#define PARPORT_IRQ_AUTO -219#define PARPORT_DMA_AUTO -220#define PARPORT_DMA_NOFIFO -321#define PARPORT_DISABLE -222#define PARPORT_IRQ_PROBEONLY -323#define PARPORT_IOHI_AUTO -124 25#define PARPORT_CONTROL_STROBE 0x126#define PARPORT_CONTROL_AUTOFD 0x227#define PARPORT_CONTROL_INIT 0x428#define PARPORT_CONTROL_SELECT 0x829 30#define PARPORT_STATUS_ERROR 0x831#define PARPORT_STATUS_SELECT 0x1032#define PARPORT_STATUS_PAPEROUT 0x2033#define PARPORT_STATUS_ACK 0x4034#define PARPORT_STATUS_BUSY 0x8035 36/* Type classes for Plug-and-Play probe. */37typedef enum {38 PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */39 PARPORT_CLASS_PRINTER,40 PARPORT_CLASS_MODEM,41 PARPORT_CLASS_NET,42 PARPORT_CLASS_HDC, /* Hard disk controller */43 PARPORT_CLASS_PCMCIA,44 PARPORT_CLASS_MEDIA, /* Multimedia device */45 PARPORT_CLASS_FDC, /* Floppy disk controller */46 PARPORT_CLASS_PORTS,47 PARPORT_CLASS_SCANNER,48 PARPORT_CLASS_DIGCAM,49 PARPORT_CLASS_OTHER, /* Anything else */50 PARPORT_CLASS_UNSPEC, /* No CLS field in ID */51 PARPORT_CLASS_SCSIADAPTER52} parport_device_class;53 54/* The "modes" entry in parport is a bit field representing the55 capabilities of the hardware. */56#define PARPORT_MODE_PCSPP (1<<0) /* IBM PC registers available. */57#define PARPORT_MODE_TRISTATE (1<<1) /* Can tristate. */58#define PARPORT_MODE_EPP (1<<2) /* Hardware EPP. */59#define PARPORT_MODE_ECP (1<<3) /* Hardware ECP. */60#define PARPORT_MODE_COMPAT (1<<4) /* Hardware 'printer protocol'. */61#define PARPORT_MODE_DMA (1<<5) /* Hardware can DMA. */62#define PARPORT_MODE_SAFEININT (1<<6) /* SPP registers accessible in IRQ. */63 64/* IEEE1284 modes: 65 Nibble mode, byte mode, ECP, ECPRLE and EPP are their own66 'extensibility request' values. Others are special.67 'Real' ECP modes must have the IEEE1284_MODE_ECP bit set. */68#define IEEE1284_MODE_NIBBLE 069#define IEEE1284_MODE_BYTE (1<<0)70#define IEEE1284_MODE_COMPAT (1<<8)71#define IEEE1284_MODE_BECP (1<<9) /* Bounded ECP mode */72#define IEEE1284_MODE_ECP (1<<4)73#define IEEE1284_MODE_ECPRLE (IEEE1284_MODE_ECP | (1<<5))74#define IEEE1284_MODE_ECPSWE (1<<10) /* Software-emulated */75#define IEEE1284_MODE_EPP (1<<6)76#define IEEE1284_MODE_EPPSL (1<<11) /* EPP 1.7 */77#define IEEE1284_MODE_EPPSWE (1<<12) /* Software-emulated */78#define IEEE1284_DEVICEID (1<<2) /* This is a flag */79#define IEEE1284_EXT_LINK (1<<14) /* This flag causes the80 * extensibility link to81 * be requested, using82 * bits 0-6. */83 84/* For the benefit of parport_read/write, you can use these with85 * parport_negotiate to use address operations. They have no effect86 * other than to make parport_read/write use address transfers. */87#define IEEE1284_ADDR (1<<13) /* This is a flag */88#define IEEE1284_DATA 0 /* So is this */89 90/* Flags for block transfer operations. */91#define PARPORT_EPP_FAST (1<<0) /* Unreliable counts. */92#define PARPORT_W91284PIC (1<<1) /* have a Warp9 w91284pic in the device */93#define PARPORT_EPP_FAST_32 PARPORT_EPP_FAST /* 32-bit EPP transfers */94#define PARPORT_EPP_FAST_16 (1<<2) /* 16-bit EPP transfers */95#define PARPORT_EPP_FAST_8 (1<<3) /* 8-bit EPP transfers */96 97/* The rest is for the kernel only */98#endif /* _UAPI_PARPORT_H_ */99