diff options
-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 30835b5..34f1727 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 35edf0c..2d93e3b 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 479500b..633aee3 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 357a06f..841ab64 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 ba8a8e8..14c1e8a 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) { |