4 * Copyright (c) 2008 Hauke Fath
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #ifndef CPI_NUBUSVAR_H
28 #define CPI_NUBUSVAR_H
30 /* Where we find the Z8536 CIO in Nubus slot space */
31 #define CIO_BASE_OFFSET 0x060010
33 /* Max. length of card name string */
34 #define CPI_CARD_NAME_LEN 64
36 /* The CIO lives on the top 8 bit of the 32 bit data bus. */
44 #define CPI_UNIT(c) (minor(c) & 0x1f)
47 LP_INITIAL
= 0, /* device is closed */
48 LP_OPENING
, /* device is about to be opened */
49 LP_OPEN
, /* device is open */
50 LP_BUSY
, /* busy with data output */
51 LP_ASLEEP
, /* waiting for output completion */
54 /* Bit masks for Centronics status + handshake lines */
56 CPI_RESET
= 0x01, /* PB0 */
57 CPI_STROBE
= 0x08, /* PC3 */
58 CPI_BUSY
= 0x40, /* PC0 */
59 CPI_SELECT
= 0x20, /* PB5 */
60 CPI_FAULT
= 0x02, /* PB1 */
61 CPI_PAPER_EMPTY
= 0x02, /* PC1 */
62 CPI_ACK
= 0x04 /* PC2 */
68 nubus_slot sc_slot
; /* Nubus slot number */
69 char cardname
[CPI_CARD_NAME_LEN
];
71 bus_addr_t sc_basepa
; /* base physical address */
72 bus_space_tag_t sc_bst
;
73 bus_space_handle_t sc_bsh
;
75 ulong sc_intcount
; /* Hard interrupts */
76 ulong sc_bytestoport
; /* Bytes written to port */
78 struct callout sc_wakeupchan
;
80 #define CPI_BUFSIZE 0x0800
81 char *sc_printbuf
; /* Driver's print buffer */
82 size_t sc_bufbytes
; /* # of bytes in buffer */
83 u_char
*sc_cp
; /* Next byte to send */
88 #endif /* CPI_NUBUSVAR_H */