diff options
author | nsouch <nsouch@FreeBSD.org> | 1999-01-09 18:08:24 +0000 |
---|---|---|
committer | nsouch <nsouch@FreeBSD.org> | 1999-01-09 18:08:24 +0000 |
commit | e670443158fa0f8567cc666000f1cf5819c156ca (patch) | |
tree | dc9371aa53218a6e6b09f54a5dd8c837e4342de9 /sys/i386 | |
parent | 674988520c88d8bdd31977e29964f169a47a72b1 (diff) | |
download | FreeBSD-src-e670443158fa0f8567cc666000f1cf5819c156ca.zip FreeBSD-src-e670443158fa0f8567cc666000f1cf5819c156ca.tar.gz |
Change /dev/smb and /dev/iic interface to allow user programs to interact with
devices dynamically. That means,
+ only one /dev/iic or /dev/smb device for each smb/iic bus to access
+ I2C/SMB device address must be given to any ioctl
+ new devices may be plugged and accessed after boot, which was
impossible previously (device addresses were hardcoded into
the kernel)
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/include/iic.h | 19 | ||||
-rw-r--r-- | sys/i386/include/smb.h | 7 |
2 files changed, 17 insertions, 9 deletions
diff --git a/sys/i386/include/iic.h b/sys/i386/include/iic.h index 1744326..6649821 100644 --- a/sys/i386/include/iic.h +++ b/sys/i386/include/iic.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: iic.h,v 1.1.2.1 1998/07/17 00:54:01 son Exp $ + * $Id: iic.h,v 1.1 1998/09/03 21:00:08 nsouch Exp $ * */ #ifndef __IIC_H @@ -31,10 +31,17 @@ #include <sys/ioccom.h> -#define I2CSTART _IO('i', 1) /* start condition */ -#define I2CSTOP _IO('i', 2) /* stop condition */ -#define I2CADDRESS _IOW('i', 3, long) /* address bus */ -#define I2CRSTCARD _IOW('i', 4, long) /* reset the card */ +struct iiccmd { + u_char slave; + int count; + int last; + char *buf; +}; -#endif +#define I2CSTART _IOW('i', 1, struct iiccmd) /* start condition */ +#define I2CSTOP _IO('i', 2) /* stop condition */ +#define I2CRSTCARD _IOW('i', 3, struct iiccmd) /* reset the card */ +#define I2CWRITE _IOW('i', 4, struct iiccmd) /* send data */ +#define I2CREAD _IOW('i', 5, struct iiccmd) /* receive data */ +#endif diff --git a/sys/i386/include/smb.h b/sys/i386/include/smb.h index 1338a15..e0ebef8 100644 --- a/sys/i386/include/smb.h +++ b/sys/i386/include/smb.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: smb.h,v 1.1 1998/08/13 17:13:20 son Exp $ + * $Id: smb.h,v 1.1 1998/09/03 21:00:08 nsouch Exp $ * */ #ifndef __SMB_H @@ -34,6 +34,7 @@ struct smbcmd { char cmd; int count; + u_char slave; union { char byte; short word; @@ -48,8 +49,8 @@ struct smbcmd { } data; }; -#define SMB_QUICK_WRITE _IO('i', 1) -#define SMB_QUICK_READ _IO('i', 2) +#define SMB_QUICK_WRITE _IOW('i', 1, struct smbcmd) +#define SMB_QUICK_READ _IOW('i', 2, struct smbcmd) #define SMB_SENDB _IOW('i', 3, struct smbcmd) #define SMB_RECVB _IOW('i', 4, struct smbcmd) #define SMB_WRITEB _IOW('i', 5, struct smbcmd) |