Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/dev/pci partially resolve 1.6 pullup ticket #29 fro...



details:   https://anonhg.NetBSD.org/src/rev/176f7338d5a7
branches:  netbsd-1-6
changeset: 527543:176f7338d5a7
user:      perry <perry%NetBSD.org@localhost>
date:      Sun May 26 16:05:36 2002 +0000

description:
partially resolve 1.6 pullup ticket #29 from grant
pulls up revisions 1.23, 1.24
Original commit messages:

> Deal with the NBPG problem in a better way.

> NBPG is not constant on the sparc, so don't use CPP tricks.

Note that grant erroneously requested a pullup of only 1.24, which
would not apply cleanly. Normally I would have rejected the entire
request, but this is needed to make the sparc & sparc64 ports compile.

diffstat:

 sys/dev/pci/twe.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r 9167d944c483 -r 176f7338d5a7 sys/dev/pci/twe.c
--- a/sys/dev/pci/twe.c Sun May 26 03:57:26 2002 +0000
+++ b/sys/dev/pci/twe.c Sun May 26 16:05:36 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: twe.c,v 1.22 2002/05/18 20:59:20 ad Exp $      */
+/*     $NetBSD: twe.c,v 1.22.2.1 2002/05/26 16:05:36 perry Exp $       */
 
 /*-
  * Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: twe.c,v 1.22 2002/05/18 20:59:20 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: twe.c,v 1.22.2.1 2002/05/26 16:05:36 perry Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -186,6 +186,7 @@
        pcireg_t csr;
        const char *intrstr;
        int size, i, rv, rseg;
+       size_t max_segs, max_xfer;
        struct twe_param *dtp, *ctp;
        bus_dma_segment_t seg;
        struct twe_cmd *tc;
@@ -269,13 +270,15 @@
        ccb = malloc(sizeof(*ccb) * TWE_MAX_QUEUECNT, M_DEVBUF, M_NOWAIT);
        sc->sc_ccbs = ccb;
        tc = (struct twe_cmd *)sc->sc_cmds;
+       max_segs = twe_get_maxsegs();
+       max_xfer = twe_get_maxxfer(max_segs);
 
        for (i = 0; i < TWE_MAX_QUEUECNT; i++, tc++, ccb++) {
                ccb->ccb_cmd = tc;
                ccb->ccb_cmdid = i;
                ccb->ccb_flags = 0;
-               rv = bus_dmamap_create(sc->sc_dmat, TWE_MAX_XFER,
-                   TWE_MAX_SEGS, PAGE_SIZE, 0,
+               rv = bus_dmamap_create(sc->sc_dmat, max_xfer,
+                   max_segs, PAGE_SIZE, 0,
                    BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW,
                    &ccb->ccb_dmamap_xfer);
                if (rv != 0) {



Home | Main Index | Thread Index | Old Index