dma: add DragonFly compat files
[dragonfly.git] / sys / bus / smbus / smbus_if.m
blobf1bece391b108a06439da3a20ce9ac879f3e2eb9
2 # Copyright (c) 1998 Nicolas Souchu
3 # All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
8 # 1. Redistributions of source code must retain the above copyright
9 #    notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 #    notice, this list of conditions and the following disclaimer in the
12 #    documentation and/or other materials provided with the distribution.
14 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 # ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 # SUCH DAMAGE.
26 # $FreeBSD: src/sys/dev/smbus/smbus_if.m,v 1.5 1999/08/28 00:42:30 peter Exp $
27 # $DragonFly: src/sys/bus/smbus/smbus_if.m,v 1.3 2003/11/17 00:54:39 asmodai Exp $
30 #include <sys/bus.h>
32 INTERFACE smbus;
35 # Interpret interrupt
37 METHOD void intr {
38         device_t dev;
39         u_char devaddr;
40         char low;
41         char high;
42         int error;
46 # smbus callback
48 METHOD int callback {
49         device_t dev;
50         int index;
51         caddr_t data;
55 # Quick command
57 METHOD int quick {
58         device_t dev;
59         u_char slave;
60         int how;
64 # Send Byte command
66 METHOD int sendb {
67         device_t dev;
68         u_char slave;
69         char byte;
73 # Receive Byte command
75 METHOD int recvb {
76         device_t dev;
77         u_char slave;
78         char *byte;
82 # Write Byte command
84 METHOD int writeb {
85         device_t dev;
86         u_char slave;
87         char cmd;
88         char byte;
92 # Write Word command
94 METHOD int writew {
95         device_t dev;
96         u_char slave;
97         char cmd;
98         short word;
102 # Read Byte command
104 METHOD int readb {
105         device_t dev;
106         u_char slave;
107         char cmd;
108         char *byte;
112 # Read Word command
114 METHOD int readw {
115         device_t dev;
116         u_char slave;
117         char cmd;
118         short *word;
122 # Process Call command
124 METHOD int pcall {
125         device_t dev;
126         u_char slave;
127         char cmd;
128         short sdata;
129         short *rdata;
133 # Block Write command
135 METHOD int bwrite {
136         device_t dev;
137         u_char slave;
138         char cmd;
139         u_char count;
140         char *buf;
144 # Block Read command
146 METHOD int bread {
147         device_t dev;
148         u_char slave;
149         char cmd;
150         u_char count;
151         char *buf;