2009-09-19 15:53:42 +04:00
|
|
|
/* $NetBSD: qec.c,v 1.50 2009/09/19 11:53:42 tsutsui Exp $ */
|
1998-07-27 23:26:32 +04:00
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Paul Kranenburg.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, 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 (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2001-11-13 09:54:32 +03:00
|
|
|
#include <sys/cdefs.h>
|
2009-09-19 15:53:42 +04:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: qec.c,v 1.50 2009/09/19 11:53:42 tsutsui Exp $");
|
2001-11-13 09:54:32 +03:00
|
|
|
|
1998-07-27 23:26:32 +04:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
#include <sys/errno.h>
|
|
|
|
#include <sys/device.h>
|
|
|
|
#include <sys/malloc.h>
|
|
|
|
|
2007-10-19 15:59:34 +04:00
|
|
|
#include <sys/bus.h>
|
|
|
|
#include <sys/intr.h>
|
1998-07-28 04:44:39 +04:00
|
|
|
#include <machine/autoconf.h>
|
1998-07-27 23:26:32 +04:00
|
|
|
|
|
|
|
#include <dev/sbus/sbusvar.h>
|
|
|
|
#include <dev/sbus/qecreg.h>
|
|
|
|
#include <dev/sbus/qecvar.h>
|
|
|
|
|
2005-02-04 05:10:35 +03:00
|
|
|
static int qecprint(void *, const char *);
|
2009-05-12 18:38:26 +04:00
|
|
|
static int qecmatch(device_t, cfdata_t, void *);
|
|
|
|
static void qecattach(device_t, device_t, void *);
|
2005-02-04 05:10:35 +03:00
|
|
|
void qec_init(struct qec_softc *);
|
1998-07-27 23:26:32 +04:00
|
|
|
|
2005-02-04 05:10:35 +03:00
|
|
|
static int qec_bus_map(
|
2004-06-28 14:30:48 +04:00
|
|
|
bus_space_tag_t,
|
|
|
|
bus_addr_t, /*coded slot+offset*/
|
|
|
|
bus_size_t, /*size*/
|
|
|
|
int, /*flags*/
|
|
|
|
vaddr_t, /*preferred virtual address */
|
2005-02-04 05:10:35 +03:00
|
|
|
bus_space_handle_t *);
|
|
|
|
static void *qec_intr_establish(
|
1999-01-17 23:47:50 +03:00
|
|
|
bus_space_tag_t,
|
2000-07-10 00:57:41 +04:00
|
|
|
int, /*bus interrupt priority*/
|
|
|
|
int, /*`device class' interrupt level*/
|
2005-02-04 05:10:35 +03:00
|
|
|
int (*)(void *), /*handler*/
|
2002-12-10 15:21:02 +03:00
|
|
|
void *, /*arg*/
|
2005-02-04 05:10:35 +03:00
|
|
|
void (*)(void)); /*optional fast trap handler*/
|
1998-07-27 23:26:32 +04:00
|
|
|
|
2009-09-19 08:48:18 +04:00
|
|
|
CFATTACH_DECL_NEW(qec, sizeof(struct qec_softc),
|
2002-10-02 20:51:16 +04:00
|
|
|
qecmatch, qecattach, NULL, NULL);
|
1998-07-27 23:26:32 +04:00
|
|
|
|
|
|
|
int
|
2009-03-14 18:35:58 +03:00
|
|
|
qecprint(void *aux, const char *busname)
|
1998-07-27 23:26:32 +04:00
|
|
|
{
|
|
|
|
struct sbus_attach_args *sa = aux;
|
|
|
|
bus_space_tag_t t = sa->sa_bustag;
|
|
|
|
struct qec_softc *sc = t->cookie;
|
|
|
|
|
|
|
|
sa->sa_bustag = sc->sc_bustag; /* XXX */
|
|
|
|
sbus_print(aux, busname); /* XXX */
|
|
|
|
sa->sa_bustag = t; /* XXX */
|
|
|
|
return (UNCONF);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2009-05-12 18:38:26 +04:00
|
|
|
qecmatch(device_t parent, cfdata_t cf, void *aux)
|
1998-07-27 23:26:32 +04:00
|
|
|
{
|
|
|
|
struct sbus_attach_args *sa = aux;
|
|
|
|
|
2002-09-27 06:24:06 +04:00
|
|
|
return (strcmp(cf->cf_name, sa->sa_name) == 0);
|
1998-07-27 23:26:32 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Attach all the sub-devices we can find
|
|
|
|
*/
|
|
|
|
void
|
2009-05-12 18:38:26 +04:00
|
|
|
qecattach(device_t parent, device_t self, void *aux)
|
1998-07-27 23:26:32 +04:00
|
|
|
{
|
|
|
|
struct sbus_attach_args *sa = aux;
|
2009-09-18 16:23:16 +04:00
|
|
|
struct qec_softc *sc = device_private(self);
|
2009-05-17 04:28:35 +04:00
|
|
|
struct sbus_softc *sbsc = device_private(parent);
|
1998-07-27 23:26:32 +04:00
|
|
|
int node;
|
|
|
|
int sbusburst;
|
|
|
|
bus_space_tag_t sbt;
|
|
|
|
bus_space_handle_t bh;
|
|
|
|
int error;
|
|
|
|
|
2009-09-19 08:48:18 +04:00
|
|
|
sc->sc_dev = self;
|
1998-07-27 23:26:32 +04:00
|
|
|
sc->sc_bustag = sa->sa_bustag;
|
|
|
|
sc->sc_dmatag = sa->sa_dmatag;
|
|
|
|
node = sa->sa_node;
|
|
|
|
|
1998-08-31 01:25:30 +04:00
|
|
|
if (sa->sa_nreg < 2) {
|
|
|
|
printf("%s: only %d register sets\n",
|
2008-04-05 22:35:31 +04:00
|
|
|
device_xname(self), sa->sa_nreg);
|
1998-07-27 23:26:32 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sbus_bus_map(sa->sa_bustag,
|
2002-08-23 06:53:10 +04:00
|
|
|
sa->sa_reg[0].oa_space,
|
|
|
|
sa->sa_reg[0].oa_base,
|
|
|
|
sa->sa_reg[0].oa_size,
|
2002-03-20 20:59:16 +03:00
|
|
|
0, &sc->sc_regs) != 0) {
|
2008-04-05 22:35:31 +04:00
|
|
|
aprint_error_dev(self, "attach: cannot map registers\n");
|
1998-07-27 23:26:32 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This device's "register space 1" is just a buffer where the
|
|
|
|
* Lance ring-buffers can be stored. Note the buffer's location
|
|
|
|
* and size, so the child driver can pick them up.
|
|
|
|
*/
|
|
|
|
if (sbus_bus_map(sa->sa_bustag,
|
2002-08-23 06:53:10 +04:00
|
|
|
sa->sa_reg[1].oa_space,
|
|
|
|
sa->sa_reg[1].oa_base,
|
|
|
|
sa->sa_reg[1].oa_size,
|
2002-03-11 19:00:55 +03:00
|
|
|
BUS_SPACE_MAP_LINEAR, &bh) != 0) {
|
2008-04-05 22:35:31 +04:00
|
|
|
aprint_error_dev(self, "attach: cannot map registers\n");
|
1998-07-27 23:26:32 +04:00
|
|
|
return;
|
|
|
|
}
|
2007-03-04 08:59:00 +03:00
|
|
|
sc->sc_buffer = (void *)bus_space_vaddr(sa->sa_bustag, bh);
|
2002-08-23 06:53:10 +04:00
|
|
|
sc->sc_bufsiz = (bus_size_t)sa->sa_reg[1].oa_size;
|
1998-07-27 23:26:32 +04:00
|
|
|
|
1999-01-16 15:46:08 +03:00
|
|
|
/* Get number of on-board channels */
|
2004-03-17 20:04:58 +03:00
|
|
|
sc->sc_nchannels = prom_getpropint(node, "#channels", -1);
|
1999-01-16 15:46:08 +03:00
|
|
|
if (sc->sc_nchannels == -1) {
|
|
|
|
printf(": no channels\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1998-07-27 23:26:32 +04:00
|
|
|
/*
|
|
|
|
* Get transfer burst size from PROM
|
|
|
|
*/
|
2009-05-17 04:28:35 +04:00
|
|
|
sbusburst = sbsc->sc_burst;
|
1998-07-27 23:26:32 +04:00
|
|
|
if (sbusburst == 0)
|
|
|
|
sbusburst = SBUS_BURST_32 - 1; /* 1->16 */
|
|
|
|
|
2004-03-17 20:04:58 +03:00
|
|
|
sc->sc_burst = prom_getpropint(node, "burst-sizes", -1);
|
1998-07-27 23:26:32 +04:00
|
|
|
if (sc->sc_burst == -1)
|
|
|
|
/* take SBus burst sizes */
|
|
|
|
sc->sc_burst = sbusburst;
|
|
|
|
|
|
|
|
/* Clamp at parent's burst sizes */
|
|
|
|
sc->sc_burst &= sbusburst;
|
|
|
|
|
2004-06-27 22:28:26 +04:00
|
|
|
/* Allocate a bus tag */
|
2004-07-01 01:16:38 +04:00
|
|
|
sbt = bus_space_tag_alloc(sc->sc_bustag, sc);
|
2004-06-27 22:28:26 +04:00
|
|
|
if (sbt == NULL) {
|
2008-04-05 22:35:31 +04:00
|
|
|
aprint_error_dev(self, "attach: out of memory\n");
|
2004-06-27 22:28:26 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-06-28 14:30:48 +04:00
|
|
|
sbt->sparc_bus_map = qec_bus_map;
|
2004-06-27 22:28:26 +04:00
|
|
|
sbt->sparc_intr_establish = qec_intr_establish;
|
|
|
|
|
1998-07-27 23:26:32 +04:00
|
|
|
/*
|
|
|
|
* Collect address translations from the OBP.
|
|
|
|
*/
|
2004-03-17 20:04:58 +03:00
|
|
|
error = prom_getprop(node, "ranges", sizeof(struct openprom_range),
|
2004-06-27 22:28:26 +04:00
|
|
|
&sbt->nranges, &sbt->ranges);
|
1998-07-27 23:26:32 +04:00
|
|
|
switch (error) {
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
case ENOENT:
|
|
|
|
default:
|
2008-04-05 22:35:31 +04:00
|
|
|
panic("%s: error getting ranges property", device_xname(self));
|
1998-07-27 23:26:32 +04:00
|
|
|
}
|
|
|
|
|
1999-01-17 23:47:50 +03:00
|
|
|
/*
|
|
|
|
* Save interrupt information for use in our qec_intr_establish()
|
|
|
|
* function below. Apparently, the intr level for the quad
|
2001-12-04 20:56:30 +03:00
|
|
|
* ethernet board (qe) is stored in the QEC node rather than
|
1999-01-17 23:47:50 +03:00
|
|
|
* separately in each of the QE nodes.
|
|
|
|
*
|
|
|
|
* XXX - qe.c should call bus_intr_establish() with `level = 0'..
|
|
|
|
* XXX - maybe we should have our own attach args for all that.
|
|
|
|
*/
|
|
|
|
sc->sc_intr = sa->sa_intr;
|
1998-07-27 23:26:32 +04:00
|
|
|
|
|
|
|
printf(": %dK memory\n", sc->sc_bufsiz / 1024);
|
|
|
|
|
1999-01-16 15:46:08 +03:00
|
|
|
qec_init(sc);
|
|
|
|
|
1998-07-27 23:26:32 +04:00
|
|
|
/* search through children */
|
|
|
|
for (node = firstchild(node); node; node = nextsibling(node)) {
|
2005-05-31 02:17:47 +04:00
|
|
|
struct sbus_attach_args sax;
|
2009-05-17 04:28:35 +04:00
|
|
|
sbus_setup_attach_args(sbsc,
|
2005-05-31 02:17:47 +04:00
|
|
|
sbt, sc->sc_dmatag, node, &sax);
|
2009-09-18 16:23:16 +04:00
|
|
|
(void)config_found(self, (void *)&sax, qecprint);
|
2005-05-31 02:17:47 +04:00
|
|
|
sbus_destroy_attach_args(&sax);
|
1998-07-27 23:26:32 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-28 14:30:48 +04:00
|
|
|
int
|
2009-09-18 16:59:47 +04:00
|
|
|
qec_bus_map(bus_space_tag_t t, bus_addr_t ba, bus_size_t size, int flags,
|
|
|
|
vaddr_t va, bus_space_handle_t *hp)
|
2009-03-15 00:04:01 +03:00
|
|
|
/* va: Ignored */
|
2004-06-28 14:30:48 +04:00
|
|
|
{
|
|
|
|
int error;
|
|
|
|
|
|
|
|
if ((error = bus_space_translate_address_generic(
|
|
|
|
t->ranges, t->nranges, &ba)) != 0)
|
|
|
|
return (error);
|
|
|
|
|
|
|
|
return (bus_space_map(t->parent, ba, size, flags, hp));
|
|
|
|
}
|
|
|
|
|
1999-01-17 23:47:50 +03:00
|
|
|
void *
|
2009-09-18 16:59:47 +04:00
|
|
|
qec_intr_establish(bus_space_tag_t t, int pri, int level,
|
|
|
|
int (*handler)(void *), void *arg, void (*fastvec)(void))
|
|
|
|
/* (*fastvec)(void): ignored */
|
1999-01-17 23:47:50 +03:00
|
|
|
{
|
|
|
|
struct qec_softc *sc = t->cookie;
|
|
|
|
|
2000-07-10 00:57:41 +04:00
|
|
|
if (pri == 0) {
|
1999-01-17 23:47:50 +03:00
|
|
|
/*
|
2000-07-10 00:57:41 +04:00
|
|
|
* qe.c calls bus_intr_establish() with `pri == 0'
|
1999-01-17 23:47:50 +03:00
|
|
|
* XXX - see also comment in qec_attach().
|
|
|
|
*/
|
|
|
|
if (sc->sc_intr == NULL) {
|
|
|
|
printf("%s: warning: no interrupts\n",
|
2009-09-19 08:48:18 +04:00
|
|
|
device_xname(sc->sc_dev));
|
1999-01-17 23:47:50 +03:00
|
|
|
return (NULL);
|
|
|
|
}
|
2002-08-23 06:53:10 +04:00
|
|
|
pri = sc->sc_intr->oi_pri;
|
1999-01-17 23:47:50 +03:00
|
|
|
}
|
|
|
|
|
2002-12-10 16:44:47 +03:00
|
|
|
return (bus_intr_establish(t->parent, pri, level, handler, arg));
|
1999-01-17 23:47:50 +03:00
|
|
|
}
|
|
|
|
|
1999-01-16 15:46:08 +03:00
|
|
|
void
|
2009-03-14 18:35:58 +03:00
|
|
|
qec_init(struct qec_softc *sc)
|
1999-01-16 15:46:08 +03:00
|
|
|
{
|
|
|
|
bus_space_tag_t t = sc->sc_bustag;
|
|
|
|
bus_space_handle_t qr = sc->sc_regs;
|
2009-09-19 15:53:42 +04:00
|
|
|
uint32_t v, burst = 0, psize;
|
1999-06-24 23:56:51 +04:00
|
|
|
int i;
|
|
|
|
|
|
|
|
/* First, reset the controller */
|
|
|
|
bus_space_write_4(t, qr, QEC_QRI_CTRL, QEC_CTRL_RESET);
|
|
|
|
for (i = 0; i < 1000; i++) {
|
|
|
|
DELAY(100);
|
|
|
|
v = bus_space_read_4(t, qr, QEC_QRI_CTRL);
|
|
|
|
if ((v & QEC_CTRL_RESET) == 0)
|
|
|
|
break;
|
|
|
|
}
|
1999-01-16 15:46:08 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Cut available buffer size into receive and transmit buffers.
|
|
|
|
* XXX - should probably be done in be & qe driver...
|
|
|
|
*/
|
|
|
|
v = sc->sc_msize = sc->sc_bufsiz / sc->sc_nchannels;
|
|
|
|
bus_space_write_4(t, qr, QEC_QRI_MSIZE, v);
|
|
|
|
|
|
|
|
v = sc->sc_rsize = sc->sc_bufsiz / (sc->sc_nchannels * 2);
|
|
|
|
bus_space_write_4(t, qr, QEC_QRI_RSIZE, v);
|
|
|
|
bus_space_write_4(t, qr, QEC_QRI_TSIZE, v);
|
|
|
|
|
1999-06-24 23:56:51 +04:00
|
|
|
psize = sc->sc_nchannels == 1 ? QEC_PSIZE_2048 : 0;
|
|
|
|
bus_space_write_4(t, qr, QEC_QRI_PSIZE, psize);
|
1999-01-16 15:46:08 +03:00
|
|
|
|
|
|
|
if (sc->sc_burst & SBUS_BURST_64)
|
|
|
|
burst = QEC_CTRL_B64;
|
|
|
|
else if (sc->sc_burst & SBUS_BURST_32)
|
|
|
|
burst = QEC_CTRL_B32;
|
|
|
|
else
|
|
|
|
burst = QEC_CTRL_B16;
|
|
|
|
|
|
|
|
v = bus_space_read_4(t, qr, QEC_QRI_CTRL);
|
|
|
|
v = (v & QEC_CTRL_MODEMASK) | burst;
|
|
|
|
bus_space_write_4(t, qr, QEC_QRI_CTRL, v);
|
|
|
|
}
|
1999-01-17 23:47:50 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Common routine to initialize the QEC packet ring buffer.
|
|
|
|
* Called from be & qe drivers.
|
|
|
|
*/
|
|
|
|
void
|
2009-03-14 18:35:58 +03:00
|
|
|
qec_meminit(struct qec_ring *qr, unsigned int pktbufsz)
|
1999-01-17 23:47:50 +03:00
|
|
|
{
|
|
|
|
bus_addr_t txbufdma, rxbufdma;
|
|
|
|
bus_addr_t dma;
|
2009-09-18 18:09:42 +04:00
|
|
|
uint8_t *p;
|
1999-01-17 23:47:50 +03:00
|
|
|
unsigned int ntbuf, nrbuf, i;
|
|
|
|
|
2009-09-18 18:09:42 +04:00
|
|
|
p = qr->rb_membase;
|
1999-01-17 23:47:50 +03:00
|
|
|
dma = qr->rb_dmabase;
|
|
|
|
|
|
|
|
ntbuf = qr->rb_ntbuf;
|
|
|
|
nrbuf = qr->rb_nrbuf;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Allocate transmit descriptors
|
|
|
|
*/
|
|
|
|
qr->rb_txd = (struct qec_xd *)p;
|
|
|
|
qr->rb_txddma = dma;
|
2009-09-18 18:09:42 +04:00
|
|
|
p += QEC_XD_RING_MAXSIZE * sizeof(struct qec_xd);
|
1999-01-17 23:47:50 +03:00
|
|
|
dma += QEC_XD_RING_MAXSIZE * sizeof(struct qec_xd);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Allocate receive descriptors
|
|
|
|
*/
|
|
|
|
qr->rb_rxd = (struct qec_xd *)p;
|
|
|
|
qr->rb_rxddma = dma;
|
2009-09-18 18:09:42 +04:00
|
|
|
p += QEC_XD_RING_MAXSIZE * sizeof(struct qec_xd);
|
1999-01-17 23:47:50 +03:00
|
|
|
dma += QEC_XD_RING_MAXSIZE * sizeof(struct qec_xd);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Allocate transmit buffers
|
|
|
|
*/
|
|
|
|
qr->rb_txbuf = p;
|
|
|
|
txbufdma = dma;
|
2009-09-18 18:09:42 +04:00
|
|
|
p += ntbuf * pktbufsz;
|
1999-01-17 23:47:50 +03:00
|
|
|
dma += ntbuf * pktbufsz;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Allocate receive buffers
|
|
|
|
*/
|
|
|
|
qr->rb_rxbuf = p;
|
|
|
|
rxbufdma = dma;
|
2009-09-18 18:09:42 +04:00
|
|
|
p += nrbuf * pktbufsz;
|
1999-01-17 23:47:50 +03:00
|
|
|
dma += nrbuf * pktbufsz;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize transmit buffer descriptors
|
|
|
|
*/
|
|
|
|
for (i = 0; i < QEC_XD_RING_MAXSIZE; i++) {
|
2009-09-19 15:53:42 +04:00
|
|
|
qr->rb_txd[i].xd_addr =
|
|
|
|
(uint32_t)(txbufdma + (i % ntbuf) * pktbufsz);
|
1999-01-17 23:47:50 +03:00
|
|
|
qr->rb_txd[i].xd_flags = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize receive buffer descriptors
|
|
|
|
*/
|
|
|
|
for (i = 0; i < QEC_XD_RING_MAXSIZE; i++) {
|
2009-09-19 15:53:42 +04:00
|
|
|
qr->rb_rxd[i].xd_addr =
|
|
|
|
(uint32_t)(rxbufdma + (i % nrbuf) * pktbufsz);
|
1999-01-17 23:47:50 +03:00
|
|
|
qr->rb_rxd[i].xd_flags = (i < nrbuf)
|
|
|
|
? QEC_XD_OWN | (pktbufsz & QEC_XD_LENGTH)
|
|
|
|
: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
qr->rb_tdhead = qr->rb_tdtail = 0;
|
|
|
|
qr->rb_td_nbusy = 0;
|
|
|
|
qr->rb_rdtail = 0;
|
|
|
|
}
|