smb.4 (129356) | smb.4 (130582) |
---|---|
1.\" Copyright (c) 1998, Nicolas Souchu 2.\" Copyright (c) 2004, Joerg Wunsch 3.\" All rights reserved. 4.\" 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 unchanged lines hidden (view full) --- 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. 25.\" | 1.\" Copyright (c) 1998, Nicolas Souchu 2.\" Copyright (c) 2004, Joerg Wunsch 3.\" All rights reserved. 4.\" 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 unchanged lines hidden (view full) --- 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. 25.\" |
26.\" $FreeBSD: head/share/man/man4/smb.4 129356 2004-05-17 20:17:39Z joerg $ | 26.\" $FreeBSD: head/share/man/man4/smb.4 130582 2004-06-16 08:33:57Z ru $ |
27.\" 28.Dd October 25, 1998 29.Dt SMB 4 30.Os 31.Sh NAME 32.Nm smb 33.Nd SMB generic I/O device driver 34.Sh SYNOPSIS 35.Cd "device smb" 36.Sh DESCRIPTION 37The 38.Em smb 39character device driver provides generic i/o to any 40.Xr smbus 4 41instance. 42In order to control SMB devices, use | 27.\" 28.Dd October 25, 1998 29.Dt SMB 4 30.Os 31.Sh NAME 32.Nm smb 33.Nd SMB generic I/O device driver 34.Sh SYNOPSIS 35.Cd "device smb" 36.Sh DESCRIPTION 37The 38.Em smb 39character device driver provides generic i/o to any 40.Xr smbus 4 41instance. 42In order to control SMB devices, use |
43.Pa /dev/smb Ns Em ? | 43.Pa /dev/smb? |
44with the ioctls described below. 45Any of these ioctl commands takes a pointer to 46.Vt struct smbcmd 47as its argument. 48.Pp 49.Bd -literal 50#include <sys/types.h> 51 --- 16 unchanged lines hidden (view full) --- 68}; 69.Ed 70.Pp 71The 72.Fa slave 73field is always used, and provides the address of the 74SMBus slave device to talk to. 75.Pp | 44with the ioctls described below. 45Any of these ioctl commands takes a pointer to 46.Vt struct smbcmd 47as its argument. 48.Pp 49.Bd -literal 50#include <sys/types.h> 51 --- 16 unchanged lines hidden (view full) --- 68}; 69.Ed 70.Pp 71The 72.Fa slave 73field is always used, and provides the address of the 74SMBus slave device to talk to. 75.Pp |
76.Bl -column ".Sy SMB_QUICK_WRITE" -compact | 76.Bl -column ".Dv SMB_QUICK_WRITE" -compact |
77.It Em Ioctl Ta Em Description 78.Pp | 77.It Em Ioctl Ta Em Description 78.Pp |
79.It Sy SMB_QUICK_WRITE Ta | 79.It Dv SMB_QUICK_WRITE Ta |
80The 81.Em QuickWrite 82command just issues the device address with write intent 83to the bus, without transferring any data. | 80The 81.Em QuickWrite 82command just issues the device address with write intent 83to the bus, without transferring any data. |
84.It Sy SMB_QUICK_READ Ta | 84.It Dv SMB_QUICK_READ Ta |
85The 86.Em QuickRead 87command just issues the device address with read intent 88to the bus, without transferring any data. | 85The 86.Em QuickRead 87command just issues the device address with read intent 88to the bus, without transferring any data. |
89.It Sy SMB_SENDB Ta | 89.It Dv SMB_SENDB Ta |
90The 91.Em SendByte 92command sends the byte provided in the 93.Fa cmd 94field to the device. | 90The 91.Em SendByte 92command sends the byte provided in the 93.Fa cmd 94field to the device. |
95.It Sy SMB_RECVB Ta | 95.It Dv SMB_RECVB Ta |
96The 97.Em ReceiveByte 98command reads a single byte from the device which will 99be returned in the 100.Fa cmd 101field. | 96The 97.Em ReceiveByte 98command reads a single byte from the device which will 99be returned in the 100.Fa cmd 101field. |
102.It Sy SMB_WRITEB Ta | 102.It Dv SMB_WRITEB Ta |
103The 104.Em WriteByte 105command first sends the byte from the 106.Fa cmd 107field to the device, followed by the byte given in 108.Fa data.byte . | 103The 104.Em WriteByte 105command first sends the byte from the 106.Fa cmd 107field to the device, followed by the byte given in 108.Fa data.byte . |
109.It Sy SMB_WRITEW Ta | 109.It Dv SMB_WRITEW Ta |
110The 111.Em WriteWord 112command first sends the byte from the 113.Fa cmd 114field to the device, followed by the word given in 115.Fa data.word . 116Note that the SMBus byte-order is little-endian by definition. | 110The 111.Em WriteWord 112command first sends the byte from the 113.Fa cmd 114field to the device, followed by the word given in 115.Fa data.word . 116Note that the SMBus byte-order is little-endian by definition. |
117.It Sy SMB_READB Ta | 117.It Dv SMB_READB Ta |
118The 119.Em ReadByte 120command first sends the byte from the 121.Fa cmd 122field to the device, and then reads one byte of data from 123the device. 124The returned data will be stored in the location pointed to by 125.Fa data.byte_ptr . | 118The 119.Em ReadByte 120command first sends the byte from the 121.Fa cmd 122field to the device, and then reads one byte of data from 123the device. 124The returned data will be stored in the location pointed to by 125.Fa data.byte_ptr . |
126.It Sy SMB_READW Ta | 126.It Dv SMB_READW Ta |
127The 128.Em ReadWord 129command first sends the byte from the 130.Fa cmd 131field to the device, and then reads one word of data from 132the device. 133The returned data will be stored in the location pointed to by 134.Fa data.word_ptr . | 127The 128.Em ReadWord 129command first sends the byte from the 130.Fa cmd 131field to the device, and then reads one word of data from 132the device. 133The returned data will be stored in the location pointed to by 134.Fa data.word_ptr . |
135.It Sy SMB_PCALL Ta | 135.It Dv SMB_PCALL Ta |
136The 137.Em ProcedureCall 138command first sends the byte from the 139.Fa cmd 140field to the device, followed by the word provided in 141.Fa data.process.sdata . 142It then reads one word of data from the device, and returns it 143in the location pointed to by 144.Fa data.process.rdata . | 136The 137.Em ProcedureCall 138command first sends the byte from the 139.Fa cmd 140field to the device, followed by the word provided in 141.Fa data.process.sdata . 142It then reads one word of data from the device, and returns it 143in the location pointed to by 144.Fa data.process.rdata . |
145.It Sy SMB_BWRITE Ta | 145.It Dv SMB_BWRITE Ta |
146The 147.Em BlockWrite 148command first sends the byte from the 149.Fa cmd 150field to the device, followed by 151.Fa count 152bytes of data that are taken from the buffer pointed to by 153.Fa data.byte_ptr . 154The SMBus specification mandates that no more than 32 bytes of 155data can be transferred in a single block read or write command. 156This value is available in the constant 157.Dv SMB_MAXBLOCKSIZE . | 146The 147.Em BlockWrite 148command first sends the byte from the 149.Fa cmd 150field to the device, followed by 151.Fa count 152bytes of data that are taken from the buffer pointed to by 153.Fa data.byte_ptr . 154The SMBus specification mandates that no more than 32 bytes of 155data can be transferred in a single block read or write command. 156This value is available in the constant 157.Dv SMB_MAXBLOCKSIZE . |
158.It Sy SMB_BREAD Ta | 158.It Dv SMB_BREAD Ta |
159The 160.Em BlockRead 161command first sends the byte from the 162.Fa cmd 163field to the device, and then reads 164.Fa count 165bytes of data that from the device. 166These data will be returned in the buffer pointed to by --- 36 unchanged lines hidden --- | 159The 160.Em BlockRead 161command first sends the byte from the 162.Fa cmd 163field to the device, and then reads 164.Fa count 165bytes of data that from the device. 166These data will be returned in the buffer pointed to by --- 36 unchanged lines hidden --- |