diff options
| author | Andriy Gapon <avg@FreeBSD.org> | 2016-11-03 07:40:52 +0000 |
|---|---|---|
| committer | Andriy Gapon <avg@FreeBSD.org> | 2016-11-03 07:40:52 +0000 |
| commit | 19a8946bce1e8cb309aa152462fcb30bf49e457e (patch) | |
| tree | 1b2b9eecf76b5412a873ac76e6c4f1d06cd25194 /sys/dev/smbus | |
| parent | 38ae0c59b9f553459a47352d88895c4c7ed4efcf (diff) | |
Notes
Diffstat (limited to 'sys/dev/smbus')
| -rw-r--r-- | sys/dev/smbus/smb.c | 18 | ||||
| -rw-r--r-- | sys/dev/smbus/smb.h | 7 | ||||
| -rw-r--r-- | sys/dev/smbus/smbconf.h | 19 | ||||
| -rw-r--r-- | sys/dev/smbus/smbus_if.m | 17 |
4 files changed, 2 insertions, 59 deletions
diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c index e84244118927..21d1e2f7c3d3 100644 --- a/sys/dev/smbus/smb.c +++ b/sys/dev/smbus/smb.c @@ -293,24 +293,6 @@ smbioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *t error = copyout(buf, s->rbuf, s->rcount); break; - case SMB_TRANS: - if (s->rcount < 0 || s->wcount < 0) { - error = EINVAL; - break; - } - if (s->rcount > SMB_MAXBLOCKSIZE) - s->rcount = SMB_MAXBLOCKSIZE; - if (s->wcount > SMB_MAXBLOCKSIZE) - s->wcount = SMB_MAXBLOCKSIZE; - if (s->wcount) - error = copyin(s->wbuf, buf, s->wcount); - if (error) - break; - error = smbus_error(smbus_trans(parent, s->slave, s->cmd, - s->op, buf, s->wcount, buf, s->rcount, &s->rcount)); - if (error == 0) - error = copyout(buf, s->rbuf, s->rcount); - break; default: error = ENOTTY; } diff --git a/sys/dev/smbus/smb.h b/sys/dev/smbus/smb.h index 80076530bb52..44b71e8a40ef 100644 --- a/sys/dev/smbus/smb.h +++ b/sys/dev/smbus/smb.h @@ -54,11 +54,8 @@ struct smbcmd { /* * SMBus spec 2.0 says block transfers may be at most 32 bytes. - * We use SMBus for i2c as well, make the size limit something more - * reasonable. Keep in mind that a char buf array is declared on the - * kernel stack. */ -#define SMB_MAXBLOCKSIZE 1024 +#define SMB_MAXBLOCKSIZE 32 #define SMB_QUICK_WRITE _IOW('i', 1, struct smbcmd) #define SMB_QUICK_READ _IOW('i', 2, struct smbcmd) @@ -72,6 +69,6 @@ struct smbcmd { #define SMB_BWRITE _IOW('i', 10, struct smbcmd) #define SMB_OLD_BREAD _IOW('i', 11, struct smbcmd) #define SMB_BREAD _IOWR('i', 11, struct smbcmd) -#define SMB_TRANS _IOWR('i', 12, struct smbcmd) +#define SMB_OLD_TRANS _IOWR('i', 12, struct smbcmd) #endif diff --git a/sys/dev/smbus/smbconf.h b/sys/dev/smbus/smbconf.h index 2c120c1a8a08..ceb80aca267c 100644 --- a/sys/dev/smbus/smbconf.h +++ b/sys/dev/smbus/smbconf.h @@ -72,25 +72,6 @@ #define SMB_QREAD 0x1 /* - * smbus transction op with pass-thru capabilities - * - * This smbus function is capable of doing a smbus command transaction - * (read or write), and can be flagged to not issue the 'cmd' and/or - * issue or expect a count field as well as flagged for chaining (no STOP), - * which gives it an i2c pass-through capability. - * - * NOSTOP- Caller chaining transactions, do not issue STOP - * NOCMD- Do not transmit the command field - * NOCNT- Do not transmit (wr) or expect (rd) the count field - */ -#define SMB_TRANS_NOSTOP 0x0001 /* do not send STOP at end */ -#define SMB_TRANS_NOCMD 0x0002 /* ignore cmd field (do not tx) */ -#define SMB_TRANS_NOCNT 0x0004 /* do not tx or rx count field */ -#define SMB_TRANS_7BIT 0x0008 /* change address mode to 7-bit */ -#define SMB_TRANS_10BIT 0x0010 /* change address mode to 10-bit */ -#define SMB_TRANS_NOREPORT 0x0020 /* do not report errors */ - -/* * ivars codes */ enum smbus_ivars { diff --git a/sys/dev/smbus/smbus_if.m b/sys/dev/smbus/smbus_if.m index 6a5acf5dbcb9..d969e25ed566 100644 --- a/sys/dev/smbus/smbus_if.m +++ b/sys/dev/smbus/smbus_if.m @@ -149,20 +149,3 @@ METHOD int bread { u_char *count; char *buf; }; - -# -# SMB roll-up transaction with flags that also allow it to be -# used for (mostly) i2c pass-through and with 10-bit addresses. -# This function can be used to roll-up all of the above functions. -# -METHOD int trans { - device_t dev; - int slave; - char cmd; - int op; - char *wbuf; - int wcount; - char *rbuf; - int rcount; - int *actualp; -}; |
