26c26
< * $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 $
160,162c160
< device_t smbdev = IIC_DEVICE(minor(dev));
< struct smb_softc *sc = IIC_SOFTC(minor(dev));
< int count;
---
> /* not supported */
164,177c162
< 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);
<
< return (0);
---
> return (EINVAL);
198c183
< if (!sc)
---
> if (!sc || !s)
203c188
< smbus_quick(parent, sc->sc_addr, SMB_QWRITE);
---
> smbus_quick(parent, s->slave, SMB_QWRITE);
207c192
< smbus_quick(parent, sc->sc_addr, SMB_QREAD);
---
> smbus_quick(parent, s->slave, SMB_QREAD);
211,213d195
< if (!s)
< return (EINVAL);
<
216c198
< smbus_sendb(parent, sc->sc_addr, s->cmd);
---
> smbus_sendb(parent, s->slave, s->cmd);
220c202
< smbus_recvb(parent, sc->sc_addr, &s->cmd);
---
> smbus_recvb(parent, s->slave, &s->cmd);
224c206
< smbus_writeb(parent, sc->sc_addr, s->cmd, s->data.byte);
---
> smbus_writeb(parent, s->slave, s->cmd, s->data.byte);
228c210
< smbus_writew(parent, sc->sc_addr, s->cmd, s->data.word);
---
> smbus_writew(parent, s->slave, s->cmd, s->data.word);
233c215
< smbus_readb(parent, sc->sc_addr, s->cmd,
---
> smbus_readb(parent, s->slave, s->cmd,
239c221
< smbus_readw(parent, sc->sc_addr, s->cmd, s->data.word_ptr);
---
> smbus_readw(parent, s->slave, s->cmd, s->data.word_ptr);
244c226
< smbus_pcall(parent, sc->sc_addr, s->cmd,
---
> smbus_pcall(parent, s->slave, s->cmd,
250c232
< smbus_bwrite(parent, sc->sc_addr, s->cmd, s->count,
---
> smbus_bwrite(parent, s->slave, s->cmd, s->count,
256c238
< smbus_bread(parent, sc->sc_addr, s->cmd, s->count,
---
> smbus_bread(parent, s->slave, s->cmd, s->count,
< * $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 $
160,162c160
< device_t smbdev = IIC_DEVICE(minor(dev));
< struct smb_softc *sc = IIC_SOFTC(minor(dev));
< int count;
---
> /* not supported */
164,177c162
< 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);
<
< return (0);
---
> return (EINVAL);
198c183
< if (!sc)
---
> if (!sc || !s)
203c188
< smbus_quick(parent, sc->sc_addr, SMB_QWRITE);
---
> smbus_quick(parent, s->slave, SMB_QWRITE);
207c192
< smbus_quick(parent, sc->sc_addr, SMB_QREAD);
---
> smbus_quick(parent, s->slave, SMB_QREAD);
211,213d195
< if (!s)
< return (EINVAL);
<
216c198
< smbus_sendb(parent, sc->sc_addr, s->cmd);
---
> smbus_sendb(parent, s->slave, s->cmd);
220c202
< smbus_recvb(parent, sc->sc_addr, &s->cmd);
---
> smbus_recvb(parent, s->slave, &s->cmd);
224c206
< smbus_writeb(parent, sc->sc_addr, s->cmd, s->data.byte);
---
> smbus_writeb(parent, s->slave, s->cmd, s->data.byte);
228c210
< smbus_writew(parent, sc->sc_addr, s->cmd, s->data.word);
---
> smbus_writew(parent, s->slave, s->cmd, s->data.word);
233c215
< smbus_readb(parent, sc->sc_addr, s->cmd,
---
> smbus_readb(parent, s->slave, s->cmd,
239c221
< smbus_readw(parent, sc->sc_addr, s->cmd, s->data.word_ptr);
---
> smbus_readw(parent, s->slave, s->cmd, s->data.word_ptr);
244c226
< smbus_pcall(parent, sc->sc_addr, s->cmd,
---
> smbus_pcall(parent, s->slave, s->cmd,
250c232
< smbus_bwrite(parent, sc->sc_addr, s->cmd, s->count,
---
> smbus_bwrite(parent, s->slave, s->cmd, s->count,
256c238
< smbus_bread(parent, sc->sc_addr, s->cmd, s->count,
---
> smbus_bread(parent, s->slave, s->cmd, s->count,