summaryrefslogtreecommitdiffstats
path: root/sys/dev/smbus
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-02-03 16:14:37 +0000
committerjhb <jhb@FreeBSD.org>2009-02-03 16:14:37 +0000
commit5515d5597b757d3c81d8ded55b1209509a2d4cd0 (patch)
tree9aca21032933c973a3881f8f79e208911283bc2c /sys/dev/smbus
parent02f472a38c34915a171f58b5337454f4a5408cf4 (diff)
downloadFreeBSD-src-5515d5597b757d3c81d8ded55b1209509a2d4cd0.zip
FreeBSD-src-5515d5597b757d3c81d8ded55b1209509a2d4cd0.tar.gz
- Change ichsmb(4) to follow the format of all the other smbus controllers
for slave addressing by using left-adjusted slave addresses (i.e. xxxxxxx0b). - Require the low bit of the slave address to always be zero in smb(4) to help catch broken applications. - Adjust some code in the IPMI driver to not convert the slave address for SSIF to a right-adjusted address. I (or possibly ambrisko@) added this in the past to (unknowingly) work around the bug in ichsmb(4). Submitted by: Andriy Gapon <avg of icyb.net.ua> (1,2) MFC after: 1 month
Diffstat (limited to 'sys/dev/smbus')
-rw-r--r--sys/dev/smbus/smb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c
index df3ebe9..579204d 100644
--- a/sys/dev/smbus/smb.c
+++ b/sys/dev/smbus/smb.c
@@ -180,6 +180,10 @@ smbioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *t
parent = device_get_parent(smbdev);
+ /* Make sure that LSB bit is cleared. */
+ if (s->slave & 0x1)
+ return (EINVAL);
+
/* Allocate the bus. */
if ((error = smbus_request_bus(parent, smbdev,
(flags & O_NONBLOCK) ? SMB_DONTWAIT : (SMB_WAIT | SMB_INTR))))
OpenPOWER on IntegriCloud