Improve smb(4) man page.

Differential Revision:	https://reviews.freebsd.org/D2368
Reviewed by:	wblock
Approved by:	wblock
This commit is contained in:
Michael Gmelin 2015-04-26 12:24:42 +00:00
parent 61e9519f63
commit 17d52d2351
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=282020

View File

@ -37,10 +37,10 @@
.Sh DESCRIPTION
The
.Em smb
character device driver provides generic i/o to any
character device driver provides generic I/O to any
.Xr smbus 4
instance.
In order to control SMB devices, use
To control SMB devices, use
.Pa /dev/smb?
with the ioctls described below.
Any of these ioctl commands takes a pointer to
@ -74,86 +74,74 @@ struct smbcmd {
The
.Fa slave
field is always used, and provides the address of the
SMBus slave device to talk to.
SMBus slave device.
The slave address is specified in the seven most significant bits
.Pq i.e. Dq "left-justified" .
.Pq i.e., Dq "left-justified" .
The least significant bit of the slave address must be zero.
.Pp
.Bl -column ".Dv SMB_QUICK_WRITE" -compact
.It Em Ioctl Ta Em Description
.Pp
.It Dv SMB_QUICK_WRITE Ta
The
.Em QuickWrite
command just issues the device address with write intent
to the bus, without transferring any data.
does not transfer any data.
It just issues the device address with write intent to the bus.
.It Dv SMB_QUICK_READ Ta
The
.Em QuickRead
command just issues the device address with read intent
to the bus, without transferring any data.
does not transfer any data.
It just issues the device address with read intent to the bus.
.It Dv SMB_SENDB Ta
The
.Em SendByte
command sends the byte provided in the
sends the byte provided in
.Fa cmd
field to the device.
to the device.
.It Dv SMB_RECVB Ta
The
.Em ReceiveByte
command reads a single byte from the device which will
be returned in the
.Fa cmd
field.
reads a single byte from the device which is returned in
.Fa cmd .
.It Dv SMB_WRITEB Ta
The
.Em WriteByte
command first sends the byte from the
first sends the byte from
.Fa cmd
field to the device, followed by the byte given in
to the device, followed by the byte given in
.Fa wdata.byte .
.It Dv SMB_WRITEW Ta
The
.Em WriteWord
command first sends the byte from the
first sends the byte from
.Fa cmd
field to the device, followed by the word given in
to the device, followed by the word given in
.Fa wdata.word .
Note that the SMBus byte-order is little-endian by definition.
.It Dv SMB_READB Ta
The
.Em ReadByte
command first sends the byte from the
first sends the byte from
.Fa cmd
field to the device, and then reads one byte of data from
to the device, then reads one byte of data from
the device.
The returned data will be stored in
Returned data is stored in
.Fa rdata.byte .
.It Dv SMB_READW Ta
The
.Em ReadWord
command first sends the byte from the
first sends the byte from
.Fa cmd
field to the device, and then reads one word of data from
to the device, then reads one word of data from
the device.
The returned data will be stored in
Returned data is stored in
.Fa rdata.word .
.It Dv SMB_PCALL Ta
The
.Em ProcedureCall
command first sends the byte from the
first sends the byte from
.Fa cmd
field to the device, followed by the word provided in
to the device, followed by the word provided in
.Fa wdata.word .
It then reads one word of data from the device, and returns it
It then reads one word of data from the device and returns it
in
.Fa rdata.word .
.It Dv SMB_BWRITE Ta
The
.Em BlockWrite
command first sends the byte from the
first sends the byte from
.Fa cmd
field to the device, followed by
to the device, followed by
.Fa wcount
bytes of data that are taken from the buffer pointed to by
.Fa wbuf .
@ -163,34 +151,32 @@ but since
.Xr smbus 4
is also used to access I2C devices, the limit has been increased
to 1024.
This value is available in the constant
This value can be read from the constant
.Dv SMB_MAXBLOCKSIZE .
.It Dv SMB_BREAD Ta
The
.Em BlockRead
command first sends the byte from the
first sends the byte from
.Fa cmd
field to the device, and then reads
to the device, then reads
.Fa rcount
bytes of data that from the device.
These data will be returned in the buffer pointed to by
This data is returned in the buffer pointed to by
.Fa rbuf .
.It Dv SMB_TRANS Ta
The
.Em Trans
command sends an SMB roll-up transaction with flags that also allow it to
be used for (mostly) I2C pass-through and with with 10-bit addresses.
This function can be used to roll up all of the above functions.
It first sends the byte from the
sends an SMB roll-up transaction with flags that also allow it to
be used for (mostly) I2C pass-through and with 10-bit addresses.
This function can be utilized to roll up all of the above functions.
It first sends the byte from
.Fa cmd
field to the device, followed by
to the device, followed by
.Fa wcount
bytes of data that are taken from the buffer pointed to by
.Fa wbuf ,
then reads
.Fa rcount
bytes of data that from the device.
These data will be returned in the buffer pointed to by
This data is returned in the buffer pointed to by
.Fa rbuf .
.Pp
The following flags are allowed in
@ -239,5 +225,4 @@ This
manual page was written by
.An Nicolas Souchu
and extended by
.An Michael Gmelin Aq freebsd@grem.de
.
.An Michael Gmelin Aq freebsd@grem.de .