xref: /titanic_44/usr/src/uts/common/sys/ecppsys.h (revision 49b225e1cfa7bbf7738d4df0a03f18e3283426eb)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #define	ECPPIOC_SETPARMS	_IOW('p', 70, struct ecpp_transfer_parms)
37 #define	ECPPIOC_GETPARMS	_IOR('p', 71, struct ecpp_transfer_parms)
38 #define	ECPPIOC_GETDEVID	_IOWR('p', 73, struct ecpp_device_id)
39 
40 /* current_mode values */
41 #define	ECPP_CENTRONICS 	0x01 /* non-1284 */
42 #define	ECPP_COMPAT_MODE	0x02
43 #define	ECPP_BYTE_MODE		0x03
44 #define	ECPP_NIBBLE_MODE	0x04
45 #define	ECPP_ECP_MODE		0x05
46 #define	ECPP_FAILURE_MODE	0x06
47 #define	ECPP_DIAG_MODE		0x07
48 #define	ECPP_INIT_MODE		0x08
49 #define	ECPP_EPP_MODE		0x09
50 
51 typedef struct p1284_ioctl_st {
52 	int array[10];
53 	char *cptr;
54 	char *name;
55 } P1284Ioctl;
56 
57 struct ecpp_transfer_parms {
58 	int	write_timeout;
59 	int	mode;
60 };
61 
62 /*
63  * Structure for retrieving IEEE 1284 Device ID
64  */
65 struct ecpp_device_id {
66 	int	mode;	/* mode to use for reading device id */
67 	int	len;	/* length of buffer */
68 	int	rlen;	/* actual length of device id string */
69 	char	*addr;	/* buffer address */
70 #ifndef _LP64
71 	int	filler[2];
72 #endif
73 };
74 
75 #ifdef _KERNEL
76 /*
77  * 32bit support for ioctl
78  */
79 struct ecpp_device_id32 {
80 	int		mode;   /* mode to use for reading device id */
81 	int		len;    /* length of buffer */
82 	int		rlen;   /* actual length of device id string */
83 	caddr32_t	addr;   /* buffer address */
84 	int		filler[2];
85 };
86 #endif /* _KERNEL */
87 #ifdef	__cplusplus
88 }
89 #endif
90 
91 #endif	/* _SYS_ECPPSYS_H */
92