Home | History | Annotate | Line # | Download | only in ppbus
      1 /* $NetBSD: ppbus_var.h,v 1.5 2005/12/11 12:23:28 christos Exp $ */
      2 
      3 #ifndef __PPBUS_VAR_H
      4 #define __PPBUS_VAR_H
      5 
      6 /* PPBUS mode masks. */
      7 #define PPBUS_COMPATIBLE	0x01	/* Centronics compatible mode */
      8 #define PPBUS_NIBBLE		0x02	/* reverse 4 bit mode */
      9 #define PPBUS_PS2		0x04	/* PS/2 byte mode */
     10 #define PPBUS_EPP		0x08	/* EPP mode, 32 bit */
     11 #define PPBUS_ECP		0x10	/* ECP mode */
     12 #define PPBUS_FAST		0x20	/* Fast Centronics mode */
     13 /* mode aliases */
     14 #define PPBUS_SPP		PPBUS_NIBBLE | PPBUS_PS2 /* Won't work! */
     15 #define PPBUS_BYTE		PPBUS_PS2
     16 #define PPBUS_MASK		0x3f
     17 #define PPBUS_OPTIONS_MASK	0xc0
     18 /* Useful macros for this field */
     19 #define PPBUS_IS_EPP(mode) ((mode) & PPBUS_EPP)
     20 #define PPBUS_IN_EPP_MODE(bus) (PPBUS_IS_EPP(ppbus_get_mode(bus)))
     21 #define PPBUS_IN_NIBBLE_MODE(bus) (ppbus_get_mode(bus) & PPBUS_NIBBLE)
     22 #define PPBUS_IN_PS2_MODE(bus) (ppbus_get_mode(bus) & PPBUS_PS2)
     23 
     24 /* PPBUS capabilities */
     25 #define PPBUS_HAS_INTR		0x01	/* Interrupt available */
     26 #define PPBUS_HAS_DMA		0x02	/* DMA available */
     27 #define PPBUS_HAS_FIFO		0x04	/* FIFO available */
     28 #define PPBUS_HAS_PS2		0x08	/* PS2 mode capable */
     29 #define PPBUS_HAS_ECP		0x10	/* ECP mode available */
     30 #define PPBUS_HAS_EPP		0x20	/* EPP mode available */
     31 
     32 /* IEEE flag in soft config */
     33 #define PPBUS_DISABLE_IEEE	0x00
     34 #define PPBUS_ENABLE_IEEE	0x01
     35 
     36 /* List of IVARS available to ppbus device drivers */
     37 /* #define PPBUS_IVAR_MODE 0 */
     38 #define PPBUS_IVAR_DMA		1
     39 #define PPBUS_IVAR_INTR		2
     40 #define PPBUS_IVAR_EPP_PROTO    3
     41 #define PPBUS_IVAR_IEEE		4
     42 /* Needed by callback's implemented using callout */
     43 #define PPBUS_IVAR_IRQSTAT	5
     44 #define PPBUS_IVAR_DMASTAT	6
     45 /* other fields are reserved to the ppbus internals */
     46 
     47 /* EPP protocol versions */
     48 #define PPBUS_EPP_1_9           0x0                     /* default */
     49 #define PPBUS_EPP_1_7           0x1
     50 
     51 /* Parallel Port Bus sleep/wakeup queue. */
     52 #define PPBUSPRI		(PZERO+8)
     53 
     54 #endif /* __PPBUS_VAR_H */
     55