summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-05-17 09:30:55 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-05-17 09:30:55 +0000
commitc67ab8b75a8aa23cd1ee0da8fb6753766c427834 (patch)
treed46050c6755b36e902210da530520ae36d5ea00f
parentff635519255cb2b42ffeffe4bbc3ac3b808aa9fc (diff)
support changing the mtu up to the maximum frame size it currently
supports (MCLBYTES).
-rw-r--r--sys/dev/pci/if_tht.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c
index 331bb309667..bba5a9ce191 100644
--- a/sys/dev/pci/if_tht.c
+++ b/sys/dev/pci/if_tht.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tht.c,v 1.100 2007/05/16 09:27:44 dlg Exp $ */
+/* $OpenBSD: if_tht.c,v 1.101 2007/05/17 09:30:54 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -784,7 +784,7 @@ tht_attach(struct device *parent, struct device *self, void *aux)
ifp->if_ioctl = tht_ioctl;
ifp->if_start = tht_start;
ifp->if_watchdog = tht_watchdog;
- ifp->if_hardmtu = 1500; /* XXX */
+ ifp->if_hardmtu = MCLBYTES - ETHER_HDR_LEN - ETHER_CRC_LEN; /* XXX */
strlcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ);
IFQ_SET_MAXLEN(&ifp->if_snd, 400);
IFQ_SET_READY(&ifp->if_snd);
@@ -895,6 +895,13 @@ tht_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
}
break;
+ case SIOCSIFMTU:
+ if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ifp->if_hardmtu)
+ error = EINVAL;
+ else
+ ifp->if_mtu = ifr->ifr_mtu;
+ break;
+
case SIOCADDMULTI:
error = ether_addmulti(ifr, &sc->sc_ac);
break;