GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SMB(4) FreeBSD Kernel Interfaces Manual SMB(4)

smb
SMB generic I/O device driver

device smb

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

QuickWrite does not transfer any data. It just issues the device address with write intent to the bus.
QuickRead does not transfer any data. It just issues the device address with read intent to the bus.
SendByte sends the byte provided in cmd to the device.
ReceiveByte reads a single byte from the device which is returned in cmd.
WriteByte first sends the byte from cmd to the device, followed by the byte given in wdata.byte.
WriteWord first sends the byte from cmd to the device, followed by the word given in wdata.word. Note that the SMBus byte-order is little-endian by definition.
ReadByte first sends the byte from cmd to the device, then reads one byte of data from the device. Returned data is stored in rdata.byte.
ReadWord first sends the byte from cmd to the device, then reads one word of data from the device. Returned data is stored in rdata.word.
ProcedureCall first sends the byte from cmd to the device, followed by the word provided in wdata.word. It then reads one word of data from the device and returns it in rdata.word.
BlockWrite first sends the byte from cmd to the device, then the byte from wcount followed by wcount bytes of data that are taken from the buffer pointed to by wbuf. The SMBus specification mandates that no more than 32 bytes of data can be transferred in a single block read or write command. This value can be read from the constant SMB_MAXBLOCKSIZE.
BlockRead first sends the byte from cmd to the device, then reads a count of data bytes that the device is going to provide and then reads that many bytes. The count is returned in rcount. The data is returned in the buffer pointed to by rbuf.

The read(2) and write(2) system calls are not implemented by this driver.

The ioctl(2) commands can cause the following driver-specific errors:
[]
Device did not respond to selection.
[]
Device still in use.
[]
Operation not supported by device (not supposed to happen).
[]
General argument error.
[]
SMBus transaction timed out.

ioctl(2), smbus(4)

The smb manual page first appeared in FreeBSD 3.0.

This manual page was written by Nicolas Souchu and extended by
Michael Gmelin ⟨freebsd@grem.de⟩.
April 25, 2015 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 4 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.