smb(4freebsd)

smb4freebsd

Smb generic i/o device driver

Usage

device smb

Overview

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.

IoctlDescription
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.

Releases

9 releases since Debian 5.0 (Lenny); the text changed 6 times.

  1. 5.0
  2. 6.0
  3. 7
  4. 8
  5. 9
  6. 10
  7. 11–13

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]⟩.

From freebsd-manpages 12.2-2 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.