diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-06-18 20:33:57 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-06-18 20:33:57 +0000 |
commit | 97077b5e3cc9222b2f366a40c5675f01d22a5e42 (patch) | |
tree | 3b8b143186f8c3eabcb8f76df374dc20a942deca /sys/dev | |
parent | cf6825fbef378f1d692556be2e63cd4e4a3c6286 (diff) |
Fix jumbo frames.
- Implement SIOCSIFMTU ioctl.
- Remove from the free list instead of the inuse list when allocating
jumbo buffers.
- Use TI_JUMBO_FRAMELEN as the size argument to bus_dmamap_create();
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_ti.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c index d10435301a7..7f79329235d 100644 --- a/sys/dev/pci/if_ti.c +++ b/sys/dev/pci/if_ti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ti.c,v 1.50 2004/05/31 16:58:19 mcbride Exp $ */ +/* $OpenBSD: if_ti.c,v 1.51 2004/06/18 20:33:56 mcbride Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -683,7 +683,7 @@ void *ti_jalloc(sc) return(NULL); } - SLIST_REMOVE_HEAD(&sc->ti_jinuse_listhead, jpool_entries); + SLIST_REMOVE_HEAD(&sc->ti_jfree_listhead, jpool_entries); SLIST_INSERT_HEAD(&sc->ti_jinuse_listhead, entry, jpool_entries); sc->ti_cdata.ti_jslots[entry->slot].ti_inuse = 1; return(sc->ti_cdata.ti_jslots[entry->slot].ti_buf); @@ -1060,8 +1060,8 @@ int ti_init_tx_ring(sc) SLIST_INIT(&sc->ti_tx_map_listhead); for (i = 0; i < TI_TX_RING_CNT; i++) { - if (bus_dmamap_create(sc->sc_dmatag, MCLBYTES, TI_NTXSEG, - MCLBYTES, 0, BUS_DMA_NOWAIT, &dmamap)) + if (bus_dmamap_create(sc->sc_dmatag, TI_JUMBO_FRAMELEN, + TI_NTXSEG, MCLBYTES, 0, BUS_DMA_NOWAIT, &dmamap)) return(ENOBUFS); entry = malloc(sizeof(*entry), M_DEVBUF, M_NOWAIT); @@ -2582,6 +2582,14 @@ int ti_ioctl(ifp, command, data) break; } break; + case SIOCSIFMTU: + if (ifr->ifr_mtu > TI_JUMBO_FRAMELEN - ETHER_HDR_LEN) { + error = EINVAL; + } else { + ifp->if_mtu = ifr->ifr_mtu; + ti_init(sc); + } + break; case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { /* |