---
name: "smb"
section: "4"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/smb"
---

# smb(4)

System Management Bus (SMBus) generic I/O device driver

## 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)](/smbus/4.md) 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)](/read/2.md) and [write(2)](/write/2.md) system calls are not implemented by this driver.

## ERRORS

The [ioctl(2)](/ioctl/2.md) 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

[ioctl(2)](/ioctl/2.md), [smbus(4)](/smbus/4.md)

## 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 ⟨*freebsd@grem.de*⟩.
