From owner-freebsd-audit Sun Oct 21 21:29: 9 2001 Delivered-To: freebsd-audit@freebsd.org Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by hub.freebsd.org (Postfix) with ESMTP id 5056437B401; Sun, 21 Oct 2001 21:27:45 -0700 (PDT) Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.11.0/8.11.0) id f9M4Rfc31343; Sun, 21 Oct 2001 21:27:41 -0700 Date: Sun, 21 Oct 2001 21:27:41 -0700 From: Brooks Davis To: stable@freebsd.org, audit@freebsd.org Subject: call for test/review: vlan cloning patch Message-ID: <20011021212741.A30521@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Please review and test the following patch to add cloning and module support to the vlan device in stable. Unlike the gif cloning support, this attempts to avoid a POLA violation by adding the number of vlan devices requested by the kernel config (this behavior will go away in 5.0-RELEASE). I plan to commit this sometime in the next week. If I make updates to the patch, they will be reflected in the copy found at: http://people.freebsd.org/~brooks/patches/vlan-stable.diff -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 Index: sys/net/ethernet.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/ethernet.h,v retrieving revision 1.12.2.5 diff -u -r1.12.2.5 ethernet.h --- sys/net/ethernet.h 2000/07/19 21:43:52 1.12.2.5 +++ sys/net/ethernet.h 2001/10/21 20:25:14 @@ -99,6 +99,41 @@ extern void (*ng_ether_attach_p)(struct ifnet *ifp); extern void (*ng_ether_detach_p)(struct ifnet *ifp); =20 +extern int (*vlan_input_p)(struct ether_header *eh, struct mbuf *m); +extern int (*vlan_input_tag_p)(struct ether_header *eh, struct mbuf *m, + u_int16_t t); +#define _VLAN_INPUT(ifp, eh, m) do { \ + if (vlan_input_p !=3D NULL) { \ + if ((*vlan_input_p)(eh, m) =3D=3D -1) \ + (ifp)->if_noproto++; \ + } else { \ + m_free(m); \ + (ifp)->if_noproto++; \ + } \ +} while (0) + +#define VLAN_INPUT(ifp, eh, m) do { \ + /* XXX: lock */ \ + _VLAN_INPUT(ifp, eh, m); \ + /* XXX: unlock */ \ +} while (0) + +#define _VLAN_INPUT_TAG(ifp, eh, m, t) do { \ + if (vlan_input_tag_p !=3D NULL) { \ + if ((*vlan_input_tag_p)(eh, m, t) =3D=3D -1) \ + (ifp)->if_noproto++; \ + } else { \ + m_free(m); \ + (ifp)->if_noproto++; \ + } \ +} while (0) + +#define VLAN_INPUT_TAG(ifp, eh, m, t) do { \ + /* XXX: lock */ \ + _VLAN_INPUT_TAG(ifp, eh, m, t); \ + /* XXX: unlock */ \ +} while (0) + #else /* _KERNEL */ =20 #include Index: sys/net/if_ethersubr.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/if_ethersubr.c,v retrieving revision 1.70.2.17 diff -u -r1.70.2.17 if_ethersubr.c --- sys/net/if_ethersubr.c 2001/08/01 00:47:49 1.70.2.17 +++ sys/net/if_ethersubr.c 2001/10/21 20:26:03 @@ -100,11 +100,6 @@ #include #endif =20 -#include "vlan.h" -#if NVLAN > 0 -#include -#endif /* NVLAN > 0 */ - /* netgraph node hooks for ng_ether(4) */ void (*ng_ether_input_p)(struct ifnet *ifp, struct mbuf **mp, struct ether_header *eh); @@ -114,6 +109,10 @@ void (*ng_ether_attach_p)(struct ifnet *ifp); void (*ng_ether_detach_p)(struct ifnet *ifp); =20 +int (*vlan_input_p)(struct ether_header *eh, struct mbuf *m); +int (*vlan_input_tag_p)(struct ether_header *eh, struct mbuf *m, + u_int16_t t); + static int ether_resolvemulti __P((struct ifnet *, struct sockaddr **, struct sockaddr *)); u_char etherbroadcastaddr[6] =3D { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; @@ -533,14 +532,6 @@ =20 ether_type =3D ntohs(eh->ether_type); =20 -#if NVLAN > 0 - if (ether_type =3D=3D vlan_proto) { - if (vlan_input(eh, m) < 0) - ifp->if_data.ifi_noproto++; - return; - } -#endif /* NVLAN > 0 */ - switch (ether_type) { #ifdef INET case ETHERTYPE_IP: @@ -591,6 +582,9 @@ aarpinput(IFP2AC(ifp), m); /* XXX */ return; #endif NETATALK + case ETHERTYPE_VLAN: + VLAN_INPUT(ifp, eh, m); + return; default: #ifdef IPX if (ef_inputp && ef_inputp(ifp, eh, m) =3D=3D 0) Index: sys/net/if_vlan.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/if_vlan.c,v retrieving revision 1.15.2.8 diff -u -r1.15.2.8 if_vlan.c --- sys/net/if_vlan.c 2001/08/01 00:47:50 1.15.2.8 +++ sys/net/if_vlan.c 2001/10/21 20:36:02 @@ -54,7 +54,9 @@ * tag value that goes with it. */ =20 +#ifndef NVLAN #include "vlan.h" +#endif #include "opt_inet.h" =20 #include @@ -67,6 +69,8 @@ #include #include #include +#include /* XXX: Shouldn't really be required! */ +#include =20 #include #include @@ -81,23 +85,32 @@ #include #endif =20 +#define VLANNAME "vlan" +#define VLAN_MAXUNIT 0x7fff /* ifp->if_unit is only 15 bits */ + SYSCTL_DECL(_net_link); SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLAG_RW, 0, "IEEE 802.1Q VLAN"= ); SYSCTL_NODE(_net_link_vlan, PF_LINK, link, CTLFLAG_RW, 0, "for consistency= "); - -u_int vlan_proto =3D ETHERTYPE_VLAN; -SYSCTL_INT(_net_link_vlan_link, VLANCTL_PROTO, proto, CTLFLAG_RW, &vlan_pr= oto, - 0, "Ethernet protocol used for VLAN encapsulation"); =20 -static struct ifvlan ifv_softc[NVLAN]; +static MALLOC_DEFINE(M_VLAN, "vlan", "802.1Q Virtual LAN Interface"); +static struct rman vlanunits[1]; +static LIST_HEAD(, ifvlan) ifv_list; =20 +static int vlan_clone_create(struct if_clone *, int *); +static void vlan_clone_destroy(struct ifnet *); static void vlan_start(struct ifnet *ifp); static void vlan_ifinit(void *foo); +static int vlan_input(struct ether_header *eh, struct mbuf *m); +static int vlan_input_tag(struct ether_header *eh, struct mbuf *m, + u_int16_t t); static int vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr); static int vlan_setmulti(struct ifnet *ifp); static int vlan_unconfig(struct ifnet *ifp); static int vlan_config(struct ifvlan *ifv, struct ifnet *p); =20 +struct if_clone vlan_cloner =3D + IF_CLONE_INITIALIZER("vlan", vlan_clone_create, vlan_clone_destroy); + /* * Program our multicast filter. What we're actually doing is * programming the multicast filter of the parent. This has the @@ -142,14 +155,14 @@ if (error) return(error); SLIST_REMOVE_HEAD(&sc->vlan_mc_listhead, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_VLAN); } =20 /* Now program new ones. */ LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family !=3D AF_LINK) continue; - mc =3D malloc(sizeof(struct vlan_mc_entry), M_DEVBUF, M_WAITOK); + mc =3D malloc(sizeof(struct vlan_mc_entry), M_VLAN, M_WAITOK); bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), (char *)&mc->mc_addr, ETHER_ADDR_LEN); SLIST_INSERT_HEAD(&sc->vlan_mc_listhead, mc, mc_entries); @@ -163,44 +176,46 @@ return(0); } =20 -static void -vlaninit(void) -{ - int i; - - for (i =3D 0; i < NVLAN; i++) { - struct ifnet *ifp =3D &ifv_softc[i].ifv_if; - - ifp->if_softc =3D &ifv_softc[i]; - ifp->if_name =3D "vlan"; - ifp->if_unit =3D i; - /* NB: flags are not set here */ - ifp->if_linkmib =3D &ifv_softc[i].ifv_mib; - ifp->if_linkmiblen =3D sizeof ifv_softc[i].ifv_mib; - /* NB: mtu is not set here */ - - ifp->if_init =3D vlan_ifinit; - ifp->if_start =3D vlan_start; - ifp->if_ioctl =3D vlan_ioctl; - ifp->if_output =3D ether_output; - ifp->if_snd.ifq_maxlen =3D ifqmaxlen; - ether_ifattach(ifp, ETHER_BPF_SUPPORTED); - /* Now undo some of the damage... */ - ifp->if_data.ifi_type =3D IFT_L2VLAN; - ifp->if_data.ifi_hdrlen =3D EVL_ENCAPLEN; - } -} - static int vlan_modevent(module_t mod, int type, void *data)=20 {=20 + int i; + int err; + switch (type) {=20 case MOD_LOAD:=20 - vlaninit(); + vlanunits->rm_type =3D RMAN_ARRAY; + vlanunits->rm_descr =3D "configurable if_vlan units"; + err =3D rman_init(vlanunits); + if (err !=3D 0) + return (err); + err =3D rman_manage_region(vlanunits, 0, VLAN_MAXUNIT); + if (err !=3D 0) { + printf("%s: vlanunits: rman_manage_region: Failed %d\n", + VLANNAME, err); + rman_fini(vlanunits); + return (err); + } + LIST_INIT(&ifv_list); + vlan_input_p =3D vlan_input; + vlan_input_tag_p =3D vlan_input_tag; + if_clone_attach(&vlan_cloner); + for(i =3D 0; i < NVLAN; i ++) { + err =3D vlan_clone_create(&vlan_cloner, &i); + KASSERT(err =3D=3D 0, + ("Unexpected error creating initial VLANs")); + } break;=20 case MOD_UNLOAD:=20 - printf("if_vlan module unload - not possible for this module type\n");= =20 - return EINVAL;=20 + if_clone_detach(&vlan_cloner); + vlan_input_p =3D NULL; + vlan_input_tag_p =3D NULL; + while (!LIST_EMPTY(&ifv_list)) + vlan_clone_destroy(&LIST_FIRST(&ifv_list)->ifv_if); + err =3D rman_fini(vlanunits); + if (err !=3D 0) + return (err); + break; }=20 return 0;=20 }=20 @@ -213,7 +228,81 @@ =20 DECLARE_MODULE(if_vlan, vlan_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); =20 +static int +vlan_clone_create(struct if_clone *ifc, int *unit) +{ + struct resource *r; + struct ifvlan *ifv; + struct ifnet *ifp; + int s; + + if (*unit > VLAN_MAXUNIT) + return (ENXIO); + + if (*unit < 0) { + r =3D rman_reserve_resource(vlanunits, 0, VLAN_MAXUNIT, 1, + RF_ALLOCATED | RF_ACTIVE, NULL); + if (r =3D=3D NULL) + return (ENOSPC); + *unit =3D rman_get_start(r); + } else { + r =3D rman_reserve_resource(vlanunits, *unit, *unit, 1, + RF_ALLOCATED | RF_ACTIVE, NULL); + if (r =3D=3D NULL) + return (EEXIST); + } + + ifv =3D malloc(sizeof(struct ifvlan), M_VLAN, M_WAITOK); + memset(ifv, 0, sizeof(struct ifvlan)); + ifp =3D &ifv->ifv_if; + SLIST_INIT(&ifv->vlan_mc_listhead); + + s =3D splnet(); + LIST_INSERT_HEAD(&ifv_list, ifv, ifv_list); + splx(s); + + ifp->if_softc =3D ifv; + ifp->if_name =3D "vlan"; + ifp->if_unit =3D *unit; + ifv->r_unit =3D r; + /* NB: flags are not set here */ + ifp->if_linkmib =3D &ifv->ifv_mib; + ifp->if_linkmiblen =3D sizeof ifv->ifv_mib; + /* NB: mtu is not set here */ + + ifp->if_init =3D vlan_ifinit; + ifp->if_start =3D vlan_start; + ifp->if_ioctl =3D vlan_ioctl; + ifp->if_output =3D ether_output; + ifp->if_snd.ifq_maxlen =3D ifqmaxlen; + ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + /* Now undo some of the damage... */ + ifp->if_data.ifi_type =3D IFT_L2VLAN; + ifp->if_data.ifi_hdrlen =3D EVL_ENCAPLEN; + + return (0); +} + static void +vlan_clone_destroy(struct ifnet *ifp) +{ + struct ifvlan *ifv =3D ifp->if_softc; + int s; + int err; + + s =3D splnet(); + LIST_REMOVE(ifv, ifv_list); + vlan_unconfig(ifp); + splx(s); + + ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); + + err =3D rman_release_resource(ifv->r_unit); + KASSERT(err =3D=3D 0, ("Unexpected error freeing resource")); + free(ifv, M_VLAN); +} + +static void vlan_ifinit(void *foo) { return; @@ -294,7 +383,7 @@ sizeof(struct ether_header)); evl =3D mtod(m, struct ether_vlan_header *); evl->evl_proto =3D evl->evl_encap_proto; - evl->evl_encap_proto =3D htons(vlan_proto); + evl->evl_encap_proto =3D htons(ETHERTYPE_VLAN); evl->evl_tag =3D htons(ifv->ifv_tag); #ifdef DEBUG printf("vlan_start: %*D\n", sizeof *evl, @@ -326,19 +415,19 @@ return; } =20 -int +static int vlan_input_tag(struct ether_header *eh, struct mbuf *m, u_int16_t t) { - int i; struct ifvlan *ifv; =20 - for (i =3D 0; i < NVLAN; i++) { - ifv =3D &ifv_softc[i]; - if (ifv->ifv_tag =3D=3D t) + for (ifv =3D LIST_FIRST(&ifv_list); ifv !=3D NULL; + ifv =3D LIST_NEXT(ifv, ifv_list)) { + if (m->m_pkthdr.rcvif =3D=3D ifv->ifv_p + && ifv->ifv_tag =3D=3D t) break; } =20 - if (i >=3D NVLAN || (ifv->ifv_if.if_flags & IFF_UP) =3D=3D 0) { + if (ifv =3D=3D NULL || (ifv->ifv_if.if_flags & IFF_UP) =3D=3D 0) { m_free(m); return -1; /* So the parent can take note */ } @@ -346,7 +435,7 @@ /* * Having found a valid vlan interface corresponding to * the given source interface and vlan tag, run the - * the real packet through ethert_input(). + * the real packet through ether_input(). */ m->m_pkthdr.rcvif =3D &ifv->ifv_if; =20 @@ -355,21 +444,20 @@ return 0; } =20 -int +static int vlan_input(struct ether_header *eh, struct mbuf *m) { - int i; struct ifvlan *ifv; =20 - for (i =3D 0; i < NVLAN; i++) { - ifv =3D &ifv_softc[i]; + for (ifv =3D LIST_FIRST(&ifv_list); ifv !=3D NULL; + ifv =3D LIST_NEXT(ifv, ifv_list)) { if (m->m_pkthdr.rcvif =3D=3D ifv->ifv_p && (EVL_VLANOFTAG(ntohs(*mtod(m, u_int16_t *))) =3D=3D ifv->ifv_tag)) break; } =20 - if (i >=3D NVLAN || (ifv->ifv_if.if_flags & IFF_UP) =3D=3D 0) { + if (ifv =3D=3D NULL || (ifv->ifv_if.if_flags & IFF_UP) =3D=3D 0) { m_freem(m); return -1; /* so ether_input can take note */ } @@ -472,7 +560,7 @@ if (error) return(error); SLIST_REMOVE_HEAD(&ifv->vlan_mc_listhead, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_VLAN); } } =20 Index: sys/net/if_vlan_var.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/if_vlan_var.h,v retrieving revision 1.5.2.2 diff -u -r1.5.2.2 if_vlan_var.h --- sys/net/if_vlan_var.h 2001/08/01 00:47:50 1.5.2.2 +++ sys/net/if_vlan_var.h 2001/10/21 20:28:44 @@ -47,6 +47,8 @@ u_int16_t ifvm_tag; /* tag to apply on packets leaving if */ } ifv_mib; SLIST_HEAD(__vlan_mchead, vlan_mc_entry) vlan_mc_listhead; + LIST_ENTRY(ifvlan) ifv_list; + struct resource *r_unit; /* resource allocated for this unit */ }; #define ifv_if ifv_ac.ac_if #define ifv_tag ifv_mib.ifvm_tag @@ -77,13 +79,5 @@ }; #define SIOCSETVLAN SIOCSIFGENERIC #define SIOCGETVLAN SIOCGIFGENERIC - -#ifdef _KERNEL -/* shared with if_ethersubr.c: */ -extern u_int vlan_proto; -extern int vlan_input(struct ether_header *eh, struct mbuf *m); -extern int vlan_input_tag(struct ether_header *eh, - struct mbuf *m, u_int16_t t); -#endif =20 #endif /* _NET_IF_VLAN_VAR_H_ */ Index: sys/dev/bge/if_bge.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/dev/bge/if_bge.c,v retrieving revision 1.3.2.2 diff -u -r1.3.2.2 if_bge.c --- sys/dev/bge/if_bge.c 2001/10/05 20:13:41 1.3.2.2 +++ sys/dev/bge/if_bge.c 2001/10/21 20:22:33 @@ -70,8 +70,6 @@ * ring. */ =20 -#include "vlan.h" - #include #include #include @@ -89,10 +87,8 @@ =20 #include =20 -#if NVLAN > 0 #include #include -#endif =20 #include #include @@ -1901,10 +1897,8 @@ u_int32_t rxidx; struct ether_header *eh; struct mbuf *m =3D NULL; -#if NVLAN > 0 u_int16_t vlan_tag =3D 0; int have_tag =3D 0; -#endif =20 cur_rx =3D &sc->bge_rdata->bge_rx_return_ring[sc->bge_rx_saved_considx]; @@ -1912,12 +1906,10 @@ rxidx =3D cur_rx->bge_idx; BGE_INC(sc->bge_rx_saved_considx, BGE_RETURN_RING_CNT); =20 -#if NVLAN > 0 if (cur_rx->bge_flags & BGE_RXBDFLAG_VLAN_TAG) { have_tag =3D 1; vlan_tag =3D cur_rx->bge_vlan_tag; } -#endif =20 if (cur_rx->bge_flags & BGE_RXBDFLAG_JUMBO_RING) { BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); @@ -1972,17 +1964,16 @@ } } =20 -#if NVLAN > 0 /* * If we received a packet with a vlan tag, pass it * to vlan_input() instead of ether_input(). */ if (have_tag) { - vlan_input_tag(eh, m, vlan_tag); + VLAN_INPUT_TAG(ifp, eh, m, vlan_tag); have_tag =3D vlan_tag =3D 0; continue; } -#endif + ether_input(ifp, eh, m); } =20 @@ -2181,14 +2172,12 @@ struct mbuf *m; u_int32_t frag, cur, cnt =3D 0; u_int16_t csum_flags =3D 0; -#if NVLAN > 0 struct ifvlan *ifv =3D NULL; =20 if ((m_head->m_flags & (M_PROTO1|M_PKTHDR)) =3D=3D (M_PROTO1|M_PKTHDR) && m_head->m_pkthdr.rcvif !=3D NULL && m_head->m_pkthdr.rcvif->if_type =3D=3D IFT_L2VLAN) ifv =3D m_head->m_pkthdr.rcvif->if_softc; -#endif =20 m =3D m_head; cur =3D frag =3D *txidx; @@ -2217,14 +2206,12 @@ vtophys(mtod(m, vm_offset_t)); f->bge_len =3D m->m_len; f->bge_flags =3D csum_flags; -#if NVLAN > 0 if (ifv !=3D NULL) { f->bge_flags |=3D BGE_TXBDFLAG_VLAN_TAG; f->bge_vlan_tag =3D ifv->ifv_tag; } else { f->bge_vlan_tag =3D 0; } -#endif /* * Sanity check: avoid coming within 16 descriptors * of the end of the ring. Index: sys/dev/fxp/if_fxp.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/dev/fxp/if_fxp.c,v retrieving revision 1.110.2.7 diff -u -r1.110.2.7 if_fxp.c --- sys/dev/fxp/if_fxp.c 2001/08/31 02:17:02 1.110.2.7 +++ sys/dev/fxp/if_fxp.c 2001/10/21 20:16:16 @@ -32,8 +32,6 @@ * Intel EtherExpress Pro/100B PCI Fast Ethernet driver */ =20 -#include "vlan.h" - #include #include #include @@ -65,10 +63,8 @@ #include /* for vtophys */ #include /* for DELAY */ =20 -#if NVLAN > 0 #include #include -#endif =20 #include #include /* for PCIM_CMD_xxx */ @@ -559,10 +555,9 @@ =20 /* turn on the extended TxCB feature */ sc->flags |=3D FXP_FLAG_EXT_TXCB; -#if NVLAN > 0 + /* enable reception of long frames for VLAN */ sc->flags |=3D FXP_FLAG_LONG_PKT_EN; -#endif } =20 /* @@ -620,12 +615,10 @@ */ ether_ifattach(ifp, ETHER_BPF_SUPPORTED); =20 -#if NVLAN > 0 /* * Tell the upper layer(s) we support long frames. */ ifp->if_data.ifi_hdrlen =3D sizeof(struct ether_vlan_header); -#endif =20 /* * Let the system queue as many packets as we have available @@ -1225,7 +1218,7 @@ m_freem(m); goto rcvloop; } -#if NVLAN > 0 + /* * Drop the packet if it has CRC * errors. This test is only needed @@ -1237,7 +1230,7 @@ m_freem(m); goto rcvloop; } -#endif + m->m_pkthdr.rcvif =3D ifp; m->m_pkthdr.len =3D m->m_len =3D total_len; eh =3D mtod(m, struct ether_header *); @@ -1519,11 +1512,7 @@ cbp->ext_txcb_dis =3D sc->flags & FXP_FLAG_EXT_TXCB ? 0 : 1; cbp->ext_stats_dis =3D 1; /* disable extended counters */ cbp->keep_overrun_rx =3D 0; /* don't pass overrun frames to host */ -#if NVLAN > 0 cbp->save_bf =3D sc->chip =3D=3D FXP_CHIP_82557 ? 1 : prm; -#else - cbp->save_bf =3D prm; /* save bad frames */ -#endif cbp->disc_short_rx =3D !prm; /* discard short packets */ cbp->underrun_retry =3D 1; /* retry mode (once) on DMA underrun */ cbp->two_frames =3D 0; /* do not limit FIFO to 2 frames */ Index: sys/dev/nge/if_nge.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/dev/nge/if_nge.c,v retrieving revision 1.13.2.5 diff -u -r1.13.2.5 if_nge.c --- sys/dev/nge/if_nge.c 2001/09/19 23:14:28 1.13.2.5 +++ sys/dev/nge/if_nge.c 2001/10/21 20:14:05 @@ -87,8 +87,6 @@ * if the user selects an MTU larger than 8152 (8170 - 18) */ =20 -#include "vlan.h" - #include #include #include @@ -102,11 +100,8 @@ #include #include #include - -#if NVLAN > 0 #include #include -#endif =20 #include =20 @@ -1402,16 +1397,14 @@ m->m_pkthdr.csum_data =3D 0xffff; } =20 -#if NVLAN > 0 /* * If we received a packet with a vlan tag, pass it * to vlan_input() instead of ether_input(). */ if (extsts & NGE_RXEXTSTS_VLANPKT) { - vlan_input_tag(eh, m, extsts & NGE_RXEXTSTS_VTCI); + VLAN_INPUT_TAG(ifp, eh, m, extsts & NGE_RXEXTSTS_VTCI); continue; } -#endif =20 ether_input(ifp, eh, m); } @@ -1608,14 +1601,12 @@ struct nge_desc *f =3D NULL; struct mbuf *m; int frag, cur, cnt =3D 0; -#if NVLAN > 0 struct ifvlan *ifv =3D NULL; =20 if ((m_head->m_flags & (M_PROTO1|M_PKTHDR)) =3D=3D (M_PROTO1|M_PKTHDR) && m_head->m_pkthdr.rcvif !=3D NULL && m_head->m_pkthdr.rcvif->if_type =3D=3D IFT_L2VLAN) ifv =3D m_head->m_pkthdr.rcvif->if_softc; -#endif =20 /* * Start packing the mbufs in this chain into @@ -1657,12 +1648,10 @@ NGE_TXEXTSTS_UDPCSUM; } =20 -#if NVLAN > 0 if (ifv !=3D NULL) { sc->nge_ldata->nge_tx_list[cur].nge_extsts |=3D (NGE_TXEXTSTS_VLANPKT|ifv->ifv_tag); } -#endif =20 sc->nge_ldata->nge_tx_list[cur].nge_mbuf =3D m_head; sc->nge_ldata->nge_tx_list[cur].nge_ctl &=3D ~NGE_CMDSTS_MORE; @@ -1823,15 +1812,13 @@ */ CSR_WRITE_4(sc, NGE_VLAN_IP_RXCTL, NGE_VIPRXCTL_IPCSUM_ENB); =20 -#if NVLAN > 0 /* - * If VLAN support is enabled, tell the chip to detect - * and strip VLAN tag info from received frames. The tag - * will be provided in the extsts field in the RX descriptors. + * Tell the chip to detect and strip VLAN tag info from + * received frames. The tag will be provided in the extsts + * field in the RX descriptors. */ NGE_SETBIT(sc, NGE_VLAN_IP_RXCTL, NGE_VIPRXCTL_TAG_DETECT_ENB|NGE_VIPRXCTL_TAG_STRIP_ENB); -#endif =20 /* Set TX configuration */ CSR_WRITE_4(sc, NGE_TX_CFG, NGE_TXCFG); @@ -1841,14 +1828,11 @@ */ CSR_WRITE_4(sc, NGE_VLAN_IP_TXCTL, NGE_VIPTXCTL_CSUM_PER_PKT); =20 -#if NVLAN > 0 /* - * If VLAN support is enabled, tell the chip to insert - * VLAN tags on a per-packet basis as dictated by the - * code in the frame encapsulation routine. + * Tell the chip to insert VLAN tags on a per-packet basis as + * dictated by the code in the frame encapsulation routine. */ NGE_SETBIT(sc, NGE_VLAN_IP_TXCTL, NGE_VIPTXCTL_TAG_PER_PKT); -#endif =20 /* Set full/half duplex mode. */ if ((mii->mii_media_active & IFM_GMASK) =3D=3D IFM_FDX) { Index: sys/dev/txp/if_txp.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/dev/txp/if_txp.c,v retrieving revision 1.4.2.2 diff -u -r1.4.2.2 if_txp.c --- sys/dev/txp/if_txp.c 2001/07/31 16:39:34 1.4.2.2 +++ sys/dev/txp/if_txp.c 2001/10/21 20:15:01 @@ -39,8 +39,6 @@ * Driver for 3c990 (Typhoon) Ethernet ASIC */ =20 -#include "vlan.h" - #include #include #include @@ -54,6 +52,7 @@ #include #include #include +#include =20 #include #include @@ -66,10 +65,6 @@ =20 #include =20 -#if NVLAN > 0 -#include -#endif - #include /* for vtophys */ #include /* for vtophys */ #include /* for DELAY */ @@ -783,14 +778,11 @@ /* Remove header from mbuf and pass it on. */ m_adj(m, sizeof(struct ether_header)); =20 -#if NVLAN > 0 if (rxd->rx_stat & RX_STAT_VLAN) { - if (vlan_input_tag(eh, m, - htons(rxd->rx_vlan >> 16)) < 0) - ifp->if_noproto++; + VLAN_INPUT_TAG(ifp, eh, m, htons(rxd->rx_vlan >> 16)); goto next; } -#endif + ether_input(ifp, eh, m); =20 next: @@ -1291,9 +1283,7 @@ struct mbuf *m, *m0; struct txp_swdesc *sd; u_int32_t firstprod, firstcnt, prod, cnt; -#if NVLAN > 0 struct ifvlan *ifv; -#endif =20 if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) !=3D IFF_RUNNING) return; @@ -1330,14 +1320,13 @@ if (++cnt >=3D (TX_ENTRIES - 4)) goto oactive; =20 -#if NVLAN > 0 if ((m->m_flags & (M_PROTO1|M_PKTHDR)) =3D=3D (M_PROTO1|M_PKTHDR) && m->m_pkthdr.rcvif !=3D NULL) { ifv =3D m->m_pkthdr.rcvif->if_softc; txd->tx_pflags =3D TX_PFLAGS_VLAN | (htons(ifv->ifv_tag) << TX_PFLAGS_VLANTAG_S); } -#endif + if (m->m_pkthdr.csum_flags & CSUM_IP) txd->tx_pflags |=3D TX_PFLAGS_IPCKSUM; =20 @@ -1854,12 +1843,10 @@ sc->sc_tx_capability =3D ext->ext_1 & OFFLOAD_MASK; sc->sc_rx_capability =3D ext->ext_2 & OFFLOAD_MASK; =20 -#if NVLAN > 0 if (rsp->rsp_par2 & rsp->rsp_par3 & OFFLOAD_VLAN) { sc->sc_tx_capability |=3D OFFLOAD_VLAN; sc->sc_rx_capability |=3D OFFLOAD_VLAN; } -#endif =20 #if 0 /* not ready yet */ Index: sys/modules/bge/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/modules/bge/Makefile,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 Makefile --- sys/modules/bge/Makefile 2001/10/01 18:19:12 1.1.2.1 +++ sys/modules/bge/Makefile 2001/10/21 20:41:49 @@ -3,11 +3,7 @@ .PATH: ${.CURDIR}/../../dev/bge =20 KMOD=3D if_bge -SRCS=3D if_bge.c miibus_if.h opt_bdg.h vlan.h device_if.h bus_if.h pci_if.h +SRCS=3D if_bge.c miibus_if.h opt_bdg.h device_if.h bus_if.h pci_if.h KMODDEPS =3D miibus -CLEANFILES=3D vlan.h - -vlan.h: - touch vlan.h =20 .include Index: sys/modules/fxp/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/modules/fxp/Makefile,v retrieving revision 1.9.2.2 diff -u -r1.9.2.2 Makefile --- sys/modules/fxp/Makefile 2001/07/25 17:46:03 1.9.2.2 +++ sys/modules/fxp/Makefile 2001/10/21 20:40:40 @@ -2,11 +2,7 @@ =20 .PATH: ${.CURDIR}/../../dev/fxp KMOD =3D if_fxp -SRCS =3D if_fxp.c opt_bdg.h vlan.h device_if.h bus_if.h pci_if.h miibus_if= .h +SRCS =3D if_fxp.c opt_bdg.h device_if.h bus_if.h pci_if.h miibus_if.h KMODDEPS =3D miibus - -CLEANFILES =3D vlan.h -vlan.h: - echo '#define NVLAN 1' > vlan.h =20 .include Index: sys/modules/nge/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/modules/nge/Makefile,v retrieving revision 1.2.2.1 diff -u -r1.2.2.1 Makefile --- sys/modules/nge/Makefile 2001/06/19 19:42:42 1.2.2.1 +++ sys/modules/nge/Makefile 2001/10/21 20:40:55 @@ -3,11 +3,7 @@ .PATH: ${.CURDIR}/../../dev/nge =20 KMOD=3D if_nge -SRCS=3D if_nge.c miibus_if.h opt_bdg.h vlan.h device_if.h bus_if.h pci_if.h +SRCS=3D if_nge.c miibus_if.h opt_bdg.h device_if.h bus_if.h pci_if.h KMODDEPS =3D miibus -CLEANFILES=3D vlan.h - -vlan.h: - touch vlan.h =20 .include Index: sys/modules/ti/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/modules/ti/Makefile,v retrieving revision 1.8 diff -u -r1.8 Makefile --- sys/modules/ti/Makefile 2000/01/28 11:26:38 1.8 +++ sys/modules/ti/Makefile 2001/10/21 20:41:08 @@ -2,10 +2,6 @@ =20 .PATH: ${.CURDIR}/../../pci KMOD =3D if_ti -SRCS =3D if_ti.c opt_bdg.h vlan.h device_if.h bus_if.h pci_if.h -CLEANFILES =3D vlan.h - -vlan.h: - touch vlan.h +SRCS =3D if_ti.c opt_bdg.h device_if.h bus_if.h pci_if.h =20 .include Index: sys/modules/txp/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/modules/txp/Makefile,v retrieving revision 1.2.2.1 diff -u -r1.2.2.1 Makefile --- sys/modules/txp/Makefile 2001/07/30 17:31:41 1.2.2.1 +++ sys/modules/txp/Makefile 2001/10/21 20:41:20 @@ -3,10 +3,6 @@ .PATH: ${.CURDIR}/../../dev/txp =20 KMOD=3D if_txp -SRCS=3D if_txp.c opt_bdg.h device_if.h bus_if.h pci_if.h vlan.h -CLEANFILES=3D vlan.h - -vlan.h: - touch vlan.h +SRCS=3D if_txp.c opt_bdg.h device_if.h bus_if.h pci_if.h =20 .include Index: sys/modules/tx/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/modules/tx/Makefile,v retrieving revision 1.4.2.2 diff -u -r1.4.2.2 Makefile --- sys/modules/tx/Makefile 2001/09/01 07:17:11 1.4.2.2 +++ sys/modules/tx/Makefile 2001/10/21 20:41:34 @@ -3,10 +3,6 @@ .PATH: ${.CURDIR}/../../pci KMOD =3D if_tx SRCS =3D if_tx.c opt_bdg.h device_if.h bus_if.h pci_if.h -SRCS +=3D miibus_if.h vlan.h -CLEANFILES =3D vlan.h - -vlan.h: - touch vlan.h +SRCS +=3D miibus_if.h =20 .include Index: sys/pci/if_ti.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/pci/if_ti.c,v retrieving revision 1.25.2.10 diff -u -r1.25.2.10 if_ti.c --- sys/pci/if_ti.c 2001/08/01 01:08:25 1.25.2.10 +++ sys/pci/if_ti.c 2001/10/21 20:38:59 @@ -78,8 +78,6 @@ * - Andrew Gallatin for providing FreeBSD/Alpha support. */ =20 -#include "vlan.h" - #include #include #include @@ -94,14 +92,11 @@ #include #include #include - -#include - -#if NVLAN > 0 #include #include -#endif =20 +#include + #include #include #include @@ -1414,9 +1409,7 @@ if (sc->arpcom.ac_if.if_hwassist) rcb->ti_flags |=3D TI_RCB_FLAG_TCP_UDP_CKSUM | TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM; -#if NVLAN > 0 rcb->ti_flags |=3D TI_RCB_FLAG_VLAN_ASSIST; -#endif =20 /* Set up the jumbo receive ring. */ rcb =3D &sc->ti_rdata->ti_info.ti_jumbo_rx_rcb; @@ -1427,9 +1420,7 @@ if (sc->arpcom.ac_if.if_hwassist) rcb->ti_flags |=3D TI_RCB_FLAG_TCP_UDP_CKSUM | TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM; -#if NVLAN > 0 rcb->ti_flags |=3D TI_RCB_FLAG_VLAN_ASSIST; -#endif =20 /* * Set up the mini ring. Only activated on the @@ -1447,9 +1438,7 @@ if (sc->arpcom.ac_if.if_hwassist) rcb->ti_flags |=3D TI_RCB_FLAG_TCP_UDP_CKSUM | TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM; -#if NVLAN > 0 rcb->ti_flags |=3D TI_RCB_FLAG_VLAN_ASSIST; -#endif =20 /* * Set up the receive return ring. @@ -1483,9 +1472,7 @@ rcb->ti_flags =3D 0; else rcb->ti_flags =3D TI_RCB_FLAG_HOST_RING; -#if NVLAN > 0 rcb->ti_flags |=3D TI_RCB_FLAG_VLAN_ASSIST; -#endif if (sc->arpcom.ac_if.if_hwassist) rcb->ti_flags |=3D TI_RCB_FLAG_TCP_UDP_CKSUM | TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM; @@ -1833,22 +1820,18 @@ u_int32_t rxidx; struct ether_header *eh; struct mbuf *m =3D NULL; -#if NVLAN > 0 u_int16_t vlan_tag =3D 0; int have_tag =3D 0; -#endif =20 cur_rx =3D &sc->ti_rdata->ti_rx_return_ring[sc->ti_rx_saved_considx]; rxidx =3D cur_rx->ti_idx; TI_INC(sc->ti_rx_saved_considx, TI_RETURN_RING_CNT); =20 -#if NVLAN > 0 if (cur_rx->ti_flags & TI_BDFLAG_VLAN_TAG) { have_tag =3D 1; vlan_tag =3D cur_rx->ti_vlan_tag & 0xfff; } -#endif =20 if (cur_rx->ti_flags & TI_BDFLAG_JUMBO_RING) { TI_INC(sc->ti_jumbo, TI_JUMBO_RX_RING_CNT); @@ -1910,17 +1893,15 @@ m->m_pkthdr.csum_data =3D cur_rx->ti_tcp_udp_cksum; } =20 -#if NVLAN > 0 /* * If we received a packet with a vlan tag, pass it * to vlan_input() instead of ether_input(). */ if (have_tag) { - vlan_input_tag(eh, m, vlan_tag); + VLAN_INPUT_TAG(ifp, eh, m, vlan_tag); have_tag =3D vlan_tag =3D 0; continue; } -#endif ether_input(ifp, eh, m); } =20 @@ -2053,14 +2034,12 @@ struct mbuf *m; u_int32_t frag, cur, cnt =3D 0; u_int16_t csum_flags =3D 0; -#if NVLAN > 0 struct ifvlan *ifv =3D NULL; =20 if ((m_head->m_flags & (M_PROTO1|M_PKTHDR)) =3D=3D (M_PROTO1|M_PKTHDR) && m_head->m_pkthdr.rcvif !=3D NULL && m_head->m_pkthdr.rcvif->if_type =3D=3D IFT_L2VLAN) ifv =3D m_head->m_pkthdr.rcvif->if_softc; -#endif =20 m =3D m_head; cur =3D frag =3D *txidx; @@ -2103,14 +2082,14 @@ TI_HOSTADDR(f->ti_addr) =3D vtophys(mtod(m, vm_offset_t)); f->ti_len =3D m->m_len; f->ti_flags =3D csum_flags; -#if NVLAN > 0 + if (ifv !=3D NULL) { f->ti_flags |=3D TI_BDFLAG_VLAN_TAG; f->ti_vlan_tag =3D ifv->ifv_tag & 0xfff; } else { f->ti_vlan_tag =3D 0; } -#endif + /* * Sanity check: avoid coming within 16 descriptors * of the end of the ring. Index: sys/pci/if_tx.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/pci/if_tx.c,v retrieving revision 1.34.2.8 diff -u -r1.34.2.8 if_tx.c --- sys/pci/if_tx.c 2001/09/01 07:21:56 1.34.2.8 +++ sys/pci/if_tx.c 2001/10/21 20:40:05 @@ -54,8 +54,6 @@ #if defined(__FreeBSD__) #define NBPFILTER 1 =20 -#include "vlan.h" - #include #include #include @@ -63,9 +61,7 @@ =20 #include =20 -#if NVLAN > 0 #include -#endif =20 #include /* for vtophys */ #include /* for vtophys */ @@ -562,9 +558,7 @@ =20 /* Attach to OS's managers */ ether_ifattach(ifp, ETHER_BPF_SUPPORTED); -#if NVLAN > 0 ifp->if_hdrlen =3D sizeof(struct ether_vlan_header); -#endif callout_handle_init(&sc->stat_ch); =20 fail: Index: share/man/man4/man4.i386/tx.4 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/share/man/man4/man4.i386/tx.4,v retrieving revision 1.11.2.7 diff -u -r1.11.2.7 tx.4 --- share/man/man4/man4.i386/tx.4 2001/09/01 07:17:31 1.11.2.7 +++ share/man/man4/man4.i386/tx.4 2001/10/21 20:47:04 @@ -80,10 +80,7 @@ .Xr vlan 4 inteface) without decreasing the MTU on the=20 .Xr vlan 4 -interfaces. This support must be enabled by adding ``pseudo-device vlan'' -to the kernel configuration file (if compiling staticaly) or inserting=20 -the ``#define NVLAN 1'' line into the sys/modules/tx/vlan.h (if compiling -as KLD) +interfaces. .Sh DIAGNOSTICS .Bl -diag .It "tx%d: device timeout %d packets" --RnlQjJ0d97Da+TV1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE706A8XY6L6fI4GtQRAsElAJ9kUUi+aYGrQ/Fnwks1nxKsJwJyTwCdGILI cvm4GmEDlwvIfrBta3oTAA4= =Cb+x -----END PGP SIGNATURE----- --RnlQjJ0d97Da+TV1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Oct 23 1:22:27 2001 Delivered-To: freebsd-audit@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id D661E37B403; Tue, 23 Oct 2001 01:22:20 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.6/8.11.2) id f9N8MF353925; Tue, 23 Oct 2001 11:22:15 +0300 (EEST) (envelope-from ru) Date: Tue, 23 Oct 2001 11:22:15 +0300 From: Ruslan Ermilov To: Warner Losh Cc: audit@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/net rcmdsh.3 rcmdsh.c Makefile.inc rcmd.c Message-ID: <20011023112215.C43285@sunbay.com> References: <200110230622.f9N6MF973431@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200110230622.f9N6MF973431@freefall.freebsd.org>; from imp@FreeBSD.org on Mon, Oct 22, 2001 at 11:22:15PM -0700 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Oct 22, 2001 at 11:22:15PM -0700, Warner Losh wrote: > imp 2001/10/22 23:22:15 PDT > > Modified files: > lib/libc/net Makefile.inc rcmd.c > Added files: > lib/libc/net rcmdsh.3 rcmdsh.c > Log: > Allow users to specify a command to use as remote command instead of > using rcmd directly. This has been in my tree for a long time, but we > may need to sync with OpenBSD before MFC. > > Obtained from: openbsd > PR: 15830 > > MFC after: 2 months > > Revision Changes Path > 1.43 +3 -3 src/lib/libc/net/Makefile.inc > 1.32 +21 -5 src/lib/libc/net/rcmd.c > 1.1 +105 -0 src/lib/libc/net/rcmdsh.3 (new) > 1.1 +130 -0 src/lib/libc/net/rcmdsh.c (new) > Warner, The attached patch: 1. Puts missing prototype for rcmd() in . 2. Cleans up the manpage. 3. Applies style(9) to rcmdsh.c. Note that the type of "rshprog" was changed from "char *" to "const char *" to satisfy WARNS=2. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Oct 23 1:24:24 2001 Delivered-To: freebsd-audit@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 356C537B401; Tue, 23 Oct 2001 01:24:07 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.6/8.11.2) id f9N8O4P54430; Tue, 23 Oct 2001 11:24:04 +0300 (EEST) (envelope-from ru) Date: Tue, 23 Oct 2001 11:24:04 +0300 From: Ruslan Ermilov To: Warner Losh Cc: audit@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/net rcmdsh.3 rcmdsh.c Makefile.inc rcmd.c Message-ID: <20011023112404.A54039@sunbay.com> References: <200110230622.f9N6MF973431@freefall.freebsd.org> <20011023112215.C43285@sunbay.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011023112215.C43285@sunbay.com>; from ru@FreeBSD.org on Tue, Oct 23, 2001 at 11:22:15AM +0300 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Doh, forgot to attach the patch, sorry. :-( On Tue, Oct 23, 2001 at 11:22:15AM +0300, Ruslan Ermilov wrote: > On Mon, Oct 22, 2001 at 11:22:15PM -0700, Warner Losh wrote: > > imp 2001/10/22 23:22:15 PDT > > > > Modified files: > > lib/libc/net Makefile.inc rcmd.c > > Added files: > > lib/libc/net rcmdsh.3 rcmdsh.c > > Log: > > Allow users to specify a command to use as remote command instead of > > using rcmd directly. This has been in my tree for a long time, but we > > may need to sync with OpenBSD before MFC. > > > > Obtained from: openbsd > > PR: 15830 > > > > MFC after: 2 months > > > > Revision Changes Path > > 1.43 +3 -3 src/lib/libc/net/Makefile.inc > > 1.32 +21 -5 src/lib/libc/net/rcmd.c > > 1.1 +105 -0 src/lib/libc/net/rcmdsh.3 (new) > > 1.1 +130 -0 src/lib/libc/net/rcmdsh.c (new) > > > Warner, > > The attached patch: > > 1. Puts missing prototype for rcmd() in . > 2. Cleans up the manpage. > 3. Applies style(9) to rcmdsh.c. > > Note that the type of "rshprog" was changed from "char *" > to "const char *" to satisfy WARNS=2. > > > Cheers, > -- > Ruslan Ermilov Oracle Developer/DBA, > ru@sunbay.com Sunbay Software AG, > ru@FreeBSD.org FreeBSD committer, > +380.652.512.251 Simferopol, Ukraine > > http://www.FreeBSD.org The Power To Serve > http://www.oracle.com Enabling The Information Age -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: include/unistd.h =================================================================== RCS file: /home/ncvs/src/include/unistd.h,v retrieving revision 1.43 diff -u -p -r1.43 unistd.h --- include/unistd.h 2001/09/21 22:50:39 1.43 +++ include/unistd.h 2001/10/23 08:19:37 @@ -173,6 +173,8 @@ int rcmd __P((char **, int, const char const char *, const char *, int *)); int rcmd_af __P((char **, int, const char *, const char *, const char *, int *, int)); +int rcmdsh __P((char **, int, const char *, + const char *, const char *, const char *)); char *re_comp __P((const char *)); int re_exec __P((const char *)); int readlink __P((const char *, char *, int)); Index: lib/libc/net/rcmdsh.3 =================================================================== RCS file: /home/ncvs/src/lib/libc/net/rcmdsh.3,v retrieving revision 1.1 diff -u -p -r1.1 rcmdsh.3 --- lib/libc/net/rcmdsh.3 2001/10/23 06:22:15 1.1 +++ lib/libc/net/rcmdsh.3 2001/10/23 08:19:37 @@ -40,9 +40,16 @@ .Nm rcmdsh .Nd return a stream to a remote command without superuser .Sh SYNOPSIS -.Fd #include +.In unistd.h .Ft int -.Fn rcmdsh "char **ahost" "int inport" "const char *locuser" "const char *remuser" "const char *cmd" "char *rshprog" +.Fo rcmdsh +.Fa "char **ahost" +.Fa "int inport" +.Fa "const char *locuser" +.Fa "const char *remuser" +.Fa "const char *cmd" +.Fa "const char *rshprog" +.Fc .Sh DESCRIPTION The .Fn rcmdsh @@ -53,7 +60,8 @@ on reserved port numbers using .Xr rshd 8 or the value of .Fa rshprog -(if non-null). +(if +.No non- Ns Dv NULL ) . .Pp The .Fn rcmdsh @@ -68,27 +76,28 @@ Otherwise is set to the standard name of the host and a connection is established to a server residing at the well-known Internet port -.Li shell/tcp +.Dq Li shell/tcp (or whatever port is used by -.Fa rshprog -). The parameter +.Fa rshprog ) . +The parameter .Fa inport is ignored; it is only included to provide an interface similar to .Xr rcmd 3 . .Pp If the connection succeeds, a socket in the -.Tn UNIX +.Ux domain of type .Dv SOCK_STREAM is returned to the caller, and given to the remote -command as stdin and stdout, and stderr. -.Sh DIAGNOSTICS +command as stdin, stdout, and stderr. +.Sh RETURN VALUES The .Fn rcmdsh function returns a valid socket descriptor on success. -It returns \-1 on error and prints a diagnostic message on the standard error. +Otherwise, \-1 is returned +and a diagnostic message is printed on the standard error. .Sh SEE ALSO .Xr rsh 1 , .Xr socketpair 2 , @@ -97,9 +106,11 @@ It returns \-1 on error and prints a dia .Sh BUGS If .Xr rsh 1 -gets an error a file descriptor is still returned instead of \-1. +encounters an error, a file descriptor is still returned instead of \-1. .Sh HISTORY The .Fn rcmdsh function first appeared in -.Ox 2.0 . +.Ox 2.0 , +and made its way into +.Fx 5.0 . Index: lib/libc/net/rcmdsh.c =================================================================== RCS file: /home/ncvs/src/lib/libc/net/rcmdsh.c,v retrieving revision 1.1 diff -u -p -r1.1 rcmdsh.c --- lib/libc/net/rcmdsh.c 2001/10/23 06:22:15 1.1 +++ lib/libc/net/rcmdsh.c 2001/10/23 08:19:37 @@ -1,30 +1,27 @@ -/* $OpenBSD: rcmdsh.c,v 1.5 1998/04/25 16:23:58 millert Exp $ */ +/* $OpenBSD: rcmdsh.c,v 1.5 1998/04/25 16:23:58 millert Exp $ */ /* - * This is an rcmd() replacement originally by + * This is an rcmd() replacement originally by * Chris Siebenmann . - * - * $FreeBSD: src/lib/libc/net/rcmdsh.c,v 1.1 2001/10/23 06:22:15 imp Exp $ */ -#if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$FreeBSD: src/lib/libc/net/rcmdsh.c,v 1.1 2001/10/23 06:22:15 imp Exp $" -#endif /* LIBC_SCCS and not lint */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +__FBSDID("$FreeBSD: src/lib/libc/net/rcmdsh.c,v 1.1 2001/10/23 06:22:15 imp Exp $"); +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + #ifndef _PATH_RSH -#define _PATH_RSH "/usr/bin/rsh" +#define _PATH_RSH "/usr/bin/rsh" #endif /* @@ -36,9 +33,8 @@ static char *rcsid = "$FreeBSD: src/lib/ int rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) char **ahost; - int rport; - const char *locuser, *remuser, *cmd; - char *rshprog; + int rport __unused; + const char *locuser, *remuser, *cmd, *rshprog; { struct hostent *hp; int cpid, sp[2]; @@ -51,41 +47,41 @@ rcmdsh(ahost, rport, locuser, remuser, c /* locuser must exist on this host. */ if ((pw = getpwnam(locuser)) == NULL) { - (void) fprintf(stderr, "rcmdsh: unknown user: %s\n", locuser); - return(-1); + (void)fprintf(stderr, "rcmdsh: unknown user: %s\n", locuser); + return (-1); } /* Validate remote hostname. */ if (strcmp(*ahost, "localhost") != 0) { if ((hp = gethostbyname(*ahost)) == NULL) { herror(*ahost); - return(-1); + return (-1); } *ahost = hp->h_name; } /* Get a socketpair we'll use for stdin and stdout. */ - if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) < 0) { + if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) == -1) { perror("rcmdsh: socketpair"); - return(-1); + return (-1); } cpid = fork(); - if (cpid < 0) { + if (cpid == -1) { perror("rcmdsh: fork failed"); - return(-1); + return (-1); } else if (cpid == 0) { /* * Child. We use sp[1] to be stdin/stdout, and close sp[0]. */ - (void) close(sp[0]); - if (dup2(sp[1], 0) < 0 || dup2(0, 1) < 0) { + (void)close(sp[0]); + if (dup2(sp[1], 0) == -1 || dup2(0, 1) == -1) { perror("rcmdsh: dup2 failed"); _exit(255); } /* Fork again to lose parent. */ cpid = fork(); - if (cpid < 0) { + if (cpid == -1) { perror("rcmdsh: fork to lose parent failed"); _exit(255); } @@ -93,38 +89,39 @@ rcmdsh(ahost, rport, locuser, remuser, c _exit(0); /* In grandchild here. Become local user for rshprog. */ - if (setuid(pw->pw_uid)) { - (void) fprintf(stderr, "rcmdsh: setuid(%u): %s\n", - pw->pw_uid, strerror(errno)); + if (setuid(pw->pw_uid) == -1) { + (void)fprintf(stderr, "rcmdsh: setuid(%u): %s\n", + pw->pw_uid, strerror(errno)); _exit(255); } /* - * If remote host is "localhost" and local and remote user + * If remote host is "localhost" and local and remote users * are the same, avoid running remote shell for efficiency. */ - if (!strcmp(*ahost, "localhost") && !strcmp(locuser, remuser)) { + if (strcmp(*ahost, "localhost") == 0 && + strcmp(locuser, remuser) == 0) { if (pw->pw_shell[0] == '\0') rshprog = _PATH_BSHELL; else rshprog = pw->pw_shell; p = strrchr(rshprog, '/'); - execlp(rshprog, p ? p+1 : rshprog, "-c", cmd, - (char *) NULL); + execlp(rshprog, p ? p + 1 : rshprog, "-c", cmd, + (char *)NULL); } else { p = strrchr(rshprog, '/'); - execlp(rshprog, p ? p+1 : rshprog, *ahost, "-l", - remuser, cmd, (char *) NULL); + execlp(rshprog, p ? p + 1 : rshprog, *ahost, "-l", + remuser, cmd, (char *)NULL); } - (void) fprintf(stderr, "rcmdsh: execlp %s failed: %s\n", - rshprog, strerror(errno)); + (void)fprintf(stderr, "rcmdsh: execlp %s failed: %s\n", + rshprog, strerror(errno)); _exit(255); } else { /* Parent. close sp[1], return sp[0]. */ - (void) close(sp[1]); + (void)close(sp[1]); /* Reap child. */ - (void) wait(NULL); - return(sp[0]); + (void)wait(NULL); + return (sp[0]); } /* NOTREACHED */ } --1yeeQ81UyVL57Vl7-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Oct 23 7:43:53 2001 Delivered-To: freebsd-audit@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id B22E637B401; Tue, 23 Oct 2001 07:43:50 -0700 (PDT) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id f9NEhmV50819; Tue, 23 Oct 2001 08:43:49 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost [127.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id f9NEhm719911; Tue, 23 Oct 2001 08:43:48 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200110231443.f9NEhm719911@harmony.village.org> To: Ruslan Ermilov Subject: Re: cvs commit: src/lib/libc/net rcmdsh.3 rcmdsh.c Makefile.inc rcmd.c Cc: audit@FreeBSD.org In-reply-to: Your message of "Tue, 23 Oct 2001 11:22:15 +0300." <20011023112215.C43285@sunbay.com> References: <20011023112215.C43285@sunbay.com> <200110230622.f9N6MF973431@freefall.freebsd.org> Date: Tue, 23 Oct 2001 08:43:48 -0600 From: Warner Losh Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20011023112215.C43285@sunbay.com> Ruslan Ermilov writes: : The attached patch: : : 1. Puts missing prototype for rcmd() in . : 2. Cleans up the manpage. : 3. Applies style(9) to rcmdsh.c. : : Note that the type of "rshprog" was changed from "char *" : to "const char *" to satisfy WARNS=2. Please hold off. I'm going to be merging from OpenBSD's latest code later this week and will just spam whatever changes you'd make. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Oct 23 7:57:28 2001 Delivered-To: freebsd-audit@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id F353A37B403 for ; Tue, 23 Oct 2001 07:57:22 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.6/8.11.2) id f9NEuxR16105; Tue, 23 Oct 2001 17:56:59 +0300 (EEST) (envelope-from ru) Date: Tue, 23 Oct 2001 17:56:59 +0300 From: Ruslan Ermilov To: Warner Losh Cc: audit@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/net rcmdsh.3 rcmdsh.c Makefile.inc rcmd.c Message-ID: <20011023175659.D12308@sunbay.com> References: <20011023112215.C43285@sunbay.com> <200110230622.f9N6MF973431@freefall.freebsd.org> <20011023112215.C43285@sunbay.com> <200110231443.f9NEhm719911@harmony.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200110231443.f9NEhm719911@harmony.village.org>; from imp@harmony.village.org on Tue, Oct 23, 2001 at 08:43:48AM -0600 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Oct 23, 2001 at 08:43:48AM -0600, Warner Losh wrote: > In message <20011023112215.C43285@sunbay.com> Ruslan Ermilov writes: > : The attached patch: > : > : 1. Puts missing prototype for rcmd() in . > : 2. Cleans up the manpage. > : 3. Applies style(9) to rcmdsh.c. > : > : Note that the type of "rshprog" was changed from "char *" > : to "const char *" to satisfy WARNS=2. > > Please hold off. I'm going to be merging from OpenBSD's latest > code later this week and will just spam whatever changes you'd make. > I've already checked. The .c file matches the latest OpenBSD revision (1.5), and I've incorporated all functional manpage fixes from OpenBSD's revisions plus extra fixes of mine. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Oct 23 7:59:21 2001 Delivered-To: freebsd-audit@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 394B137B403; Tue, 23 Oct 2001 07:59:18 -0700 (PDT) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id f9NExGV50944; Tue, 23 Oct 2001 08:59:16 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost [127.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id f9NExF720178; Tue, 23 Oct 2001 08:59:15 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200110231459.f9NExF720178@harmony.village.org> To: Ruslan Ermilov Subject: Re: cvs commit: src/lib/libc/net rcmdsh.3 rcmdsh.c Makefile.inc rcmd.c Cc: audit@FreeBSD.org In-reply-to: Your message of "Tue, 23 Oct 2001 17:56:59 +0300." <20011023175659.D12308@sunbay.com> References: <20011023175659.D12308@sunbay.com> <20011023112215.C43285@sunbay.com> <200110230622.f9N6MF973431@freefall.freebsd.org> <20011023112215.C43285@sunbay.com> <200110231443.f9NEhm719911@harmony.village.org> Date: Tue, 23 Oct 2001 08:59:15 -0600 From: Warner Losh Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20011023175659.D12308@sunbay.com> Ruslan Ermilov writes: : I've already checked. The .c file matches the latest OpenBSD revision : (1.5), and I've incorporated all functional manpage fixes from : OpenBSD's revisions plus extra fixes of mine. Well then, that's different :-). I'll take a look at your patches and commit them later today if they are good. My first blush look said yes, but I've not had my morning caffiene yet. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Oct 24 9:23: 5 2001 Delivered-To: freebsd-audit@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id 76F9637B401; Wed, 24 Oct 2001 09:22:53 -0700 (PDT) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) (authenticated as iwa with CRAM-MD5) by tasogare.imasy.or.jp (8.11.6+3.4W/8.11.6/tasogare) with ESMTP/inet id f9OGMlm16160; Thu, 25 Oct 2001 01:22:47 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) Date: Thu, 25 Oct 2001 01:22:43 +0900 (JST) Message-Id: <20011025.012243.71082514.iwasaki@jp.FreeBSD.org> To: acpi-jp@jp.freebsd.org Cc: arch@freebsd.org, audit@freebsd.org Subject: ACPI: APM compatibility implementation From: Mitsuru IWASAKI X-Mailer: Mew version 2.0 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, I've just started implementation of APM compatibility stuff for FreeBSD/i386. The goal is to support most APM applications (binary) w/o any changes on ACPI enabled kernel. This emulates APM device node interface APIs (mainly ioctl) and provides APM services for the applications. The patches at: http://people.freebsd.org/~iwasaki/acpi/acpi_compat_apm-20011025.diff Currently following ioctls are implemented; - APMIO_SUSPEND (mapped S3 as default but can be changed by sysctl) - APMIO_STANDBY (mapped S1 as default but can be changed by sysctl) - APMIO_GETINFO and APMIO_GETINFO_OLD - APMIO_GETPWSTATUS Many APM applications are already supported. apmopen, apmclose, apmwrite, apmpoll and following ioctls are fake :-p - APMIO_ENABLE - APMIO_DISABLE - APMIO_HALTCPU - APMIO_NOTHALTCPU - APMIO_DISPLAY - APMIO_BIOS My apm reports correct info with ACPI kernel as follows. % apm APM version: 1.2 APM Managment: Enabled AC Line status: off-line Battery status: high Remaining battery life: 99% Remaining battery time: 3:18:00 Number of batteries: 1 Battery 0: Battery status: high Remaining battery life: 99% Remaining battery time: 3:18:00 Resume timer: Thu Jan 1 08:59:59 1970 Resume on ring indicator: disabled APM Capacities: unknown Any comments are welcome. I'll commit this coming weekend. Thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Oct 24 9:36: 2 2001 Delivered-To: freebsd-audit@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id F221637B401; Wed, 24 Oct 2001 09:35:51 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f9OGZpM35317; Wed, 24 Oct 2001 09:35:51 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id A62F939F0; Wed, 24 Oct 2001 09:35:51 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Mitsuru IWASAKI Cc: acpi-jp@jp.freebsd.org, arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: ACPI: APM compatibility implementation In-Reply-To: <20011025.012243.71082514.iwasaki@jp.FreeBSD.org> Date: Wed, 24 Oct 2001 09:35:51 -0700 From: Peter Wemm Message-Id: <20011024163551.A62F939F0@overcee.netplex.com.au> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mitsuru IWASAKI wrote: > Hi, > > I've just started implementation of APM compatibility stuff for > FreeBSD/i386. > The goal is to support most APM applications (binary) w/o any changes > on ACPI enabled kernel. > This emulates APM device node interface APIs (mainly ioctl) and > provides APM services for the applications. > > The patches at: > http://people.freebsd.org/~iwasaki/acpi/acpi_compat_apm-20011025.diff This is great news! I look forward to it. :-) Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Oct 25 8:40:11 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gull.prod.itd.earthlink.net (gull.mail.pas.earthlink.net [207.217.121.85]) by hub.freebsd.org (Postfix) with ESMTP id 2001F37B415; Thu, 25 Oct 2001 08:39:55 -0700 (PDT) Received: from dialup-209.244.104.103.dial1.sanjose1.level3.net ([209.244.104.103] helo=mindspring.com) by gull.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 15wmbn-0000yw-00; Thu, 25 Oct 2001 08:39:51 -0700 Message-ID: <3BD8327C.A73CF24A@mindspring.com> Date: Thu, 25 Oct 2001 08:40:44 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Mitsuru IWASAKI Cc: acpi-jp@jp.freebsd.org, arch@freebsd.org, audit@freebsd.org Subject: Re: ACPI: APM compatibility implementation References: <20011025.012243.71082514.iwasaki@jp.FreeBSD.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mitsuru IWASAKI wrote: [ ... ] > My apm reports correct info with ACPI kernel as follows. [ ... ] > Remaining battery time: 3:18:00 [ ... ] > Any comments are welcome. I'll commit this coming weekend. Comments: 1) Cool patch! 2) What kind of hardware gives a 3 hour battery life on one battery?!? -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Oct 25 8:52:18 2001 Delivered-To: freebsd-audit@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id 8466537B433; Thu, 25 Oct 2001 08:52:07 -0700 (PDT) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) (authenticated as iwa with CRAM-MD5) by tasogare.imasy.or.jp (8.11.6+3.4W/8.11.6/tasogare) with ESMTP/inet id f9PFq3m87324; Fri, 26 Oct 2001 00:52:03 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) Date: Fri, 26 Oct 2001 00:51:58 +0900 (JST) Message-Id: <20011026.005158.71086516.iwasaki@jp.FreeBSD.org> To: arch@freebsd.org Cc: audit@freebsd.org Subject: (was Re: cvs commit: src/sys/modules Makefile src/sys/modules/apm Mak ) From: Mitsuru IWASAKI In-Reply-To: <20011025.231348.92585814.iwasaki@jp.FreeBSD.org> References: <200110250505.f9P55R739324@harmony.village.org> <20011025.231348.92585814.iwasaki@jp.FreeBSD.org> X-Mailer: Mew version 2.0 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, I've just make patches for the recent apm module changes. http://people.freebsd.org/~iwasaki/apm/apm_module-20011025.diff The problems I'm tring to solve are; - Apm loadable module cannot inform other kernel components whether apm will be enabled (e.g. i386/isa/clock.c:startrtclock()'s TCS hack). SI_SUB_KLD stuff should be invoked earlier than SI_SUB_CPU. - APM and ACPI cannot co-exist together at the same time according to ACPI spec. They should be enabled exclusively by some sort of arbitration mechanism. - Now that `#ifdef DEV_APM' related code is almost obsolete. Also public apm(4) functions, such as apm_suspend(), cannot be called directly, should be called via abstracted interface. Note that the patches contain exchanging priority of SI_SUB_CPU and SI_SUB_KLD. I already checked dependency of all MOD_LOAD code on cpu_startup() related code (e.g. DELAY) roughly, but I'm not sure if there is no problem. I think that module load event code and kernel linker should not depend on SI_SUB_CPU... Any comments are welcome. I'll commit this early in Nov. Thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Oct 25 9: 6:20 2001 Delivered-To: freebsd-audit@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id E80A537B401; Thu, 25 Oct 2001 09:06:15 -0700 (PDT) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) (authenticated as iwa with CRAM-MD5) by tasogare.imasy.or.jp (8.11.6+3.4W/8.11.6/tasogare/smtpfeed 1.14) with ESMTP/inet id f9PG6Bm90366; Fri, 26 Oct 2001 01:06:11 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) Date: Fri, 26 Oct 2001 01:06:08 +0900 (JST) Message-Id: <20011026.010608.97294590.iwasaki@jp.FreeBSD.org> To: tlambert2@mindspring.com Cc: acpi-jp@jp.freebsd.org, arch@freebsd.org, audit@freebsd.org, iwasaki@jp.FreeBSD.org Subject: Re: ACPI: APM compatibility implementation From: Mitsuru IWASAKI In-Reply-To: <3BD8327C.A73CF24A@mindspring.com> References: <20011025.012243.71082514.iwasaki@jp.FreeBSD.org> <3BD8327C.A73CF24A@mindspring.com> X-Mailer: Mew version 2.0 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, > > Any comments are welcome. I'll commit this coming weekend. > > Comments: > > 1) Cool patch! Thanks! > 2) What kind of hardware gives a 3 hour battery life on > one battery?!? This one http://www.casio.com/personalpcs/product.cfm?section=17&market=0&product=3917 Bigger battery is like this :) % apm APM version: 1.2 APM Managment: Enabled AC Line status: off-line Battery status: high Remaining battery life: 99% Remaining battery time: 7:01:00 Thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Oct 25 13:32:33 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id 686C737B507; Thu, 25 Oct 2001 13:32:10 -0700 (PDT) Received: from caddis.yogotech.com (yogotech.nokia.com [4.22.66.156]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id OAA13030; Thu, 25 Oct 2001 14:31:59 -0600 (MDT) (envelope-from nate@yogotech.com) Received: (from nate@localhost) by caddis.yogotech.com (8.11.6/8.11.6) id f9PKVm504839; Thu, 25 Oct 2001 14:31:48 -0600 (MDT) (envelope-from nate) From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15320.30388.178781.313461@caddis.yogotech.com> Date: Thu, 25 Oct 2001 14:31:48 -0600 To: tlambert2@mindspring.com Cc: Mitsuru IWASAKI , acpi-jp@jp.FreeBSD.org, arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: ACPI: APM compatibility implementation In-Reply-To: <3BD8327C.A73CF24A@mindspring.com> References: <20011025.012243.71082514.iwasaki@jp.FreeBSD.org> <3BD8327C.A73CF24A@mindspring.com> X-Mailer: VM 6.95 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > [ ... ] > > My apm reports correct info with ACPI kernel as follows. > [ ... ] > > Remaining battery time: 3:18:00 > [ ... ] > > Any comments are welcome. I'll commit this coming weekend. > > Comments: > > 1) Cool patch! > 2) What kind of hardware gives a 3 hour battery life on > one battery?!? Not quite 3 hours, but really close on my ThinkPad. caddis:~ # apm APM version: 1.2 APM Managment: Enabled AC Line status: off-line Battery status: high Remaining battery life: 100% Remaining battery time: 2:50:00 Number of batteries: 2 Battery 0: Battery status: high Remaining battery life: 100% Remaining battery time: 2:50:00 Battery 1: Battery status: not present Resume timer: disabled Resume on ring indicator: disabled APM Capacities: global standby state global suspend state resume timer from suspend 3+ hours is actually common on even newer hardware. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Oct 26 4:18: 8 2001 Delivered-To: freebsd-audit@freebsd.org Received: from storm.FreeBSD.org.uk (storm.FreeBSD.org.uk [194.242.139.170]) by hub.freebsd.org (Postfix) with ESMTP id 324F037B401; Fri, 26 Oct 2001 04:18:03 -0700 (PDT) Received: (from uucp@localhost) by storm.FreeBSD.org.uk (8.11.6/8.11.6) with UUCP id f9QBHiT92977; Fri, 26 Oct 2001 12:17:44 +0100 (BST) (envelope-from mark@grondar.za) Received: from grondar.za (localhost [127.0.0.1]) by grimreaper.grondar.org (8.11.6/8.11.6) with ESMTP id f9QA2bY44136; Fri, 26 Oct 2001 11:02:37 +0100 (BST) (envelope-from mark@grondar.za) Message-Id: <200110261002.f9QA2bY44136@grimreaper.grondar.org> To: tlambert2@mindspring.com Cc: Mitsuru IWASAKI , acpi-jp@jp.FreeBSD.org, arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: ACPI: APM compatibility implementation References: <3BD8327C.A73CF24A@mindspring.com> In-Reply-To: <3BD8327C.A73CF24A@mindspring.com> ; from Terry Lambert "Thu, 25 Oct 2001 08:40:44 PDT." Date: Fri, 26 Oct 2001 11:02:37 +0100 From: Mark Murray Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > 2) What kind of hardware gives a 3 hour battery life on > one battery?!? Toshiba Libretto 110CT. M -- o Mark Murray \_ FreeBSD Services Limited O.\_ Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message