xref: /freebsd/sys/dev/smbus/smb.h (revision bf896bd0e264a6e1212a915808ba00f014550ffa)
1b2dc47b4SNicolas Souchu /*-
2b2dc47b4SNicolas Souchu  * Copyright (c) 1998 Nicolas Souchu
3b2dc47b4SNicolas Souchu  * All rights reserved.
4b2dc47b4SNicolas Souchu  *
5b2dc47b4SNicolas Souchu  * Redistribution and use in source and binary forms, with or without
6b2dc47b4SNicolas Souchu  * modification, are permitted provided that the following conditions
7b2dc47b4SNicolas Souchu  * are met:
8b2dc47b4SNicolas Souchu  * 1. Redistributions of source code must retain the above copyright
9b2dc47b4SNicolas Souchu  *    notice, this list of conditions and the following disclaimer.
10b2dc47b4SNicolas Souchu  * 2. Redistributions in binary form must reproduce the above copyright
11b2dc47b4SNicolas Souchu  *    notice, this list of conditions and the following disclaimer in the
12b2dc47b4SNicolas Souchu  *    documentation and/or other materials provided with the distribution.
13b2dc47b4SNicolas Souchu  *
14b2dc47b4SNicolas Souchu  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15b2dc47b4SNicolas Souchu  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16b2dc47b4SNicolas Souchu  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17b2dc47b4SNicolas Souchu  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18b2dc47b4SNicolas Souchu  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19b2dc47b4SNicolas Souchu  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20b2dc47b4SNicolas Souchu  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21b2dc47b4SNicolas Souchu  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22b2dc47b4SNicolas Souchu  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23b2dc47b4SNicolas Souchu  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24b2dc47b4SNicolas Souchu  * SUCH DAMAGE.
25b2dc47b4SNicolas Souchu  *
26bf896bd0SNicolas Souchu  *	$Id: smb.h,v 1.1 1998/09/03 21:00:08 nsouch Exp $
27b2dc47b4SNicolas Souchu  *
28b2dc47b4SNicolas Souchu  */
29b2dc47b4SNicolas Souchu #ifndef __SMB_H
30b2dc47b4SNicolas Souchu #define __SMB_H
31b2dc47b4SNicolas Souchu 
32b2dc47b4SNicolas Souchu #include <sys/ioccom.h>
33b2dc47b4SNicolas Souchu 
34b2dc47b4SNicolas Souchu struct smbcmd {
35b2dc47b4SNicolas Souchu 	char cmd;
36b2dc47b4SNicolas Souchu 	int count;
37bf896bd0SNicolas Souchu 	u_char slave;
38b2dc47b4SNicolas Souchu 	union {
39b2dc47b4SNicolas Souchu 		char byte;
40b2dc47b4SNicolas Souchu 		short word;
41b2dc47b4SNicolas Souchu 
42b2dc47b4SNicolas Souchu 		char *byte_ptr;
43b2dc47b4SNicolas Souchu 		short *word_ptr;
44b2dc47b4SNicolas Souchu 
45b2dc47b4SNicolas Souchu 		struct {
46b2dc47b4SNicolas Souchu 			short sdata;
47b2dc47b4SNicolas Souchu 			short *rdata;
48b2dc47b4SNicolas Souchu 		} process;
49b2dc47b4SNicolas Souchu 	} data;
50b2dc47b4SNicolas Souchu };
51b2dc47b4SNicolas Souchu 
52bf896bd0SNicolas Souchu #define SMB_QUICK_WRITE	_IOW('i', 1, struct smbcmd)
53bf896bd0SNicolas Souchu #define SMB_QUICK_READ	_IOW('i', 2, struct smbcmd)
54b2dc47b4SNicolas Souchu #define SMB_SENDB	_IOW('i', 3, struct smbcmd)
55b2dc47b4SNicolas Souchu #define SMB_RECVB	_IOW('i', 4, struct smbcmd)
56b2dc47b4SNicolas Souchu #define SMB_WRITEB	_IOW('i', 5, struct smbcmd)
57b2dc47b4SNicolas Souchu #define SMB_WRITEW	_IOW('i', 6, struct smbcmd)
58b2dc47b4SNicolas Souchu #define SMB_READB	_IOW('i', 7, struct smbcmd)
59b2dc47b4SNicolas Souchu #define SMB_READW	_IOW('i', 8, struct smbcmd)
60b2dc47b4SNicolas Souchu #define SMB_PCALL	_IOW('i', 9, struct smbcmd)
61b2dc47b4SNicolas Souchu #define SMB_BWRITE	_IOW('i', 10, struct smbcmd)
62b2dc47b4SNicolas Souchu #define SMB_BREAD	_IOW('i', 11, struct smbcmd)
63b2dc47b4SNicolas Souchu 
64b2dc47b4SNicolas Souchu #endif
65