diff options
author | Hartmut Brandt <harti@FreeBSD.org> | 2003-07-10 13:55:09 +0000 |
---|---|---|
committer | Hartmut Brandt <harti@FreeBSD.org> | 2003-07-10 13:55:09 +0000 |
commit | 445b5e54cfed99e1b73466d3c26a7bf14a225109 (patch) | |
tree | 1c3d55b6d976500360e108536bcb716e20798aa1 /sys | |
parent | dda3614332a280c6a8403f2f157ab17012f0291a (diff) | |
download | src-445b5e54cfed99e1b73466d3c26a7bf14a225109.tar.gz src-445b5e54cfed99e1b73466d3c26a7bf14a225109.zip |
Use the default arguments for lockfunc and lockfuncarg in
bus_dma_tag_create. We need to be sure that our packets are
kept in-sequence (that's how ATM is supposed to work) and
therefor use BUS_DMA_NOWAIT in all calls to bus_dmamap_load.
For memory allocated with bus_dmamem_alloc the use of anything
other than NULL arguments for the locking is anyway bogus because
this memory never should need bouncing and hence the load should never
be defered.
Allow the receipt of OAM and RM cells on raw connections. Caveat: it seems
that RM cells are still processed by the hardware even when we open the
connection as UBR.
Notes
Notes:
svn path=/head/; revision=117382
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/hatm/if_hatm.c | 24 | ||||
-rw-r--r-- | sys/dev/hatm/if_hatm_intr.c | 4 | ||||
-rw-r--r-- | sys/dev/hatm/if_hatm_ioctl.c | 2 | ||||
-rw-r--r-- | sys/dev/hatm/if_hatm_rx.c | 3 | ||||
-rw-r--r-- | sys/dev/hatm/if_hatm_tx.c | 4 |
5 files changed, 23 insertions, 14 deletions
diff --git a/sys/dev/hatm/if_hatm.c b/sys/dev/hatm/if_hatm.c index 30835b556fb5..34f17276e9f2 100644 --- a/sys/dev/hatm/if_hatm.c +++ b/sys/dev/hatm/if_hatm.c @@ -215,7 +215,7 @@ hatm_alloc_dmamem(struct hatm_softc *sc, const char *what, struct dmamem *mem) BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, mem->size, 1, BUS_SPACE_MAXSIZE_32BIT, BUS_DMA_ALLOCNOW, - busdma_lock_mutex, &Giant, &mem->tag); + NULL, NULL, &mem->tag); if (error) { if_printf(&sc->ifatm.ifnet, "DMA tag create (%s)\n", what); return (error); @@ -231,7 +231,7 @@ hatm_alloc_dmamem(struct hatm_softc *sc, const char *what, struct dmamem *mem) } error = bus_dmamap_load(mem->tag, mem->map, mem->base, mem->size, - dmaload_helper, &mem->paddr, 0); + dmaload_helper, &mem->paddr, BUS_DMA_NOWAIT); if (error) { if_printf(&sc->ifatm.ifnet, "DMA map load (%s): %d\n", what, error); @@ -1714,7 +1714,7 @@ hatm_attach(device_t dev) NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 1, BUS_SPACE_MAXSIZE_32BIT, 0, - busdma_lock_mutex, &Giant, &sc->parent_tag)) { + NULL, NULL, &sc->parent_tag)) { device_printf(dev, "could not allocate DMA tag\n"); error = ENOMEM; goto failed; @@ -1725,7 +1725,7 @@ hatm_attach(device_t dev) NULL, NULL, MBUF_ALLOC_SIZE, 1, MBUF_ALLOC_SIZE, 0, - busdma_lock_mutex, &Giant, &sc->mbuf_tag)) { + NULL, NULL, &sc->mbuf_tag)) { device_printf(dev, "could not allocate mbuf DMA tag\n"); error = ENOMEM; goto failed; @@ -1741,7 +1741,7 @@ hatm_attach(device_t dev) if (bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, HE_MAX_PDU, 3 * HE_CONFIG_MAX_TPD_PER_PACKET, HE_MAX_PDU, 0, - busdma_lock_mutex, &Giant, &sc->tx_tag)) { + NULL, NULL, &sc->tx_tag)) { device_printf(dev, "could not allocate TX tag\n"); error = ENOMEM; goto failed; @@ -2143,9 +2143,17 @@ hatm_initialize(struct hatm_softc *sc) WRITE4(sc, HE_REGO_TXAAL5_PROTO, 0); - WRITE4(sc, HE_REGO_RHCONFIG, - HE_REGM_RHCONFIG_PHYENB | - ((sc->he622 ? 0x41 : 0x31) << HE_REGS_RHCONFIG_PTMR_PRE)); + if (sc->rbp_s1.size != 0) { + WRITE4(sc, HE_REGO_RHCONFIG, + HE_REGM_RHCONFIG_PHYENB | + ((sc->he622 ? 0x41 : 0x31) << HE_REGS_RHCONFIG_PTMR_PRE) | + (1 << HE_REGS_RHCONFIG_OAM_GID)); + } else { + WRITE4(sc, HE_REGO_RHCONFIG, + HE_REGM_RHCONFIG_PHYENB | + ((sc->he622 ? 0x41 : 0x31) << HE_REGS_RHCONFIG_PTMR_PRE) | + (0 << HE_REGS_RHCONFIG_OAM_GID)); + } BARRIER_W(sc); hatm_init_cm(sc); diff --git a/sys/dev/hatm/if_hatm_intr.c b/sys/dev/hatm/if_hatm_intr.c index 35edf0c16527..2d93e3bd2efb 100644 --- a/sys/dev/hatm/if_hatm_intr.c +++ b/sys/dev/hatm/if_hatm_intr.c @@ -150,7 +150,7 @@ hatm_mbuf_page_alloc(struct hatm_softc *sc, u_int group) return; } err = bus_dmamap_load(sc->mbuf_tag, pg->hdr.map, pg, MBUF_ALLOC_SIZE, - hatm_extbuf_helper, &pg->hdr.phys, 0); + hatm_extbuf_helper, &pg->hdr.phys, BUS_DMA_NOWAIT); if (err != 0) { if_printf(&sc->ifatm.ifnet, "%s -- mbuf mapping failed %d\n", __func__, err); @@ -342,7 +342,7 @@ he_intr_rbp(struct hatm_softc *sc, struct herbp *rbp, u_int large, if ((error = bus_dmamap_load(sc->mbuf_tag, sc->rmaps[sc->lbufs_next], m->m_data, rbp->bsize, hatm_mbuf_helper, - &rbp->rbp[rbp->tail].phys, 0)) != NULL) + &rbp->rbp[rbp->tail].phys, BUS_DMA_NOWAIT)) != NULL) panic("hatm: mbuf mapping failed %d", error); bus_dmamap_sync(sc->mbuf_tag, diff --git a/sys/dev/hatm/if_hatm_ioctl.c b/sys/dev/hatm/if_hatm_ioctl.c index 479500bd5160..633aee31b30e 100644 --- a/sys/dev/hatm/if_hatm_ioctl.c +++ b/sys/dev/hatm/if_hatm_ioctl.c @@ -222,7 +222,7 @@ hatm_open_vcc(struct hatm_softc *sc, struct atmio_openvcc *arg) if (!(vcc->param.flags & ATMIO_FLAG_NG) || (vcc->param.flags & ATMIO_FLAG_PVC)) atm_message(&sc->ifatm.ifnet, ATM_MSG_VCC_CHANGED, - (1 << 24) | (arg->vpi << 16) | arg->vci); + (1 << 24) | (arg->param.vpi << 16) | arg->param.vci); #endif /* don't free below */ diff --git a/sys/dev/hatm/if_hatm_rx.c b/sys/dev/hatm/if_hatm_rx.c index 357a06f78373..841ab642cefe 100644 --- a/sys/dev/hatm/if_hatm_rx.c +++ b/sys/dev/hatm/if_hatm_rx.c @@ -287,7 +287,8 @@ hatm_rx_vcc_open(struct hatm_softc *sc, u_int cid) rsr1 |= (1 << HE_REGS_RSR1_GROUP); rsr4 |= (1 << HE_REGS_RSR4_GROUP); } - rsr0 |= HE_REGM_RSR0_AAL_RAW; + rsr0 |= HE_REGM_RSR0_AAL_RAW | HE_REGM_RSR0_PTI7 | + HE_REGM_RSR0_RM | HE_REGM_RSR0_F5OAM; } rsr0 |= HE_REGM_RSR0_OPEN; diff --git a/sys/dev/hatm/if_hatm_tx.c b/sys/dev/hatm/if_hatm_tx.c index ba8a8e8c2b94..14c1e8a32b80 100644 --- a/sys/dev/hatm/if_hatm_tx.c +++ b/sys/dev/hatm/if_hatm_tx.c @@ -422,7 +422,7 @@ hatm_start(struct ifnet *ifp) arg.mbuf = m; error = bus_dmamap_load_mbuf(sc->tx_tag, tpd->map, m, - hatm_load_txbuf, &arg, 0); + hatm_load_txbuf, &arg, BUS_DMA_NOWAIT); if (error == EFBIG) { /* try to defragment the packet */ @@ -434,7 +434,7 @@ hatm_start(struct ifnet *ifp) } arg.mbuf = m; error = bus_dmamap_load_mbuf(sc->tx_tag, tpd->map, m, - hatm_load_txbuf, &arg, 0); + hatm_load_txbuf, &arg, BUS_DMA_NOWAIT); } if (error != 0) { |