1 .\" Copyright (c) 1998, Nicolas Souchu
2 .\" Copyright (c) 2004, Joerg Wunsch
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
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
33 .Nd SMB generic I/O device driver
39 character device driver provides generic i/o to any
42 In order to control SMB devices, use
44 with the ioctls described below.
45 Any of these ioctl commands takes a pointer to
49 #include <sys/types.h>
72 field is always used, and provides the address of the
73 SMBus slave device to talk to.
74 The slave address is specified in the seven most significant bits
75 .Pq i.e. Dq "left-justified" .
76 The least significant bit of the slave address must be zero.
78 .Bl -column ".Dv SMB_QUICK_WRITE" -compact
79 .It Em Ioctl Ta Em Description
81 .It Dv SMB_QUICK_WRITE Ta
84 command just issues the device address with write intent
85 to the bus, without transferring any data.
86 .It Dv SMB_QUICK_READ Ta
89 command just issues the device address with read intent
90 to the bus, without transferring any data.
94 command sends the byte provided in the
100 command reads a single byte from the device which will
107 command first sends the byte from the
109 field to the device, followed by the byte given in
114 command first sends the byte from the
116 field to the device, followed by the word given in
118 Note that the SMBus byte-order is little-endian by definition.
122 command first sends the byte from the
124 field to the device, and then reads one byte of data from
126 The returned data will be stored in the location pointed to by
131 command first sends the byte from the
133 field to the device, and then reads one word of data from
135 The returned data will be stored in the location pointed to by
140 command first sends the byte from the
142 field to the device, followed by the word provided in
143 .Fa data.process.sdata .
144 It then reads one word of data from the device, and returns it
145 in the location pointed to by
146 .Fa data.process.rdata .
150 command first sends the byte from the
152 field to the device, followed by
154 bytes of data that are taken from the buffer pointed to by
156 The SMBus specification mandates that no more than 32 bytes of
157 data can be transferred in a single block read or write command.
158 This value is available in the constant
159 .Dv SMB_MAXBLOCKSIZE .
163 command first sends the byte from the
165 field to the device, and then reads
167 bytes of data that from the device.
168 These data will be returned in the buffer pointed to by
176 system calls are not implemented by this driver.
180 commands can cause the following driver-specific errors:
183 Device did not respond to selection.
187 Operation not supported by device (not supposed to happen).
189 General argument error.
190 .It Bq Er EWOULDBLOCK
191 SMBus transaction timed out.
199 manual page first appeared in
203 manual page was written by