xref: /illumos-gate/usr/src/uts/common/sys/ecppsys.h (revision 2d6eb4a5e0a47d30189497241345dc5466bb68ab)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1990-2000 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_SYS_ECPPSYS_H
28 #define	_SYS_ECPPSYS_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 #define	ECPPIOC_SETPARMS	_IOW('p', 70, struct ecpp_transfer_parms)
35 #define	ECPPIOC_GETPARMS	_IOR('p', 71, struct ecpp_transfer_parms)
36 #define	ECPPIOC_GETDEVID	_IOWR('p', 73, struct ecpp_device_id)
37 
38 /* current_mode values */
39 #define	ECPP_CENTRONICS 	0x01 /* non-1284 */
40 #define	ECPP_COMPAT_MODE	0x02
41 #define	ECPP_BYTE_MODE		0x03
42 #define	ECPP_NIBBLE_MODE	0x04
43 #define	ECPP_ECP_MODE		0x05
44 #define	ECPP_FAILURE_MODE	0x06
45 #define	ECPP_DIAG_MODE		0x07
46 #define	ECPP_INIT_MODE		0x08
47 #define	ECPP_EPP_MODE		0x09
48 
49 typedef struct p1284_ioctl_st {
50 	int array[10];
51 	char *cptr;
52 	char *name;
53 } P1284Ioctl;
54 
55 struct ecpp_transfer_parms {
56 	int	write_timeout;
57 	int	mode;
58 };
59 
60 /*
61  * Structure for retrieving IEEE 1284 Device ID
62  */
63 struct ecpp_device_id {
64 	int	mode;	/* mode to use for reading device id */
65 	int	len;	/* length of buffer */
66 	int	rlen;	/* actual length of device id string */
67 	char	*addr;	/* buffer address */
68 #ifndef _LP64
69 	int	filler[2];
70 #endif
71 };
72 
73 #ifdef _KERNEL
74 /*
75  * 32bit support for ioctl
76  */
77 struct ecpp_device_id32 {
78 	int		mode;   /* mode to use for reading device id */
79 	int		len;    /* length of buffer */
80 	int		rlen;   /* actual length of device id string */
81 	caddr32_t	addr;   /* buffer address */
82 	int		filler[2];
83 };
84 #endif /* _KERNEL */
85 #ifdef	__cplusplus
86 }
87 #endif
88 
89 #endif	/* _SYS_ECPPSYS_H */
90