SM bus ioctls incorrect in FreeBSD 11

Lewis Donzis lew at
Thu Oct 13 21:58:28 UTC 2016

After upgrading to FreeBSD 11.0 and changing source code to use the new version of “struct smbcmd”, some commands are not working as documented, specifically those that read data.

As an example, SMB_READW is documented as returning the word read from the device in rdata.word.  However, this doesn’t happen, I think because the ioctl request value is defined using _IOW(), so the kernel doesn’t copy the data it read back out.

In prior versions, the structure had only a pointer to the data, and the smb.c code used copyout() to transfer the data back to userland.

As a temporary work-around, we added code to set rbuf to point to rdata.word and rcount to two.


More information about the freebsd-bugs mailing list