summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/iicbus/iic.c16
-rw-r--r--sys/dev/iicbus/iic.h19
-rw-r--r--sys/dev/iicbus/iicbus.c35
-rw-r--r--sys/dev/iicbus/iicbus.h4
-rw-r--r--sys/dev/iicbus/iiconf.c99
-rw-r--r--sys/dev/iicbus/iiconf.h18
-rw-r--r--sys/dev/smbus/smb.c48
-rw-r--r--sys/dev/smbus/smb.h7
-rw-r--r--sys/dev/smbus/smbconf.c5
-rw-r--r--sys/dev/smbus/smbus.c3
-rw-r--r--sys/i386/include/iic.h19
-rw-r--r--sys/i386/include/smb.h7
12 files changed, 196 insertions, 84 deletions
diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c
index e2d59fd..e41d08b 100644
--- a/sys/dev/iicbus/iic.c
+++ b/sys/dev/iicbus/iic.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iic.c,v 1.4 1998/10/31 11:31:07 nsouch Exp $
+ * $Id: iic.c,v 1.5 1998/12/07 21:58:16 archie Exp $
*
*/
#include <sys/param.h>
@@ -40,6 +40,7 @@
#include <dev/iicbus/iiconf.h>
#include <dev/iicbus/iicbus.h>
+
#include <machine/iic.h>
#include "iicbus_if.h"
@@ -209,15 +210,16 @@ iicioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
{
device_t iicdev = IIC_DEVICE(minor(dev));
struct iic_softc *sc = IIC_SOFTC(minor(dev));
- int error;
device_t parent = device_get_parent(iicdev);
+ struct iiccmd *s = (struct iiccmd *)data;
+ int error, count;
if (!sc)
return (EINVAL);
switch (cmd) {
case I2CSTART:
- error = iicbus_start(parent, sc->sc_addr, 0);
+ error = iicbus_start(parent, s->slave, 0);
break;
case I2CSTOP:
@@ -228,6 +230,14 @@ iicioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
error = iicbus_reset(parent, 0, 0, NULL);
break;
+ case I2CWRITE:
+ error = iicbus_write(parent, s->buf, s->count, &count, 0);
+ break;
+
+ case I2CREAD:
+ error = iicbus_read(parent, s->buf, s->count, &count, s->last, 0);
+ break;
+
default:
error = ENODEV;
}
diff --git a/sys/dev/iicbus/iic.h b/sys/dev/iicbus/iic.h
index 1744326..6649821 100644
--- a/sys/dev/iicbus/iic.h
+++ b/sys/dev/iicbus/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/dev/iicbus/iicbus.c b/sys/dev/iicbus/iicbus.c
index fd982ce..cf9f6ba 100644
--- a/sys/dev/iicbus/iicbus.c
+++ b/sys/dev/iicbus/iicbus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicbus.c,v 1.5 1998/11/22 22:01:42 nsouch Exp $
+ * $Id: iicbus.c,v 1.6 1998/12/07 21:58:16 archie Exp $
*
*/
@@ -73,14 +73,14 @@ struct iicbus_device {
/*
* list of known devices
+ *
+ * XXX only one smb driver should exist for each I2C interface
*/
struct iicbus_device iicbus_children[] = {
{ "iicsmb", IICBUS_DRIVER_CLASS, "I2C to SMB bridge" },
- { "iic", IICBUS_DEVICE_CLASS, "PCF8574 I2C to 8 bits parallel i/o", 64},
- { "iic", IICBUS_DEVICE_CLASS, "PCF8584 as slave", PCF_MASTER_ADDRESS },
- { "ic", IICBUS_DEVICE_CLASS, "network interface", PCF_MASTER_ADDRESS },
+ { "iic", IICBUS_DRIVER_CLASS, "I2C general purpose I/O" },
#if 0
- { "iic", IICBUS_DRIVER_CLASS, "General Call", I2C_GENERAL_CALL },
+ { "ic", IICBUS_DEVICE_CLASS, "network interface", PCF_MASTER_ADDRESS },
#endif
{ NULL, 0 }
};
@@ -121,10 +121,12 @@ static driver_t iicbus_driver = {
static int
iicbus_probe(device_t dev)
{
- /* always present if probed */
+ device_set_desc(dev, "Philips I2C bus");
+
return (0);
}
+#if 0
static int
iic_probe_device(device_t dev, u_char addr)
{
@@ -145,6 +147,7 @@ iic_probe_device(device_t dev, u_char addr)
return (0);
}
+#endif
/*
* We add all the devices which we know about.
@@ -155,10 +158,15 @@ iicbus_attach(device_t dev)
{
struct iicbus_device *iicdev;
device_t child;
- int addr;
iicbus_reset(dev, IIC_FASTEST, 0, NULL);
+ /* device probing is meaningless since the bus is supposed to be
+ * hot-plug. Moreover, some I2C chips do not appreciate random
+ * accesses like stop after start to fast, reads for less than
+ * x bytes...
+ */
+#if 0
printf("Probing for devices on iicbus%d:", device_get_unit(dev));
/* probe any devices */
@@ -168,21 +176,27 @@ iicbus_attach(device_t dev)
}
}
printf("\n");
+#endif
/* attach known devices */
for (iicdev = iicbus_children; iicdev->iicd_name; iicdev++) {
switch (iicdev->iicd_class) {
case IICBUS_DEVICE_CLASS:
/* check if the devclass exists */
- if (devclass_find(iicdev->iicd_name) &&
- iic_probe_device(dev, iicdev->iicd_addr))
+ if (devclass_find(iicdev->iicd_name))
iicdev->iicd_alive = 1;
+ else if (bootverbose)
+ printf("iicbus: %s devclass not found\n",
+ iicdev->iicd_name);
break;
case IICBUS_DRIVER_CLASS:
/* check if the devclass exists */
- if (!devclass_find(iicdev->iicd_name))
+ if (devclass_find(iicdev->iicd_name))
iicdev->iicd_alive = 1;
+ else if (bootverbose)
+ printf("iicbus: %s devclass not found\n",
+ iicdev->iicd_name);
break;
default:
@@ -272,4 +286,3 @@ iicbus_write_ivar(device_t bus, device_t dev, int index, u_long val)
DRIVER_MODULE(iicbus, pcf, iicbus_driver, iicbus_devclass, 0, 0);
DRIVER_MODULE(iicbus, iicbb, iicbus_driver, iicbus_devclass, 0, 0);
DRIVER_MODULE(iicbus, bti2c, iicbus_driver, iicbus_devclass, 0, 0);
-DRIVER_MODULE(iicbus, smbtx, iicbus_driver, iicbus_devclass, 0, 0);
diff --git a/sys/dev/iicbus/iicbus.h b/sys/dev/iicbus/iicbus.h
index 21c0f97..3c23095 100644
--- a/sys/dev/iicbus/iicbus.h
+++ b/sys/dev/iicbus/iicbus.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicbus.h,v 1.1.1.1 1998/09/03 20:51:50 nsouch Exp $
+ * $Id: iicbus.h,v 1.2 1998/10/31 11:31:07 nsouch Exp $
*
*/
#ifndef __IICBUS_H
@@ -32,6 +32,8 @@
struct iicbus_softc {
device_t owner; /* iicbus owner device structure */
+ u_char started; /* address of the 'started' slave
+ * 0 if no start condition succeeded */
};
extern devclass_t iicbus_devclass;
diff --git a/sys/dev/iicbus/iiconf.c b/sys/dev/iicbus/iiconf.c
index f4056ce..47f1686 100644
--- a/sys/dev/iicbus/iiconf.c
+++ b/sys/dev/iicbus/iiconf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iiconf.c,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+ * $Id: iiconf.c,v 1.3 1998/11/22 22:01:42 nsouch Exp $
*
*/
#include <sys/param.h>
@@ -65,9 +65,6 @@ iicbus_alloc_bus(device_t parent)
/* add the bus to the parent */
child = device_add_child(parent, "iicbus", -1, NULL);
- if (child)
- device_set_desc(child, "Philips I2C bus");
-
return (child);
}
@@ -164,6 +161,99 @@ iicbus_release_bus(device_t bus, device_t dev)
}
/*
+ * iicbus_started()
+ *
+ * Test if the iicbus is started by the controller
+ */
+int
+iicbus_started(device_t bus)
+{
+ struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
+
+ return (sc->started);
+}
+
+/*
+ * iicbus_start()
+ *
+ * Send start condition to the slave addressed by 'slave'
+ */
+int
+iicbus_start(device_t bus, u_char slave, int timeout)
+{
+ struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
+ int error = 0;
+
+ if (sc->started)
+ return (EINVAL); /* bus already started */
+
+ if (!(error = IICBUS_START(device_get_parent(bus), slave, timeout)))
+ sc->started = slave;
+ else
+ sc->started = 0;
+
+ return (error);
+}
+
+/*
+ * iicbus_stop()
+ *
+ * Send stop condition to the bus
+ */
+int
+iicbus_stop(device_t bus)
+{
+ struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
+ int error = 0;
+
+ if (!sc->started)
+ return (EINVAL); /* bus not started */
+
+ error = IICBUS_STOP(device_get_parent(bus));
+
+ /* refuse any further access */
+ sc->started = 0;
+
+ return (error);
+}
+
+/*
+ * iicbus_write()
+ *
+ * Write a block of data to the slave previously started by
+ * iicbus_start() call
+ */
+int
+iicbus_write(device_t bus, char *buf, int len, int *sent, int timeout)
+{
+ struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
+
+ /* a slave must have been started with the appropriate address */
+ if (!sc->started || (sc->started & LSB))
+ return (EINVAL);
+
+ return (IICBUS_WRITE(device_get_parent(bus), buf, len, sent, timeout));
+}
+
+/*
+ * iicbus_read()
+ *
+ * Read a block of data from the slave previously started by
+ * iicbus_read() call
+ */
+int
+iicbus_read(device_t bus, char *buf, int len, int *read, int last, int delay)
+{
+ struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
+
+ /* a slave must have been started with the appropriate address */
+ if (!sc->started || !(sc->started & LSB))
+ return (EINVAL);
+
+ return (IICBUS_READ(device_get_parent(bus), buf, len, read, last, delay));
+}
+
+/*
* iicbus_block_write()
*
* Write a block of data to slave ; start/stop protocol managed
@@ -220,3 +310,4 @@ iicbus_get_addr(device_t dev)
return ((u_char)addr);
}
+
diff --git a/sys/dev/iicbus/iiconf.h b/sys/dev/iicbus/iiconf.h
index 874ecd4..0b548fb 100644
--- a/sys/dev/iicbus/iiconf.h
+++ b/sys/dev/iicbus/iiconf.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iiconf.h,v 1.1.1.1 1998/09/03 20:51:50 nsouch Exp $
+ * $Id: iiconf.h,v 1.2 1998/10/31 11:31:07 nsouch Exp $
*/
#ifndef __IICONF_H
#define __IICONF_H
@@ -108,17 +108,17 @@ extern int iicbus_null_callback(device_t, int, caddr_t);
#define iicbus_repeated_start(bus,slave,timeout) \
(IICBUS_REPEATED_START(device_get_parent(bus), slave, timeout))
-#define iicbus_start(bus,slave,timeout) \
- (IICBUS_START(device_get_parent(bus), slave, timeout))
-#define iicbus_stop(bus) \
- (IICBUS_STOP(device_get_parent(bus)))
#define iicbus_reset(bus,speed,addr,oldaddr) \
(IICBUS_RESET(device_get_parent(bus), speed, addr, oldaddr))
-#define iicbus_write(bus,buf,len,sent,timeout) \
- (IICBUS_WRITE(device_get_parent(bus), buf, len, sent, timeout))
-#define iicbus_read(bus,buf,len,sent,last,delay) \
- (IICBUS_READ(device_get_parent(bus), buf, len, sent, last, delay))
+/* basic I2C operations */
+extern int iicbus_started(device_t);
+extern int iicbus_start(device_t, u_char, int);
+extern int iicbus_stop(device_t);
+extern int iicbus_write(device_t, char *, int, int *, int);
+extern int iicbus_read(device_t, char *, int, int *, int, int);
+
+/* Read/write operations with start/stop conditions managed */
extern int iicbus_block_write(device_t, u_char, char *, int, int *);
extern int iicbus_block_read(device_t, u_char, char *, int, int *);
diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c
index 72c4780..1ecca51 100644
--- a/sys/dev/smbus/smb.c
+++ b/sys/dev/smbus/smb.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smb.c,v 1.3 1998/09/09 18:57:38 nsouch Exp $
+ * $Id: smb.c,v 1.4 1998/12/07 21:58:17 archie Exp $
*
*/
#include <sys/param.h>
@@ -157,24 +157,9 @@ smbclose(dev_t dev, int flags, int fmt, struct proc *p)
static int
smbwrite(dev_t dev, struct uio * uio, int ioflag)
{
- device_t smbdev = IIC_DEVICE(minor(dev));
- struct smb_softc *sc = IIC_SOFTC(minor(dev));
- int count;
-
- if (!sc || !smbdev)
- return (EINVAL);
-
- if (sc->sc_count == 0)
- return (EINVAL);
-
- count = min(uio->uio_resid, BUFSIZE);
- uiomove(sc->sc_buffer, count, uio);
-
- /* we consider the command char as the first character to send */
- smbus_bwrite(device_get_parent(smbdev), sc->sc_addr,
- sc->sc_buffer[0], count-1, sc->sc_buffer+1);
+ /* not supported */
- return (0);
+ return (EINVAL);
}
static int
@@ -195,65 +180,62 @@ smbioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
int error = 0;
struct smbcmd *s = (struct smbcmd *)data;
- if (!sc)
+ if (!sc || !s)
return (EINVAL);
switch (cmd) {
case SMB_QUICK_WRITE:
- smbus_quick(parent, sc->sc_addr, SMB_QWRITE);
+ smbus_quick(parent, s->slave, SMB_QWRITE);
goto end;
case SMB_QUICK_READ:
- smbus_quick(parent, sc->sc_addr, SMB_QREAD);
+ smbus_quick(parent, s->slave, SMB_QREAD);
goto end;
};
- if (!s)
- return (EINVAL);
-
switch (cmd) {
case SMB_SENDB:
- smbus_sendb(parent, sc->sc_addr, s->cmd);
+ smbus_sendb(parent, s->slave, s->cmd);
break;
case SMB_RECVB:
- smbus_recvb(parent, sc->sc_addr, &s->cmd);
+ smbus_recvb(parent, s->slave, &s->cmd);
break;
case SMB_WRITEB:
- smbus_writeb(parent, sc->sc_addr, s->cmd, s->data.byte);
+ smbus_writeb(parent, s->slave, s->cmd, s->data.byte);
break;
case SMB_WRITEW:
- smbus_writew(parent, sc->sc_addr, s->cmd, s->data.word);
+ smbus_writew(parent, s->slave, s->cmd, s->data.word);
break;
case SMB_READB:
if (s->data.byte_ptr)
- smbus_readb(parent, sc->sc_addr, s->cmd,
+ smbus_readb(parent, s->slave, s->cmd,
s->data.byte_ptr);
break;
case SMB_READW:
if (s->data.word_ptr)
- smbus_readw(parent, sc->sc_addr, s->cmd, s->data.word_ptr);
+ smbus_readw(parent, s->slave, s->cmd, s->data.word_ptr);
break;
case SMB_PCALL:
if (s->data.process.rdata)
- smbus_pcall(parent, sc->sc_addr, s->cmd,
+ smbus_pcall(parent, s->slave, s->cmd,
s->data.process.sdata, s->data.process.rdata);
break;
case SMB_BWRITE:
if (s->count && s->data.byte_ptr)
- smbus_bwrite(parent, sc->sc_addr, s->cmd, s->count,
+ smbus_bwrite(parent, s->slave, s->cmd, s->count,
s->data.byte_ptr);
break;
case SMB_BREAD:
if (s->count && s->data.byte_ptr)
- smbus_bread(parent, sc->sc_addr, s->cmd, s->count,
+ smbus_bread(parent, s->slave, s->cmd, s->count,
s->data.byte_ptr);
break;
diff --git a/sys/dev/smbus/smb.h b/sys/dev/smbus/smb.h
index 1338a15..e0ebef8 100644
--- a/sys/dev/smbus/smb.h
+++ b/sys/dev/smbus/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)
diff --git a/sys/dev/smbus/smbconf.c b/sys/dev/smbus/smbconf.c
index dbf417b..458916f 100644
--- a/sys/dev/smbus/smbconf.c
+++ b/sys/dev/smbus/smbconf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smbconf.c,v 1.2 1998/10/31 11:39:54 nsouch Exp $
+ * $Id: smbconf.c,v 1.3 1998/11/22 22:01:42 nsouch Exp $
*
*/
#include <sys/param.h>
@@ -65,9 +65,6 @@ smbus_alloc_bus(device_t parent)
/* add the bus to the parent */
child = device_add_child(parent, "smbus", -1, NULL);
- if (child)
- device_set_desc(child, "System Management Bus");
-
return (child);
}
diff --git a/sys/dev/smbus/smbus.c b/sys/dev/smbus/smbus.c
index 0ab21a4..ca06710 100644
--- a/sys/dev/smbus/smbus.c
+++ b/sys/dev/smbus/smbus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smbus.c,v 1.5 1998/12/10 02:31:08 archie Exp $
+ * $Id: smbus.c,v 1.6 1998/12/28 19:07:51 nsouch Exp $
*
*/
#include <sys/param.h>
@@ -159,3 +159,4 @@ smbus_read_ivar(device_t bus, device_t dev, int index, u_long* result)
DRIVER_MODULE(smbus, iicsmb, smbus_driver, smbus_devclass, 0, 0);
DRIVER_MODULE(smbus, bti2c, smbus_driver, smbus_devclass, 0, 0);
DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devclass, 0, 0);
+DRIVER_MODULE(smbus, smbv, smbus_driver, smbus_devclass, 0, 0);
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)
OpenPOWER on IntegriCloud