1 /* $NetBSD: cyvar.h,v 1.8 2001/01/20 19:29:06 thorpej Exp $ */
6 * Driver for Cyclades Cyclom-8/16/32 multiport serial cards
7 * (currently not tested with Cyclom-32 cards)
11 * Supports both ISA and PCI Cyclom cards
14 /* #define CY_DEBUG */
18 * Maximum number of ports per card
20 #define CY_MAX_PORTS (CD1400_NO_OF_CHANNELS * CY_MAX_CD1400s)
22 #define CY_RX_FIFO_THRESHOLD 6
25 * Automatic RTS (or actually DTR, the RTS and DTR lines need to be
26 * exchanged) handshake threshold used if CY_HW_RTS is defined
28 #define CY_RX_DTR_THRESHOLD 9
31 * read/write cd1400 registers (when sc_softc-structure is available)
33 #define cd_read_reg(sc,chip,reg) bus_space_read_1(sc->sc_memt, \
34 sc->sc_bsh, sc->sc_cd1400_offs[chip] + \
35 (((reg << 1)) << sc->sc_bustype))
37 #define cd_write_reg(sc,chip,reg,val) bus_space_write_1(sc->sc_memt, \
38 sc->sc_bsh, sc->sc_cd1400_offs[chip] + \
39 (((reg << 1))<< sc->sc_bustype), (val))
42 * ibuf is a simple ring buffer. It is always used two
43 * bytes at a time (status and data)
45 #define CY_IBUF_SIZE (2*512)
47 /* software state for one port */
49 struct cy_softc
*cy_softc
;
57 u_char cy_channel_control
; /* last CCR channel control
59 u_char cy_carrier_stat
; /* copied from MSVR2 */
61 u_char
*cy_ibuf
, *cy_ibuf_end
;
62 u_char
*cy_ibuf_rd_ptr
, *cy_ibuf_wr_ptr
;
66 int cy_modem_int_count
;
68 #endif /* CY_DEBUG1 */
71 #define CY_F_CARRIER_CHANGED 0x01
72 #define CY_F_START_BREAK 0x02
73 #define CY_F_END_BREAK 0x04
74 #define CY_F_STOP 0x08
75 #define CY_F_SEND_NUL 0x10
76 #define CY_F_START 0x20
78 /* software state for one card */
82 bus_space_tag_t sc_memt
;
83 bus_space_handle_t sc_bsh
;
85 int sc_nchips
; /* Number of cd1400's on this card */
86 int sc_cd1400_offs
[CY_MAX_CD1400s
];
87 struct cy_port sc_ports
[CY_MAX_PORTS
];
88 int sc_nchannels
; /* total number of ports */
95 int cy_find(struct cy_softc
*);
96 void cy_attach(struct cy_softc
*);