NAME
smb – System Management Bus (SMBus) generic I/O device driver
SYNOPSIS
device smb
DESCRIPTION
The smb character device driver provides generic I/O to any smbus(4) instance. To control SMB devices, use /dev/smb? with the ioctls described below. Any of these ioctl commands takes a pointer to struct smbcmd as its argument.
#include <sys/types.h>
struct smbcmd {
u_char cmd;
u_char reserved;
u_short op;
union {
char byte;
char buf[2];
short word;
} wdata;
union {
char byte;
char buf[2];
short word;
} rdata;
int slave;
char *wbuf; /* use wdata if NULL */
int wcount;
char *rbuf; /* use rdata if NULL */
int rcount;
};
The slave field is always used, and provides the address of the SMBus slave device. The slave address is specified in the seven most significant bits (i.e., “left-justified”). The least significant bit of the slave address must be zero.
| Ioctl | Description |
| SMB_QUICK_WRITE | |
| SMB_QUICK_READ | |
| SMB_SENDB | |
| SMB_RECVB | |
| SMB_WRITEB | |
| SMB_WRITEW | |
| SMB_READB | |
| SMB_READW | |
| SMB_PCALL | |
| SMB_BWRITE | |
| SMB_BREAD |
The read(2) and write(2) system calls are not implemented by this driver.
ERRORS
The ioctl(2) commands can cause the following driver-specific errors:
- [ENXIO]
-
Device did not respond to selection.
- [EBUSY]
-
Device still in use.
- [ENODEV]
-
Operation not supported by device (not supposed to happen).
- [EINVAL]
-
General argument error.
- [EWOULDBLOCK]
-
SMBus transaction timed out.
SEE ALSO
HISTORY
The smb manual page first appeared in FreeBSD 3.0.
AUTHORS
This manual page was written by Nicolas Souchu and extended by Michael Gmelin ⟨[email protected]⟩.