diff options
author | Jonathan Lemon <jlemon@FreeBSD.org> | 2001-09-18 17:41:42 +0000 |
---|---|---|
committer | Jonathan Lemon <jlemon@FreeBSD.org> | 2001-09-18 17:41:42 +0000 |
commit | 016da741b275c805892a049a03017965c27a8d8c (patch) | |
tree | f389fec466bb5c5593d80daaaa547ab750789d27 /sys/net | |
parent | 7429c0e49b557f4ac5406ea41a62ec40d0383279 (diff) | |
download | src-016da741b275c805892a049a03017965c27a8d8c.tar.gz src-016da741b275c805892a049a03017965c27a8d8c.zip |
Notes
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if.c | 14 | ||||
-rw-r--r-- | sys/net/if.h | 7 | ||||
-rw-r--r-- | sys/net/if_var.h | 2 |
3 files changed, 23 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index c08d494b9b63..edc73036f862 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -994,6 +994,11 @@ ifioctl(so, cmd, data, td) ifr->ifr_flags = ifp->if_flags; break; + case SIOCGIFCAP: + ifr->ifr_reqcap = ifp->if_capabilities; + ifr->ifr_curcap = ifp->if_capenable; + break; + case SIOCGIFMETRIC: ifr->ifr_metric = ifp->if_metric; break; @@ -1031,6 +1036,15 @@ ifioctl(so, cmd, data, td) getmicrotime(&ifp->if_lastchange); break; + case SIOCSIFCAP: + error = suser_td(td); + if (error) + return (error); + if (ifr->ifr_reqcap & ~ifp->if_capabilities) + return (EINVAL); + (void) (*ifp->if_ioctl)(ifp, cmd, data); + break; + case SIOCSIFMETRIC: error = suser_td(td); if (error) diff --git a/sys/net/if.h b/sys/net/if.h index 70428bfca28a..b0cc9053a934 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -136,6 +136,10 @@ struct if_data { (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\ IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART) +/* Capabilities that interfaces can advertise. */ +#define IFCAP_HWCSUM 0x0001 /* can do hardware checksums */ +#define IFCAP_NETCONS 0x0002 /* can be a network console */ + #define IFQ_MAXLEN 50 #define IFNET_SLOWHZ 1 /* granularity is 1 second */ @@ -198,6 +202,7 @@ struct ifreq { int ifru_phys; int ifru_media; caddr_t ifru_data; + int ifru_cap[2]; } ifr_ifru; #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ @@ -209,6 +214,8 @@ struct ifreq { #define ifr_phys ifr_ifru.ifru_phys /* physical wire */ #define ifr_media ifr_ifru.ifru_media /* physical media */ #define ifr_data ifr_ifru.ifru_data /* for use by interface */ +#define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ +#define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ }; #define _SIZEOF_ADDR_IFREQ(ifr) \ diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 597eb644f8de..0d6979126c05 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -117,6 +117,8 @@ struct ifnet { short if_unit; /* sub-unit for lower level driver */ short if_timer; /* time 'til if_watchdog called */ short if_flags; /* up/down, broadcast, etc. */ + int if_capabilities; /* interface capabilities */ + int if_capenable; /* enabled features */ int if_mpsafe; /* XXX TEMPORARY */ int if_ipending; /* interrupts pending */ void *if_linkmib; /* link-type-specific MIB data */ |