From 97077b5e3cc9222b2f366a40c5675f01d22a5e42 Mon Sep 17 00:00:00 2001 From: Ryan Thomas McBride Date: Fri, 18 Jun 2004 20:33:57 +0000 Subject: 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(); --- sys/dev/pci/if_ti.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'sys/dev/pci/if_ti.c') 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) { /* -- cgit v1.2.3