---
name: "smb"
section: "4"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/smb"
---

# smb(4)

SMB generic I/O device driver

## NAME

**smb** – SMB 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. In order 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 {
	char cmd;
	int count;
	u_char slave;
	union {
		char byte;
		short word;
		char *byte_ptr;
		short *word_ptr;
		struct {
			short sdata;
			short *rdata;
		} process;
	} data;
};
```

The *slave* field is always used, and provides the address of the SMBus slave device to talk to.

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