diff options
author | dg <dg@FreeBSD.org> | 1994-11-13 12:39:38 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-11-13 12:39:38 +0000 |
commit | 05ff8934e380eb14959131be1b738b6d854b6eee (patch) | |
tree | 50e15e67d0d8817d55271ce38d30a42cf389cfd2 | |
parent | 14a63f17d4c7a600d3d0d551f8955196a3a786bb (diff) | |
download | FreeBSD-src-05ff8934e380eb14959131be1b738b6d854b6eee.zip FreeBSD-src-05ff8934e380eb14959131be1b738b6d854b6eee.tar.gz |
Added support for SIOCSIFMTU ioctl. Fixed bug that caused panic at boot time
related to interrupts being enabled before the device attach. The interrupt
should be mapped *after* the device attach.
-rw-r--r-- | sys/dev/de/if_de.c | 21 | ||||
-rw-r--r-- | sys/i386/pci/if_de.c | 21 | ||||
-rw-r--r-- | sys/pci/if_de.c | 21 |
3 files changed, 48 insertions, 15 deletions
diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 36af5bb..e88cfb3 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_de.c,v 1.4 1994/11/09 15:12:44 davidg Exp $ + * $Id: if_de.c,v 1.5 1994/11/10 02:56:48 davidg Exp $ * */ @@ -832,13 +832,14 @@ tulip_ioctl( caddr_t data) { tulip_softc_t *sc = tulips[ifp->if_unit]; + struct ifaddr *ifa = (struct ifaddr *)data; + struct ifreq *ifr = (struct ifreq *) data; int s, error = 0; s = splimp(); switch (cmd) { case SIOCSIFADDR: { - struct ifaddr *ifa = (struct ifaddr *)data; ifp->if_flags |= IFF_UP; switch(ifa->ifa_addr->sa_family) { @@ -901,9 +902,9 @@ tulip_ioctl( * Update multicast listeners */ if (cmd == SIOCADDMULTI) - error = ether_addmulti((struct ifreq *)data, &sc->tulip_ac); + error = ether_addmulti(ifr, &sc->tulip_ac); else - error = ether_delmulti((struct ifreq *)data, &sc->tulip_ac); + error = ether_delmulti(ifr, &sc->tulip_ac); if (error == ENETRESET) { tulip_addr_filter(sc); /* reset multicast filtering */ @@ -912,6 +913,16 @@ tulip_ioctl( } break; } + case SIOCSIFMTU: + /* + * Set the interface MTU. + */ + if (ifr->ifr_mtu > ETHERMTU) { + error = EINVAL; + } else { + ifp->if_mtu = ifr->ifr_mtu; + } + break; default: { error = EINVAL; @@ -1120,9 +1131,9 @@ tulip_pci_attach( (sc->tulip_revinfo & 0xF0) >> 4, sc->tulip_revinfo & 0x0F, "unknown"); } else { - pci_map_int (config_id, tulip_intr, (void*) sc, &net_imask); TULIP_RESET(sc); tulip_attach(sc); + pci_map_int (config_id, tulip_intr, (void*) sc, &net_imask); } } #endif /* NPCI > 0 */ diff --git a/sys/i386/pci/if_de.c b/sys/i386/pci/if_de.c index 36af5bb..e88cfb3 100644 --- a/sys/i386/pci/if_de.c +++ b/sys/i386/pci/if_de.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_de.c,v 1.4 1994/11/09 15:12:44 davidg Exp $ + * $Id: if_de.c,v 1.5 1994/11/10 02:56:48 davidg Exp $ * */ @@ -832,13 +832,14 @@ tulip_ioctl( caddr_t data) { tulip_softc_t *sc = tulips[ifp->if_unit]; + struct ifaddr *ifa = (struct ifaddr *)data; + struct ifreq *ifr = (struct ifreq *) data; int s, error = 0; s = splimp(); switch (cmd) { case SIOCSIFADDR: { - struct ifaddr *ifa = (struct ifaddr *)data; ifp->if_flags |= IFF_UP; switch(ifa->ifa_addr->sa_family) { @@ -901,9 +902,9 @@ tulip_ioctl( * Update multicast listeners */ if (cmd == SIOCADDMULTI) - error = ether_addmulti((struct ifreq *)data, &sc->tulip_ac); + error = ether_addmulti(ifr, &sc->tulip_ac); else - error = ether_delmulti((struct ifreq *)data, &sc->tulip_ac); + error = ether_delmulti(ifr, &sc->tulip_ac); if (error == ENETRESET) { tulip_addr_filter(sc); /* reset multicast filtering */ @@ -912,6 +913,16 @@ tulip_ioctl( } break; } + case SIOCSIFMTU: + /* + * Set the interface MTU. + */ + if (ifr->ifr_mtu > ETHERMTU) { + error = EINVAL; + } else { + ifp->if_mtu = ifr->ifr_mtu; + } + break; default: { error = EINVAL; @@ -1120,9 +1131,9 @@ tulip_pci_attach( (sc->tulip_revinfo & 0xF0) >> 4, sc->tulip_revinfo & 0x0F, "unknown"); } else { - pci_map_int (config_id, tulip_intr, (void*) sc, &net_imask); TULIP_RESET(sc); tulip_attach(sc); + pci_map_int (config_id, tulip_intr, (void*) sc, &net_imask); } } #endif /* NPCI > 0 */ diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c index 36af5bb..e88cfb3 100644 --- a/sys/pci/if_de.c +++ b/sys/pci/if_de.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_de.c,v 1.4 1994/11/09 15:12:44 davidg Exp $ + * $Id: if_de.c,v 1.5 1994/11/10 02:56:48 davidg Exp $ * */ @@ -832,13 +832,14 @@ tulip_ioctl( caddr_t data) { tulip_softc_t *sc = tulips[ifp->if_unit]; + struct ifaddr *ifa = (struct ifaddr *)data; + struct ifreq *ifr = (struct ifreq *) data; int s, error = 0; s = splimp(); switch (cmd) { case SIOCSIFADDR: { - struct ifaddr *ifa = (struct ifaddr *)data; ifp->if_flags |= IFF_UP; switch(ifa->ifa_addr->sa_family) { @@ -901,9 +902,9 @@ tulip_ioctl( * Update multicast listeners */ if (cmd == SIOCADDMULTI) - error = ether_addmulti((struct ifreq *)data, &sc->tulip_ac); + error = ether_addmulti(ifr, &sc->tulip_ac); else - error = ether_delmulti((struct ifreq *)data, &sc->tulip_ac); + error = ether_delmulti(ifr, &sc->tulip_ac); if (error == ENETRESET) { tulip_addr_filter(sc); /* reset multicast filtering */ @@ -912,6 +913,16 @@ tulip_ioctl( } break; } + case SIOCSIFMTU: + /* + * Set the interface MTU. + */ + if (ifr->ifr_mtu > ETHERMTU) { + error = EINVAL; + } else { + ifp->if_mtu = ifr->ifr_mtu; + } + break; default: { error = EINVAL; @@ -1120,9 +1131,9 @@ tulip_pci_attach( (sc->tulip_revinfo & 0xF0) >> 4, sc->tulip_revinfo & 0x0F, "unknown"); } else { - pci_map_int (config_id, tulip_intr, (void*) sc, &net_imask); TULIP_RESET(sc); tulip_attach(sc); + pci_map_int (config_id, tulip_intr, (void*) sc, &net_imask); } } #endif /* NPCI > 0 */ |