*** Summary ***
When a link-layer address changes (e.g., ifconfig ex0 link
02🇩🇪ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.
Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address. (Thanks matt@.)
Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior. Make network drivers share more code.
Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.
Return consistent, appropriate error codes from network drivers.
Improve readability. KNF.
*** Details ***
In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.
In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.
Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR. In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr. That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR. In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.
In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.
Pull device initialization out of switch statements under
SIOCINITIFADDR. For example, pull ..._init() out of any switch
statement that looks like this:
switch (...->sa_family) {
case ...:
..._init();
...
break;
...
default:
..._init();
...
break;
}
Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,
switch (x & (IFF_UP|IFF_RUNNING)) {
case 0:
...
break;
case IFF_RUNNING:
...
break;
case IFF_UP:
...
break;
case IFF_UP|IFF_RUNNING:
...
break;
}
unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).
In ipw(4), remove an if_set_sadl() call that is out of place.
In nfe(4), reuse the jumbo MTU logic in ether_ioctl().
Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure. Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.
Return ENOTTY instead of EINVAL for inappropriate ioctls. In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.
Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source. In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.
Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively. Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.
In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.
Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.
In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.
Let ifioctl_common() handle SIOCGIFADDR.
Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.
In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.
bzero -> memset. Delete unnecessary casts to void *. Use
sockaddr_in_init() and sockaddr_in6_init(). Compare pointers with
NULL instead of "testing truth". Replace some instances of (type
*)0 with NULL. Change some K&R prototypes to ANSI C, and join
lines.
This commit is contained in:
parent
f455f7ee91
commit
de87fe677d
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: altq_afmap.c,v 1.18 2007/03/04 05:59:00 christos Exp $ */
|
/* $NetBSD: altq_afmap.c,v 1.19 2008/11/07 00:20:01 dyoung Exp $ */
|
||||||
/* $KAME: altq_afmap.c,v 1.12 2005/04/13 03:44:24 suz Exp $ */
|
/* $KAME: altq_afmap.c,v 1.12 2005/04/13 03:44:24 suz Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: altq_afmap.c,v 1.18 2007/03/04 05:59:00 christos Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: altq_afmap.c,v 1.19 2008/11/07 00:20:01 dyoung Exp $");
|
||||||
|
|
||||||
#ifdef _KERNEL_OPT
|
#ifdef _KERNEL_OPT
|
||||||
#include "opt_altq.h"
|
#include "opt_altq.h"
|
||||||
|
@ -371,8 +371,7 @@ afmioctl(dev_t dev, ioctlcmd_t cmd, void *addr, int flag,
|
||||||
flowmap = (struct atm_flowmap *)addr;
|
flowmap = (struct atm_flowmap *)addr;
|
||||||
flowmap->af_ifname[IFNAMSIZ-1] = '\0';
|
flowmap->af_ifname[IFNAMSIZ-1] = '\0';
|
||||||
ifp = ifunit(flowmap->af_ifname);
|
ifp = ifunit(flowmap->af_ifname);
|
||||||
if (ifp == NULL || ifp->if_ioctl == NULL ||
|
if (ifp == NULL || (ifp->if_flags & IFF_RUNNING) == 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0)
|
|
||||||
error = ENXIO;
|
error = ENXIO;
|
||||||
else
|
else
|
||||||
error = ifp->if_ioctl(ifp, cmd, addr);
|
error = ifp->if_ioctl(ifp, cmd, addr);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ie.c,v 1.19 2007/10/17 19:52:54 garbled Exp $ */
|
/* $NetBSD: if_ie.c,v 1.20 2008/11/07 00:20:01 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1995 Melvin Tang-Richardson.
|
* Copyright (c) 1995 Melvin Tang-Richardson.
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.19 2007/10/17 19:52:54 garbled Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.20 2008/11/07 00:20:01 dyoung Exp $");
|
||||||
|
|
||||||
#define IGNORE_ETHER1_IDROM_CHECKSUM
|
#define IGNORE_ETHER1_IDROM_CHECKSUM
|
||||||
|
|
||||||
|
@ -614,14 +614,10 @@ iezero(sc, p, size)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
ieioctl(ifp, cmd, data)
|
ieioctl(struct ifnet *ifp, unsigned long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct ie_softc *sc = ifp->if_softc;
|
struct ie_softc *sc = ifp->if_softc;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
/* struct ifreq *ifr = (struct ifreq *)data;*/
|
|
||||||
int s;
|
int s;
|
||||||
int error=0;
|
int error=0;
|
||||||
|
|
||||||
|
@ -629,9 +625,9 @@ ieioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch ( cmd )
|
switch ( cmd )
|
||||||
{
|
{
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
switch ( ifa->ifa_addr->sa_family ) {
|
switch (ifa->ifa_addr->sa_family ) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
ieinit(sc);
|
ieinit(sc);
|
||||||
|
@ -650,6 +646,8 @@ ieioctl(ifp, cmd, data)
|
||||||
#define DOCLR(a,b) (a->if_flags&=~b)
|
#define DOCLR(a,b) (a->if_flags&=~b)
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
return error;
|
||||||
sc->promisc = ifp->if_flags & ( IFF_PROMISC | IFF_ALLMULTI );
|
sc->promisc = ifp->if_flags & ( IFF_PROMISC | IFF_ALLMULTI );
|
||||||
|
|
||||||
if ( IZCLR(ifp,IFF_UP) && IZSET(ifp,IFF_RUNNING) )
|
if ( IZCLR(ifp,IFF_UP) && IZSET(ifp,IFF_RUNNING) )
|
||||||
|
@ -671,7 +669,8 @@ ieioctl(ifp, cmd, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
(void)splx(s);
|
(void)splx(s);
|
||||||
return error;
|
return error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ade.c,v 1.33 2008/03/24 12:24:37 yamt Exp $ */
|
/* $NetBSD: if_ade.c,v 1.34 2008/11/07 00:20:01 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE: this version of if_de was modified for bounce buffers prior
|
* NOTE: this version of if_de was modified for bounce buffers prior
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
#define LCLDMA 1
|
#define LCLDMA 1
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ade.c,v 1.33 2008/03/24 12:24:37 yamt Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ade.c,v 1.34 2008/11/07 00:20:01 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "opt_ns.h"
|
#include "opt_ns.h"
|
||||||
|
@ -3943,7 +3943,7 @@ tulip_ifioctl(
|
||||||
s = TULIP_RAISESPL();
|
s = TULIP_RAISESPL();
|
||||||
#endif
|
#endif
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR: {
|
case SIOCINITIFADDR: {
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
switch(ifa->ifa_addr->sa_family) {
|
switch(ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
|
@ -3982,13 +3982,9 @@ tulip_ifioctl(
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SIOCGIFADDR: {
|
|
||||||
memcpy((void *) ((struct sockaddr *)&ifr->ifr_data)->sa_data,
|
|
||||||
(void *) sc->tulip_enaddr, 6);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case SIOCSIFFLAGS: {
|
case SIOCSIFFLAGS: {
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
tulip_init(sc);
|
tulip_init(sc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4056,7 +4052,7 @@ tulip_ifioctl(
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
default: {
|
default: {
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_xb.c,v 1.18 2007/10/17 19:52:54 garbled Exp $ */
|
/* $NetBSD: if_xb.c,v 1.19 2008/11/07 00:20:01 dyoung Exp $ */
|
||||||
|
|
||||||
/* [Notice revision 2.2]
|
/* [Notice revision 2.2]
|
||||||
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
|
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
#include "opt_avalon_a12.h" /* Config options headers */
|
#include "opt_avalon_a12.h" /* Config options headers */
|
||||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||||
|
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_xb.c,v 1.18 2007/10/17 19:52:54 garbled Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_xb.c,v 1.19 2008/11/07 00:20:01 dyoung Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -231,7 +231,7 @@ xbattach(parent, self, aux)
|
||||||
xbfound = 1;
|
xbfound = 1;
|
||||||
ccp = &xb_configuration;
|
ccp = &xb_configuration;
|
||||||
xb_init_config(ccp, 1);
|
xb_init_config(ccp, 1);
|
||||||
printf(": driver %s mtu %lu\n", "$Revision: 1.18 $", xbi.if_mtu);
|
printf(": driver %s mtu %lu\n", "$Revision: 1.19 $", xbi.if_mtu);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -419,29 +419,20 @@ xb_stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xb_ioctl(ifp, cmd, data)
|
xb_ioctl(struct ifnet *ifp, unsigned long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
int s, error = 0;
|
int s, error = 0;
|
||||||
|
|
||||||
s = splnet();
|
s = splnet();
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
xbi.if_flags |= IFF_UP;
|
xbi.if_flags |= IFF_UP;
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
xb_init(ifp);
|
||||||
#ifdef INET
|
|
||||||
case AF_INET:
|
|
||||||
xb_init(ifp);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
default:
|
|
||||||
xb_init(ifp);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((ifp->if_flags & IFF_UP) == 0 &&
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
(ifp->if_flags & IFF_RUNNING) != 0) {
|
||||||
xb_stop();
|
xb_stop();
|
||||||
|
@ -455,7 +446,7 @@ xb_ioctl(ifp, cmd, data)
|
||||||
xb_debug = 1;
|
xb_debug = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ifioctl_common(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ed.c,v 1.55 2007/10/17 19:53:16 garbled Exp $ */
|
/* $NetBSD: if_ed.c,v 1.56 2008/11/07 00:20:01 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
|
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
#include "opt_ns.h"
|
#include "opt_ns.h"
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ed.c,v 1.55 2007/10/17 19:53:16 garbled Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ed.c,v 1.56 2008/11/07 00:20:01 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -865,7 +865,7 @@ ed_ioctl(register struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
|
@ -899,6 +899,11 @@ ed_ioctl(register struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
/* XXX if ed_init() would ed_stop(, 0), first, perhaps we
|
||||||
|
* can re-use the code in ether_ioctl().
|
||||||
|
*/
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((ifp->if_flags & IFF_UP) == 0 &&
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
(ifp->if_flags & IFF_RUNNING) != 0) {
|
||||||
/*
|
/*
|
||||||
|
@ -941,7 +946,8 @@ ed_ioctl(register struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_es.c,v 1.42 2007/10/17 19:53:16 garbled Exp $ */
|
/* $NetBSD: if_es.c,v 1.43 2008/11/07 00:20:01 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1995 Michael L. Hitch
|
* Copyright (c) 1995 Michael L. Hitch
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
#include "opt_ns.h"
|
#include "opt_ns.h"
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.42 2007/10/17 19:53:16 garbled Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.43 2008/11/07 00:20:01 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -961,7 +961,7 @@ esstart(struct ifnet *ifp)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
esioctl(register struct ifnet *ifp, u_long cmd, void *data)
|
esioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
{
|
{
|
||||||
struct es_softc *sc = ifp->if_softc;
|
struct es_softc *sc = ifp->if_softc;
|
||||||
register struct ifaddr *ifa = (struct ifaddr *)data;
|
register struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
@ -972,7 +972,7 @@ esioctl(register struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
|
@ -1005,6 +1005,9 @@ esioctl(register struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
/* XXX see the comment in ed_ioctl() about code re-use */
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then stop it
|
* If interface is marked down and it is running, then stop it
|
||||||
*/
|
*/
|
||||||
|
@ -1059,7 +1062,8 @@ esioctl(register struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_qn.c,v 1.31 2007/10/17 19:53:16 garbled Exp $ */
|
/* $NetBSD: if_qn.c,v 1.32 2008/11/07 00:20:01 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1995 Mika Kortelainen
|
* Copyright (c) 1995 Mika Kortelainen
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1.31 2007/10/17 19:53:16 garbled Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1.32 2008/11/07 00:20:01 dyoung Exp $");
|
||||||
|
|
||||||
#include "qn.h"
|
#include "qn.h"
|
||||||
#if NQN > 0
|
#if NQN > 0
|
||||||
|
@ -830,7 +830,7 @@ qnioctl(register struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
|
@ -866,6 +866,9 @@ qnioctl(register struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
/* XXX see the comment in ed_ioctl() about code re-use */
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((ifp->if_flags & IFF_UP) == 0 &&
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
(ifp->if_flags & IFF_RUNNING) != 0) {
|
||||||
/*
|
/*
|
||||||
|
@ -913,8 +916,7 @@ qnioctl(register struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log(LOG_INFO, "qnioctl: default\n");
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
error = EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_mc.c,v 1.34 2007/10/17 19:55:13 garbled Exp $ */
|
/* $NetBSD: if_mc.c,v 1.35 2008/11/07 00:20:01 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1997 David Huang <khym@azeotrope.org>
|
* Copyright (c) 1997 David Huang <khym@azeotrope.org>
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.34 2007/10/17 19:55:13 garbled Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.35 2008/11/07 00:20:01 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_ddb.h"
|
#include "opt_ddb.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -178,23 +178,25 @@ mcioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifa = (struct ifaddr *)data;
|
ifa = (struct ifaddr *)data;
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
mcinit(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
mcinit(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
mcinit(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((err = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
/* XXX see the comment in ed_ioctl() about code re-use */
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((ifp->if_flags & IFF_UP) == 0 &&
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
(ifp->if_flags & IFF_RUNNING) != 0) {
|
||||||
/*
|
/*
|
||||||
|
@ -233,7 +235,7 @@ mcioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
err = EINVAL;
|
err = ether_ioctl(ifp, cmd, data);
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
return (err);
|
return (err);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_netdock_nubus.c,v 1.18 2008/04/04 09:49:33 hauke Exp $ */
|
/* $NetBSD: if_netdock_nubus.c,v 1.19 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2000,2002 Daishi Kato <daishi@axlight.com>
|
* Copyright (C) 2000,2002 Daishi Kato <daishi@axlight.com>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
/***********************/
|
/***********************/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.18 2008/04/04 09:49:33 hauke Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.19 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/device.h>
|
#include <sys/device.h>
|
||||||
|
@ -383,23 +383,25 @@ netdock_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
int temp;
|
int temp;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifa = (struct ifaddr *)data;
|
ifa = (struct ifaddr *)data;
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
(void)netdock_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
(void)netdock_init(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
(void)netdock_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((err = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
/* XXX see the comment in ed_ioctl() about code re-use */
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((ifp->if_flags & IFF_UP) == 0 &&
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
(ifp->if_flags & IFF_RUNNING) != 0) {
|
||||||
netdock_stop(sc);
|
netdock_stop(sc);
|
||||||
|
@ -427,7 +429,7 @@ netdock_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
err = EINVAL;
|
err = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: am79c950.c,v 1.23 2007/10/17 19:55:17 garbled Exp $ */
|
/* $NetBSD: am79c950.c,v 1.24 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1997 David Huang <khym@bga.com>
|
* Copyright (c) 1997 David Huang <khym@bga.com>
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: am79c950.c,v 1.23 2007/10/17 19:55:17 garbled Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: am79c950.c,v 1.24 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
|
||||||
|
@ -190,23 +190,25 @@ mcioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifa = (struct ifaddr *)data;
|
ifa = (struct ifaddr *)data;
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
mcinit(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
mcinit(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
mcinit(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((err = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
/* XXX see the comment in ed_ioctl() about code re-use */
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((ifp->if_flags & IFF_UP) == 0 &&
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
(ifp->if_flags & IFF_RUNNING) != 0) {
|
||||||
/*
|
/*
|
||||||
|
@ -252,7 +254,8 @@ mcioctl(ifp, cmd, data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
err = EINVAL;
|
err = ether_ioctl(ifp, cmd, data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
return (err);
|
return (err);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_bm.c,v 1.37 2008/09/26 03:39:23 macallan Exp $ */
|
/* $NetBSD: if_bm.c,v 1.38 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (C) 1998, 1999, 2000 Tsubai Masanari. All rights reserved.
|
* Copyright (C) 1998, 1999, 2000 Tsubai Masanari. All rights reserved.
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.37 2008/09/26 03:39:23 macallan Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.38 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -719,10 +719,7 @@ bmac_watchdog(ifp)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
bmac_ioctl(ifp, cmd, data)
|
bmac_ioctl(struct ifnet *ifp, unsigned long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct bmac_softc *sc = ifp->if_softc;
|
struct bmac_softc *sc = ifp->if_softc;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
@ -732,23 +729,25 @@ bmac_ioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
|
bmac_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
bmac_init(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
bmac_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
/* XXX see the comment in ed_ioctl() about code re-use */
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((ifp->if_flags & IFF_UP) == 0 &&
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
(ifp->if_flags & IFF_RUNNING) != 0) {
|
||||||
/*
|
/*
|
||||||
|
@ -795,7 +794,8 @@ bmac_ioctl(ifp, cmd, data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_gm.c,v 1.33 2008/01/19 22:10:15 dyoung Exp $ */
|
/* $NetBSD: if_gm.c,v 1.34 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
|
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.33 2008/01/19 22:10:15 dyoung Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.34 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "rnd.h"
|
#include "rnd.h"
|
||||||
|
@ -791,10 +791,7 @@ gmac_init(sc)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
gmac_ioctl(ifp, cmd, data)
|
gmac_ioctl(struct ifnet *ifp, unsigned long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct gmac_softc *sc = ifp->if_softc;
|
struct gmac_softc *sc = ifp->if_softc;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
@ -805,23 +802,25 @@ gmac_ioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
|
gmac_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
gmac_init(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
gmac_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
/* XXX see the comment in ed_ioctl() about code re-use */
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((ifp->if_flags & IFF_UP) == 0 &&
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
(ifp->if_flags & IFF_RUNNING) != 0) {
|
||||||
/*
|
/*
|
||||||
|
@ -868,7 +867,8 @@ gmac_ioctl(ifp, cmd, data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: if_ae.c,v 1.14 2008/04/28 20:23:28 martin Exp $ */
|
/* $Id: if_ae.c,v 1.15 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2006 Urbana-Champaign Independent Media Center.
|
* Copyright (c) 2006 Urbana-Champaign Independent Media Center.
|
||||||
* Copyright (c) 2006 Garrett D'Amore.
|
* Copyright (c) 2006 Garrett D'Amore.
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.14 2008/04/28 20:23:28 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.15 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -154,6 +154,7 @@ static void ae_attach(device_t, device_t, void *);
|
||||||
static int ae_detach(device_t, int);
|
static int ae_detach(device_t, int);
|
||||||
static int ae_activate(device_t, enum devact);
|
static int ae_activate(device_t, enum devact);
|
||||||
|
|
||||||
|
static int ae_ifflags_cb(struct ethercom *);
|
||||||
static void ae_reset(struct ae_softc *);
|
static void ae_reset(struct ae_softc *);
|
||||||
static void ae_idle(struct ae_softc *, u_int32_t);
|
static void ae_idle(struct ae_softc *, u_int32_t);
|
||||||
|
|
||||||
|
@ -387,6 +388,7 @@ ae_attach(device_t parent, device_t self, void *aux)
|
||||||
*/
|
*/
|
||||||
if_attach(ifp);
|
if_attach(ifp);
|
||||||
ether_ifattach(ifp, enaddr);
|
ether_ifattach(ifp, enaddr);
|
||||||
|
ether_set_ifflags_cb(&sc->sc_ethercom, ae_ifflags_cb);
|
||||||
|
|
||||||
#if NRND > 0
|
#if NRND > 0
|
||||||
rnd_attach_source(&sc->sc_rnd_source, sc->sc_dev.dv_xname,
|
rnd_attach_source(&sc->sc_rnd_source, sc->sc_dev.dv_xname,
|
||||||
|
@ -813,6 +815,24 @@ ae_watchdog(struct ifnet *ifp)
|
||||||
ae_start(ifp);
|
ae_start(ifp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the interface is up and running, only modify the receive
|
||||||
|
* filter when changing to/from promiscuous mode. Otherwise return
|
||||||
|
* ENETRESET so that ether_ioctl will reset the chip.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
ae_ifflags_cb(struct ethercom *ec)
|
||||||
|
{
|
||||||
|
struct ifnet *ifp = &ec->ec_if;
|
||||||
|
struct ae_softc *sc = ifp->if_softc;
|
||||||
|
int change = ifp->if_flags ^ sc->sc_if_flags;
|
||||||
|
|
||||||
|
if ((change & ~(IFF_CANTCHANGE|IFF_DEBUG)) != 0)
|
||||||
|
return ENETRESET;
|
||||||
|
else if ((change & IFF_PROMISC) != 0)
|
||||||
|
ae_filter_setup(sc);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ae_ioctl: [ifnet interface function]
|
* ae_ioctl: [ifnet interface function]
|
||||||
*
|
*
|
||||||
|
@ -826,37 +846,16 @@ ae_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
case SIOCSIFFLAGS:
|
if (error == ENETRESET) {
|
||||||
/* If the interface is up and running, only modify the receive
|
if (ifp->if_flags & IFF_RUNNING) {
|
||||||
* filter when setting promiscuous or debug mode. Otherwise
|
/*
|
||||||
* fall through to ether_ioctl, which will reset the chip.
|
* Multicast list has changed. Set the
|
||||||
*/
|
* hardware filter accordingly.
|
||||||
#define RESETIGN (IFF_CANTCHANGE|IFF_DEBUG)
|
*/
|
||||||
if (((ifp->if_flags & (IFF_UP|IFF_RUNNING))
|
|
||||||
== (IFF_UP|IFF_RUNNING))
|
|
||||||
&& ((ifp->if_flags & (~RESETIGN))
|
|
||||||
== (sc->sc_if_flags & (~RESETIGN)))) {
|
|
||||||
/* Set up the receive filter. */
|
|
||||||
ae_filter_setup(sc);
|
ae_filter_setup(sc);
|
||||||
error = 0;
|
|
||||||
break;
|
|
||||||
#undef RESETIGN
|
|
||||||
}
|
}
|
||||||
/* FALLTHROUGH */
|
error = 0;
|
||||||
default:
|
|
||||||
error = ether_ioctl(ifp, cmd, data);
|
|
||||||
if (error == ENETRESET) {
|
|
||||||
if (ifp->if_flags & IFF_RUNNING) {
|
|
||||||
/*
|
|
||||||
* Multicast list has changed. Set the
|
|
||||||
* hardware filter accordingly.
|
|
||||||
*/
|
|
||||||
ae_filter_setup(sc);
|
|
||||||
}
|
|
||||||
error = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try to get more packets going. */
|
/* Try to get more packets going. */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: sbmac.c,v 1.28 2008/02/07 01:21:52 dyoung Exp $ */
|
/* $NetBSD: sbmac.c,v 1.29 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2000, 2001, 2004
|
* Copyright 2000, 2001, 2004
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.28 2008/02/07 01:21:52 dyoung Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.29 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -1957,7 +1957,7 @@ sbmac_ether_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct sbmac_softc *sc = ifp->if_softc;
|
struct sbmac_softc *sc = ifp->if_softc;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
|
@ -1990,7 +1990,7 @@ sbmac_ether_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return (EINVAL);
|
return ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -2022,8 +2022,7 @@ sbmac_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch(command) {
|
switch(command) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
case SIOCGIFADDR:
|
|
||||||
error = sbmac_ether_ioctl(ifp, command, data);
|
error = sbmac_ether_ioctl(ifp, command, data);
|
||||||
break;
|
break;
|
||||||
case SIOCSIFMTU:
|
case SIOCSIFMTU:
|
||||||
|
@ -2034,6 +2033,8 @@ sbmac_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
error = 0;
|
error = 0;
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
/*
|
/*
|
||||||
* If only the state of the PROMISC flag changed,
|
* If only the state of the PROMISC flag changed,
|
||||||
|
@ -2069,7 +2070,7 @@ sbmac_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, command, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_sn.c,v 1.30 2008/04/09 15:40:30 tsutsui Exp $ */
|
/* $NetBSD: if_sn.c,v 1.31 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* National Semiconductor DP8393X SONIC Driver
|
* National Semiconductor DP8393X SONIC Driver
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.30 2008/04/09 15:40:30 tsutsui Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.31 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
|
||||||
|
@ -234,23 +234,24 @@ snioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifa = (struct ifaddr *)data;
|
ifa = (struct ifaddr *)data;
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
(void)sninit(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
(void)sninit(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
(void)sninit(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((err = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((ifp->if_flags & IFF_UP) == 0 &&
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
(ifp->if_flags & IFF_RUNNING) != 0) {
|
||||||
/*
|
/*
|
||||||
|
@ -294,7 +295,8 @@ snioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
err = EINVAL;
|
err = ether_ioctl(ifp, cmd, data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: mb8795.c,v 1.42 2007/10/17 19:56:03 garbled Exp $ */
|
/* $NetBSD: mb8795.c,v 1.43 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998 Darrin B. Jewell
|
* Copyright (c) 1998 Darrin B. Jewell
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.42 2007/10/17 19:56:03 garbled Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.43 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -596,19 +596,18 @@ mb8795_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
DPRINTF(("%s: mb8795_ioctl() SIOCSIFADDR\n",sc->sc_dev.dv_xname));
|
DPRINTF(("%s: mb8795_ioctl() SIOCINITIFADDR\n",sc->sc_dev.dv_xname));
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
|
mb8795_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
mb8795_init(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
mb8795_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -616,27 +615,31 @@ mb8795_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
DPRINTF(("%s: mb8795_ioctl() SIOCSIFFLAGS\n",sc->sc_dev.dv_xname));
|
DPRINTF(("%s: mb8795_ioctl() SIOCSIFFLAGS\n",sc->sc_dev.dv_xname));
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
*/
|
*/
|
||||||
/* ifp->if_flags &= ~IFF_RUNNING; */
|
/* ifp->if_flags &= ~IFF_RUNNING; */
|
||||||
mb8795_reset(sc);
|
mb8795_reset(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
mb8795_init(sc);
|
mb8795_init(sc);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
/*
|
/*
|
||||||
* Reset the interface to pick up changes in any other
|
* Reset the interface to pick up changes in any other
|
||||||
* flags that affect hardware registers.
|
* flags that affect hardware registers.
|
||||||
*/
|
*/
|
||||||
mb8795_init(sc);
|
mb8795_init(sc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
#ifdef MB8795_DEBUG
|
#ifdef MB8795_DEBUG
|
||||||
if (ifp->if_flags & IFF_DEBUG)
|
if (ifp->if_flags & IFF_DEBUG)
|
||||||
|
@ -668,7 +671,7 @@ mb8795_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ec.c,v 1.15 2008/07/06 13:29:50 tsutsui Exp $ */
|
/* $NetBSD: if_ec.c,v 1.16 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.15 2008/07/06 13:29:50 tsutsui Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.16 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "opt_ns.h"
|
#include "opt_ns.h"
|
||||||
|
@ -601,7 +601,7 @@ ec_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
|
@ -618,26 +618,30 @@ ec_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
*/
|
*/
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
ec_init(ifp);
|
ec_init(ifp);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
/*
|
/*
|
||||||
* Some other important flag might have changed, so
|
* Some other important flag might have changed, so
|
||||||
* reset.
|
* reset.
|
||||||
*/
|
*/
|
||||||
ec_reset(ifp);
|
ec_reset(ifp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -647,7 +651,7 @@ ec_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ie.c,v 1.51 2008/06/28 12:13:38 tsutsui Exp $ */
|
/* $NetBSD: if_ie.c,v 1.52 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum.
|
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum.
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.51 2008/06/28 12:13:38 tsutsui Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.52 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "opt_ns.h"
|
#include "opt_ns.h"
|
||||||
|
@ -1530,7 +1530,7 @@ ieioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
|
@ -1564,30 +1564,34 @@ ieioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
sc->promisc = ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI);
|
sc->promisc = ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI);
|
||||||
|
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
*/
|
*/
|
||||||
iestop(sc);
|
iestop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
ieinit(sc);
|
ieinit(sc);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
/*
|
/*
|
||||||
* Reset the interface to pick up changes in any other
|
* Reset the interface to pick up changes in any other
|
||||||
* flags that affect hardware registers.
|
* flags that affect hardware registers.
|
||||||
*/
|
*/
|
||||||
iestop(sc);
|
iestop(sc);
|
||||||
ieinit(sc);
|
ieinit(sc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
#ifdef IEDEBUG
|
#ifdef IEDEBUG
|
||||||
if (ifp->if_flags & IFF_DEBUG)
|
if (ifp->if_flags & IFF_DEBUG)
|
||||||
|
@ -1611,7 +1615,8 @@ ieioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
return error;
|
return error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ni.c,v 1.36 2008/07/09 17:51:21 joerg Exp $ */
|
/* $NetBSD: if_ni.c,v 1.37 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
|
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.36 2008/07/09 17:51:21 joerg Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.37 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -697,7 +697,7 @@ niioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
switch(ifa->ifa_addr->sa_family) {
|
switch(ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
|
@ -710,27 +710,33 @@ niioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running,
|
* If interface is marked down and it is running,
|
||||||
* stop it.
|
* stop it.
|
||||||
*/
|
*/
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
ni_setup(sc);
|
ni_setup(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface it marked up and it is stopped, then
|
* If interface it marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
niinit(sc);
|
niinit(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0) {
|
break;
|
||||||
|
case IFF_UP|IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* Send a new setup packet to match any new changes.
|
* Send a new setup packet to match any new changes.
|
||||||
* (Like IFF_PROMISC etc)
|
* (Like IFF_PROMISC etc)
|
||||||
*/
|
*/
|
||||||
ni_setup(sc);
|
ni_setup(sc);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -751,8 +757,8 @@ niioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
return (error);
|
return (error);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: an.c,v 1.52 2008/07/03 18:10:07 drochner Exp $ */
|
/* $NetBSD: an.c,v 1.53 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 1998, 1999
|
* Copyright (c) 1997, 1998, 1999
|
||||||
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
|
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.52 2008/07/03 18:10:07 drochner Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.53 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -889,6 +889,8 @@ an_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
|
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, command, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (sc->sc_enabled) {
|
if (sc->sc_enabled) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: ath.c,v 1.102 2008/07/09 19:47:24 joerg Exp $ */
|
/* $NetBSD: ath.c,v 1.103 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
|
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $");
|
__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $");
|
||||||
#endif
|
#endif
|
||||||
#ifdef __NetBSD__
|
#ifdef __NetBSD__
|
||||||
__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.102 2008/07/09 19:47:24 joerg Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.103 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -5148,6 +5148,8 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
ATH_LOCK(sc);
|
ATH_LOCK(sc);
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (IS_RUNNING(ifp)) {
|
if (IS_RUNNING(ifp)) {
|
||||||
/*
|
/*
|
||||||
* To avoid rescanning another access point,
|
* To avoid rescanning another access point,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: atw.c,v 1.140 2008/07/09 20:07:19 joerg Exp $ */
|
/* $NetBSD: atw.c,v 1.141 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.140 2008/07/09 20:07:19 joerg Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.141 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -3838,6 +3838,8 @@ atw_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (ATW_IS_ENABLED(sc)) {
|
if (ATW_IS_ENABLED(sc)) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: awi.c,v 1.80 2008/05/16 22:11:51 dyoung Exp $ */
|
/* $NetBSD: awi.c,v 1.81 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1999,2000,2001 The NetBSD Foundation, Inc.
|
* Copyright (c) 1999,2000,2001 The NetBSD Foundation, Inc.
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifdef __NetBSD__
|
#ifdef __NetBSD__
|
||||||
__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.80 2008/05/16 22:11:51 dyoung Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.81 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
#endif
|
#endif
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
__FBSDID("$FreeBSD: src/sys/dev/awi/awi.c,v 1.30 2004/01/15 13:30:06 onoe Exp $");
|
__FBSDID("$FreeBSD: src/sys/dev/awi/awi.c,v 1.30 2004/01/15 13:30:06 onoe Exp $");
|
||||||
|
@ -902,6 +902,8 @@ awi_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (sc->sc_enabled) {
|
if (sc->sc_enabled) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: dp8390.c,v 1.68 2008/03/12 14:31:11 cube Exp $ */
|
/* $NetBSD: dp8390.c,v 1.69 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
|
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.68 2008/03/12 14:31:11 cube Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.69 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_ipkdb.h"
|
#include "opt_ipkdb.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -873,25 +873,26 @@ dp8390_ioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
if ((error = dp8390_enable(sc)) != 0)
|
if ((error = dp8390_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
|
dp8390_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
dp8390_init(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
dp8390_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
case IFF_RUNNING:
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
|
@ -951,7 +952,7 @@ dp8390_ioctl(ifp, cmd, data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = ENODEV;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: elinkxl.c,v 1.105 2008/04/28 20:23:49 martin Exp $ */
|
/* $NetBSD: elinkxl.c,v 1.106 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.105 2008/04/28 20:23:49 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.106 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "rnd.h"
|
#include "rnd.h"
|
||||||
|
@ -84,6 +84,8 @@ int exdebug = 0;
|
||||||
int ex_media_chg(struct ifnet *ifp);
|
int ex_media_chg(struct ifnet *ifp);
|
||||||
void ex_media_stat(struct ifnet *ifp, struct ifmediareq *req);
|
void ex_media_stat(struct ifnet *ifp, struct ifmediareq *req);
|
||||||
|
|
||||||
|
static int ex_ifflags_cb(struct ethercom *);
|
||||||
|
|
||||||
void ex_probe_media(struct ex_softc *);
|
void ex_probe_media(struct ex_softc *);
|
||||||
void ex_set_filter(struct ex_softc *);
|
void ex_set_filter(struct ex_softc *);
|
||||||
void ex_set_media(struct ex_softc *);
|
void ex_set_media(struct ex_softc *);
|
||||||
|
@ -432,6 +434,7 @@ ex_config(struct ex_softc *sc)
|
||||||
|
|
||||||
if_attach(ifp);
|
if_attach(ifp);
|
||||||
ether_ifattach(ifp, macaddr);
|
ether_ifattach(ifp, macaddr);
|
||||||
|
ether_set_ifflags_cb(&sc->sc_ethercom, ex_ifflags_cb);
|
||||||
|
|
||||||
GO_WINDOW(1);
|
GO_WINDOW(1);
|
||||||
|
|
||||||
|
@ -1437,6 +1440,20 @@ ex_intr(void *arg)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ex_ifflags_cb(struct ethercom *ec)
|
||||||
|
{
|
||||||
|
struct ifnet *ifp = &ec->ec_if;
|
||||||
|
struct ex_softc *sc = ifp->if_softc;
|
||||||
|
int change = ifp->if_flags ^ sc->sc_if_flags;
|
||||||
|
|
||||||
|
if ((change & ~(IFF_CANTCHANGE|IFF_DEBUG)) != 0)
|
||||||
|
return ENETRESET;
|
||||||
|
else if ((change & IFF_PROMISC) != 0)
|
||||||
|
ex_set_mc(sc);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ex_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
ex_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
{
|
{
|
||||||
|
@ -1451,22 +1468,6 @@ ex_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
case SIOCGIFMEDIA:
|
case SIOCGIFMEDIA:
|
||||||
error = ifmedia_ioctl(ifp, ifr, &sc->ex_mii.mii_media, cmd);
|
error = ifmedia_ioctl(ifp, ifr, &sc->ex_mii.mii_media, cmd);
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
|
||||||
/* If the interface is up and running, only modify the receive
|
|
||||||
* filter when setting promiscuous or debug mode. Otherwise
|
|
||||||
* fall through to ether_ioctl, which will reset the chip.
|
|
||||||
*/
|
|
||||||
#define RESETIGN (IFF_CANTCHANGE|IFF_DEBUG)
|
|
||||||
if (((ifp->if_flags & (IFF_UP|IFF_RUNNING))
|
|
||||||
== (IFF_UP|IFF_RUNNING))
|
|
||||||
&& ((ifp->if_flags & (~RESETIGN))
|
|
||||||
== (sc->sc_if_flags & (~RESETIGN)))) {
|
|
||||||
ex_set_mc(sc);
|
|
||||||
error = 0;
|
|
||||||
break;
|
|
||||||
#undef RESETIGN
|
|
||||||
}
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
default:
|
default:
|
||||||
if ((error = ether_ioctl(ifp, cmd, data)) != ENETRESET)
|
if ((error = ether_ioctl(ifp, cmd, data)) != ENETRESET)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: gem.c,v 1.78 2008/09/15 19:50:28 jdc Exp $ */
|
/* $NetBSD: gem.c,v 1.79 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.78 2008/09/15 19:50:28 jdc Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.79 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -119,6 +119,8 @@ static int gem_mii_readreg(struct device *, int, int);
|
||||||
static void gem_mii_writereg(struct device *, int, int, int);
|
static void gem_mii_writereg(struct device *, int, int, int);
|
||||||
static void gem_mii_statchg(struct device *);
|
static void gem_mii_statchg(struct device *);
|
||||||
|
|
||||||
|
static int gem_ifflags_cb(struct ethercom *);
|
||||||
|
|
||||||
void gem_statuschange(struct gem_softc *);
|
void gem_statuschange(struct gem_softc *);
|
||||||
|
|
||||||
int gem_ser_mediachange(struct ifnet *);
|
int gem_ser_mediachange(struct ifnet *);
|
||||||
|
@ -451,6 +453,7 @@ gem_attach(sc, enaddr)
|
||||||
/* Attach the interface. */
|
/* Attach the interface. */
|
||||||
if_attach(ifp);
|
if_attach(ifp);
|
||||||
ether_ifattach(ifp, enaddr);
|
ether_ifattach(ifp, enaddr);
|
||||||
|
ether_set_ifflags_cb(&sc->sc_ethercom, gem_ifflags_cb);
|
||||||
|
|
||||||
sc->sc_sh = shutdownhook_establish(gem_shutdown, sc);
|
sc->sc_sh = shutdownhook_establish(gem_shutdown, sc);
|
||||||
if (sc->sc_sh == NULL)
|
if (sc->sc_sh == NULL)
|
||||||
|
@ -2472,38 +2475,33 @@ gem_ser_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||||
ifmr->ifm_status = sc->sc_mii.mii_media_status;
|
ifmr->ifm_status = sc->sc_mii.mii_media_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
gem_ifflags_cb(struct ethercom *ec)
|
||||||
|
{
|
||||||
|
struct ifnet *ifp = &ec->ec_if;
|
||||||
|
struct gem_softc *sc = ifp->if_softc;
|
||||||
|
int change = ifp->if_flags ^ sc->sc_if_flags;
|
||||||
|
|
||||||
|
if ((change & ~(IFF_CANTCHANGE|IFF_DEBUG)) != 0)
|
||||||
|
return ENETRESET;
|
||||||
|
else if ((change & IFF_PROMISC) != 0)
|
||||||
|
gem_setladrf(sc);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Process an ioctl request.
|
* Process an ioctl request.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
gem_ioctl(ifp, cmd, data)
|
gem_ioctl(struct ifnet *ifp, unsigned long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct gem_softc *sc = ifp->if_softc;
|
struct gem_softc *sc = ifp->if_softc;
|
||||||
int s, error = 0;
|
int s, error = 0;
|
||||||
|
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {
|
||||||
case SIOCSIFFLAGS:
|
|
||||||
#define RESETIGN (IFF_CANTCHANGE|IFF_DEBUG)
|
|
||||||
if (((ifp->if_flags & (IFF_UP|IFF_RUNNING))
|
|
||||||
== (IFF_UP|IFF_RUNNING))
|
|
||||||
&& ((ifp->if_flags & (~RESETIGN))
|
|
||||||
== (sc->sc_if_flags & (~RESETIGN)))) {
|
|
||||||
gem_setladrf(sc);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#undef RESETIGN
|
|
||||||
/*FALLTHROUGH*/
|
|
||||||
default:
|
|
||||||
if ((error = ether_ioctl(ifp, cmd, data)) != ENETRESET)
|
|
||||||
break;
|
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
|
if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
|
||||||
;
|
;
|
||||||
else if (ifp->if_flags & IFF_RUNNING) {
|
else if (ifp->if_flags & IFF_RUNNING) {
|
||||||
|
@ -2513,7 +2511,6 @@ gem_ioctl(ifp, cmd, data)
|
||||||
*/
|
*/
|
||||||
gem_setladrf(sc);
|
gem_setladrf(sc);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try to get things going again */
|
/* Try to get things going again */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: hd64570.c,v 1.39 2008/04/08 12:07:26 cegger Exp $ */
|
/* $NetBSD: hd64570.c,v 1.40 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999 Christian E. Hopps
|
* Copyright (c) 1999 Christian E. Hopps
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.39 2008/04/08 12:07:26 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.40 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -926,10 +926,10 @@ sca_output(
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
sca_ioctl(ifp, cmd, addr)
|
sca_ioctl(ifp, cmd, data)
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
u_long cmd;
|
u_long cmd;
|
||||||
void *addr;
|
void *data;
|
||||||
{
|
{
|
||||||
struct ifreq *ifr;
|
struct ifreq *ifr;
|
||||||
struct ifaddr *ifa;
|
struct ifaddr *ifa;
|
||||||
|
@ -938,12 +938,12 @@ sca_ioctl(ifp, cmd, addr)
|
||||||
|
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
ifr = (struct ifreq *)addr;
|
ifr = (struct ifreq *)data;
|
||||||
ifa = (struct ifaddr *)addr;
|
ifa = (struct ifaddr *)data;
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
switch(ifa->ifa_addr->sa_family) {
|
switch(ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
|
@ -997,6 +997,8 @@ sca_ioctl(ifp, cmd, addr)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifr->ifr_flags & IFF_UP) {
|
if (ifr->ifr_flags & IFF_UP) {
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
sca_port_up(ifp->if_softc);
|
sca_port_up(ifp->if_softc);
|
||||||
|
@ -1008,7 +1010,7 @@ sca_ioctl(ifp, cmd, addr)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ifioctl_common(ifp, cmd, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: hme.c,v 1.66 2008/05/04 17:06:09 xtraeme Exp $ */
|
/* $NetBSD: hme.c,v 1.67 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.66 2008/05/04 17:06:09 xtraeme Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.67 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
/* #define HMEDEBUG */
|
/* #define HMEDEBUG */
|
||||||
|
|
||||||
|
@ -1400,10 +1400,7 @@ hme_mediachange(ifp)
|
||||||
* Process an ioctl request.
|
* Process an ioctl request.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
hme_ioctl(ifp, cmd, data)
|
hme_ioctl(struct ifnet *ifp, unsigned long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct hme_softc *sc = ifp->if_softc;
|
struct hme_softc *sc = ifp->if_softc;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
@ -1413,7 +1410,7 @@ hme_ioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
|
@ -1435,25 +1432,32 @@ hme_ioctl(ifp, cmd, data)
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
#ifdef HMEDEBUG
|
#ifdef HMEDEBUG
|
||||||
sc->sc_debug = (ifp->if_flags & IFF_DEBUG) != 0 ? 1 : 0;
|
{
|
||||||
|
struct ifreq *ifr = data;
|
||||||
|
sc->sc_debug =
|
||||||
|
(ifr->ifr_flags & IFF_DEBUG) != 0 ? 1 : 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
*/
|
*/
|
||||||
hme_stop(sc, false);
|
hme_stop(sc, false);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
error = hme_init(sc);
|
error = hme_init(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0) {
|
break;
|
||||||
|
case IFF_UP|IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If setting debug or promiscuous mode, do not reset
|
* If setting debug or promiscuous mode, do not reset
|
||||||
* the chip; for everything else, call hme_init()
|
* the chip; for everything else, call hme_init()
|
||||||
|
@ -1468,6 +1472,9 @@ hme_ioctl(ifp, cmd, data)
|
||||||
error = hme_init(sc);
|
error = hme_init(sc);
|
||||||
}
|
}
|
||||||
#undef RESETIGN
|
#undef RESETIGN
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sc->sc_ec_capenable != sc->sc_ethercom.ec_capenable)
|
if (sc->sc_ec_capenable != sc->sc_ethercom.ec_capenable)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: i82586.c,v 1.62 2008/04/28 20:23:50 martin Exp $ */
|
/* $NetBSD: i82586.c,v 1.63 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||||
|
@ -137,7 +137,7 @@ Mode of operation:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.62 2008/04/28 20:23:50 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.63 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -1772,10 +1772,7 @@ i82586_stop(
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
i82586_ioctl(ifp, cmd, data)
|
i82586_ioctl(struct ifnet *ifp, unsigned long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct ie_softc *sc = ifp->if_softc;
|
struct ie_softc *sc = ifp->if_softc;
|
||||||
struct ifreq *ifr = (struct ifreq *)data;
|
struct ifreq *ifr = (struct ifreq *)data;
|
||||||
|
@ -1829,7 +1826,7 @@ again:
|
||||||
memcmp(enm->enm_addrlo, enm->enm_addrhi, 6) != 0) {
|
memcmp(enm->enm_addrlo, enm->enm_addrhi, 6) != 0) {
|
||||||
sc->sc_ethercom.ec_if.if_flags |= IFF_ALLMULTI;
|
sc->sc_ethercom.ec_if.if_flags |= IFF_ALLMULTI;
|
||||||
i82586_ioctl(&sc->sc_ethercom.ec_if,
|
i82586_ioctl(&sc->sc_ethercom.ec_if,
|
||||||
SIOCSIFFLAGS, (void *)0);
|
SIOCSIFFLAGS, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ETHER_NEXT_MULTI(step, enm);
|
ETHER_NEXT_MULTI(step, enm);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: lance.c,v 1.41 2008/04/28 20:23:50 martin Exp $ */
|
/* $NetBSD: lance.c,v 1.42 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: lance.c,v 1.41 2008/04/28 20:23:50 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: lance.c,v 1.42 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "rnd.h"
|
#include "rnd.h"
|
||||||
|
@ -543,31 +543,25 @@ lance_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
|
||||||
case SIOCSIFFLAGS:
|
|
||||||
error = ether_ioctl(ifp, cmd, data);
|
|
||||||
break;
|
|
||||||
case SIOCADDMULTI:
|
|
||||||
case SIOCDELMULTI:
|
|
||||||
if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {
|
|
||||||
/*
|
|
||||||
* Multicast list has changed; set the hardware filter
|
|
||||||
* accordingly.
|
|
||||||
*/
|
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
|
||||||
lance_reset(sc);
|
|
||||||
error = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SIOCGIFMEDIA:
|
case SIOCGIFMEDIA:
|
||||||
case SIOCSIFMEDIA:
|
case SIOCSIFMEDIA:
|
||||||
error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd);
|
error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
if ((error = ether_ioctl(ifp, cmd, data)) != ENETRESET)
|
||||||
|
break;
|
||||||
|
error = 0;
|
||||||
|
if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
|
||||||
|
break;
|
||||||
|
if (ifp->if_flags & IFF_RUNNING) {
|
||||||
|
/*
|
||||||
|
* Multicast list has changed; set the hardware filter
|
||||||
|
* accordingly.
|
||||||
|
*/
|
||||||
|
lance_reset(sc);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: lemac.c,v 1.35 2008/04/08 12:07:26 cegger Exp $ */
|
/* $NetBSD: lemac.c,v 1.36 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1994, 1995, 1997 Matt Thomas <matt@3am-software.com>
|
* Copyright (c) 1994, 1995, 1997 Matt Thomas <matt@3am-software.com>
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.35 2008/04/08 12:07:26 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.36 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "rnd.h"
|
#include "rnd.h"
|
||||||
|
@ -757,7 +757,7 @@ lemac_ifioctl(
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR: {
|
case SIOCINITIFADDR: {
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
@ -779,6 +779,8 @@ lemac_ifioctl(
|
||||||
}
|
}
|
||||||
|
|
||||||
case SIOCSIFFLAGS: {
|
case SIOCSIFFLAGS: {
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
lemac_init(sc);
|
lemac_init(sc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -805,7 +807,7 @@ lemac_ifioctl(
|
||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: mb86950.c,v 1.11 2008/04/08 12:07:26 cegger Exp $ */
|
/* $NetBSD: mb86950.c,v 1.12 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
|
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.11 2008/04/08 12:07:26 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.12 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Device driver for Fujitsu mb86950 based Ethernet cards.
|
* Device driver for Fujitsu mb86950 based Ethernet cards.
|
||||||
|
@ -444,10 +444,7 @@ mb86950_watchdog(ifp)
|
||||||
* Process an ioctl request.
|
* Process an ioctl request.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
mb86950_ioctl(ifp, cmd, data)
|
mb86950_ioctl(struct ifnet *ifp, unsigned long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct mb86950_softc *sc = ifp->if_softc;
|
struct mb86950_softc *sc = ifp->if_softc;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
@ -458,32 +455,34 @@ mb86950_ioctl(ifp, cmd, data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
/* XXX depreciated ? What should I use instead? */
|
/* XXX deprecated ? What should I use instead? */
|
||||||
if ((error = mb86950_enable(sc)) != 0)
|
if ((error = mb86950_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
|
mb86950_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
|
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
mb86950_init(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
mb86950_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
|
@ -491,9 +490,8 @@ mb86950_ioctl(ifp, cmd, data)
|
||||||
mb86950_stop(sc);
|
mb86950_stop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
mb86950_disable(sc);
|
mb86950_disable(sc);
|
||||||
|
break;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
case IFF_UP:
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
|
@ -501,15 +499,19 @@ mb86950_ioctl(ifp, cmd, data)
|
||||||
if ((error = mb86950_enable(sc)) != 0)
|
if ((error = mb86950_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
mb86950_init(sc);
|
mb86950_init(sc);
|
||||||
|
break;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0) {
|
case IFF_UP|IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* Reset the interface to pick up changes in any other
|
* Reset the interface to pick up changes in any other
|
||||||
* flags that affect hardware registers.
|
* flags that affect hardware registers.
|
||||||
*/
|
*/
|
||||||
/* Setmode not supported
|
#if 0
|
||||||
|
/* Setmode not supported */
|
||||||
mb86950_setmode(sc);
|
mb86950_setmode(sc);
|
||||||
*/
|
#endif
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ESTAR_DEBUG >= 1
|
#if ESTAR_DEBUG >= 1
|
||||||
|
@ -528,7 +530,7 @@ mb86950_ioctl(ifp, cmd, data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: mb86960.c,v 1.70 2008/04/12 06:37:51 tsutsui Exp $ */
|
/* $NetBSD: mb86960.c,v 1.71 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
|
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.70 2008/04/12 06:37:51 tsutsui Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.71 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
|
* Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
|
||||||
|
@ -1188,27 +1188,29 @@ mb86960_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
if ((error = mb86960_enable(sc)) != 0)
|
if ((error = mb86960_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
|
mb86960_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
mb86960_init(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
mb86960_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
|
@ -1216,8 +1218,8 @@ mb86960_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
mb86960_stop(sc);
|
mb86960_stop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
mb86960_disable(sc);
|
mb86960_disable(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
|
@ -1225,12 +1227,16 @@ mb86960_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
if ((error = mb86960_enable(sc)) != 0)
|
if ((error = mb86960_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
mb86960_init(sc);
|
mb86960_init(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0) {
|
break;
|
||||||
|
case IFF_UP|IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* Reset the interface to pick up changes in any other
|
* Reset the interface to pick up changes in any other
|
||||||
* flags that affect hardware registers.
|
* flags that affect hardware registers.
|
||||||
*/
|
*/
|
||||||
mb86960_setmode(sc);
|
mb86960_setmode(sc);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
#if FE_DEBUG >= 1
|
#if FE_DEBUG >= 1
|
||||||
/* "ifconfig fe0 debug" to print register dump. */
|
/* "ifconfig fe0 debug" to print register dump. */
|
||||||
|
@ -1267,7 +1273,7 @@ mb86960_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: midway.c,v 1.82 2008/09/08 23:36:54 gmcgarry Exp $ */
|
/* $NetBSD: midway.c,v 1.83 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
/* (sync'd to midway.c 1.68) */
|
/* (sync'd to midway.c 1.68) */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.82 2008/09/08 23:36:54 gmcgarry Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.83 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_natm.h"
|
#include "opt_natm.h"
|
||||||
|
|
||||||
|
@ -1199,39 +1199,30 @@ void *data;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
#ifdef INET6
|
|
||||||
case SIOCSIFADDR_IN6:
|
|
||||||
#endif
|
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
en_reset(sc);
|
||||||
|
en_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
en_reset(sc);
|
|
||||||
en_init(sc);
|
|
||||||
ifa->ifa_rtrequest = atm_rtrequest; /* ??? */
|
ifa->ifa_rtrequest = atm_rtrequest; /* ??? */
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
en_reset(sc);
|
|
||||||
en_init(sc);
|
|
||||||
ifa->ifa_rtrequest = atm_rtrequest; /* ??? */
|
ifa->ifa_rtrequest = atm_rtrequest; /* ??? */
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
/* what to do if not INET? */
|
/* what to do if not INET? */
|
||||||
en_reset(sc);
|
|
||||||
en_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCGIFADDR:
|
|
||||||
error = EINVAL;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
#ifdef ATM_PVCEXT
|
#ifdef ATM_PVCEXT
|
||||||
/* point-2-point pvc is allowed to change if_flags */
|
/* point-2-point pvc is allowed to change if_flags */
|
||||||
if (((ifp->if_flags & IFF_UP) && !(ifp->if_flags & IFF_RUNNING))
|
if (((ifp->if_flags & IFF_UP) && !(ifp->if_flags & IFF_RUNNING))
|
||||||
|
@ -1344,7 +1335,7 @@ void *data;
|
||||||
#endif /* ATM_PVCEXT */
|
#endif /* ATM_PVCEXT */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ifioctl_common(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: pdq_ifsubr.c,v 1.52 2008/04/08 12:07:27 cegger Exp $ */
|
/* $NetBSD: pdq_ifsubr.c,v 1.53 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1995, 1996 Matt Thomas <matt@3am-software.com>
|
* Copyright (c) 1995, 1996 Matt Thomas <matt@3am-software.com>
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c,v 1.52 2008/04/08 12:07:27 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c,v 1.53 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#ifdef __NetBSD__
|
#ifdef __NetBSD__
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -105,21 +105,6 @@ __KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c,v 1.52 2008/04/08 12:07:27 cegger Exp $
|
||||||
#include "pdqreg.h"
|
#include "pdqreg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__bsdi__) && _BSDI_VERSION < 199506 /* XXX */
|
|
||||||
static void
|
|
||||||
arp_ifinit(
|
|
||||||
struct arpcom *ac,
|
|
||||||
struct ifaddr *ifa)
|
|
||||||
{
|
|
||||||
sc->sc_ac.ac_ipaddr = IA_SIN(ifa)->sin_addr;
|
|
||||||
arpwhohas(&sc->sc_ac, &IA_SIN(ifa)->sin_addr);
|
|
||||||
#if _BSDI_VERSION >= 199401
|
|
||||||
ifa->ifa_rtrequest = arp_rtrequest;
|
|
||||||
ifa->ifa_flags |= RTF_CLONING;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
pdq_ifinit(
|
pdq_ifinit(
|
||||||
pdq_softc_t *sc)
|
pdq_softc_t *sc)
|
||||||
|
@ -425,35 +410,25 @@ pdq_ifioctl(
|
||||||
s = PDQ_OS_SPL_RAISE();
|
s = PDQ_OS_SPL_RAISE();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR: {
|
case SIOCINITIFADDR: {
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
pdq_ifinit(sc);
|
||||||
switch(ifa->ifa_addr->sa_family) {
|
switch(ifa->ifa_addr->sa_family) {
|
||||||
#if defined(INET)
|
#if defined(INET)
|
||||||
case AF_INET: {
|
case AF_INET:
|
||||||
pdq_ifinit(sc);
|
|
||||||
PDQ_ARP_IFINIT(sc, ifa);
|
PDQ_ARP_IFINIT(sc, ifa);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
#endif /* INET */
|
#endif /* INET */
|
||||||
|
default:
|
||||||
|
|
||||||
default: {
|
|
||||||
pdq_ifinit(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SIOCGIFADDR: {
|
|
||||||
struct ifreq *ifr = (struct ifreq *)data;
|
|
||||||
error = ifreq_setaddr(cmd, ifr,
|
|
||||||
(const struct sockaddr *)sc->sc_if.if_sadl);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case SIOCSIFFLAGS: {
|
case SIOCSIFFLAGS: {
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
pdq_ifinit(sc);
|
pdq_ifinit(sc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -500,7 +475,7 @@ pdq_ifioctl(
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: rrunner.c,v 1.67 2008/06/08 12:43:51 tsutsui Exp $ */
|
/* $NetBSD: rrunner.c,v 1.68 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.67 2008/06/08 12:43:51 tsutsui Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.68 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
|
||||||
|
@ -2939,7 +2939,7 @@ eshioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
if ((sc->sc_flags & ESH_FL_INITIALIZED) == 0) {
|
if ((sc->sc_flags & ESH_FL_INITIALIZED) == 0) {
|
||||||
eshinit(sc);
|
eshinit(sc);
|
||||||
|
@ -2973,6 +2973,8 @@ eshioctl(ifp, cmd, data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((ifp->if_flags & IFF_UP) == 0 &&
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
(ifp->if_flags & IFF_RUNNING) != 0) {
|
||||||
/*
|
/*
|
||||||
|
@ -3021,7 +3023,7 @@ eshioctl(ifp, cmd, data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: rt2560.c,v 1.19 2008/04/08 12:07:27 cegger Exp $ */
|
/* $NetBSD: rt2560.c,v 1.20 2008/11/07 00:20:02 dyoung Exp $ */
|
||||||
/* $OpenBSD: rt2560.c,v 1.15 2006/04/20 20:31:12 miod Exp $ */
|
/* $OpenBSD: rt2560.c,v 1.15 2006/04/20 20:31:12 miod Exp $ */
|
||||||
/* $FreeBSD: rt2560.c,v 1.3 2006/03/21 21:15:43 damien Exp $*/
|
/* $FreeBSD: rt2560.c,v 1.3 2006/03/21 21:15:43 damien Exp $*/
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
* http://www.ralinktech.com/
|
* http://www.ralinktech.com/
|
||||||
*/
|
*/
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.19 2008/04/08 12:07:27 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.20 2008/11/07 00:20:02 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -2201,6 +2201,8 @@ rt2560_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
if (ifp->if_flags & IFF_RUNNING)
|
||||||
rt2560_update_promisc(sc);
|
rt2560_update_promisc(sc);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: rt2661.c,v 1.24 2008/04/29 22:21:45 scw Exp $ */
|
/* $NetBSD: rt2661.c,v 1.25 2008/11/07 00:20:03 dyoung Exp $ */
|
||||||
/* $OpenBSD: rt2661.c,v 1.17 2006/05/01 08:41:11 damien Exp $ */
|
/* $OpenBSD: rt2661.c,v 1.17 2006/05/01 08:41:11 damien Exp $ */
|
||||||
/* $FreeBSD: rt2560.c,v 1.5 2006/06/02 19:59:31 csjp Exp $ */
|
/* $FreeBSD: rt2560.c,v 1.5 2006/06/02 19:59:31 csjp Exp $ */
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.24 2008/04/29 22:21:45 scw Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.25 2008/11/07 00:20:03 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -1931,6 +1931,8 @@ rt2661_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
if (ifp->if_flags & IFF_RUNNING)
|
||||||
rt2661_update_promisc(sc);
|
rt2661_update_promisc(sc);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: rtw.c,v 1.104 2008/03/15 00:21:12 dyoung Exp $ */
|
/* $NetBSD: rtw.c,v 1.105 2008/11/07 00:20:03 dyoung Exp $ */
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2004, 2005, 2006, 2007 David Young. All rights
|
* Copyright (c) 2004, 2005, 2006, 2007 David Young. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.104 2008/03/15 00:21:12 dyoung Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.105 2008/11/07 00:20:03 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -2970,7 +2970,9 @@ rtw_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
s = splnet();
|
s = splnet();
|
||||||
if (cmd == SIOCSIFFLAGS) {
|
if (cmd == SIOCSIFFLAGS) {
|
||||||
if ((ifp->if_flags & IFF_UP) != 0) {
|
if ((rc = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
;
|
||||||
|
else if ((ifp->if_flags & IFF_UP) != 0) {
|
||||||
if (device_is_active(sc->sc_dev))
|
if (device_is_active(sc->sc_dev))
|
||||||
rtw_pktfilt_load(sc);
|
rtw_pktfilt_load(sc);
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: sgec.c,v 1.35 2008/03/11 05:34:01 matt Exp $ */
|
/* $NetBSD: sgec.c,v 1.36 2008/11/07 00:20:03 dyoung Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
|
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.35 2008/03/11 05:34:01 matt Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.36 2008/11/07 00:20:03 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -547,7 +547,7 @@ zeioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
switch(ifa->ifa_addr->sa_family) {
|
switch(ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
|
@ -560,8 +560,11 @@ zeioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running,
|
* If interface is marked down and it is running,
|
||||||
* stop it. (by disabling receive mechanism).
|
* stop it. (by disabling receive mechanism).
|
||||||
|
@ -569,19 +572,23 @@ zeioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
ZE_WCSR(ZE_CSR6, ZE_RCSR(ZE_CSR6) &
|
ZE_WCSR(ZE_CSR6, ZE_RCSR(ZE_CSR6) &
|
||||||
~(ZE_NICSR6_ST|ZE_NICSR6_SR));
|
~(ZE_NICSR6_ST|ZE_NICSR6_SR));
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface it marked up and it is stopped, then
|
* If interface it marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
zeinit(sc);
|
zeinit(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0) {
|
break;
|
||||||
|
case IFF_UP|IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* Send a new setup packet to match any new changes.
|
* Send a new setup packet to match any new changes.
|
||||||
* (Like IFF_PROMISC etc)
|
* (Like IFF_PROMISC etc)
|
||||||
*/
|
*/
|
||||||
ze_setup(sc);
|
ze_setup(sc);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -602,7 +609,7 @@ zeioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: smc90cx6.c,v 1.56 2008/04/28 20:23:51 martin Exp $ */
|
/* $NetBSD: smc90cx6.c,v 1.57 2008/11/07 00:20:03 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
|
* Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: smc90cx6.c,v 1.56 2008/04/28 20:23:51 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: smc90cx6.c,v 1.57 2008/11/07 00:20:03 dyoung Exp $");
|
||||||
|
|
||||||
/* #define BAHSOFTCOPY */
|
/* #define BAHSOFTCOPY */
|
||||||
#define BAHRETRANSMIT /**/
|
#define BAHRETRANSMIT /**/
|
||||||
|
@ -276,7 +276,7 @@ bah_reset(sc)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* tell the routing level about the (possibly changed) link address */
|
/* tell the routing level about the (possibly changed) link address */
|
||||||
if_set_sadl(ifp, &linkaddress, sizeof(linkaddress));
|
if_set_sadl(ifp, &linkaddress, sizeof(linkaddress), false);
|
||||||
|
|
||||||
/* POR is NMI, but we need it below: */
|
/* POR is NMI, but we need it below: */
|
||||||
sc->sc_intmask = BAH_RECON|BAH_POR;
|
sc->sc_intmask = BAH_RECON|BAH_POR;
|
||||||
|
@ -922,36 +922,39 @@ bah_ioctl(ifp, cmd, data)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
bah_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
bah_init(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
bah_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running,
|
* If interface is marked down and it is running,
|
||||||
* then stop it.
|
* then stop it.
|
||||||
*/
|
*/
|
||||||
bah_stop(sc);
|
bah_stop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
bah_init(sc);
|
bah_init(sc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -969,7 +972,7 @@ bah_ioctl(ifp, cmd, data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: smc91cxx.c,v 1.70 2008/09/03 20:36:24 rjs Exp $ */
|
/* $NetBSD: smc91cxx.c,v 1.71 2008/11/07 00:20:03 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.70 2008/09/03 20:36:24 rjs Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.71 2008/11/07 00:20:03 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -1353,27 +1353,29 @@ smc91cxx_ioctl(ifp, cmd, data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
if ((error = smc91cxx_enable(sc)) != 0)
|
if ((error = smc91cxx_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
smc91cxx_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
smc91cxx_init(sc);
|
arp_ifinit(ifp, ifa);
|
||||||
arp_ifinit(ifp, ifa);
|
break;
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
smc91cxx_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running,
|
* If interface is marked down and it is running,
|
||||||
* stop it.
|
* stop it.
|
||||||
|
@ -1381,8 +1383,8 @@ smc91cxx_ioctl(ifp, cmd, data)
|
||||||
smc91cxx_stop(sc);
|
smc91cxx_stop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
smc91cxx_disable(sc);
|
smc91cxx_disable(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped,
|
* If interface is marked up and it is stopped,
|
||||||
* start it.
|
* start it.
|
||||||
|
@ -1390,12 +1392,16 @@ smc91cxx_ioctl(ifp, cmd, data)
|
||||||
if ((error = smc91cxx_enable(sc)) != 0)
|
if ((error = smc91cxx_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
smc91cxx_init(sc);
|
smc91cxx_init(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0) {
|
break;
|
||||||
|
case IFF_UP|IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* Reset the interface to pick up changes in any
|
* Reset the interface to pick up changes in any
|
||||||
* other flags that affect hardware registers.
|
* other flags that affect hardware registers.
|
||||||
*/
|
*/
|
||||||
smc91cxx_reset(sc);
|
smc91cxx_reset(sc);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1423,7 +1429,7 @@ smc91cxx_ioctl(ifp, cmd, data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: tropic.c,v 1.34 2008/04/08 12:07:27 cegger Exp $ */
|
/* $NetBSD: tropic.c,v 1.35 2008/11/07 00:20:03 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ported to NetBSD by Onno van der Linden
|
* Ported to NetBSD by Onno van der Linden
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: tropic.c,v 1.34 2008/04/08 12:07:27 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: tropic.c,v 1.35 2008/11/07 00:20:03 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -1525,10 +1525,7 @@ struct ifnet *ifp;
|
||||||
* tr_ioctl - process an ioctl request
|
* tr_ioctl - process an ioctl request
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
tr_ioctl(ifp, cmd, data)
|
tr_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct tr_softc *sc = ifp->if_softc;
|
struct tr_softc *sc = ifp->if_softc;
|
||||||
struct ifreq *ifr = (struct ifreq *) data;
|
struct ifreq *ifr = (struct ifreq *) data;
|
||||||
|
@ -1539,68 +1536,65 @@ void *data;
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
if ((error = tr_enable(sc)) != 0)
|
if ((error = tr_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* XXX if not running */
|
||||||
|
if ((ifp->if_flags & IFF_RUNNING) == 0) {
|
||||||
|
tr_init(sc); /* before arp_ifinit/arpwhohas */
|
||||||
|
tr_sleep(sc);
|
||||||
|
}
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
/* XXX if not running */
|
|
||||||
if ((ifp->if_flags & IFF_RUNNING) == 0) {
|
|
||||||
tr_init(sc); /* before arp_ifinit */
|
|
||||||
tr_sleep(sc);
|
|
||||||
}
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif /*INET*/
|
#endif /*INET*/
|
||||||
default:
|
default:
|
||||||
/* XXX if not running */
|
|
||||||
if ((ifp->if_flags & IFF_RUNNING) == 0) {
|
|
||||||
tr_init(sc); /* before arpwhohas */
|
|
||||||
tr_sleep(sc);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
/*
|
/*
|
||||||
* 1- If the adapter is DOWN , turn the device off
|
* 1- If the adapter is DOWN , turn the device off
|
||||||
* ie. adapter down but still running
|
* ie. adapter down but still running
|
||||||
* 2- If the adapter is UP, turn the device on
|
* 2- If the adapter is UP, turn the device on
|
||||||
* ie. adapter up but not running yet
|
* ie. adapter up but not running yet
|
||||||
*/
|
*/
|
||||||
if ((ifp->if_flags & (IFF_RUNNING | IFF_UP)) == IFF_RUNNING) {
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
tr_stop(sc);
|
tr_stop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
tr_disable(sc);
|
tr_disable(sc);
|
||||||
}
|
break;
|
||||||
else if ((ifp->if_flags & (IFF_RUNNING | IFF_UP)) == IFF_UP) {
|
case IFF_UP:
|
||||||
if ((error = tr_enable(sc)) != 0)
|
if ((error = tr_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
tr_init(sc);
|
tr_init(sc);
|
||||||
tr_sleep(sc);
|
tr_sleep(sc);
|
||||||
}
|
break;
|
||||||
else {
|
default:
|
||||||
/*
|
/*
|
||||||
* XXX handle other flag changes
|
* XXX handle other flag changes
|
||||||
*/
|
*/
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SIOCGIFMEDIA:
|
case SIOCGIFMEDIA:
|
||||||
case SIOCSIFMEDIA:
|
case SIOCSIFMEDIA:
|
||||||
error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd);
|
error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd);
|
||||||
break;
|
break;
|
||||||
#ifdef SIOCSIFMTU
|
|
||||||
case SIOCSIFMTU:
|
case SIOCSIFMTU:
|
||||||
if (ifr->ifr_mtu > sc->sc_maxmtu)
|
if (ifr->ifr_mtu > sc->sc_maxmtu)
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
else if ((error = ifioctl_common(ifp, cmd, data)) == ENETRESET)
|
else if ((error = ifioctl_common(ifp, cmd, data)) == ENETRESET)
|
||||||
error = 0;
|
error = 0;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ifioctl_common(ifp, cmd, data);
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
return (error);
|
return (error);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: tulip.c,v 1.163 2008/04/28 20:23:51 martin Exp $ */
|
/* $NetBSD: tulip.c,v 1.164 2008/11/07 00:20:03 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.163 2008/04/28 20:23:51 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.164 2008/11/07 00:20:03 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ static void tlp_watchdog(struct ifnet *);
|
||||||
static int tlp_ioctl(struct ifnet *, u_long, void *);
|
static int tlp_ioctl(struct ifnet *, u_long, void *);
|
||||||
static int tlp_init(struct ifnet *);
|
static int tlp_init(struct ifnet *);
|
||||||
static void tlp_stop(struct ifnet *, int);
|
static void tlp_stop(struct ifnet *, int);
|
||||||
|
static int tlp_ifflags_cb(struct ethercom *);
|
||||||
|
|
||||||
static void tlp_rxdrain(struct tulip_softc *);
|
static void tlp_rxdrain(struct tulip_softc *);
|
||||||
static int tlp_add_rxbuf(struct tulip_softc *, int);
|
static int tlp_add_rxbuf(struct tulip_softc *, int);
|
||||||
|
@ -525,6 +526,7 @@ tlp_attach(struct tulip_softc *sc, const u_int8_t *enaddr)
|
||||||
*/
|
*/
|
||||||
if_attach(ifp);
|
if_attach(ifp);
|
||||||
ether_ifattach(ifp, enaddr);
|
ether_ifattach(ifp, enaddr);
|
||||||
|
ether_set_ifflags_cb(&sc->sc_ethercom, tlp_ifflags_cb);
|
||||||
#if NRND > 0
|
#if NRND > 0
|
||||||
rnd_attach_source(&sc->sc_rnd_source, device_xname(&sc->sc_dev),
|
rnd_attach_source(&sc->sc_rnd_source, device_xname(&sc->sc_dev),
|
||||||
RND_TYPE_NET, 0);
|
RND_TYPE_NET, 0);
|
||||||
|
@ -958,6 +960,24 @@ tlp_watchdog(struct ifnet *ifp)
|
||||||
tlp_start(ifp);
|
tlp_start(ifp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the interface is up and running, only modify the receive
|
||||||
|
* filter when setting promiscuous or debug mode. Otherwise fall
|
||||||
|
* through to ether_ioctl, which will reset the chip.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
tlp_ifflags_cb(struct ethercom *ec)
|
||||||
|
{
|
||||||
|
struct ifnet *ifp = &ec->ec_if;
|
||||||
|
struct tulip_softc *sc = ifp->if_softc;
|
||||||
|
int change = ifp->if_flags ^ sc->sc_if_flags;
|
||||||
|
|
||||||
|
if ((change & ~(IFF_CANTCHANGE|IFF_DEBUG)) != 0)
|
||||||
|
return ENETRESET;
|
||||||
|
if ((change & IFF_PROMISC) != 0)
|
||||||
|
(*sc->sc_filter_setup)(sc);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* tlp_ioctl: [ifnet interface function]
|
* tlp_ioctl: [ifnet interface function]
|
||||||
*
|
*
|
||||||
|
@ -977,23 +997,6 @@ tlp_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
case SIOCGIFMEDIA:
|
case SIOCGIFMEDIA:
|
||||||
error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
|
error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
|
||||||
/* If the interface is up and running, only modify the receive
|
|
||||||
* filter when setting promiscuous or debug mode. Otherwise
|
|
||||||
* fall through to ether_ioctl, which will reset the chip.
|
|
||||||
*/
|
|
||||||
#define RESETIGN (IFF_CANTCHANGE|IFF_DEBUG)
|
|
||||||
if (((ifp->if_flags & (IFF_UP|IFF_RUNNING))
|
|
||||||
== (IFF_UP|IFF_RUNNING))
|
|
||||||
&& ((ifp->if_flags & (~RESETIGN))
|
|
||||||
== (sc->sc_if_flags & (~RESETIGN)))) {
|
|
||||||
/* Set up the receive filter. */
|
|
||||||
(*sc->sc_filter_setup)(sc);
|
|
||||||
error = 0;
|
|
||||||
break;
|
|
||||||
#undef RESETIGN
|
|
||||||
}
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
default:
|
default:
|
||||||
error = ether_ioctl(ifp, cmd, data);
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
if (error == ENETRESET) {
|
if (error == ENETRESET) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: wi.c,v 1.226 2008/04/28 20:23:51 martin Exp $ */
|
/* $NetBSD: wi.c,v 1.227 2008/11/07 00:20:03 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2004 The NetBSD Foundation, Inc.
|
* Copyright (c) 2004 The NetBSD Foundation, Inc.
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.226 2008/04/28 20:23:51 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.227 2008/11/07 00:20:03 dyoung Exp $");
|
||||||
|
|
||||||
#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */
|
#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */
|
||||||
#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */
|
#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */
|
||||||
|
@ -1325,6 +1325,8 @@ wi_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
/*
|
/*
|
||||||
* Can't do promisc and hostap at the same time. If all that's
|
* Can't do promisc and hostap at the same time. If all that's
|
||||||
* changing is the promisc flag, try to short-circuit a call to
|
* changing is the promisc flag, try to short-circuit a call to
|
||||||
|
@ -2260,8 +2262,9 @@ wi_set_cfg(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
len = (wreq.wi_len - 1) * 2;
|
len = (wreq.wi_len - 1) * 2;
|
||||||
switch (wreq.wi_type) {
|
switch (wreq.wi_type) {
|
||||||
case WI_RID_MAC_NODE:
|
case WI_RID_MAC_NODE:
|
||||||
|
/* XXX convert to SIOCALIFADDR, AF_LINK, IFLR_ACTIVE */
|
||||||
(void)memcpy(ic->ic_myaddr, wreq.wi_val, ETHER_ADDR_LEN);
|
(void)memcpy(ic->ic_myaddr, wreq.wi_val, ETHER_ADDR_LEN);
|
||||||
if_set_sadl(ifp, ic->ic_myaddr, ETHER_ADDR_LEN);
|
if_set_sadl(ifp, ic->ic_myaddr, ETHER_ADDR_LEN, false);
|
||||||
wi_write_rid(sc, WI_RID_MAC_NODE, ic->ic_myaddr,
|
wi_write_rid(sc, WI_RID_MAC_NODE, ic->ic_myaddr,
|
||||||
IEEE80211_ADDR_LEN);
|
IEEE80211_ADDR_LEN);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_fwip.c,v 1.15 2008/06/24 10:13:51 gmcgarry Exp $ */
|
/* $NetBSD: if_fwip.c,v 1.16 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2004
|
* Copyright (c) 2004
|
||||||
* Doug Rabson
|
* Doug Rabson
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_fwip.c,v 1.15 2008/06/24 10:13:51 gmcgarry Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_fwip.c,v 1.16 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#ifdef HAVE_KERNEL_OPTION_HEADERS
|
#ifdef HAVE_KERNEL_OPTION_HEADERS
|
||||||
#include "opt_device_polling.h"
|
#include "opt_device_polling.h"
|
||||||
|
@ -540,19 +540,13 @@ fwip_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
s = splfwnet();
|
s = splfwnet();
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
#if defined(__FreeBSD__)
|
;
|
||||||
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
|
else if (ifp->if_flags & IFF_UP) {
|
||||||
#elif defined(__NetBSD__)
|
|
||||||
if (!(ifp->if_flags & IFF_RUNNING))
|
if (!(ifp->if_flags & IFF_RUNNING))
|
||||||
#endif
|
|
||||||
FWIP_INIT(fwip);
|
FWIP_INIT(fwip);
|
||||||
} else {
|
} else {
|
||||||
#if defined(__FreeBSD__)
|
|
||||||
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
|
|
||||||
#elif defined(__NetBSD__)
|
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
if (ifp->if_flags & IFF_RUNNING)
|
||||||
#endif
|
|
||||||
FWIP_STOP(fwip);
|
FWIP_STOP(fwip);
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
|
@ -592,22 +586,11 @@ fwip_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
#endif /* DEVICE_POLLING */
|
#endif /* DEVICE_POLLING */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if (defined(__FreeBSD__) && __FreeBSD_version >= 500000) || defined(__NetBSD__)
|
|
||||||
default:
|
default:
|
||||||
#else
|
|
||||||
case SIOCSIFADDR:
|
|
||||||
case SIOCGIFADDR:
|
|
||||||
case SIOCSIFMTU:
|
|
||||||
#endif
|
|
||||||
s = splfwnet();
|
s = splfwnet();
|
||||||
error = FIREWIRE_IOCTL(ifp, cmd, data);
|
error = FIREWIRE_IOCTL(ifp, cmd, data);
|
||||||
splx(s);
|
splx(s);
|
||||||
return (error);
|
return (error);
|
||||||
#if defined(__DragonFly__) || \
|
|
||||||
(defined(__FreeBSD__) && __FreeBSD_version < 500000)
|
|
||||||
default:
|
|
||||||
return (EINVAL);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.69.2.6 2005/03/31 04:24:36 wpaul Exp $");
|
__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.69.2.6 2005/03/31 04:24:36 wpaul Exp $");
|
||||||
#endif
|
#endif
|
||||||
#ifdef __NetBSD__
|
#ifdef __NetBSD__
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ndis.c,v 1.18 2008/04/08 06:12:21 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ndis.c,v 1.19 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
|
@ -2522,10 +2522,7 @@ ndis_getstate_80211(sc)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ndis_ioctl(ifp, command, data)
|
ndis_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long command;
|
|
||||||
void * data;
|
|
||||||
{
|
{
|
||||||
struct ndis_softc *sc = ifp->if_softc;
|
struct ndis_softc *sc = ifp->if_softc;
|
||||||
struct ifreq *ifr = (struct ifreq *) data;
|
struct ifreq *ifr = (struct ifreq *) data;
|
||||||
|
@ -2541,6 +2538,8 @@ ndis_ioctl(ifp, command, data)
|
||||||
|
|
||||||
switch(command) {
|
switch(command) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, command, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (ifp->if_flags & IFF_RUNNING &&
|
if (ifp->if_flags & IFF_RUNNING &&
|
||||||
ifp->if_flags & IFF_PROMISC &&
|
ifp->if_flags & IFF_PROMISC &&
|
||||||
|
@ -2561,11 +2560,7 @@ ndis_ioctl(ifp, command, data)
|
||||||
OID_GEN_CURRENT_PACKET_FILTER,
|
OID_GEN_CURRENT_PACKET_FILTER,
|
||||||
&sc->ndis_filter, &i);
|
&sc->ndis_filter, &i);
|
||||||
} else
|
} else
|
||||||
#ifdef __FreeBSD__
|
|
||||||
ndis_init(sc);
|
|
||||||
#else /* __NetBSD__ */
|
|
||||||
ndis_init(ifp);
|
ndis_init(ifp);
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
if (ifp->if_flags & IFF_RUNNING)
|
||||||
ndis_stop(sc);
|
ndis_stop(sc);
|
||||||
|
@ -2618,11 +2613,7 @@ ndis_ioctl(ifp, command, data)
|
||||||
default:
|
default:
|
||||||
sc->ndis_skip = 1;
|
sc->ndis_skip = 1;
|
||||||
if (sc->ndis_80211) {
|
if (sc->ndis_80211) {
|
||||||
#ifdef __FreeBSD__
|
|
||||||
error = ieee80211_ioctl(ifp, command, data);
|
|
||||||
#else /* __NetBSD__ */
|
|
||||||
error = ieee80211_ioctl(&sc->ic, command, data);
|
error = ieee80211_ioctl(&sc->ic, command, data);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (error == ENETRESET) {
|
if (error == ENETRESET) {
|
||||||
ndis_setstate_80211(sc);
|
ndis_setstate_80211(sc);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_eg.c,v 1.76 2008/04/08 20:08:49 cegger Exp $ */
|
/* $NetBSD: if_eg.c,v 1.77 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1993 Dean Huxley <dean@fsa.ca>
|
* Copyright (c) 1993 Dean Huxley <dean@fsa.ca>
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_eg.c,v 1.76 2008/04/08 20:08:49 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_eg.c,v 1.77 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -838,10 +838,7 @@ bad:
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
egioctl(ifp, cmd, data)
|
egioctl(struct ifnet *ifp, unsigned long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct eg_softc *sc = ifp->if_softc;
|
struct eg_softc *sc = ifp->if_softc;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
@ -851,39 +848,42 @@ egioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
|
eginit(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
eginit(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
eginit(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
*/
|
*/
|
||||||
egstop(sc);
|
egstop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
eginit(sc);
|
eginit(sc);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
sc->eg_pcb[0] = EG_CMD_GETSTATS;
|
sc->eg_pcb[0] = EG_CMD_GETSTATS;
|
||||||
sc->eg_pcb[1] = 0;
|
sc->eg_pcb[1] = 0;
|
||||||
if (egwritePCB(sc->sc_iot, sc->sc_ioh, sc->eg_pcb) != 0) {
|
if (egwritePCB(sc->sc_iot, sc->sc_ioh, sc->eg_pcb) != 0) {
|
||||||
|
@ -894,11 +894,12 @@ egioctl(ifp, cmd, data)
|
||||||
* IFF_MULTICAST, IFF_PROMISC,
|
* IFF_MULTICAST, IFF_PROMISC,
|
||||||
* IFF_LINK0, IFF_LINK1,
|
* IFF_LINK0, IFF_LINK1,
|
||||||
*/
|
*/
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_el.c,v 1.80 2008/04/08 20:08:50 cegger Exp $ */
|
/* $NetBSD: if_el.c,v 1.81 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1994, Matthew E. Kimmel. Permission is hereby granted
|
* Copyright (c) 1994, Matthew E. Kimmel. Permission is hereby granted
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_el.c,v 1.80 2008/04/08 20:08:50 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_el.c,v 1.81 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -682,10 +682,7 @@ bad:
|
||||||
* Process an ioctl request. This code needs some work - it looks pretty ugly.
|
* Process an ioctl request. This code needs some work - it looks pretty ugly.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
elioctl(ifp, cmd, data)
|
elioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct el_softc *sc = ifp->if_softc;
|
struct el_softc *sc = ifp->if_softc;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
@ -695,49 +692,53 @@ elioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
|
elinit(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
elinit(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
elinit(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
*/
|
*/
|
||||||
elstop(sc);
|
elstop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
elinit(sc);
|
elinit(sc);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
/*
|
/*
|
||||||
* Some other important flag might have changed, so
|
* Some other important flag might have changed, so
|
||||||
* reset.
|
* reset.
|
||||||
*/
|
*/
|
||||||
elreset(sc);
|
elreset(sc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_hp.c,v 1.44 2008/04/08 20:08:50 cegger Exp $ */
|
/* $NetBSD: if_hp.c,v 1.45 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/* XXX THIS DRIVER IS BROKEN. IT WILL NOT EVEN COMPILE. */
|
/* XXX THIS DRIVER IS BROKEN. IT WILL NOT EVEN COMPILE. */
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_hp.c,v 1.44 2008/04/08 20:08:50 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_hp.c,v 1.45 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "hp.h"
|
#include "hp.h"
|
||||||
#if NHP > 0
|
#if NHP > 0
|
||||||
|
@ -963,10 +963,7 @@ hpget(buf, totlen, off0, ifp)
|
||||||
/*
|
/*
|
||||||
* Process an ioctl request.
|
* Process an ioctl request.
|
||||||
*/
|
*/
|
||||||
hpioctl(ifp, cmd, data)
|
hpioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct ifaddr *ifa = (struct ifaddr *) data;
|
struct ifaddr *ifa = (struct ifaddr *) data;
|
||||||
struct hp_softc *ns = &hp_softc[ifp->if_unit];
|
struct hp_softc *ns = &hp_softc[ifp->if_unit];
|
||||||
|
@ -976,38 +973,43 @@ hpioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
|
hpinit(ifp->if_unit);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
hpinit(ifp->if_unit); /* before arpwhohas */
|
|
||||||
((struct arpcom *) ifp)->ac_ipaddr =
|
((struct arpcom *) ifp)->ac_ipaddr =
|
||||||
IA_SIN(ifa)->sin_addr;
|
IA_SIN(ifa)->sin_addr;
|
||||||
arpwhohas((struct arpcom *) ifp, &IA_SIN(ifa)->sin_addr);
|
arpwhohas((struct arpcom *) ifp, &IA_SIN(ifa)->sin_addr);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
hpinit(ifp->if_unit);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
#ifdef HP_DEBUG
|
#ifdef HP_DEBUG
|
||||||
printf("hp: setting flags, up: %s, running: %s\n",
|
printf("hp: setting flags, up: %s, running: %s\n",
|
||||||
ifp->if_flags & IFF_UP ? "yes" : "no",
|
ifp->if_flags & IFF_UP ? "yes" : "no",
|
||||||
ifp->if_flags & IFF_RUNNING ? "yes" : "no");
|
ifp->if_flags & IFF_RUNNING ? "yes" : "no");
|
||||||
#endif
|
#endif
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
/* XXX re-use ether_ioctl() */
|
||||||
ifp->if_flags & IFF_RUNNING) {
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
outb(ns->ns_port + ds_cmd, DSCM_STOP | DSCM_NODMA);
|
outb(ns->ns_port + ds_cmd, DSCM_STOP | DSCM_NODMA);
|
||||||
} else
|
break;
|
||||||
if (ifp->if_flags & IFF_UP &&
|
case IFF_UP:
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0)
|
hpinit(ifp->if_unit);
|
||||||
hpinit(ifp->if_unit);
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef notdef
|
#ifdef notdef
|
||||||
|
@ -1018,7 +1020,7 @@ hpioctl(ifp, cmd, data)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
return (error);
|
return (error);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_iy.c,v 1.80 2008/04/28 20:23:52 martin Exp $ */
|
/* $NetBSD: if_iy.c,v 1.81 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
/* #define IYDEBUG */
|
/* #define IYDEBUG */
|
||||||
/* #define IYMEMDEBUG */
|
/* #define IYMEMDEBUG */
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.80 2008/04/28 20:23:52 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.81 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -1186,10 +1186,7 @@ struct iy_softc *sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
iyioctl(ifp, cmd, data)
|
iyioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct iy_softc *sc;
|
struct iy_softc *sc;
|
||||||
struct ifaddr *ifa;
|
struct ifaddr *ifa;
|
||||||
|
@ -1209,46 +1206,50 @@ iyioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
|
iyinit(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
iyinit(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
iyinit(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
sc->promisc = ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI);
|
sc->promisc = ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI);
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
/* XXX re-use ether_ioctl() */
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
*/
|
*/
|
||||||
iystop(sc);
|
iystop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
iyinit(sc);
|
iyinit(sc);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
/*
|
/*
|
||||||
* Reset the interface to pick up changes in any other
|
* Reset the interface to pick up changes in any other
|
||||||
* flags that affect hardware registers.
|
* flags that affect hardware registers.
|
||||||
*/
|
*/
|
||||||
iystop(sc);
|
iystop(sc);
|
||||||
iyinit(sc);
|
iyinit(sc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
#ifdef IYDEBUGX
|
#ifdef IYDEBUGX
|
||||||
if (ifp->if_flags & IFF_DEBUG)
|
if (ifp->if_flags & IFF_DEBUG)
|
||||||
|
@ -1279,7 +1280,7 @@ iyioctl(ifp, cmd, data)
|
||||||
error = ifmedia_ioctl(ifp, ifr, &sc->iy_ifmedia, cmd);
|
error = ifmedia_ioctl(ifp, ifr, &sc->iy_ifmedia, cmd);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
return error;
|
return error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_gfe.c,v 1.30 2008/06/10 22:44:07 he Exp $ */
|
/* $NetBSD: if_gfe.c,v 1.31 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
|
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.30 2008/06/10 22:44:07 he Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.31 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -436,23 +436,25 @@ gfe_ifioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
error = gfe_whack(sc, GE_WHACK_START);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
error = gfe_whack(sc, GE_WHACK_START);
|
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
error = gfe_whack(sc, GE_WHACK_START);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
case IFF_UP|IFF_RUNNING:/* active->active, update */
|
case IFF_UP|IFF_RUNNING:/* active->active, update */
|
||||||
error = gfe_whack(sc, GE_WHACK_CHANGE);
|
error = gfe_whack(sc, GE_WHACK_CHANGE);
|
||||||
|
@ -490,7 +492,7 @@ gfe_ifioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: ofnet.c,v 1.41 2008/04/08 20:11:58 cegger Exp $ */
|
/* $NetBSD: ofnet.c,v 1.42 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: ofnet.c,v 1.41 2008/04/08 20:11:58 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: ofnet.c,v 1.42 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "ofnet.h"
|
#include "ofnet.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -374,7 +374,7 @@ ofnet_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
|
@ -389,20 +389,25 @@ ofnet_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
ofnet_init(of);
|
ofnet_init(of);
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/* If interface is down, but running, stop it. */
|
/* If interface is down, but running, stop it. */
|
||||||
ofnet_stop(of);
|
ofnet_stop(of);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/* If interface is up, but not running, start it. */
|
/* If interface is up, but not running, start it. */
|
||||||
ofnet_init(of);
|
ofnet_init(of);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
/* Other flags are ignored. */
|
/* Other flags are ignored. */
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
|
|
|
@ -29,7 +29,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifdef __NetBSD__
|
#ifdef __NetBSD__
|
||||||
__KERNEL_RCSID(0, "$NetBSD: cxgb_main.c,v 1.11 2008/02/07 01:21:55 dyoung Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: cxgb_main.c,v 1.12 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
#endif
|
#endif
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_main.c,v 1.36 2007/09/11 23:49:27 kmacy Exp $");
|
__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_main.c,v 1.36 2007/09/11 23:49:27 kmacy Exp $");
|
||||||
|
@ -2356,10 +2356,8 @@ cxgb_ioctl(struct ifnet *ifp, unsigned long command, void *data)
|
||||||
error = cxgb_set_mtu(p, ifr->ifr_mtu);
|
error = cxgb_set_mtu(p, ifr->ifr_mtu);
|
||||||
printf("SIOCSIFMTU: error=%d\n", error);
|
printf("SIOCSIFMTU: error=%d\n", error);
|
||||||
break;
|
break;
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
printf("SIOCSIFADDR:\n");
|
printf("SIOCINITIFADDR:\n");
|
||||||
case SIOCGIFADDR:
|
|
||||||
printf("SIOCGIFADDR:\n");
|
|
||||||
PORT_LOCK(p);
|
PORT_LOCK(p);
|
||||||
if (ifa->ifa_addr->sa_family == AF_INET) {
|
if (ifa->ifa_addr->sa_family == AF_INET) {
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
@ -2372,6 +2370,8 @@ cxgb_ioctl(struct ifnet *ifp, unsigned long command, void *data)
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
printf("SIOCSIFFLAGS:\n");
|
printf("SIOCSIFFLAGS:\n");
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
callout_drain(&p->adapter->cxgb_tick_ch);
|
callout_drain(&p->adapter->cxgb_tick_ch);
|
||||||
PORT_LOCK(p);
|
PORT_LOCK(p);
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_bge.c,v 1.152 2008/08/31 19:57:03 tron Exp $ */
|
/* $NetBSD: if_bge.c,v 1.153 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Wind River Systems
|
* Copyright (c) 2001 Wind River Systems
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.152 2008/08/31 19:57:03 tron Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.153 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "vlan.h"
|
#include "vlan.h"
|
||||||
|
@ -4290,6 +4290,8 @@ bge_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
|
|
||||||
switch(command) {
|
switch(command) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, command, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
/*
|
/*
|
||||||
* If only the state of the PROMISC flag changed,
|
* If only the state of the PROMISC flag changed,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_de.c,v 1.128 2008/04/10 19:13:36 cegger Exp $ */
|
/* $NetBSD: if_de.c,v 1.129 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
|
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
* board which support 21040, 21041, or 21140 (mostly).
|
* board which support 21040, 21041, or 21140 (mostly).
|
||||||
*/
|
*/
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.128 2008/04/10 19:13:36 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.129 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#define TULIP_HDR_DATA
|
#define TULIP_HDR_DATA
|
||||||
|
|
||||||
|
@ -4744,10 +4744,7 @@ tulip_txput_setup(
|
||||||
* defined or not.
|
* defined or not.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
tulip_ifioctl(
|
tulip_ifioctl(struct ifnet *ifp, unsigned long cmd, void *data)
|
||||||
struct ifnet * ifp,
|
|
||||||
ioctl_cmd_t cmd,
|
|
||||||
void *data)
|
|
||||||
{
|
{
|
||||||
TULIP_PERFSTART(ifioctl)
|
TULIP_PERFSTART(ifioctl)
|
||||||
tulip_softc_t * const sc = TULIP_IFP_TO_SOFTC(ifp);
|
tulip_softc_t * const sc = TULIP_IFP_TO_SOFTC(ifp);
|
||||||
|
@ -4762,32 +4759,24 @@ tulip_ifioctl(
|
||||||
s = TULIP_RAISESPL();
|
s = TULIP_RAISESPL();
|
||||||
#endif
|
#endif
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR: {
|
case SIOCINITIFADDR: {
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
tulip_init(sc);
|
||||||
switch(ifa->ifa_addr->sa_family) {
|
switch(ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET: {
|
case AF_INET:
|
||||||
tulip_init(sc);
|
|
||||||
TULIP_ARP_IFINIT(sc, ifa);
|
TULIP_ARP_IFINIT(sc, ifa);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
#endif /* INET */
|
#endif /* INET */
|
||||||
|
default:
|
||||||
|
|
||||||
default: {
|
|
||||||
tulip_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SIOCGIFADDR: {
|
|
||||||
memcpy((void *) ((struct sockaddr *)&ifr->ifr_data)->sa_data,
|
|
||||||
(void *) sc->tulip_enaddr, ETHER_ADDR_LEN);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case SIOCSIFFLAGS: {
|
case SIOCSIFFLAGS: {
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
#if !defined(IFM_ETHER)
|
#if !defined(IFM_ETHER)
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
if (ifp->if_flags & IFF_LINK0) flags |= 1;
|
if (ifp->if_flags & IFF_LINK0) flags |= 1;
|
||||||
|
@ -4882,7 +4871,7 @@ tulip_ifioctl(
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
default: {
|
default: {
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_dge.c,v 1.21 2008/04/10 19:13:36 cegger Exp $ */
|
/* $NetBSD: if_dge.c,v 1.22 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, SUNET, Swedish University Computer Network.
|
* Copyright (c) 2004, SUNET, Swedish University Computer Network.
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.21 2008/04/10 19:13:36 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.22 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "rnd.h"
|
#include "rnd.h"
|
||||||
|
@ -1428,6 +1428,8 @@ dge_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
/* extract link flags */
|
/* extract link flags */
|
||||||
if ((ifp->if_flags & IFF_LINK0) == 0 &&
|
if ((ifp->if_flags & IFF_LINK0) == 0 &&
|
||||||
(ifp->if_flags & IFF_LINK1) == 0)
|
(ifp->if_flags & IFF_LINK1) == 0)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ipw.c,v 1.42 2008/10/30 00:27:32 joerg Exp $ */
|
/* $NetBSD: if_ipw.c,v 1.43 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
/* FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp */
|
/* FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.42 2008/10/30 00:27:32 joerg Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.43 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Intel(R) PRO/Wireless 2100 MiniPCI driver
|
* Intel(R) PRO/Wireless 2100 MiniPCI driver
|
||||||
|
@ -1616,6 +1616,8 @@ ipw_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (!(ifp->if_flags & IFF_RUNNING))
|
if (!(ifp->if_flags & IFF_RUNNING))
|
||||||
ipw_init(ifp);
|
ipw_init(ifp);
|
||||||
|
@ -1994,7 +1996,6 @@ ipw_config(struct ipw_softc *sc)
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINTF(("Setting MAC to %s\n", ether_sprintf(ic->ic_myaddr)));
|
DPRINTF(("Setting MAC to %s\n", ether_sprintf(ic->ic_myaddr)));
|
||||||
if_set_sadl(ifp, ic->ic_myaddr, IEEE80211_ADDR_LEN);
|
|
||||||
error = ipw_cmd(sc, IPW_CMD_SET_MAC_ADDRESS, ic->ic_myaddr,
|
error = ipw_cmd(sc, IPW_CMD_SET_MAC_ADDRESS, ic->ic_myaddr,
|
||||||
IEEE80211_ADDR_LEN);
|
IEEE80211_ADDR_LEN);
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_iwi.c,v 1.74 2008/10/30 00:27:32 joerg Exp $ */
|
/* $NetBSD: if_iwi.c,v 1.75 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2004, 2005
|
* Copyright (c) 2004, 2005
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.74 2008/10/30 00:27:32 joerg Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.75 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
|
* Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
|
||||||
|
@ -1824,6 +1824,8 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (!(ifp->if_flags & IFF_RUNNING))
|
if (!(ifp->if_flags & IFF_RUNNING))
|
||||||
iwi_init(ifp);
|
iwi_init(ifp);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_iwn.c,v 1.24 2008/11/06 12:03:43 blymn Exp $ */
|
/* $NetBSD: if_iwn.c,v 1.25 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2007
|
* Copyright (c) 2007
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.24 2008/11/06 12:03:43 blymn Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.25 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2296,6 +2296,8 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, void * data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (!(ifp->if_flags & IFF_RUNNING))
|
if (!(ifp->if_flags & IFF_RUNNING))
|
||||||
iwn_init(ifp);
|
iwn_init(ifp);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_lmc.c,v 1.43 2008/06/27 00:53:41 gmcgarry Exp $ */
|
/* $NetBSD: if_lmc.c,v 1.44 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2002-2006 David Boggs. <boggs@boggs.palo-alto.ca.us>
|
* Copyright (c) 2002-2006 David Boggs. <boggs@boggs.palo-alto.ca.us>
|
||||||
|
@ -142,7 +142,7 @@
|
||||||
|
|
||||||
#if defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
# include <sys/cdefs.h>
|
# include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_lmc.c,v 1.43 2008/06/27 00:53:41 gmcgarry Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_lmc.c,v 1.44 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
# include <sys/param.h> /* OS version */
|
# include <sys/param.h> /* OS version */
|
||||||
/* -DLKM is passed on the compiler command line */
|
/* -DLKM is passed on the compiler command line */
|
||||||
# include "opt_inet.h" /* INET6, INET */
|
# include "opt_inet.h" /* INET6, INET */
|
||||||
|
@ -3549,11 +3549,13 @@ rawip_ioctl(softc_t *sc, u_long cmd, void *data)
|
||||||
case SIOCDELMULTI:
|
case SIOCDELMULTI:
|
||||||
if (sc->config.debug)
|
if (sc->config.debug)
|
||||||
printf("%s: rawip_ioctl: SIOCADD/DELMULTI\n", NAME_UNIT);
|
printf("%s: rawip_ioctl: SIOCADD/DELMULTI\n", NAME_UNIT);
|
||||||
case SIOCAIFADDR:
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
error = ifioctl_common(sc->ifp, cmd, data);
|
||||||
|
break;
|
||||||
|
case SIOCAIFADDR:
|
||||||
case SIOCSIFDSTADDR:
|
case SIOCSIFDSTADDR:
|
||||||
break;
|
break;
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
sc->ifp->if_flags |= IFF_UP; /* a Unix tradition */
|
sc->ifp->if_flags |= IFF_UP; /* a Unix tradition */
|
||||||
break;
|
break;
|
||||||
case SIOCSIFMTU:
|
case SIOCSIFMTU:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_nfe.c,v 1.36 2008/06/17 12:59:32 cube Exp $ */
|
/* $NetBSD: if_nfe.c,v 1.37 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
/* $OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $ */
|
/* $OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
/* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */
|
/* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.36 2008/06/17 12:59:32 cube Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.37 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -74,6 +74,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.36 2008/06/17 12:59:32 cube Exp $");
|
||||||
#include <dev/pci/if_nfereg.h>
|
#include <dev/pci/if_nfereg.h>
|
||||||
#include <dev/pci/if_nfevar.h>
|
#include <dev/pci/if_nfevar.h>
|
||||||
|
|
||||||
|
static int nfe_ifflags_cb(struct ethercom *);
|
||||||
|
|
||||||
int nfe_match(device_t, cfdata_t, void *);
|
int nfe_match(device_t, cfdata_t, void *);
|
||||||
void nfe_attach(device_t, device_t, void *);
|
void nfe_attach(device_t, device_t, void *);
|
||||||
void nfe_power(int, void *);
|
void nfe_power(int, void *);
|
||||||
|
@ -363,10 +365,8 @@ nfe_attach(device_t parent, device_t self, void *aux)
|
||||||
IFQ_SET_READY(&ifp->if_snd);
|
IFQ_SET_READY(&ifp->if_snd);
|
||||||
strlcpy(ifp->if_xname, device_xname(self), IFNAMSIZ);
|
strlcpy(ifp->if_xname, device_xname(self), IFNAMSIZ);
|
||||||
|
|
||||||
#ifdef notyet
|
|
||||||
if (sc->sc_flags & NFE_USE_JUMBO)
|
if (sc->sc_flags & NFE_USE_JUMBO)
|
||||||
ifp->if_hardmtu = NFE_JUMBO_MTU;
|
sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if NVLAN > 0
|
#if NVLAN > 0
|
||||||
if (sc->sc_flags & NFE_HW_VLAN)
|
if (sc->sc_flags & NFE_HW_VLAN)
|
||||||
|
@ -400,6 +400,7 @@ nfe_attach(device_t parent, device_t self, void *aux)
|
||||||
|
|
||||||
if_attach(ifp);
|
if_attach(ifp);
|
||||||
ether_ifattach(ifp, sc->sc_enaddr);
|
ether_ifattach(ifp, sc->sc_enaddr);
|
||||||
|
ether_set_ifflags_cb(&sc->sc_ethercom, nfe_ifflags_cb);
|
||||||
|
|
||||||
callout_init(&sc->sc_tick_ch, 0);
|
callout_init(&sc->sc_tick_ch, 0);
|
||||||
callout_setfunc(&sc->sc_tick_ch, nfe_tick, sc);
|
callout_setfunc(&sc->sc_tick_ch, nfe_tick, sc);
|
||||||
|
@ -572,18 +573,37 @@ nfe_intr(void *arg)
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
nfe_ifflags_cb(struct ethercom *ec)
|
||||||
|
{
|
||||||
|
struct ifnet *ifp = &ec->ec_if;
|
||||||
|
struct nfe_softc *sc = ifp->if_softc;
|
||||||
|
int change = ifp->if_flags ^ sc->sc_if_flags;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If only the PROMISC flag changes, then
|
||||||
|
* don't do a full re-init of the chip, just update
|
||||||
|
* the Rx filter.
|
||||||
|
*/
|
||||||
|
if ((change & ~(IFF_CANTCHANGE|IFF_DEBUG)) != 0)
|
||||||
|
return ENETRESET;
|
||||||
|
else if ((change & IFF_PROMISC) != 0)
|
||||||
|
nfe_setmulti(sc);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nfe_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
nfe_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
{
|
{
|
||||||
struct nfe_softc *sc = ifp->if_softc;
|
struct nfe_softc *sc = ifp->if_softc;
|
||||||
struct ifreq *ifr = (struct ifreq *)data;
|
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
int s, error = 0;
|
int s, error = 0;
|
||||||
|
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
nfe_init(ifp);
|
nfe_init(ifp);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
|
@ -596,35 +616,6 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SIOCSIFMTU:
|
|
||||||
if (ifr->ifr_mtu < ETHERMIN ||
|
|
||||||
((sc->sc_flags & NFE_USE_JUMBO) &&
|
|
||||||
ifr->ifr_mtu > ETHERMTU_JUMBO) ||
|
|
||||||
(!(sc->sc_flags & NFE_USE_JUMBO) &&
|
|
||||||
ifr->ifr_mtu > ETHERMTU))
|
|
||||||
error = EINVAL;
|
|
||||||
else if ((error = ifioctl_common(ifp, cmd, data)) == ENETRESET)
|
|
||||||
error = 0;
|
|
||||||
break;
|
|
||||||
case SIOCSIFFLAGS:
|
|
||||||
if (ifp->if_flags & IFF_UP) {
|
|
||||||
/*
|
|
||||||
* If only the PROMISC or ALLMULTI flag changes, then
|
|
||||||
* don't do a full re-init of the chip, just update
|
|
||||||
* the Rx filter.
|
|
||||||
*/
|
|
||||||
if ((ifp->if_flags & IFF_RUNNING) &&
|
|
||||||
((ifp->if_flags ^ sc->sc_if_flags) &
|
|
||||||
(IFF_ALLMULTI | IFF_PROMISC)) != 0) {
|
|
||||||
nfe_setmulti(sc);
|
|
||||||
} else
|
|
||||||
nfe_init(ifp);
|
|
||||||
} else {
|
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
|
||||||
nfe_stop(ifp, 1);
|
|
||||||
}
|
|
||||||
sc->sc_if_flags = ifp->if_flags;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
if ((error = ether_ioctl(ifp, cmd, data)) != ENETRESET)
|
if ((error = ether_ioctl(ifp, cmd, data)) != ENETRESET)
|
||||||
break;
|
break;
|
||||||
|
@ -637,6 +628,7 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
nfe_setmulti(sc);
|
nfe_setmulti(sc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
sc->sc_if_flags = ifp->if_flags;
|
||||||
|
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_sip.c,v 1.134 2008/05/05 20:19:09 dyoung Exp $ */
|
/* $NetBSD: if_sip.c,v 1.135 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
|
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.134 2008/05/05 20:19:09 dyoung Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.135 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "rnd.h"
|
#include "rnd.h"
|
||||||
|
@ -559,6 +559,7 @@ sip_init_rxdesc(struct sip_softc *sc, int x)
|
||||||
|
|
||||||
#define SIP_TIMEOUT 1000
|
#define SIP_TIMEOUT 1000
|
||||||
|
|
||||||
|
static int sip_ifflags_cb(struct ethercom *);
|
||||||
static void sipcom_start(struct ifnet *);
|
static void sipcom_start(struct ifnet *);
|
||||||
static void sipcom_watchdog(struct ifnet *);
|
static void sipcom_watchdog(struct ifnet *);
|
||||||
static int sipcom_ioctl(struct ifnet *, u_long, void *);
|
static int sipcom_ioctl(struct ifnet *, u_long, void *);
|
||||||
|
@ -1283,6 +1284,7 @@ sipcom_attach(device_t parent, device_t self, void *aux)
|
||||||
*/
|
*/
|
||||||
if_attach(ifp);
|
if_attach(ifp);
|
||||||
ether_ifattach(ifp, enaddr);
|
ether_ifattach(ifp, enaddr);
|
||||||
|
ether_set_ifflags_cb(&sc->sc_ethercom, sip_ifflags_cb);
|
||||||
sc->sc_prev.ec_capenable = sc->sc_ethercom.ec_capenable;
|
sc->sc_prev.ec_capenable = sc->sc_ethercom.ec_capenable;
|
||||||
sc->sc_prev.is_vlan = VLAN_ATTACHED(&(sc)->sc_ethercom);
|
sc->sc_prev.is_vlan = VLAN_ATTACHED(&(sc)->sc_ethercom);
|
||||||
sc->sc_prev.if_capenable = ifp->if_capenable;
|
sc->sc_prev.if_capenable = ifp->if_capenable;
|
||||||
|
@ -1719,6 +1721,30 @@ sipcom_watchdog(struct ifnet *ifp)
|
||||||
sipcom_start(ifp);
|
sipcom_start(ifp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the interface is up and running, only modify the receive
|
||||||
|
* filter when setting promiscuous or debug mode. Otherwise fall
|
||||||
|
* through to ether_ioctl, which will reset the chip.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
sip_ifflags_cb(struct ethercom *ec)
|
||||||
|
{
|
||||||
|
#define COMPARE_EC(sc) (((sc)->sc_prev.ec_capenable \
|
||||||
|
== (sc)->sc_ethercom.ec_capenable) \
|
||||||
|
&& ((sc)->sc_prev.is_vlan == \
|
||||||
|
VLAN_ATTACHED(&(sc)->sc_ethercom) ))
|
||||||
|
#define COMPARE_IC(sc, ifp) ((sc)->sc_prev.if_capenable == (ifp)->if_capenable)
|
||||||
|
struct ifnet *ifp = &ec->ec_if;
|
||||||
|
struct sip_softc *sc = ifp->if_softc;
|
||||||
|
int change = ifp->if_flags ^ sc->sc_if_flags;
|
||||||
|
|
||||||
|
if ((change & ~(IFF_CANTCHANGE|IFF_DEBUG)) != 0 || !COMPARE_EC(sc) ||
|
||||||
|
!COMPARE_IC(sc, ifp))
|
||||||
|
return ENETRESET;
|
||||||
|
/* Set up the receive filter. */
|
||||||
|
(*sc->sc_model->sip_variant->sipv_set_filter)(sc);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sip_ioctl: [ifnet interface function]
|
* sip_ioctl: [ifnet interface function]
|
||||||
*
|
*
|
||||||
|
@ -1762,34 +1788,7 @@ sipcom_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
}
|
}
|
||||||
sc->sc_flowflags = ifr->ifr_media & IFM_ETH_FMASK;
|
sc->sc_flowflags = ifr->ifr_media & IFM_ETH_FMASK;
|
||||||
}
|
}
|
||||||
goto ethioctl;
|
/*FALLTHROUGH*/
|
||||||
case SIOCSIFFLAGS:
|
|
||||||
/* If the interface is up and running, only modify the receive
|
|
||||||
* filter when setting promiscuous or debug mode. Otherwise
|
|
||||||
* fall through to ether_ioctl, which will reset the chip.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define COMPARE_EC(sc) (((sc)->sc_prev.ec_capenable \
|
|
||||||
== (sc)->sc_ethercom.ec_capenable) \
|
|
||||||
&& ((sc)->sc_prev.is_vlan == \
|
|
||||||
VLAN_ATTACHED(&(sc)->sc_ethercom) ))
|
|
||||||
|
|
||||||
#define COMPARE_IC(sc, ifp) ((sc)->sc_prev.if_capenable == (ifp)->if_capenable)
|
|
||||||
|
|
||||||
#define RESETIGN (IFF_CANTCHANGE|IFF_DEBUG)
|
|
||||||
if (((ifp->if_flags & (IFF_UP|IFF_RUNNING))
|
|
||||||
== (IFF_UP|IFF_RUNNING))
|
|
||||||
&& ((ifp->if_flags & (~RESETIGN))
|
|
||||||
== (sc->sc_if_flags & (~RESETIGN)))
|
|
||||||
&& COMPARE_EC(sc) && COMPARE_IC(sc, ifp)) {
|
|
||||||
/* Set up the receive filter. */
|
|
||||||
(*sc->sc_model->sip_variant->sipv_set_filter)(sc);
|
|
||||||
error = 0;
|
|
||||||
break;
|
|
||||||
#undef RESETIGN
|
|
||||||
}
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
ethioctl:
|
|
||||||
default:
|
default:
|
||||||
if ((error = ether_ioctl(ifp, cmd, data)) != ENETRESET)
|
if ((error = ether_ioctl(ifp, cmd, data)) != ENETRESET)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_sk.c,v 1.54 2008/09/09 05:54:23 cegger Exp $ */
|
/* $NetBSD: if_sk.c,v 1.55 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.54 2008/09/09 05:54:23 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.55 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "rnd.h"
|
#include "rnd.h"
|
||||||
|
@ -1003,6 +1003,8 @@ sk_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
DPRINTFN(2, ("sk_ioctl IFFLAGS\n"));
|
DPRINTFN(2, ("sk_ioctl IFFLAGS\n"));
|
||||||
|
if ((error = ifioctl_common(ifp, command, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (ifp->if_flags & IFF_RUNNING &&
|
if (ifp->if_flags & IFF_RUNNING &&
|
||||||
ifp->if_flags & IFF_PROMISC &&
|
ifp->if_flags & IFF_PROMISC &&
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ti.c,v 1.81 2008/04/10 19:13:37 cegger Exp $ */
|
/* $NetBSD: if_ti.c,v 1.82 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 1998, 1999
|
* Copyright (c) 1997, 1998, 1999
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.81 2008/04/10 19:13:37 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.82 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -2706,7 +2706,7 @@ ti_ether_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
|
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
|
@ -2737,8 +2737,7 @@ ti_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
case SIOCGIFADDR:
|
|
||||||
error = ti_ether_ioctl(ifp, command, data);
|
error = ti_ether_ioctl(ifp, command, data);
|
||||||
break;
|
break;
|
||||||
case SIOCSIFMTU:
|
case SIOCSIFMTU:
|
||||||
|
@ -2750,6 +2749,8 @@ ti_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, command, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
/*
|
/*
|
||||||
* If only the state of the PROMISC flag changed,
|
* If only the state of the PROMISC flag changed,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_txp.c,v 1.26 2008/04/10 19:13:37 cegger Exp $ */
|
/* $NetBSD: if_txp.c,v 1.27 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001
|
* Copyright (c) 2001
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.26 2008/04/10 19:13:37 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.27 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -1254,10 +1254,7 @@ txp_dma_free(sc, dma)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
txp_ioctl(ifp, command, data)
|
txp_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long command;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct txp_softc *sc = ifp->if_softc;
|
struct txp_softc *sc = ifp->if_softc;
|
||||||
struct ifreq *ifr = (struct ifreq *)data;
|
struct ifreq *ifr = (struct ifreq *)data;
|
||||||
|
@ -1274,21 +1271,22 @@ txp_ioctl(ifp, command, data)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch(command) {
|
switch(command) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
txp_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
txp_init(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif /* INET */
|
#endif /* INET */
|
||||||
default:
|
default:
|
||||||
txp_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, command, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
txp_init(sc);
|
txp_init(sc);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1318,7 +1316,7 @@ txp_ioctl(ifp, command, data)
|
||||||
error = ifmedia_ioctl(ifp, ifr, &sc->sc_ifmedia, command);
|
error = ifmedia_ioctl(ifp, ifr, &sc->sc_ifmedia, command);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, command, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_vge.c,v 1.41 2008/04/10 19:13:37 cegger Exp $ */
|
/* $NetBSD: if_vge.c,v 1.42 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2004
|
* Copyright (c) 2004
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.41 2008/04/10 19:13:37 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.42 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
|
* VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
|
||||||
|
@ -115,8 +115,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.41 2008/04/10 19:13:37 cegger Exp $");
|
||||||
|
|
||||||
#include <dev/pci/if_vgereg.h>
|
#include <dev/pci/if_vgereg.h>
|
||||||
|
|
||||||
#define VGE_JUMBO_MTU 9000
|
|
||||||
|
|
||||||
#define VGE_IFQ_MAXLEN 64
|
#define VGE_IFQ_MAXLEN 64
|
||||||
|
|
||||||
#define VGE_RING_ALIGN 256
|
#define VGE_RING_ALIGN 256
|
||||||
|
@ -295,6 +293,8 @@ struct vge_softc {
|
||||||
static inline void vge_set_txaddr(struct vge_txfrag *, bus_addr_t);
|
static inline void vge_set_txaddr(struct vge_txfrag *, bus_addr_t);
|
||||||
static inline void vge_set_rxaddr(struct vge_rxdesc *, bus_addr_t);
|
static inline void vge_set_rxaddr(struct vge_rxdesc *, bus_addr_t);
|
||||||
|
|
||||||
|
static int vge_ifflags_cb(struct ethercom *);
|
||||||
|
|
||||||
static int vge_match(struct device *, struct cfdata *, void *);
|
static int vge_match(struct device *, struct cfdata *, void *);
|
||||||
static void vge_attach(struct device *, struct device *, void *);
|
static void vge_attach(struct device *, struct device *, void *);
|
||||||
|
|
||||||
|
@ -1054,6 +1054,7 @@ vge_attach(struct device *parent, struct device *self, void *aux)
|
||||||
*/
|
*/
|
||||||
if_attach(ifp);
|
if_attach(ifp);
|
||||||
ether_ifattach(ifp, eaddr);
|
ether_ifattach(ifp, eaddr);
|
||||||
|
ether_set_ifflags_cb(&sc->sc_ethercom, vge_ifflags_cb);
|
||||||
|
|
||||||
callout_init(&sc->sc_timeout, 0);
|
callout_init(&sc->sc_timeout, 0);
|
||||||
callout_setfunc(&sc->sc_timeout, vge_tick, sc);
|
callout_setfunc(&sc->sc_timeout, vge_tick, sc);
|
||||||
|
@ -1995,6 +1996,26 @@ vge_miibus_statchg(struct device *self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
vge_ifflags_cb(struct ethercom *ec)
|
||||||
|
{
|
||||||
|
struct ifnet *ifp = &ec->ec_if;
|
||||||
|
struct vge_softc *sc = ifp->if_softc;
|
||||||
|
int change = ifp->if_flags ^ sc->sc_if_flags;
|
||||||
|
|
||||||
|
if ((change & ~(IFF_CANTCHANGE|IFF_DEBUG)) != 0)
|
||||||
|
return ENETRESET;
|
||||||
|
else if ((change & IFF_PROMISC) == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if ((ifp->if_flags & IFF_PROMISC) == 0)
|
||||||
|
CSR_CLRBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_PROMISC);
|
||||||
|
else
|
||||||
|
CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_PROMISC);
|
||||||
|
vge_setmulti(sc);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vge_ioctl(struct ifnet *ifp, u_long command, void *data)
|
vge_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
{
|
{
|
||||||
|
@ -2008,41 +2029,8 @@ vge_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
|
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (command) {
|
if ((error = ether_ioctl(ifp, command, data)) == ENETRESET) {
|
||||||
case SIOCSIFMTU:
|
|
||||||
if (ifr->ifr_mtu > VGE_JUMBO_MTU)
|
|
||||||
error = EINVAL;
|
|
||||||
else if ((error = ifioctl_common(ifp, command, data)) == ENETRESET)
|
|
||||||
error = 0;
|
|
||||||
break;
|
|
||||||
case SIOCSIFFLAGS:
|
|
||||||
if (ifp->if_flags & IFF_UP) {
|
|
||||||
if (ifp->if_flags & IFF_RUNNING &&
|
|
||||||
ifp->if_flags & IFF_PROMISC &&
|
|
||||||
(sc->sc_if_flags & IFF_PROMISC) == 0) {
|
|
||||||
CSR_SETBIT_1(sc, VGE_RXCTL,
|
|
||||||
VGE_RXCTL_RX_PROMISC);
|
|
||||||
vge_setmulti(sc);
|
|
||||||
} else if (ifp->if_flags & IFF_RUNNING &&
|
|
||||||
(ifp->if_flags & IFF_PROMISC) == 0 &&
|
|
||||||
sc->sc_if_flags & IFF_PROMISC) {
|
|
||||||
CSR_CLRBIT_1(sc, VGE_RXCTL,
|
|
||||||
VGE_RXCTL_RX_PROMISC);
|
|
||||||
vge_setmulti(sc);
|
|
||||||
} else
|
|
||||||
vge_init(ifp);
|
|
||||||
} else {
|
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
|
||||||
vge_stop(sc);
|
|
||||||
}
|
|
||||||
sc->sc_if_flags = ifp->if_flags;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if ((error = ether_ioctl(ifp, command, data)) != ENETRESET)
|
|
||||||
break;
|
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
if (command != SIOCADDMULTI && command != SIOCDELMULTI)
|
if (command != SIOCADDMULTI && command != SIOCDELMULTI)
|
||||||
;
|
;
|
||||||
else if (ifp->if_flags & IFF_RUNNING) {
|
else if (ifp->if_flags & IFF_RUNNING) {
|
||||||
|
@ -2052,8 +2040,8 @@ vge_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
*/
|
*/
|
||||||
vge_setmulti(sc);
|
vge_setmulti(sc);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
sc->sc_if_flags = ifp->if_flags;
|
||||||
|
|
||||||
splx(s);
|
splx(s);
|
||||||
return error;
|
return error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_wpi.c,v 1.39 2008/07/02 03:42:55 cube Exp $ */
|
/* $NetBSD: if_wpi.c,v 1.40 2008/11/07 00:20:07 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2006, 2007
|
* Copyright (c) 2006, 2007
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.39 2008/07/02 03:42:55 cube Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.40 2008/11/07 00:20:07 dyoung Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
|
* Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
|
||||||
|
@ -2035,6 +2035,8 @@ wpi_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (!(ifp->if_flags & IFF_RUNNING))
|
if (!(ifp->if_flags & IFF_RUNNING))
|
||||||
wpi_init(ifp);
|
wpi_init(ifp);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_cnw.c,v 1.44 2008/04/28 20:23:56 martin Exp $ */
|
/* $NetBSD: if_cnw.c,v 1.45 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
|
||||||
|
@ -105,7 +105,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.44 2008/04/28 20:23:56 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.45 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -1015,10 +1015,7 @@ cnw_intr(arg)
|
||||||
* Handle device ioctls.
|
* Handle device ioctls.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
cnw_ioctl(ifp, cmd, data)
|
cnw_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct cnw_softc *sc = ifp->if_softc;
|
struct cnw_softc *sc = ifp->if_softc;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
@ -1027,7 +1024,7 @@ cnw_ioctl(ifp, cmd, data)
|
||||||
struct lwp *l = curlwp; /*XXX*/
|
struct lwp *l = curlwp; /*XXX*/
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
case SIOCADDMULTI:
|
case SIOCADDMULTI:
|
||||||
case SIOCDELMULTI:
|
case SIOCDELMULTI:
|
||||||
|
@ -1050,40 +1047,46 @@ cnw_ioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
if (!(ifp->if_flags & IFF_RUNNING) &&
|
if (!(ifp->if_flags & IFF_RUNNING) &&
|
||||||
(error = cnw_enable(sc)) != 0)
|
(error = cnw_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
cnw_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
cnw_init(sc);
|
|
||||||
arp_ifinit(&sc->sc_ethercom.ec_if, ifa);
|
arp_ifinit(&sc->sc_ethercom.ec_if, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
cnw_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == IFF_RUNNING) {
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* The interface is marked down and it is running, so
|
* The interface is marked down and it is running, so
|
||||||
* stop it.
|
* stop it.
|
||||||
*/
|
*/
|
||||||
cnw_disable(sc);
|
cnw_disable(sc);
|
||||||
} else if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == IFF_UP){
|
break;
|
||||||
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* The interface is marked up and it is stopped, so
|
* The interface is marked up and it is stopped, so
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
error = cnw_enable(sc);
|
error = cnw_enable(sc);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
/* IFF_PROMISC may be changed */
|
/* IFF_PROMISC may be changed */
|
||||||
cnw_init(sc);
|
cnw_init(sc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1124,7 +1127,7 @@ cnw_ioctl(ifp, cmd, data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ray.c,v 1.70 2008/04/05 21:31:23 cegger Exp $ */
|
/* $NetBSD: if_ray.c,v 1.71 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000 Christian E. Hopps
|
* Copyright (c) 2000 Christian E. Hopps
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.70 2008/04/05 21:31:23 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.71 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -870,10 +870,7 @@ ray_reset_resetloop(arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ray_ioctl(ifp, cmd, data)
|
ray_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct ieee80211_nwid nwid;
|
struct ieee80211_nwid nwid;
|
||||||
struct ray_param_req pr;
|
struct ray_param_req pr;
|
||||||
|
@ -892,8 +889,8 @@ ray_ioctl(ifp, cmd, data)
|
||||||
RAY_DPRINTF(("%s: ioctl: cmd 0x%lx data 0x%lx\n", ifp->if_xname,
|
RAY_DPRINTF(("%s: ioctl: cmd 0x%lx data 0x%lx\n", ifp->if_xname,
|
||||||
cmd, (long)data));
|
cmd, (long)data));
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
RAY_DPRINTF(("%s: ioctl: cmd SIOCSIFADDR\n", ifp->if_xname));
|
RAY_DPRINTF(("%s: ioctl: cmd SIOCINITIFADDR\n", ifp->if_xname));
|
||||||
if ((ifp->if_flags & IFF_RUNNING) == 0)
|
if ((ifp->if_flags & IFF_RUNNING) == 0)
|
||||||
if ((error = ray_enable(sc)))
|
if ((error = ray_enable(sc)))
|
||||||
break;
|
break;
|
||||||
|
@ -911,6 +908,8 @@ ray_ioctl(ifp, cmd, data)
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
RAY_DPRINTF(("%s: ioctl: cmd SIOCSIFFLAGS\n", ifp->if_xname));
|
RAY_DPRINTF(("%s: ioctl: cmd SIOCSIFFLAGS\n", ifp->if_xname));
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if ((ifp->if_flags & IFF_RUNNING) == 0) {
|
if ((ifp->if_flags & IFF_RUNNING) == 0) {
|
||||||
if ((error = ray_enable(sc)))
|
if ((error = ray_enable(sc)))
|
||||||
|
@ -1001,7 +1000,7 @@ ray_ioctl(ifp, cmd, data)
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
RAY_DPRINTF(("%s: ioctl: unknown\n", ifp->if_xname));
|
RAY_DPRINTF(("%s: ioctl: unknown\n", ifp->if_xname));
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_xi.c,v 1.64 2008/04/05 21:31:23 cegger Exp $ */
|
/* $NetBSD: if_xi.c,v 1.65 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
/* OpenBSD: if_xe.c,v 1.9 1999/09/16 11:28:42 niklas Exp */
|
/* OpenBSD: if_xe.c,v 1.9 1999/09/16 11:28:42 niklas Exp */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.64 2008/04/05 21:31:23 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.65 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "opt_ipx.h"
|
#include "opt_ipx.h"
|
||||||
|
@ -914,23 +914,22 @@ xi_ether_ioctl(ifp, cmd, data)
|
||||||
DPRINTF(XID_CONFIG, ("xi_ether_ioctl()\n"));
|
DPRINTF(XID_CONFIG, ("xi_ether_ioctl()\n"));
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
if ((error = xi_enable(sc)) != 0)
|
if ((error = xi_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
|
||||||
|
xi_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
xi_init(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif /* INET */
|
#endif /* INET */
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
xi_init(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -943,10 +942,7 @@ xi_ether_ioctl(ifp, cmd, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
xi_ioctl(ifp, cmd, data)
|
xi_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct xi_softc *sc = ifp->if_softc;
|
struct xi_softc *sc = ifp->if_softc;
|
||||||
int s, error = 0;
|
int s, error = 0;
|
||||||
|
@ -956,13 +952,16 @@ xi_ioctl(ifp, cmd, data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
error = xi_ether_ioctl(ifp, cmd, data);
|
error = xi_ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running,
|
* If interface is marked down and it is running,
|
||||||
* stop it.
|
* stop it.
|
||||||
|
@ -970,8 +969,8 @@ xi_ioctl(ifp, cmd, data)
|
||||||
xi_stop(sc);
|
xi_stop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
xi_disable(sc);
|
xi_disable(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped,
|
* If interface is marked up and it is stopped,
|
||||||
* start it.
|
* start it.
|
||||||
|
@ -979,12 +978,16 @@ xi_ioctl(ifp, cmd, data)
|
||||||
if ((error = xi_enable(sc)) != 0)
|
if ((error = xi_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
xi_init(sc);
|
xi_init(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0) {
|
break;
|
||||||
|
case IFF_UP|IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* Reset the interface to pick up changes in any
|
* Reset the interface to pick up changes in any
|
||||||
* other flags that affect hardware registers.
|
* other flags that affect hardware registers.
|
||||||
*/
|
*/
|
||||||
xi_set_address(sc);
|
xi_set_address(sc);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1009,7 +1012,7 @@ xi_ioctl(ifp, cmd, data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_plip.c,v 1.21 2008/04/18 14:56:40 cegger Exp $ */
|
/* $NetBSD: if_plip.c,v 1.22 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1997 Poul-Henning Kamp
|
* Copyright (c) 1997 Poul-Henning Kamp
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_plip.c,v 1.21 2008/04/18 14:56:40 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_plip.c,v 1.22 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parallel port TCP/IP interfaces added. I looked at the driver from
|
* Parallel port TCP/IP interfaces added. I looked at the driver from
|
||||||
|
@ -345,7 +345,7 @@ lpfreetables (void)
|
||||||
|
|
||||||
/* Process an ioctl request. */
|
/* Process an ioctl request. */
|
||||||
static int
|
static int
|
||||||
lpioctl (struct ifnet *ifp, u_long cmd, void *data)
|
lpioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
{
|
{
|
||||||
struct lp_softc * sc = ifp->if_softc;
|
struct lp_softc * sc = ifp->if_softc;
|
||||||
device_t dev = sc->ppbus_dev.sc_dev;
|
device_t dev = sc->ppbus_dev.sc_dev;
|
||||||
|
@ -372,7 +372,7 @@ lpioctl (struct ifnet *ifp, u_long cmd, void *data)
|
||||||
error = EAFNOSUPPORT;
|
error = EAFNOSUPPORT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
if (ifa->ifa_addr->sa_family != AF_INET) {
|
if (ifa->ifa_addr->sa_family != AF_INET) {
|
||||||
error = EAFNOSUPPORT;
|
error = EAFNOSUPPORT;
|
||||||
break;
|
break;
|
||||||
|
@ -380,6 +380,8 @@ lpioctl (struct ifnet *ifp, u_long cmd, void *data)
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if((ifp->if_flags & (IFF_UP|IFF_RUNNING)) == IFF_UP) {
|
if((ifp->if_flags & (IFF_UP|IFF_RUNNING)) == IFF_UP) {
|
||||||
if((error = ppbus_request_bus(ppbus, dev, 0, 0)))
|
if((error = ppbus_request_bus(ppbus, dev, 0, 0)))
|
||||||
break;
|
break;
|
||||||
|
@ -459,7 +461,7 @@ lpioctl (struct ifnet *ifp, u_long cmd, void *data)
|
||||||
*/
|
*/
|
||||||
default:
|
default:
|
||||||
LP_PRINTF("LP:ioctl(0x%lx)\n", cmd);
|
LP_PRINTF("LP:ioctl(0x%lx)\n", cmd);
|
||||||
error = EINVAL;
|
error = ifioctl_common(ifp, cmd, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_dmc.c,v 1.16 2008/04/05 19:16:49 cegger Exp $ */
|
/* $NetBSD: if_dmc.c,v 1.17 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1982, 1986 Regents of the University of California.
|
* Copyright (c) 1982, 1986 Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.16 2008/04/05 19:16:49 cegger Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.17 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#undef DMCDEBUG /* for base table dump on fatal error */
|
#undef DMCDEBUG /* for base table dump on fatal error */
|
||||||
|
|
||||||
|
@ -841,7 +841,7 @@ dmcioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
if ((ifp->if_flags & IFF_RUNNING) == 0)
|
if ((ifp->if_flags & IFF_RUNNING) == 0)
|
||||||
dmcinit(ifp);
|
dmcinit(ifp);
|
||||||
|
@ -853,6 +853,8 @@ dmcioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((ifp->if_flags & IFF_UP) == 0 &&
|
||||||
sc->sc_flag & DMC_RUNNING)
|
sc->sc_flag & DMC_RUNNING)
|
||||||
dmcdown(sc);
|
dmcdown(sc);
|
||||||
|
@ -862,7 +864,7 @@ dmcioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ifioctl_common(ifp, cmd, data);
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
return (error);
|
return (error);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_qe.c,v 1.67 2008/03/11 05:34:01 matt Exp $ */
|
/* $NetBSD: if_qe.c,v 1.68 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
|
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_qe.c,v 1.67 2008/03/11 05:34:01 matt Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_qe.c,v 1.68 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -660,7 +660,7 @@ qeioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
switch(ifa->ifa_addr->sa_family) {
|
switch(ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
|
@ -673,8 +673,11 @@ qeioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running,
|
* If interface is marked down and it is running,
|
||||||
* stop it. (by disabling receive mechanism).
|
* stop it. (by disabling receive mechanism).
|
||||||
|
@ -682,19 +685,23 @@ qeioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
QE_WCSR(QE_CSR_CSR,
|
QE_WCSR(QE_CSR_CSR,
|
||||||
QE_RCSR(QE_CSR_CSR) & ~QE_RCV_ENABLE);
|
QE_RCSR(QE_CSR_CSR) & ~QE_RCV_ENABLE);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface it marked up and it is stopped, then
|
* If interface it marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
qeinit(sc);
|
qeinit(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0) {
|
break;
|
||||||
|
case IFF_UP|IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* Send a new setup packet to match any new changes.
|
* Send a new setup packet to match any new changes.
|
||||||
* (Like IFF_PROMISC etc)
|
* (Like IFF_PROMISC etc)
|
||||||
*/
|
*/
|
||||||
qe_setup(sc);
|
qe_setup(sc);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -715,8 +722,7 @@ qeioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
return (error);
|
return (error);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: be.c,v 1.59 2008/05/04 17:14:41 xtraeme Exp $ */
|
/* $NetBSD: be.c,v 1.60 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.59 2008/05/04 17:14:41 xtraeme Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.60 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_ddb.h"
|
#include "opt_ddb.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -971,10 +971,7 @@ berint(sc)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
beioctl(ifp, cmd, data)
|
beioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct be_softc *sc = ifp->if_softc;
|
struct be_softc *sc = ifp->if_softc;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
@ -984,44 +981,48 @@ beioctl(ifp, cmd, data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
beinit(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
beinit(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif /* INET */
|
#endif /* INET */
|
||||||
default:
|
default:
|
||||||
beinit(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
*/
|
*/
|
||||||
bestop(sc);
|
bestop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
beinit(sc);
|
beinit(sc);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
/*
|
/*
|
||||||
* Reset the interface to pick up changes in any other
|
* Reset the interface to pick up changes in any other
|
||||||
* flags that affect hardware registers.
|
* flags that affect hardware registers.
|
||||||
*/
|
*/
|
||||||
bestop(sc);
|
bestop(sc);
|
||||||
beinit(sc);
|
beinit(sc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
#ifdef BEDEBUG
|
#ifdef BEDEBUG
|
||||||
if (ifp->if_flags & IFF_DEBUG)
|
if (ifp->if_flags & IFF_DEBUG)
|
||||||
|
@ -1048,7 +1049,7 @@ beioctl(ifp, cmd, data)
|
||||||
error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd);
|
error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: qe.c,v 1.45 2008/04/28 20:23:57 martin Exp $ */
|
/* $NetBSD: qe.c,v 1.46 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: qe.c,v 1.45 2008/04/28 20:23:57 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: qe.c,v 1.46 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#define QEDEBUG
|
#define QEDEBUG
|
||||||
|
|
||||||
|
@ -923,46 +923,48 @@ qeioctl(ifp, cmd, data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
qeinit(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
qeinit(sc);
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif /* INET */
|
#endif /* INET */
|
||||||
default:
|
default:
|
||||||
qeinit(sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
*/
|
*/
|
||||||
qestop(sc);
|
qestop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
|
break;
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
case IFF_UP:
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
qeinit(sc);
|
qeinit(sc);
|
||||||
|
break;
|
||||||
} else {
|
default:
|
||||||
/*
|
/*
|
||||||
* Reset the interface to pick up changes in any other
|
* Reset the interface to pick up changes in any other
|
||||||
* flags that affect hardware registers.
|
* flags that affect hardware registers.
|
||||||
*/
|
*/
|
||||||
qestop(sc);
|
qestop(sc);
|
||||||
qeinit(sc);
|
qeinit(sc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
#ifdef QEDEBUG
|
#ifdef QEDEBUG
|
||||||
sc->sc_debug = (ifp->if_flags & IFF_DEBUG) != 0 ? 1 : 0;
|
sc->sc_debug = (ifp->if_flags & IFF_DEBUG) != 0 ? 1 : 0;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_se.c,v 1.72 2008/06/08 18:18:34 tsutsui Exp $ */
|
/* $NetBSD: if_se.c,v 1.73 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 Ian W. Dall <ian.dall@dsto.defence.gov.au>
|
* Copyright (c) 1997 Ian W. Dall <ian.dall@dsto.defence.gov.au>
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.72 2008/06/08 18:18:34 tsutsui Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.73 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "opt_atalk.h"
|
#include "opt_atalk.h"
|
||||||
|
@ -977,10 +977,7 @@ se_stop(sc)
|
||||||
* Process an ioctl request.
|
* Process an ioctl request.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
se_ioctl(ifp, cmd, data)
|
se_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct ifnet *ifp;
|
|
||||||
u_long cmd;
|
|
||||||
void *data;
|
|
||||||
{
|
{
|
||||||
struct se_softc *sc = ifp->if_softc;
|
struct se_softc *sc = ifp->if_softc;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
@ -992,7 +989,7 @@ se_ioctl(ifp, cmd, data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
if ((error = se_enable(sc)) != 0)
|
if ((error = se_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
@ -1024,8 +1021,11 @@ se_ioctl(ifp, cmd, data)
|
||||||
|
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & IFF_UP) == 0 &&
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
(ifp->if_flags & IFF_RUNNING) != 0) {
|
break;
|
||||||
|
/* XXX re-use ether_ioctl() */
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running, then
|
* If interface is marked down and it is running, then
|
||||||
* stop it.
|
* stop it.
|
||||||
|
@ -1033,8 +1033,8 @@ se_ioctl(ifp, cmd, data)
|
||||||
se_stop(sc);
|
se_stop(sc);
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
se_disable(sc);
|
se_disable(sc);
|
||||||
} else if ((ifp->if_flags & IFF_UP) != 0 &&
|
break;
|
||||||
(ifp->if_flags & IFF_RUNNING) == 0) {
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
|
@ -1042,12 +1042,15 @@ se_ioctl(ifp, cmd, data)
|
||||||
if ((error = se_enable(sc)) != 0)
|
if ((error = se_enable(sc)) != 0)
|
||||||
break;
|
break;
|
||||||
error = se_init(sc);
|
error = se_init(sc);
|
||||||
} else if (sc->sc_enabled) {
|
break;
|
||||||
|
default:
|
||||||
/*
|
/*
|
||||||
* Reset the interface to pick up changes in any other
|
* Reset the interface to pick up changes in any other
|
||||||
* flags that affect hardware registers.
|
* flags that affect hardware registers.
|
||||||
*/
|
*/
|
||||||
error = se_init(sc);
|
if (sc->sc_enabled)
|
||||||
|
error = se_init(sc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
#ifdef SEDEBUG
|
#ifdef SEDEBUG
|
||||||
if (ifp->if_flags & IFF_DEBUG)
|
if (ifp->if_flags & IFF_DEBUG)
|
||||||
|
@ -1077,7 +1080,7 @@ se_ioctl(ifp, cmd, data)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_aue.c,v 1.111 2008/05/24 16:40:58 cube Exp $ */
|
/* $NetBSD: if_aue.c,v 1.112 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 1998, 1999, 2000
|
* Copyright (c) 1997, 1998, 1999, 2000
|
||||||
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
|
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.111 2008/05/24 16:40:58 cube Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.112 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#if defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -1587,7 +1587,7 @@ aue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch(command) {
|
switch(command) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
aue_init(sc);
|
aue_init(sc);
|
||||||
|
|
||||||
|
@ -1612,6 +1612,8 @@ aue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, command, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (ifp->if_flags & IFF_RUNNING &&
|
if (ifp->if_flags & IFF_RUNNING &&
|
||||||
ifp->if_flags & IFF_PROMISC &&
|
ifp->if_flags & IFF_PROMISC &&
|
||||||
|
@ -1647,7 +1649,7 @@ aue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, command, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_axe.c,v 1.25 2008/05/24 16:40:58 cube Exp $ */
|
/* $NetBSD: if_axe.c,v 1.26 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 1998, 1999, 2000-2003
|
* Copyright (c) 1997, 1998, 1999, 2000-2003
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.25 2008/05/24 16:40:58 cube Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.26 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#if defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -1134,7 +1134,7 @@ axe_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
switch(cmd) {
|
switch(cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
axe_init(sc);
|
axe_init(sc);
|
||||||
|
|
||||||
|
@ -1159,6 +1159,8 @@ axe_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (ifp->if_flags & IFF_RUNNING &&
|
if (ifp->if_flags & IFF_RUNNING &&
|
||||||
ifp->if_flags & IFF_PROMISC &&
|
ifp->if_flags & IFF_PROMISC &&
|
||||||
|
@ -1209,7 +1211,7 @@ axe_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_cdce.c,v 1.18 2008/09/24 07:19:18 ws Exp $ */
|
/* $NetBSD: if_cdce.c,v 1.19 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com>
|
* Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com>
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.18 2008/09/24 07:19:18 ws Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.19 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#ifdef __NetBSD__
|
#ifdef __NetBSD__
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -434,7 +434,7 @@ cdce_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch(command) {
|
switch(command) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
cdce_init(sc);
|
cdce_init(sc);
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
|
@ -458,18 +458,23 @@ cdce_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if ((error = ifioctl_common(ifp, command, data)) != 0)
|
||||||
if (!(ifp->if_flags & IFF_RUNNING))
|
break;
|
||||||
cdce_init(sc);
|
/* XXX re-use ether_ioctl() */
|
||||||
} else {
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
case IFF_UP:
|
||||||
cdce_stop(sc);
|
cdce_init(sc);
|
||||||
|
break;
|
||||||
|
case IFF_RUNNING:
|
||||||
|
cdce_stop(sc);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
error = 0;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, command, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_cue.c,v 1.53 2008/05/24 16:40:58 cube Exp $ */
|
/* $NetBSD: if_cue.c,v 1.54 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 1998, 1999, 2000
|
* Copyright (c) 1997, 1998, 1999, 2000
|
||||||
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
|
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.53 2008/05/24 16:40:58 cube Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.54 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#if defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -1162,7 +1162,7 @@ cue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch(command) {
|
switch(command) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
cue_init(sc);
|
cue_init(sc);
|
||||||
|
|
||||||
|
@ -1187,6 +1187,8 @@ cue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, command, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (ifp->if_flags & IFF_RUNNING &&
|
if (ifp->if_flags & IFF_RUNNING &&
|
||||||
ifp->if_flags & IFF_PROMISC &&
|
ifp->if_flags & IFF_PROMISC &&
|
||||||
|
@ -1213,7 +1215,7 @@ cue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
error = 0;
|
error = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, command, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_kue.c,v 1.63 2008/05/24 16:40:58 cube Exp $ */
|
/* $NetBSD: if_kue.c,v 1.64 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 1998, 1999, 2000
|
* Copyright (c) 1997, 1998, 1999, 2000
|
||||||
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
|
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.63 2008/05/24 16:40:58 cube Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.64 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#if defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -1069,7 +1069,7 @@ kue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch(command) {
|
switch(command) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
kue_init(sc);
|
kue_init(sc);
|
||||||
|
|
||||||
|
@ -1094,6 +1094,8 @@ kue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, command, data)) != 0)
|
||||||
|
break;
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if (ifp->if_flags & IFF_UP) {
|
||||||
if (ifp->if_flags & IFF_RUNNING &&
|
if (ifp->if_flags & IFF_RUNNING &&
|
||||||
ifp->if_flags & IFF_PROMISC &&
|
ifp->if_flags & IFF_PROMISC &&
|
||||||
|
@ -1122,7 +1124,7 @@ kue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
error = 0;
|
error = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ether_ioctl(ifp, command, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $ */
|
/* $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $ */
|
||||||
/* $NetBSD: if_rum.c,v 1.23 2008/10/21 12:21:46 jun Exp $ */
|
/* $NetBSD: if_rum.c,v 1.24 2008/11/07 00:20:12 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini@free.fr>
|
* Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini@free.fr>
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.23 2008/10/21 12:21:46 jun Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.24 2008/11/07 00:20:12 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -1373,14 +1373,21 @@ rum_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
break;
|
||||||
rum_update_promisc(sc);
|
/* XXX re-use ether_ioctl() */
|
||||||
else
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
rum_init(ifp);
|
case IFF_UP|IFF_RUNNING:
|
||||||
} else {
|
rum_update_promisc(sc);
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
break;
|
||||||
rum_stop(ifp, 1);
|
case IFF_UP:
|
||||||
|
rum_init(ifp);
|
||||||
|
break;
|
||||||
|
case IFF_RUNNING:
|
||||||
|
rum_stop(ifp, 1);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_upl.c,v 1.32 2008/05/24 16:40:58 cube Exp $ */
|
/* $NetBSD: if_upl.c,v 1.33 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.32 2008/05/24 16:40:58 cube Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.33 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -856,7 +856,7 @@ upl_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch(command) {
|
switch(command) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
upl_init(sc);
|
upl_init(sc);
|
||||||
|
|
||||||
|
@ -876,17 +876,22 @@ upl_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if ((error = ifioctl_common(ifp, command, data)) != 0)
|
||||||
if (!(ifp->if_flags & IFF_RUNNING))
|
break;
|
||||||
upl_init(sc);
|
/* XXX re-use ether_ioctl() */
|
||||||
} else {
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
case IFF_UP:
|
||||||
upl_stop(sc);
|
upl_init(sc);
|
||||||
|
break;
|
||||||
|
case IFF_RUNNING:
|
||||||
|
upl_stop(sc);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
error = 0;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ifioctl_common(ifp, command, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ural.c,v 1.30 2008/05/24 16:40:58 cube Exp $ */
|
/* $NetBSD: if_ural.c,v 1.31 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
/* $FreeBSD: /repoman/r/ncvs/src/sys/dev/usb/if_ural.c,v 1.40 2006/06/02 23:14:40 sam Exp $ */
|
/* $FreeBSD: /repoman/r/ncvs/src/sys/dev/usb/if_ural.c,v 1.40 2006/06/02 23:14:40 sam Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.30 2008/05/24 16:40:58 cube Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.31 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -1505,14 +1505,21 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
break;
|
||||||
ural_update_promisc(sc);
|
/* XXX re-use ether_ioctl() */
|
||||||
else
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
ural_init(ifp);
|
case IFF_UP|IFF_RUNNING:
|
||||||
} else {
|
ural_update_promisc(sc);
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
break;
|
||||||
ural_stop(ifp, 1);
|
case IFF_UP:
|
||||||
|
ural_init(ifp);
|
||||||
|
break;
|
||||||
|
case IFF_RUNNING:
|
||||||
|
ural_stop(ifp, 1);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* $OpenBSD: if_zyd.c,v 1.52 2007/02/11 00:08:04 jsg Exp $ */
|
/* $OpenBSD: if_zyd.c,v 1.52 2007/02/11 00:08:04 jsg Exp $ */
|
||||||
/* $NetBSD: if_zyd.c,v 1.14 2008/09/21 09:38:27 freza Exp $ */
|
/* $NetBSD: if_zyd.c,v 1.15 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2006 by Damien Bergamini <damien.bergamini@free.fr>
|
* Copyright (c) 2006 by Damien Bergamini <damien.bergamini@free.fr>
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
* ZyDAS ZD1211/ZD1211B USB WLAN driver.
|
* ZyDAS ZD1211/ZD1211B USB WLAN driver.
|
||||||
*/
|
*/
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_zyd.c,v 1.14 2008/09/21 09:38:27 freza Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_zyd.c,v 1.15 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
|
||||||
|
@ -2419,18 +2419,24 @@ zyd_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if (ifp->if_flags & IFF_UP) {
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
if (!(ifp->if_flags & IFF_RUNNING))
|
break;
|
||||||
zyd_init(ifp);
|
/* XXX re-use ether_ioctl() */
|
||||||
} else {
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
if (ifp->if_flags & IFF_RUNNING)
|
case IFF_UP:
|
||||||
zyd_stop(ifp, 1);
|
zyd_init(ifp);
|
||||||
|
break;
|
||||||
|
case IFF_RUNNING:
|
||||||
|
zyd_stop(ifp, 1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (!sc->attached)
|
if (!sc->attached)
|
||||||
error = ENOTTY;
|
error = ENXIO;
|
||||||
else
|
else
|
||||||
error = ieee80211_ioctl(ic, cmd, data);
|
error = ieee80211_ioctl(ic, cmd, data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_pflog.c,v 1.12 2008/06/18 09:06:27 yamt Exp $ */
|
/* $NetBSD: if_pflog.c,v 1.13 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
/* $OpenBSD: if_pflog.c,v 1.24 2007/05/26 17:13:30 jason Exp $ */
|
/* $OpenBSD: if_pflog.c,v 1.24 2007/05/26 17:13:30 jason Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_pflog.c,v 1.12 2008/06/18 09:06:27 yamt Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_pflog.c,v 1.13 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#ifdef _KERNEL_OPT
|
#ifdef _KERNEL_OPT
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -223,21 +223,26 @@ pflogoutput(struct ifnet *ifp, struct mbuf *m,
|
||||||
int
|
int
|
||||||
pflogioctl(struct ifnet *ifp, u_long cmd, void *data)
|
pflogioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
{
|
{
|
||||||
|
int error = 0;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
/*FALLTHROUGH*/
|
||||||
|
case SIOCINITIFADDR:
|
||||||
case SIOCAIFADDR:
|
case SIOCAIFADDR:
|
||||||
case SIOCSIFDSTADDR:
|
case SIOCSIFDSTADDR:
|
||||||
case SIOCSIFFLAGS:
|
|
||||||
if (ifp->if_flags & IFF_UP)
|
if (ifp->if_flags & IFF_UP)
|
||||||
ifp->if_flags |= IFF_RUNNING;
|
ifp->if_flags |= IFF_RUNNING;
|
||||||
else
|
else
|
||||||
ifp->if_flags &= ~IFF_RUNNING;
|
ifp->if_flags &= ~IFF_RUNNING;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return (EINVAL);
|
error = ifioctl_common(ifp, cmd, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_agr.c,v 1.21 2008/05/19 02:53:47 yamt Exp $ */
|
/* $NetBSD: if_agr.c,v 1.22 2008/11/07 00:20:18 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c)2005 YAMAMOTO Takashi,
|
* Copyright (c)2005 YAMAMOTO Takashi,
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_agr.c,v 1.21 2008/05/19 02:53:47 yamt Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_agr.c,v 1.22 2008/11/07 00:20:18 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -532,11 +532,10 @@ agr_addport(struct ifnet *ifp, struct ifnet *ifp_port)
|
||||||
* start to modify ifp_port.
|
* start to modify ifp_port.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
error = (*ifp_port->if_ioctl)(ifp_port, SIOCSIFADDR,
|
error = (*ifp_port->if_ioctl)(ifp_port, SIOCINITIFADDR, ifp->if_dl);
|
||||||
(void *)ifp->if_dl);
|
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
printf("%s: SIOCSIFADDR error %d\n", __func__, error);
|
printf("%s: SIOCINITIFADDR error %d\n", __func__, error);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
port->port_flags |= AGRPORT_LADDRCHANGED;
|
port->port_flags |= AGRPORT_LADDRCHANGED;
|
||||||
|
@ -696,7 +695,7 @@ agrport_cleanup(struct agr_softc *sc, struct agr_port *port)
|
||||||
port->port_origlladdr, ifp_port->if_addrlen);
|
port->port_origlladdr, ifp_port->if_addrlen);
|
||||||
memset(&ifa, 0, sizeof(ifa));
|
memset(&ifa, 0, sizeof(ifa));
|
||||||
ifa.ifa_addr = &u.sa;
|
ifa.ifa_addr = &u.sa;
|
||||||
error = agrport_ioctl(port, SIOCSIFADDR, &ifa);
|
error = agrport_ioctl(port, SIOCINITIFADDR, &ifa);
|
||||||
#endif
|
#endif
|
||||||
if (error) {
|
if (error) {
|
||||||
printf("%s: if_init error %d\n", __func__, error);
|
printf("%s: if_init error %d\n", __func__, error);
|
||||||
|
@ -751,14 +750,33 @@ agr_ioctl_filter(struct ifnet *ifp, u_long cmd, void *arg)
|
||||||
KASSERT(port);
|
KASSERT(port);
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCGIFADDR:
|
case SIOCADDMULTI: /* add m'cast addr */
|
||||||
case SIOCGIFMEDIA:
|
case SIOCAIFADDR: /* add/chg IF alias */
|
||||||
case SIOCSIFFLAGS: /* XXX */
|
case SIOCALIFADDR: /* add IF addr */
|
||||||
error = agrport_ioctl(port, cmd, arg);
|
case SIOCDELMULTI: /* del m'cast addr */
|
||||||
break;
|
case SIOCDIFADDR: /* delete IF addr */
|
||||||
default:
|
case SIOCDIFPHYADDR: /* delete gif addrs */
|
||||||
|
case SIOCDLIFADDR: /* delete IF addr */
|
||||||
|
case SIOCINITIFADDR:
|
||||||
|
case SIOCSDRVSPEC: /* set driver-specific parameters */
|
||||||
|
case SIOCSIFADDR: /* set ifnet address */
|
||||||
|
case SIOCSIFBRDADDR: /* set broadcast addr */
|
||||||
|
case SIOCSIFDSTADDR: /* set p-p address */
|
||||||
|
case SIOCSIFGENERIC: /* generic IF set op */
|
||||||
|
case SIOCSIFMEDIA: /* set net media */
|
||||||
|
case SIOCSIFMETRIC: /* set IF metric */
|
||||||
|
case SIOCSIFMTU: /* set ifnet mtu */
|
||||||
|
case SIOCSIFNETMASK: /* set net addr mask */
|
||||||
|
case SIOCSIFPHYADDR: /* set gif addres */
|
||||||
|
case SIOCSLIFPHYADDR: /* set gif addrs */
|
||||||
|
case SIOCSVH: /* set carp param */
|
||||||
error = EBUSY;
|
error = EBUSY;
|
||||||
break;
|
break;
|
||||||
|
case SIOCSIFCAP: /* XXX */
|
||||||
|
case SIOCSIFFLAGS: /* XXX */
|
||||||
|
default:
|
||||||
|
error = agrport_ioctl(port, cmd, arg);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
@ -801,7 +819,6 @@ agr_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct agr_softc *sc = ifp->if_softc;
|
struct agr_softc *sc = ifp->if_softc;
|
||||||
struct ifreq *ifr = (struct ifreq *)data;
|
struct ifreq *ifr = (struct ifreq *)data;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
struct sockaddr *sa;
|
|
||||||
struct agrreq ar;
|
struct agrreq ar;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
int s;
|
int s;
|
||||||
|
@ -811,7 +828,7 @@ agr_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
if (sc->sc_nports == 0) {
|
if (sc->sc_nports == 0) {
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
break;
|
break;
|
||||||
|
@ -828,16 +845,13 @@ agr_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCGIFADDR:
|
|
||||||
sa = (struct sockaddr *)&ifr->ifr_data;
|
|
||||||
memcpy(sa->sa_data, CLLADDR(ifp->if_sadl), ifp->if_addrlen);
|
|
||||||
break;
|
|
||||||
|
|
||||||
#if 0 /* notyet */
|
#if 0 /* notyet */
|
||||||
case SIOCSIFMTU:
|
case SIOCSIFMTU:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
agr_config_promisc(sc);
|
agr_config_promisc(sc);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -878,7 +892,7 @@ agr_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ifioctl_common(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
70
sys/net/if.c
70
sys/net/if.c
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if.c,v 1.230 2008/10/24 21:46:09 dyoung Exp $ */
|
/* $NetBSD: if.c,v 1.231 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
|
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.230 2008/10/24 21:46:09 dyoung Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.231 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ struct ifnet **ifindex2ifnet = NULL;
|
||||||
struct ifnet *lo0ifp;
|
struct ifnet *lo0ifp;
|
||||||
|
|
||||||
void
|
void
|
||||||
if_set_sadl(struct ifnet *ifp, const void *lla, u_char addrlen)
|
if_set_sadl(struct ifnet *ifp, const void *lla, u_char addrlen, bool factory)
|
||||||
{
|
{
|
||||||
struct ifaddr *ifa;
|
struct ifaddr *ifa;
|
||||||
struct sockaddr_dl *sdl;
|
struct sockaddr_dl *sdl;
|
||||||
|
@ -289,6 +289,10 @@ if_set_sadl(struct ifnet *ifp, const void *lla, u_char addrlen)
|
||||||
sdl = satosdl(ifa->ifa_addr);
|
sdl = satosdl(ifa->ifa_addr);
|
||||||
|
|
||||||
(void)sockaddr_dl_setaddr(sdl, sdl->sdl_len, lla, ifp->if_addrlen);
|
(void)sockaddr_dl_setaddr(sdl, sdl->sdl_len, lla, ifp->if_addrlen);
|
||||||
|
if (factory) {
|
||||||
|
ifp->if_hwdl = ifp->if_dl;
|
||||||
|
IFAREF(ifp->if_hwdl);
|
||||||
|
}
|
||||||
/* TBD routing socket */
|
/* TBD routing socket */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,8 +392,9 @@ if_activate_sadl(struct ifnet *ifp, struct ifaddr *ifa,
|
||||||
if_deactivate_sadl(ifp);
|
if_deactivate_sadl(ifp);
|
||||||
|
|
||||||
if_sadl_setrefs(ifp, ifa);
|
if_sadl_setrefs(ifp, ifa);
|
||||||
|
IFADDR_FOREACH(ifa, ifp)
|
||||||
|
rtinit(ifa, RTM_LLINFO_UPD, 0);
|
||||||
splx(s);
|
splx(s);
|
||||||
rt_ifmsg(ifp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -416,8 +421,11 @@ if_free_sadl(struct ifnet *ifp)
|
||||||
s = splnet();
|
s = splnet();
|
||||||
rtinit(ifa, RTM_DELETE, 0);
|
rtinit(ifa, RTM_DELETE, 0);
|
||||||
ifa_remove(ifp, ifa);
|
ifa_remove(ifp, ifa);
|
||||||
|
|
||||||
if_deactivate_sadl(ifp);
|
if_deactivate_sadl(ifp);
|
||||||
|
if (ifp->if_hwdl == ifa) {
|
||||||
|
IFAFREE(ifa);
|
||||||
|
ifp->if_hwdl = NULL;
|
||||||
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,6 +444,9 @@ if_attach(struct ifnet *ifp)
|
||||||
}
|
}
|
||||||
TAILQ_INIT(&ifp->if_addrlist);
|
TAILQ_INIT(&ifp->if_addrlist);
|
||||||
TAILQ_INSERT_TAIL(&ifnet, ifp, if_list);
|
TAILQ_INSERT_TAIL(&ifnet, ifp, if_list);
|
||||||
|
if (ifp->if_ioctl == NULL)
|
||||||
|
ifp->if_ioctl = ifioctl_common;
|
||||||
|
|
||||||
ifp->if_index = if_index;
|
ifp->if_index = if_index;
|
||||||
if (ifindex2ifnet == NULL)
|
if (ifindex2ifnet == NULL)
|
||||||
if_index++;
|
if_index++;
|
||||||
|
@ -1576,6 +1587,8 @@ ifioctl(struct socket *so, u_long cmd, void *data, struct lwp *l)
|
||||||
#endif
|
#endif
|
||||||
case SIOCGIFCONF:
|
case SIOCGIFCONF:
|
||||||
return ifconf(cmd, data);
|
return ifconf(cmd, data);
|
||||||
|
case SIOCINITIFADDR:
|
||||||
|
return EPERM;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef COMPAT_OIFREQ
|
#ifdef COMPAT_OIFREQ
|
||||||
|
@ -1648,47 +1661,13 @@ ifioctl(struct socket *so, u_long cmd, void *data, struct lwp *l)
|
||||||
}
|
}
|
||||||
|
|
||||||
oif_flags = ifp->if_flags;
|
oif_flags = ifp->if_flags;
|
||||||
switch (cmd) {
|
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
error = (*ifp->if_ioctl)(ifp, cmd, data);
|
||||||
ifioctl_common(ifp, cmd, data);
|
if (error != ENOTTY)
|
||||||
if (ifp->if_ioctl)
|
;
|
||||||
(void)(*ifp->if_ioctl)(ifp, cmd, data);
|
else if (so->so_proto == NULL)
|
||||||
break;
|
return EOPNOTSUPP;
|
||||||
|
else {
|
||||||
case SIOCSIFPHYADDR:
|
|
||||||
case SIOCDIFPHYADDR:
|
|
||||||
#ifdef INET6
|
|
||||||
case SIOCSIFPHYADDR_IN6:
|
|
||||||
#endif
|
|
||||||
case SIOCSLIFPHYADDR:
|
|
||||||
case SIOCADDMULTI:
|
|
||||||
case SIOCDELMULTI:
|
|
||||||
case SIOCSIFMEDIA:
|
|
||||||
case SIOCGIFPSRCADDR:
|
|
||||||
case SIOCGIFPDSTADDR:
|
|
||||||
case SIOCGLIFPHYADDR:
|
|
||||||
case SIOCGIFMEDIA:
|
|
||||||
case SIOCG80211:
|
|
||||||
case SIOCS80211:
|
|
||||||
case SIOCS80211NWID:
|
|
||||||
case SIOCS80211NWKEY:
|
|
||||||
case SIOCS80211POWER:
|
|
||||||
case SIOCS80211BSSID:
|
|
||||||
case SIOCS80211CHANNEL:
|
|
||||||
case SIOCSIFCAP:
|
|
||||||
case SIOCSIFMTU:
|
|
||||||
if (ifp->if_ioctl == NULL)
|
|
||||||
return EOPNOTSUPP;
|
|
||||||
error = (*ifp->if_ioctl)(ifp, cmd, data);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
error = ifioctl_common(ifp, cmd, data);
|
|
||||||
if (error != ENOTTY)
|
|
||||||
break;
|
|
||||||
if (so->so_proto == NULL)
|
|
||||||
return EOPNOTSUPP;
|
|
||||||
#ifdef COMPAT_OSOCK
|
#ifdef COMPAT_OSOCK
|
||||||
error = compat_ifioctl(so, ocmd, cmd, data, l);
|
error = compat_ifioctl(so, ocmd, cmd, data, l);
|
||||||
#else
|
#else
|
||||||
|
@ -1696,7 +1675,6 @@ ifioctl(struct socket *so, u_long cmd, void *data, struct lwp *l)
|
||||||
(struct mbuf *)cmd, (struct mbuf *)data,
|
(struct mbuf *)cmd, (struct mbuf *)data,
|
||||||
(struct mbuf *)ifp, l);
|
(struct mbuf *)ifp, l);
|
||||||
#endif
|
#endif
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((oif_flags ^ ifp->if_flags) & IFF_UP) != 0) {
|
if (((oif_flags ^ ifp->if_flags) & IFF_UP) != 0) {
|
||||||
|
|
17
sys/net/if.h
17
sys/net/if.h
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if.h,v 1.140 2008/10/24 17:07:33 dyoung Exp $ */
|
/* $NetBSD: if.h,v 1.141 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
|
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
|
||||||
|
@ -268,7 +268,17 @@ struct ifnet { /* and the entries */
|
||||||
(struct ifnet *);
|
(struct ifnet *);
|
||||||
struct ifaltq if_snd; /* output queue (includes altq) */
|
struct ifaltq if_snd; /* output queue (includes altq) */
|
||||||
struct ifaddr *if_dl; /* identity of this interface. */
|
struct ifaddr *if_dl; /* identity of this interface. */
|
||||||
const struct sockaddr_dl *if_sadl; /* pointer to our sockaddr_dl */
|
const struct sockaddr_dl *if_sadl; /* pointer to sockaddr_dl
|
||||||
|
* of if_dl
|
||||||
|
*/
|
||||||
|
/* if_hwdl: h/w identity
|
||||||
|
*
|
||||||
|
* May be NULL. If not NULL, it is the address assigned
|
||||||
|
* to the interface by the manufacturer, so it very likely
|
||||||
|
* to be unique. It MUST NOT be deleted. It is highly
|
||||||
|
* suitable for deriving the EUI64 for the interface.
|
||||||
|
*/
|
||||||
|
struct ifaddr *if_hwdl;
|
||||||
const uint8_t *if_broadcastaddr;/* linklevel broadcast bytestring */
|
const uint8_t *if_broadcastaddr;/* linklevel broadcast bytestring */
|
||||||
void *if_bridge; /* bridge glue */
|
void *if_bridge; /* bridge glue */
|
||||||
int if_dlt; /* data link type (<net/dlt.h>) */
|
int if_dlt; /* data link type (<net/dlt.h>) */
|
||||||
|
@ -643,6 +653,7 @@ struct if_laddrreq {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
#define IFLR_PREFIX 0x8000 /* in: prefix given out: kernel fills id */
|
#define IFLR_PREFIX 0x8000 /* in: prefix given out: kernel fills id */
|
||||||
#define IFLR_ACTIVE 0x4000 /* in/out: link-layer address activation */
|
#define IFLR_ACTIVE 0x4000 /* in/out: link-layer address activation */
|
||||||
|
#define IFLR_FACTORY 0x2000 /* in/out: factory link-layer address */
|
||||||
unsigned int prefixlen; /* in/out */
|
unsigned int prefixlen; /* in/out */
|
||||||
struct sockaddr_storage addr; /* in/out */
|
struct sockaddr_storage addr; /* in/out */
|
||||||
struct sockaddr_storage dstaddr; /* out */
|
struct sockaddr_storage dstaddr; /* out */
|
||||||
|
@ -826,7 +837,7 @@ void if_initname(struct ifnet *, const char *, int);
|
||||||
struct ifaddr *if_dl_create(const struct ifnet *, const struct sockaddr_dl **);
|
struct ifaddr *if_dl_create(const struct ifnet *, const struct sockaddr_dl **);
|
||||||
void if_activate_sadl(struct ifnet *, struct ifaddr *,
|
void if_activate_sadl(struct ifnet *, struct ifaddr *,
|
||||||
const struct sockaddr_dl *);
|
const struct sockaddr_dl *);
|
||||||
void if_set_sadl(struct ifnet *, const void *, u_char);
|
void if_set_sadl(struct ifnet *, const void *, u_char, bool);
|
||||||
void if_alloc_sadl(struct ifnet *);
|
void if_alloc_sadl(struct ifnet *);
|
||||||
void if_free_sadl(struct ifnet *);
|
void if_free_sadl(struct ifnet *);
|
||||||
void if_attach(struct ifnet *);
|
void if_attach(struct ifnet *);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_arcsubr.c,v 1.59 2008/02/20 17:05:52 matt Exp $ */
|
/* $NetBSD: if_arcsubr.c,v 1.60 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1994, 1995 Ignatios Souvatzis
|
* Copyright (c) 1994, 1995 Ignatios Souvatzis
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.59 2008/02/20 17:05:52 matt Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.60 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
|
||||||
|
@ -645,7 +645,7 @@ arc_ifattach(struct ifnet *ifp, uint8_t lla)
|
||||||
ifp->if_xname, ifp->if_xname);
|
ifp->if_xname, ifp->if_xname);
|
||||||
}
|
}
|
||||||
if_attach(ifp);
|
if_attach(ifp);
|
||||||
if_set_sadl(ifp, &lla, sizeof(lla));
|
if_set_sadl(ifp, &lla, sizeof(lla), true);
|
||||||
|
|
||||||
ifp->if_broadcastaddr = &arcbroadcastaddr;
|
ifp->if_broadcastaddr = &arcbroadcastaddr;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_bridge.c,v 1.62 2008/06/15 16:37:21 christos Exp $ */
|
/* $NetBSD: if_bridge.c,v 1.63 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2001 Wasabi Systems, Inc.
|
* Copyright 2001 Wasabi Systems, Inc.
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.62 2008/06/15 16:37:21 christos Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.63 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_bridge_ipf.h"
|
#include "opt_bridge_ipf.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -488,23 +488,30 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) == IFF_RUNNING) {
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
* If interface is marked down and it is running,
|
* If interface is marked down and it is running,
|
||||||
* then stop and disable it.
|
* then stop and disable it.
|
||||||
*/
|
*/
|
||||||
(*ifp->if_stop)(ifp, 1);
|
(*ifp->if_stop)(ifp, 1);
|
||||||
} else if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) == IFF_UP) {
|
break;
|
||||||
|
case IFF_UP:
|
||||||
/*
|
/*
|
||||||
* If interface is marked up and it is stopped, then
|
* If interface is marked up and it is stopped, then
|
||||||
* start it.
|
* start it.
|
||||||
*/
|
*/
|
||||||
error = (*ifp->if_init)(ifp);
|
error = (*ifp->if_init)(ifp);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = ENOTTY;
|
error = ifioctl_common(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ecosubr.c,v 1.28 2008/03/12 18:22:24 dyoung Exp $ */
|
/* $NetBSD: if_ecosubr.c,v 1.29 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2001 Ben Harris
|
* Copyright (c) 2001 Ben Harris
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.28 2008/03/12 18:22:24 dyoung Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.29 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -148,7 +148,8 @@ eco_ifattach(struct ifnet *ifp, const uint8_t *lla)
|
||||||
} while (/*CONSTCOND*/0)
|
} while (/*CONSTCOND*/0)
|
||||||
|
|
||||||
int
|
int
|
||||||
eco_init(struct ifnet *ifp) {
|
eco_init(struct ifnet *ifp)
|
||||||
|
{
|
||||||
struct ecocom *ec = (struct ecocom *)ifp;
|
struct ecocom *ec = (struct ecocom *)ifp;
|
||||||
|
|
||||||
if ((ifp->if_flags & IFF_RUNNING) == 0)
|
if ((ifp->if_flags & IFF_RUNNING) == 0)
|
||||||
|
@ -525,20 +526,18 @@ eco_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
|
if ((ifp->if_flags & IFF_RUNNING) == 0 &&
|
||||||
|
(error = (*ifp->if_init)(ifp)) != 0)
|
||||||
|
return error;
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
switch (ifa->ifa_addr->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
if ((ifp->if_flags & IFF_RUNNING) == 0 &&
|
|
||||||
(error = (*ifp->if_init)(ifp)) != 0)
|
|
||||||
return error;
|
|
||||||
arp_ifinit(ifp, ifa);
|
arp_ifinit(ifp, ifa);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
if ((ifp->if_flags & IFF_RUNNING) == 0)
|
|
||||||
return (*ifp->if_init)(ifp);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -551,6 +550,8 @@ eco_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
return error;
|
||||||
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
case IFF_RUNNING:
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
|
@ -576,7 +577,7 @@ eco_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return ENOTTY;
|
return ifioctl_common(ifp, cmd, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ether.h,v 1.53 2008/07/25 20:04:50 dsl Exp $ */
|
/* $NetBSD: if_ether.h,v 1.54 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1982, 1986, 1993
|
* Copyright (c) 1982, 1986, 1993
|
||||||
|
@ -145,6 +145,10 @@ do { \
|
||||||
|
|
||||||
struct mii_data;
|
struct mii_data;
|
||||||
|
|
||||||
|
struct ethercom;
|
||||||
|
|
||||||
|
typedef int (*ether_cb_t)(struct ethercom *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Structure shared between the ethernet driver modules and
|
* Structure shared between the ethernet driver modules and
|
||||||
* the multicast list code. For example, each ec_softc or il_softc
|
* the multicast list code. For example, each ec_softc or il_softc
|
||||||
|
@ -164,6 +168,11 @@ struct ethercom {
|
||||||
int ec_nvlans; /* # VLANs on this interface */
|
int ec_nvlans; /* # VLANs on this interface */
|
||||||
/* The device handle for the MII bus child device. */
|
/* The device handle for the MII bus child device. */
|
||||||
struct mii_data *ec_mii;
|
struct mii_data *ec_mii;
|
||||||
|
/* Called after a change to ec_if.if_flags. Returns
|
||||||
|
* ENETRESET if the device should be reinitialized with
|
||||||
|
* ec_if.if_init, 0 on success, not 0 on failure.
|
||||||
|
*/
|
||||||
|
ether_cb_t ec_ifflags_cb;
|
||||||
#ifdef MBUFTRACE
|
#ifdef MBUFTRACE
|
||||||
struct mowner ec_rx_mowner; /* mbufs received */
|
struct mowner ec_rx_mowner; /* mbufs received */
|
||||||
struct mowner ec_tx_mowner; /* mbufs transmitted */
|
struct mowner ec_tx_mowner; /* mbufs transmitted */
|
||||||
|
@ -180,6 +189,7 @@ extern const uint8_t ethermulticastaddr_slowprotocols[ETHER_ADDR_LEN];
|
||||||
extern const uint8_t ether_ipmulticast_min[ETHER_ADDR_LEN];
|
extern const uint8_t ether_ipmulticast_min[ETHER_ADDR_LEN];
|
||||||
extern const uint8_t ether_ipmulticast_max[ETHER_ADDR_LEN];
|
extern const uint8_t ether_ipmulticast_max[ETHER_ADDR_LEN];
|
||||||
|
|
||||||
|
void ether_set_ifflags_cb(struct ethercom *, ether_cb_t);
|
||||||
int ether_ioctl(struct ifnet *, u_long, void *);
|
int ether_ioctl(struct ifnet *, u_long, void *);
|
||||||
int ether_addmulti(const struct sockaddr *, struct ethercom *);
|
int ether_addmulti(const struct sockaddr *, struct ethercom *);
|
||||||
int ether_delmulti(const struct sockaddr *, struct ethercom *);
|
int ether_delmulti(const struct sockaddr *, struct ethercom *);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_etherip.c,v 1.24 2008/11/03 00:52:07 hans Exp $ */
|
/* $NetBSD: if_etherip.c,v 1.25 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006, Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
|
* Copyright (c) 2006, Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_etherip.c,v 1.24 2008/11/03 00:52:07 hans Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_etherip.c,v 1.25 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -700,7 +700,7 @@ etherip_sysctl_handler(SYSCTLFN_ARGS)
|
||||||
if (ether_nonstatic_aton(enaddr, addr) != 0)
|
if (ether_nonstatic_aton(enaddr, addr) != 0)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
|
||||||
if_set_sadl(ifp, enaddr, ETHER_ADDR_LEN);
|
if_set_sadl(ifp, enaddr, ETHER_ADDR_LEN, false);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_ethersubr.c,v 1.169 2008/07/23 06:34:31 dyoung Exp $ */
|
/* $NetBSD: if_ethersubr.c,v 1.170 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.169 2008/07/23 06:34:31 dyoung Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.170 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "opt_atalk.h"
|
#include "opt_atalk.h"
|
||||||
|
@ -1077,7 +1077,7 @@ ether_ifattach(struct ifnet *ifp, const uint8_t *lla)
|
||||||
if (ifp->if_baudrate == 0)
|
if (ifp->if_baudrate == 0)
|
||||||
ifp->if_baudrate = IF_Mbps(10); /* just a default */
|
ifp->if_baudrate = IF_Mbps(10); /* just a default */
|
||||||
|
|
||||||
if_set_sadl(ifp, lla, ETHER_ADDR_LEN);
|
if_set_sadl(ifp, lla, ETHER_ADDR_LEN, !ETHER_IS_LOCAL(lla));
|
||||||
|
|
||||||
LIST_INIT(&ec->ec_multiaddrs);
|
LIST_INIT(&ec->ec_multiaddrs);
|
||||||
ifp->if_broadcastaddr = etherbroadcastaddr;
|
ifp->if_broadcastaddr = etherbroadcastaddr;
|
||||||
|
@ -1433,6 +1433,12 @@ ether_delmulti(const struct sockaddr *sa, struct ethercom *ec)
|
||||||
return (ENETRESET);
|
return (ENETRESET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ether_set_ifflags_cb(struct ethercom *ec, ether_cb_t cb)
|
||||||
|
{
|
||||||
|
ec->ec_ifflags_cb = cb;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Common ioctls for Ethernet interfaces. Note, we must be
|
* Common ioctls for Ethernet interfaces. Note, we must be
|
||||||
* called at splnet().
|
* called at splnet().
|
||||||
|
@ -1443,30 +1449,23 @@ ether_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
struct ethercom *ec = (void *) ifp;
|
struct ethercom *ec = (void *) ifp;
|
||||||
struct ifreq *ifr = (struct ifreq *)data;
|
struct ifreq *ifr = (struct ifreq *)data;
|
||||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||||
|
struct if_laddrreq *iflr = data;
|
||||||
|
const struct sockaddr_dl *sdl;
|
||||||
|
static const uint8_t zero[ETHER_ADDR_LEN];
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) !=
|
||||||
switch (ifa->ifa_addr->sa_family) {
|
(IFF_UP|IFF_RUNNING)) {
|
||||||
#ifdef INET
|
ifp->if_flags |= IFF_UP;
|
||||||
case AF_INET:
|
if ((error = (*ifp->if_init)(ifp)) != 0)
|
||||||
if ((ifp->if_flags & IFF_RUNNING) == 0 &&
|
|
||||||
(error = (*ifp->if_init)(ifp)) != 0)
|
|
||||||
return error;
|
return error;
|
||||||
arp_ifinit(ifp, ifa);
|
|
||||||
break;
|
|
||||||
#endif /* INET */
|
|
||||||
default:
|
|
||||||
if ((ifp->if_flags & IFF_RUNNING) == 0)
|
|
||||||
return (*ifp->if_init)(ifp);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return 0;
|
#ifdef INET
|
||||||
|
if (ifa->ifa_addr->sa_family == AF_INET)
|
||||||
case SIOCGIFADDR:
|
arp_ifinit(ifp, ifa);
|
||||||
memcpy(((struct sockaddr *)&ifr->ifr_data)->sa_data,
|
#endif /* INET */
|
||||||
CLLADDR(ifp->if_sadl), ETHER_ADDR_LEN);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case SIOCSIFMTU:
|
case SIOCSIFMTU:
|
||||||
|
@ -1490,6 +1489,8 @@ ether_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
return error;
|
||||||
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
|
||||||
case IFF_RUNNING:
|
case IFF_RUNNING:
|
||||||
/*
|
/*
|
||||||
|
@ -1505,11 +1506,17 @@ ether_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
*/
|
*/
|
||||||
return (*ifp->if_init)(ifp);
|
return (*ifp->if_init)(ifp);
|
||||||
case IFF_UP|IFF_RUNNING:
|
case IFF_UP|IFF_RUNNING:
|
||||||
/*
|
error = 0;
|
||||||
* Reset the interface to pick up changes in any other
|
if (ec->ec_ifflags_cb == NULL ||
|
||||||
* flags that affect the hardware state.
|
(error = (*ec->ec_ifflags_cb)(ec)) == ENETRESET) {
|
||||||
*/
|
/*
|
||||||
return (*ifp->if_init)(ifp);
|
* Reset the interface to pick up
|
||||||
|
* changes in any other flags that
|
||||||
|
* affect the hardware state.
|
||||||
|
*/
|
||||||
|
return (*ifp->if_init)(ifp);
|
||||||
|
} else
|
||||||
|
return error;
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1523,10 +1530,17 @@ ether_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
if (ec->ec_mii == NULL)
|
if (ec->ec_mii == NULL)
|
||||||
return ENOTTY;
|
return ENOTTY;
|
||||||
return ifmedia_ioctl(ifp, ifr, &ec->ec_mii->mii_media, cmd);
|
return ifmedia_ioctl(ifp, ifr, &ec->ec_mii->mii_media, cmd);
|
||||||
case SIOCSIFCAP:
|
case SIOCALIFADDR:
|
||||||
return ifioctl_common(ifp, cmd, data);
|
sdl = satocsdl(sstocsa(&iflr->addr));
|
||||||
|
if (sdl->sdl_family != AF_LINK)
|
||||||
|
;
|
||||||
|
else if (ETHER_IS_MULTICAST(CLLADDR(sdl)))
|
||||||
|
return EINVAL;
|
||||||
|
else if (memcmp(zero, CLLADDR(sdl), sizeof(zero)) == 0)
|
||||||
|
return EINVAL;
|
||||||
|
/*FALLTHROUGH*/
|
||||||
default:
|
default:
|
||||||
return ENOTTY;
|
return ifioctl_common(ifp, cmd, data);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_faith.c,v 1.44 2008/10/24 17:07:33 dyoung Exp $ */
|
/* $NetBSD: if_faith.c,v 1.45 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
/* $KAME: if_faith.c,v 1.21 2001/02/20 07:59:26 itojun Exp $ */
|
/* $KAME: if_faith.c,v 1.21 2001/02/20 07:59:26 itojun Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_faith.c,v 1.44 2008/10/24 17:07:33 dyoung Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_faith.c,v 1.45 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ faithioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP | IFF_RUNNING;
|
ifp->if_flags |= IFF_UP | IFF_RUNNING;
|
||||||
ifa = (struct ifaddr *)data;
|
ifa = (struct ifaddr *)data;
|
||||||
ifa->ifa_rtrequest = faithrtrequest;
|
ifa->ifa_rtrequest = faithrtrequest;
|
||||||
|
@ -264,18 +264,10 @@ faithioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef SIOCSIFMTU
|
default:
|
||||||
case SIOCSIFMTU:
|
|
||||||
if ((error = ifioctl_common(ifp, cmd, data)) == ENETRESET)
|
if ((error = ifioctl_common(ifp, cmd, data)) == ENETRESET)
|
||||||
error = 0;
|
error = 0;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
error = EINVAL;
|
|
||||||
}
|
}
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_fddisubr.c,v 1.76 2008/05/11 20:13:30 dyoung Exp $ */
|
/* $NetBSD: if_fddisubr.c,v 1.77 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.76 2008/05/11 20:13:30 dyoung Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.77 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "opt_atalk.h"
|
#include "opt_atalk.h"
|
||||||
|
@ -521,7 +521,8 @@ fddi_output(struct ifnet *ifp0, struct mbuf *m0, const struct sockaddr *dst,
|
||||||
|
|
||||||
#if NCARP > 0
|
#if NCARP > 0
|
||||||
if (ifp0 != ifp && ifp0->if_type == IFT_CARP) {
|
if (ifp0 != ifp && ifp0->if_type == IFT_CARP) {
|
||||||
if_set_sadl(ifp0, fh->fddi_shost, sizeof(fh->fddi_shost));
|
if_set_sadl(ifp0, fh->fddi_shost, sizeof(fh->fddi_shost),
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ifp != ifp0)
|
if (ifp != ifp0)
|
||||||
|
@ -786,7 +787,7 @@ fddi_ifattach(struct ifnet *ifp, void *lla)
|
||||||
max_linkhdr = ALIGN(ifp->if_hdrlen);
|
max_linkhdr = ALIGN(ifp->if_hdrlen);
|
||||||
|
|
||||||
LIST_INIT(&ec->ec_multiaddrs);
|
LIST_INIT(&ec->ec_multiaddrs);
|
||||||
if_set_sadl(ifp, lla, 6);
|
if_set_sadl(ifp, lla, 6, true);
|
||||||
|
|
||||||
ifp->if_broadcastaddr = fddibroadcastaddr;
|
ifp->if_broadcastaddr = fddibroadcastaddr;
|
||||||
#if NBPFILTER > 0
|
#if NBPFILTER > 0
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_gif.c,v 1.75 2008/06/15 16:37:21 christos Exp $ */
|
/* $NetBSD: if_gif.c,v 1.76 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
/* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */
|
/* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.75 2008/06/15 16:37:21 christos Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.76 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "opt_iso.h"
|
#include "opt_iso.h"
|
||||||
|
@ -157,6 +157,7 @@ gifattach0(struct gif_softc *sc)
|
||||||
sc->gif_if.if_output = gif_output;
|
sc->gif_if.if_output = gif_output;
|
||||||
sc->gif_if.if_type = IFT_GIF;
|
sc->gif_if.if_type = IFT_GIF;
|
||||||
sc->gif_if.if_dlt = DLT_NULL;
|
sc->gif_if.if_dlt = DLT_NULL;
|
||||||
|
sc->gif_if.if_softc = sc;
|
||||||
IFQ_SET_READY(&sc->gif_if.if_snd);
|
IFQ_SET_READY(&sc->gif_if.if_snd);
|
||||||
if_attach(&sc->gif_if);
|
if_attach(&sc->gif_if);
|
||||||
if_alloc_sadl(&sc->gif_if);
|
if_alloc_sadl(&sc->gif_if);
|
||||||
|
@ -197,7 +198,7 @@ gif_encapcheck(struct mbuf *m, int off, int proto, void *arg)
|
||||||
struct ip ip;
|
struct ip ip;
|
||||||
struct gif_softc *sc;
|
struct gif_softc *sc;
|
||||||
|
|
||||||
sc = (struct gif_softc *)arg;
|
sc = arg;
|
||||||
if (sc == NULL)
|
if (sc == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -230,7 +231,7 @@ gif_encapcheck(struct mbuf *m, int off, int proto, void *arg)
|
||||||
if (m->m_pkthdr.len < sizeof(ip))
|
if (m->m_pkthdr.len < sizeof(ip))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
m_copydata(m, 0, sizeof(ip), (void *)&ip);
|
m_copydata(m, 0, sizeof(ip), &ip);
|
||||||
|
|
||||||
switch (ip.ip_v) {
|
switch (ip.ip_v) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
|
@ -259,7 +260,7 @@ int
|
||||||
gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||||
struct rtentry *rt)
|
struct rtentry *rt)
|
||||||
{
|
{
|
||||||
struct gif_softc *sc = (struct gif_softc*)ifp;
|
struct gif_softc *sc = ifp->if_softc;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
static int called = 0; /* XXX: MUTEX */
|
static int called = 0; /* XXX: MUTEX */
|
||||||
ALTQ_DECL(struct altq_pktattr pktattr;)
|
ALTQ_DECL(struct altq_pktattr pktattr;)
|
||||||
|
@ -345,7 +346,7 @@ gifintr(void *arg)
|
||||||
int s;
|
int s;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
sc = (struct gif_softc *)arg;
|
sc = arg;
|
||||||
ifp = &sc->gif_if;
|
ifp = &sc->gif_if;
|
||||||
|
|
||||||
/* output processing */
|
/* output processing */
|
||||||
|
@ -477,7 +478,7 @@ int
|
||||||
gif_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
gif_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
{
|
{
|
||||||
struct lwp *l = curlwp; /* XXX */
|
struct lwp *l = curlwp; /* XXX */
|
||||||
struct gif_softc *sc = (struct gif_softc*)ifp;
|
struct gif_softc *sc = ifp->if_softc;
|
||||||
struct ifreq *ifr = (struct ifreq*)data;
|
struct ifreq *ifr = (struct ifreq*)data;
|
||||||
int error = 0, size;
|
int error = 0, size;
|
||||||
struct sockaddr *dst, *src;
|
struct sockaddr *dst, *src;
|
||||||
|
@ -499,7 +500,7 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
ifp->if_flags |= IFF_UP;
|
ifp->if_flags |= IFF_UP;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -720,13 +721,8 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
memcpy(dst, src, src->sa_len);
|
memcpy(dst, src, src->sa_len);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCSIFFLAGS:
|
|
||||||
/* if_ioctl() takes care of it */
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
return ifioctl_common(ifp, cmd, data);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
bad:
|
bad:
|
||||||
return error;
|
return error;
|
||||||
|
@ -735,7 +731,7 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||||
int
|
int
|
||||||
gif_set_tunnel(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst)
|
gif_set_tunnel(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst)
|
||||||
{
|
{
|
||||||
struct gif_softc *sc = (struct gif_softc *)ifp;
|
struct gif_softc *sc = ifp->if_softc;
|
||||||
struct gif_softc *sc2;
|
struct gif_softc *sc2;
|
||||||
struct sockaddr *osrc, *odst;
|
struct sockaddr *osrc, *odst;
|
||||||
int s;
|
int s;
|
||||||
|
@ -844,7 +840,7 @@ gif_set_tunnel(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst)
|
||||||
void
|
void
|
||||||
gif_delete_tunnel(struct ifnet *ifp)
|
gif_delete_tunnel(struct ifnet *ifp)
|
||||||
{
|
{
|
||||||
struct gif_softc *sc = (struct gif_softc *)ifp;
|
struct gif_softc *sc = ifp->if_softc;
|
||||||
int s;
|
int s;
|
||||||
|
|
||||||
s = splsoftnet();
|
s = splsoftnet();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_gre.c,v 1.138 2008/08/06 15:01:23 plunky Exp $ */
|
/* $NetBSD: if_gre.c,v 1.139 2008/11/07 00:20:13 dyoung Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.138 2008/08/06 15:01:23 plunky Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.139 2008/11/07 00:20:13 dyoung Exp $");
|
||||||
|
|
||||||
#include "opt_gre.h"
|
#include "opt_gre.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -1305,7 +1305,7 @@ gre_ioctl(struct ifnet *ifp, const u_long cmd, void *data)
|
||||||
GRE_DPRINTF(sc, "\n");
|
GRE_DPRINTF(sc, "\n");
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCSIFADDR:
|
case SIOCINITIFADDR:
|
||||||
GRE_DPRINTF(sc, "\n");
|
GRE_DPRINTF(sc, "\n");
|
||||||
if ((ifp->if_flags & IFF_UP) != 0)
|
if ((ifp->if_flags & IFF_UP) != 0)
|
||||||
break;
|
break;
|
||||||
|
@ -1315,6 +1315,8 @@ gre_ioctl(struct ifnet *ifp, const u_long cmd, void *data)
|
||||||
case SIOCSIFDSTADDR:
|
case SIOCSIFDSTADDR:
|
||||||
break;
|
break;
|
||||||
case SIOCSIFFLAGS:
|
case SIOCSIFFLAGS:
|
||||||
|
if ((error = ifioctl_common(ifp, cmd, data)) != 0)
|
||||||
|
break;
|
||||||
oproto = sp->sp_proto;
|
oproto = sp->sp_proto;
|
||||||
otype = sp->sp_type;
|
otype = sp->sp_type;
|
||||||
switch (ifr->ifr_flags & (IFF_LINK0|IFF_LINK2)) {
|
switch (ifr->ifr_flags & (IFF_LINK0|IFF_LINK2)) {
|
||||||
|
@ -1525,7 +1527,7 @@ gre_ioctl(struct ifnet *ifp, const u_long cmd, void *data)
|
||||||
GRE_DPRINTF(sc, "\n");
|
GRE_DPRINTF(sc, "\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = EINVAL;
|
error = ifioctl_common(ifp, cmd, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue