1997-01-11 13:58:12 +03:00
|
|
|
/* $NetBSD: ncr.c,v 1.33 1997/01/11 10:58:14 matthias Exp $ */
|
1996-10-16 01:59:03 +04:00
|
|
|
|
1995-01-19 10:03:35 +03:00
|
|
|
/*
|
1996-03-11 23:50:50 +03:00
|
|
|
* Copyright (c) 1996 Matthias Pfaller.
|
1994-02-23 01:54:42 +03:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
1995-08-25 11:30:33 +04:00
|
|
|
* This product includes software developed by Matthias Pfaller.
|
1995-06-09 08:36:14 +04:00
|
|
|
* 4. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission
|
1994-02-23 01:54:42 +03:00
|
|
|
*
|
1995-06-09 08:36:14 +04:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
1994-02-23 01:54:42 +03:00
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
1995-06-09 08:36:14 +04:00
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
1994-02-23 01:54:42 +03:00
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1995-06-09 08:36:14 +04:00
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1994-02-23 01:54:42 +03:00
|
|
|
*/
|
|
|
|
|
1994-05-17 21:29:34 +04:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
1995-05-16 11:30:30 +04:00
|
|
|
#include <sys/kernel.h>
|
1994-05-17 21:29:34 +04:00
|
|
|
#include <sys/device.h>
|
1995-06-09 08:36:14 +04:00
|
|
|
#include <sys/buf.h>
|
1995-01-19 10:03:35 +03:00
|
|
|
#include <scsi/scsi_all.h>
|
1995-06-09 08:36:14 +04:00
|
|
|
#include <scsi/scsi_message.h>
|
1995-01-19 10:03:35 +03:00
|
|
|
#include <scsi/scsiconf.h>
|
|
|
|
|
1996-03-11 23:50:50 +03:00
|
|
|
#include <dev/ic/ncr5380reg.h>
|
|
|
|
#include <dev/ic/ncr5380var.h>
|
1997-01-11 13:58:12 +03:00
|
|
|
|
|
|
|
#include <machine/autoconf.h>
|
1996-03-11 23:50:50 +03:00
|
|
|
#include <machine/cpufunc.h>
|
1994-02-23 01:54:42 +03:00
|
|
|
|
1996-12-23 11:37:04 +03:00
|
|
|
|
1995-06-09 08:36:14 +04:00
|
|
|
/*
|
1996-03-11 23:50:50 +03:00
|
|
|
* Function declarations:
|
1995-06-09 08:36:14 +04:00
|
|
|
*/
|
1996-03-11 23:50:50 +03:00
|
|
|
static int ncr_pdma_in __P((struct ncr5380_softc *, int, int, u_char *));
|
|
|
|
static int ncr_pdma_out __P((struct ncr5380_softc *, int, int, u_char *));
|
|
|
|
static void ncr_minphys __P((struct buf *bp));
|
|
|
|
static void ncr_intr __P((void *));
|
|
|
|
static void ncr_attach __P((struct device *, struct device *, void *));
|
1996-12-23 11:37:04 +03:00
|
|
|
static int ncr_match __P((struct device *, struct cfdata *, void *));
|
1994-02-23 01:54:42 +03:00
|
|
|
|
1995-06-09 08:36:14 +04:00
|
|
|
/*
|
1996-03-11 23:50:50 +03:00
|
|
|
* Some constants.
|
1995-06-09 08:36:14 +04:00
|
|
|
*/
|
1996-03-11 23:50:50 +03:00
|
|
|
#define PDMA_ADDRESS ((volatile u_char *) 0xffe00000)
|
|
|
|
#define NCR5380 ((volatile u_char *) 0xffd00000)
|
1995-06-09 08:36:14 +04:00
|
|
|
|
1996-05-19 09:32:09 +04:00
|
|
|
/*
|
|
|
|
* Bit allocation in config's sc_flags field.
|
|
|
|
*
|
|
|
|
* bit 0: disable disconnect/reconnect
|
|
|
|
* bit 1: disable use of interrupts
|
|
|
|
* bits 8-15: disable parity (per target)
|
|
|
|
*/
|
|
|
|
#define NCR_DISABLE_RESELECT 1
|
|
|
|
#define NCR_DISABLE_INTERRUPTS 2
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Make the default options patchable with gdb.
|
|
|
|
*/
|
|
|
|
int ncr_default_options = 0;
|
|
|
|
|
1996-03-11 23:50:50 +03:00
|
|
|
struct scsi_adapter ncr_switch = {
|
|
|
|
ncr5380_scsi_cmd, /* scsi_cmd() */
|
1996-10-09 11:29:58 +04:00
|
|
|
minphys, /* scsi_minphys() */
|
1996-03-11 23:50:50 +03:00
|
|
|
0, /* open_target_lu() */
|
|
|
|
0 /* close_target_lu() */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct scsi_device ncr_dev = {
|
|
|
|
NULL, /* use default error handler */
|
|
|
|
NULL, /* do not have a start functio */
|
|
|
|
NULL, /* have no async handler */
|
|
|
|
NULL /* Use default done routine */
|
|
|
|
};
|
|
|
|
|
1996-03-17 04:38:52 +03:00
|
|
|
struct cfattach ncr_ca = {
|
|
|
|
sizeof(struct ncr5380_softc), ncr_match, ncr_attach
|
|
|
|
};
|
|
|
|
|
|
|
|
struct cfdriver ncr_cd = {
|
1996-12-23 11:37:04 +03:00
|
|
|
NULL, "ncr", DV_DULL
|
1996-03-11 23:50:50 +03:00
|
|
|
};
|
1995-06-09 08:36:14 +04:00
|
|
|
|
1995-08-25 11:30:33 +04:00
|
|
|
static int
|
1996-03-11 23:50:50 +03:00
|
|
|
ncr_match(parent, cf, aux)
|
1996-12-23 11:37:04 +03:00
|
|
|
struct device *parent;
|
|
|
|
struct cfdata *cf;
|
|
|
|
void *aux;
|
1995-06-09 08:36:14 +04:00
|
|
|
{
|
1997-01-11 13:58:12 +03:00
|
|
|
struct confargs *ca = aux;
|
1996-12-23 11:37:04 +03:00
|
|
|
int unit = cf->cf_unit;
|
1996-03-11 23:50:50 +03:00
|
|
|
|
|
|
|
if (unit != 0) /* Only one unit */
|
1995-06-09 08:36:14 +04:00
|
|
|
return(0);
|
1997-01-11 13:58:12 +03:00
|
|
|
|
|
|
|
ca->ca_addr = (int)NCR5380;
|
|
|
|
ca->ca_irq = IR_SCSI1;
|
1995-06-09 08:36:14 +04:00
|
|
|
return(1);
|
1994-02-23 01:54:42 +03:00
|
|
|
}
|
|
|
|
|
1995-06-09 08:36:14 +04:00
|
|
|
static void
|
1996-03-11 23:50:50 +03:00
|
|
|
ncr_attach(parent, self, aux)
|
1996-12-23 11:37:04 +03:00
|
|
|
struct device *parent, *self;
|
|
|
|
void *aux;
|
1995-06-09 08:36:14 +04:00
|
|
|
{
|
1997-01-11 13:58:12 +03:00
|
|
|
struct confargs *ca = aux;
|
1996-03-11 23:50:50 +03:00
|
|
|
struct ncr5380_softc *sc = (struct ncr5380_softc *) self;
|
1996-05-19 09:32:09 +04:00
|
|
|
int flags;
|
1996-03-11 23:50:50 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* For now we only support the DP8490.
|
|
|
|
*/
|
|
|
|
scsi_select_ctlr(DP8490);
|
|
|
|
|
1996-05-19 09:32:09 +04:00
|
|
|
/* Pull in config flags. */
|
1997-01-11 13:58:12 +03:00
|
|
|
flags = ca->ca_flags | ncr_default_options;
|
|
|
|
|
|
|
|
if (flags)
|
|
|
|
printf(": flags %d\n");
|
|
|
|
else
|
|
|
|
printf("\n");
|
1996-05-19 09:32:09 +04:00
|
|
|
|
1996-03-11 23:50:50 +03:00
|
|
|
/*
|
|
|
|
* Fill in the prototype scsi_link.
|
|
|
|
*/
|
1996-08-28 22:59:15 +04:00
|
|
|
sc->sc_link.channel = SCSI_CHANNEL_ONLY_ONE;
|
1996-03-11 23:50:50 +03:00
|
|
|
sc->sc_link.adapter_softc = sc;
|
|
|
|
sc->sc_link.adapter_target = 7;
|
|
|
|
sc->sc_link.adapter = &ncr_switch;
|
|
|
|
sc->sc_link.device = &ncr_dev;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize NCR5380 register addresses.
|
|
|
|
*/
|
|
|
|
sc->sci_r0 = NCR5380 + 0;
|
|
|
|
sc->sci_r1 = NCR5380 + 1;
|
|
|
|
sc->sci_r2 = NCR5380 + 2;
|
|
|
|
sc->sci_r3 = NCR5380 + 3;
|
|
|
|
sc->sci_r4 = NCR5380 + 4;
|
|
|
|
sc->sci_r5 = NCR5380 + 5;
|
|
|
|
sc->sci_r6 = NCR5380 + 6;
|
|
|
|
sc->sci_r7 = NCR5380 + 7;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We only have to set the sc_pio_in and sc_pio_out
|
|
|
|
* function pointers. The rest of the MD functions is
|
|
|
|
* not used and defaults to NULL.
|
|
|
|
*/
|
|
|
|
sc->sc_pio_in = ncr_pdma_in;
|
|
|
|
sc->sc_pio_out = ncr_pdma_out;
|
|
|
|
|
|
|
|
/*
|
1996-05-19 09:32:09 +04:00
|
|
|
* Copy options from cf_flags to sc_flags and sc_parity_disable.
|
1996-03-11 23:50:50 +03:00
|
|
|
*/
|
1996-05-19 09:32:09 +04:00
|
|
|
sc->sc_flags = ((flags & NCR_DISABLE_RESELECT) ?
|
|
|
|
0 : NCR5380_PERMIT_RESELECT) |
|
|
|
|
((flags & NCR_DISABLE_INTERRUPTS) ?
|
|
|
|
NCR5380_FORCE_POLLING : 0);
|
|
|
|
sc->sc_parity_disable = flags >> 8;
|
1996-03-11 23:50:50 +03:00
|
|
|
|
|
|
|
intr_establish(IR_SCSI1, ncr_intr, (void *)sc, sc->sc_dev.dv_xname,
|
1996-12-23 11:37:04 +03:00
|
|
|
IPL_BIO, IPL_BIO, RISING_EDGE);
|
1996-03-11 23:50:50 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize the SCSI controller itself.
|
|
|
|
*/
|
|
|
|
ncr5380_init(sc);
|
|
|
|
ncr5380_reset_scsibus(sc);
|
1996-08-28 22:59:15 +04:00
|
|
|
config_found(self, &(sc->sc_link), scsiprint);
|
1996-03-11 23:50:50 +03:00
|
|
|
}
|
|
|
|
|
1996-10-09 11:29:58 +04:00
|
|
|
static void
|
1996-11-24 16:32:48 +03:00
|
|
|
ncr_intr(arg)
|
|
|
|
void *arg;
|
1996-03-11 23:50:50 +03:00
|
|
|
{
|
1996-12-23 11:37:04 +03:00
|
|
|
struct ncr5380_softc *sc = arg;
|
1996-03-11 23:50:50 +03:00
|
|
|
|
|
|
|
if (*sc->sci_csr & SCI_CSR_INT) {
|
|
|
|
if (ncr5380_intr(sc) == 0) {
|
1996-10-13 07:29:05 +04:00
|
|
|
printf("%s: ", sc->sc_dev.dv_xname);
|
1996-03-11 23:50:50 +03:00
|
|
|
if ((*sc->sci_bus_csr & ~SCI_BUS_RST) == 0)
|
1996-10-13 07:29:05 +04:00
|
|
|
printf("BUS RESET\n");
|
1996-03-11 23:50:50 +03:00
|
|
|
else
|
1996-10-13 07:29:05 +04:00
|
|
|
printf("spurious interrupt\n");
|
1996-03-11 23:50:50 +03:00
|
|
|
SCI_CLR_INTR(sc);
|
|
|
|
}
|
1995-06-09 08:36:14 +04:00
|
|
|
}
|
1994-02-23 01:54:42 +03:00
|
|
|
}
|
|
|
|
|
1995-06-09 08:36:14 +04:00
|
|
|
/*
|
1995-08-25 11:30:33 +04:00
|
|
|
* PDMA stuff
|
1995-06-09 08:36:14 +04:00
|
|
|
*/
|
1994-02-23 01:54:42 +03:00
|
|
|
|
1995-06-09 08:36:14 +04:00
|
|
|
#define byte_data ((volatile u_char *)pdma)
|
|
|
|
#define word_data ((volatile u_short *)pdma)
|
|
|
|
#define long_data ((volatile u_long *)pdma)
|
1995-06-27 03:13:54 +04:00
|
|
|
|
1995-06-09 08:36:14 +04:00
|
|
|
#define W1(n) *byte_data = *(data + n)
|
|
|
|
#define W2(n) *word_data = *((u_short *)data + n)
|
|
|
|
#define W4(n) *long_data = *((u_long *)data + n)
|
1995-06-27 03:13:54 +04:00
|
|
|
#define R1(n) *(data + n) = *byte_data
|
1995-06-09 08:36:14 +04:00
|
|
|
#define R4(n) *((u_long *)data + n) = *long_data
|
1994-02-23 01:54:42 +03:00
|
|
|
|
1996-12-23 11:37:04 +03:00
|
|
|
#ifndef NCR_TSIZE_OUT
|
|
|
|
#define NCR_TSIZE_OUT 512
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef NCR_TSIZE_IN
|
|
|
|
#define NCR_TSIZE_IN 128
|
|
|
|
#endif
|
1996-03-11 23:50:50 +03:00
|
|
|
|
|
|
|
#define TIMEOUT 1000000
|
|
|
|
|
|
|
|
static __inline int
|
|
|
|
ncr_ready(sc)
|
|
|
|
struct ncr5380_softc *sc;
|
|
|
|
{
|
1996-12-23 11:37:04 +03:00
|
|
|
int i;
|
1996-03-11 23:50:50 +03:00
|
|
|
|
|
|
|
for (i = TIMEOUT; i > 0; i--) {
|
|
|
|
if ((*sc->sci_csr & (SCI_CSR_DREQ | SCI_CSR_PHASE_MATCH)) ==
|
|
|
|
(SCI_CSR_DREQ | SCI_CSR_PHASE_MATCH))
|
|
|
|
return(1);
|
|
|
|
|
|
|
|
if ((*sc->sci_csr & SCI_CSR_PHASE_MATCH) == 0 ||
|
|
|
|
SCI_BUSY(sc) == 0)
|
|
|
|
return(0);
|
|
|
|
}
|
1996-10-13 07:29:05 +04:00
|
|
|
printf("%s: ready timeout\n", sc->sc_dev.dv_xname);
|
1996-03-11 23:50:50 +03:00
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
1995-09-26 23:15:57 +03:00
|
|
|
static int
|
1996-03-11 23:50:50 +03:00
|
|
|
ncr_pdma_in(sc, phase, datalen, data)
|
|
|
|
struct ncr5380_softc *sc;
|
|
|
|
int phase, datalen;
|
1995-08-25 11:30:33 +04:00
|
|
|
u_char *data;
|
1994-02-23 01:54:42 +03:00
|
|
|
{
|
1996-12-23 11:37:04 +03:00
|
|
|
volatile u_char *pdma = PDMA_ADDRESS;
|
|
|
|
int resid, s;
|
1996-03-11 23:50:50 +03:00
|
|
|
|
1996-10-09 11:29:58 +04:00
|
|
|
s = splbio();
|
1996-03-11 23:50:50 +03:00
|
|
|
*sc->sci_mode |= SCI_MODE_DMA;
|
|
|
|
*sc->sci_irecv = 0;
|
1994-02-23 01:54:42 +03:00
|
|
|
|
1996-12-23 11:37:04 +03:00
|
|
|
for (resid = datalen; resid >= NCR_TSIZE_IN; resid -= NCR_TSIZE_IN) {
|
1996-03-11 23:50:50 +03:00
|
|
|
if (ncr_ready(sc) == 0) {
|
1996-12-23 11:37:04 +03:00
|
|
|
goto interrupt;
|
1996-03-11 23:50:50 +03:00
|
|
|
}
|
|
|
|
di();
|
1996-12-23 11:37:04 +03:00
|
|
|
movsd((u_char *)pdma, data, NCR_TSIZE_IN / 4);
|
1996-03-11 23:50:50 +03:00
|
|
|
ei();
|
1995-06-09 08:36:14 +04:00
|
|
|
}
|
1996-03-11 23:50:50 +03:00
|
|
|
|
1996-12-23 11:37:04 +03:00
|
|
|
if (resid) {
|
|
|
|
int t;
|
|
|
|
if (ncr_ready(sc) == 0) {
|
|
|
|
goto interrupt;
|
1995-06-09 08:36:14 +04:00
|
|
|
}
|
1996-12-23 11:37:04 +03:00
|
|
|
t = resid / sizeof(int);
|
|
|
|
di();
|
|
|
|
movsd((u_char *)pdma, data, t);
|
|
|
|
t *= sizeof(int);
|
|
|
|
resid -= t;
|
|
|
|
|
|
|
|
movsb((u_char *)pdma, data, resid);
|
1996-03-11 23:50:50 +03:00
|
|
|
ei();
|
1996-12-23 11:37:04 +03:00
|
|
|
resid = 0;
|
1996-03-11 23:50:50 +03:00
|
|
|
}
|
1996-12-23 11:37:04 +03:00
|
|
|
interrupt:
|
1996-03-11 23:50:50 +03:00
|
|
|
SCI_CLR_INTR(sc);
|
|
|
|
*sc->sci_mode &= ~SCI_MODE_DMA;
|
1996-10-09 11:29:58 +04:00
|
|
|
splx(s);
|
1996-03-11 23:50:50 +03:00
|
|
|
return(datalen - resid);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
ncr_pdma_out(sc, phase, datalen, data)
|
|
|
|
struct ncr5380_softc *sc;
|
|
|
|
int phase, datalen;
|
1996-12-23 11:37:04 +03:00
|
|
|
u_char *data;
|
1996-03-11 23:50:50 +03:00
|
|
|
{
|
1996-12-23 11:37:04 +03:00
|
|
|
volatile u_char *pdma = PDMA_ADDRESS;
|
|
|
|
int i, s, resid, ready = 1;
|
|
|
|
u_char icmd;
|
1996-03-11 23:50:50 +03:00
|
|
|
|
1996-10-09 11:29:58 +04:00
|
|
|
s = splbio();
|
1996-03-11 23:50:50 +03:00
|
|
|
icmd = *(sc->sci_icmd) & SCI_ICMD_RMASK;
|
|
|
|
*sc->sci_icmd = icmd | SCI_ICMD_DATA;
|
|
|
|
*sc->sci_mode |= SCI_MODE_DMA;
|
|
|
|
*sc->sci_dma_send = 0;
|
|
|
|
|
|
|
|
resid = datalen;
|
1996-12-23 11:37:04 +03:00
|
|
|
if (ncr_ready(sc) == 0) {
|
|
|
|
goto interrupt;
|
|
|
|
}
|
|
|
|
if (resid > NCR_TSIZE_OUT) {
|
|
|
|
/* Because of the chips DMA prefetch, phase changes
|
|
|
|
* etc, won't be detected until we have written at
|
|
|
|
* least one byte more. We pre-write 4 bytes so
|
|
|
|
* subsequent transfers will be aligned to a 4 byte
|
|
|
|
* boundary. Assuming disconects will only occur on
|
|
|
|
* block boundaries, we then correct for the pre-write
|
|
|
|
* when and if we get a phase change. If the chip had
|
|
|
|
* DMA byte counting hardware, the assumption would not
|
|
|
|
* be necessary.
|
1996-03-11 23:50:50 +03:00
|
|
|
*/
|
1996-12-23 11:37:04 +03:00
|
|
|
W4(0);
|
1996-03-11 23:50:50 +03:00
|
|
|
data += 4;
|
1996-12-23 11:37:04 +03:00
|
|
|
resid -= 4;
|
|
|
|
|
|
|
|
for (; resid >= NCR_TSIZE_OUT; resid -= NCR_TSIZE_OUT) {
|
|
|
|
if (ncr_ready(sc) == 0) {
|
|
|
|
resid += 4; /* Overshot */
|
|
|
|
goto interrupt;
|
1995-06-09 08:36:14 +04:00
|
|
|
}
|
1996-12-23 11:37:04 +03:00
|
|
|
movsd(data, (u_char *)pdma, NCR_TSIZE_OUT / 4);
|
|
|
|
}
|
|
|
|
if (ncr_ready(sc) == 0) {
|
|
|
|
resid += 4; /* Overshot */
|
|
|
|
goto interrupt;
|
1995-06-09 08:36:14 +04:00
|
|
|
}
|
|
|
|
}
|
1994-02-23 01:54:42 +03:00
|
|
|
|
1996-12-23 11:37:04 +03:00
|
|
|
if (resid) {
|
|
|
|
int t;
|
|
|
|
t = resid / sizeof(int);
|
|
|
|
movsd(data, (u_char *)pdma, t);
|
|
|
|
t *= sizeof(int);
|
|
|
|
resid -= t;
|
|
|
|
|
|
|
|
movsb(data, (u_char *)pdma, resid);
|
|
|
|
resid = 0;
|
|
|
|
}
|
1996-03-11 23:50:50 +03:00
|
|
|
for (i = TIMEOUT; i > 0; i--) {
|
|
|
|
if ((*sc->sci_csr & (SCI_CSR_DREQ|SCI_CSR_PHASE_MATCH))
|
|
|
|
!= SCI_CSR_DREQ)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (i != 0)
|
|
|
|
*byte_data = 0;
|
1995-06-09 08:36:14 +04:00
|
|
|
else
|
1996-10-13 07:29:05 +04:00
|
|
|
printf("%s: timeout waiting for final SCI_DSR_DREQ.\n",
|
1996-03-11 23:50:50 +03:00
|
|
|
sc->sc_dev.dv_xname);
|
1995-08-25 11:30:33 +04:00
|
|
|
|
1996-12-23 11:37:04 +03:00
|
|
|
interrupt:
|
1996-03-11 23:50:50 +03:00
|
|
|
SCI_CLR_INTR(sc);
|
|
|
|
*sc->sci_mode &= ~SCI_MODE_DMA;
|
|
|
|
*sc->sci_icmd = icmd;
|
1996-10-09 11:29:58 +04:00
|
|
|
splx(s);
|
1996-03-11 23:50:50 +03:00
|
|
|
return(datalen - resid);
|
|
|
|
}
|
1996-12-23 11:37:04 +03:00
|
|
|
|