KNF. No functional change.

This commit is contained in:
msaitoh 2019-06-18 08:36:52 +00:00
parent 7ad35d74eb
commit 38d0497851
1 changed files with 19 additions and 23 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_vlan.c,v 1.136 2019/05/15 02:59:18 ozaki-r Exp $ */
/* $NetBSD: if_vlan.c,v 1.137 2019/06/18 08:36:52 msaitoh Exp $ */
/*
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.136 2019/05/15 02:59:18 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.137 2019/06/18 08:36:52 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -147,7 +147,7 @@ struct ifvlan_linkmib {
int ifvm_mintu; /* min transmission unit */
uint16_t ifvm_proto; /* encapsulation ethertype */
uint16_t ifvm_tag; /* tag to apply on packets */
struct ifnet *ifvm_p; /* parent interface of this vlan */
struct ifnet *ifvm_p; /* parent interface of this vlan */
struct psref_target ifvm_psref;
};
@ -199,23 +199,19 @@ const struct vlan_multisw vlan_ether_multisw = {
static int vlan_clone_create(struct if_clone *, int);
static int vlan_clone_destroy(struct ifnet *);
static int vlan_config(struct ifvlan *, struct ifnet *,
uint16_t);
static int vlan_config(struct ifvlan *, struct ifnet *, uint16_t);
static int vlan_ioctl(struct ifnet *, u_long, void *);
static void vlan_start(struct ifnet *);
static int vlan_transmit(struct ifnet *, struct mbuf *);
static void vlan_unconfig(struct ifnet *);
static int vlan_unconfig_locked(struct ifvlan *,
struct ifvlan_linkmib *);
static int vlan_unconfig_locked(struct ifvlan *, struct ifvlan_linkmib *);
static void vlan_hash_init(void);
static int vlan_hash_fini(void);
static int vlan_tag_hash(uint16_t, u_long);
static struct ifvlan_linkmib* vlan_getref_linkmib(struct ifvlan *,
struct psref *);
static void vlan_putref_linkmib(struct ifvlan_linkmib *,
struct psref *);
static void vlan_linkmib_update(struct ifvlan *,
struct ifvlan_linkmib *);
static void vlan_putref_linkmib(struct ifvlan_linkmib *, struct psref *);
static void vlan_linkmib_update(struct ifvlan *, struct ifvlan_linkmib *);
static struct ifvlan_linkmib* vlan_lookup_tag_psref(struct ifnet *,
uint16_t, struct psref *);
@ -348,7 +344,7 @@ vlan_clone_create(struct if_clone *ifc, int unit)
struct ifvlan_linkmib *mib;
int rv;
ifv = malloc(sizeof(struct ifvlan), M_DEVBUF, M_WAITOK|M_ZERO);
ifv = malloc(sizeof(struct ifvlan), M_DEVBUF, M_WAITOK | M_ZERO);
mib = kmem_zalloc(sizeof(struct ifvlan_linkmib), KM_SLEEP);
ifp = &ifv->ifv_if;
LIST_INIT(&ifv->ifv_mc_listhead);
@ -508,11 +504,11 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag)
ec->ec_capenable |= ETHERCAP_VLAN_HWTAGGING;
ifp->if_capabilities = p->if_capabilities &
(IFCAP_TSOv4 | IFCAP_TSOv6 |
IFCAP_CSUM_IPv4_Tx|IFCAP_CSUM_IPv4_Rx|
IFCAP_CSUM_TCPv4_Tx|IFCAP_CSUM_TCPv4_Rx|
IFCAP_CSUM_UDPv4_Tx|IFCAP_CSUM_UDPv4_Rx|
IFCAP_CSUM_TCPv6_Tx|IFCAP_CSUM_TCPv6_Rx|
IFCAP_CSUM_UDPv6_Tx|IFCAP_CSUM_UDPv6_Rx);
IFCAP_CSUM_IPv4_Tx | IFCAP_CSUM_IPv4_Rx |
IFCAP_CSUM_TCPv4_Tx | IFCAP_CSUM_TCPv4_Rx |
IFCAP_CSUM_UDPv4_Tx | IFCAP_CSUM_UDPv4_Rx |
IFCAP_CSUM_TCPv6_Tx | IFCAP_CSUM_TCPv6_Rx |
IFCAP_CSUM_UDPv6_Tx | IFCAP_CSUM_UDPv6_Rx);
}
/*
@ -598,7 +594,7 @@ vlan_unconfig_locked(struct ifvlan *ifv, struct ifvlan_linkmib *nmib)
KASSERT(IFNET_LOCKED(ifp));
KASSERT(mutex_owned(&ifv->ifv_lock));
ifp->if_flags &= ~(IFF_UP|IFF_RUNNING);
ifp->if_flags &= ~(IFF_UP | IFF_RUNNING);
omib = ifv->ifv_mib;
p = omib->ifvm_p;
@ -613,7 +609,7 @@ vlan_unconfig_locked(struct ifvlan *ifv, struct ifvlan_linkmib *nmib)
psref_target_init(nmib_psref, ifvm_psref_class);
/*
* Since the interface is being unconfigured, we need to empty the
* Since the interface is being unconfigured, we need to empty the
* list of multicast groups that we may have joined while we were
* alive and remove them from the parent's list also.
*/
@ -860,8 +856,8 @@ vlan_ifdetach(struct ifnet *p)
/* XXX ifv_mib = NULL? */
if (ifv->ifv_mib->ifvm_p == p) {
KASSERTMSG(i < cnt, "no memory for unconfig, parent=%s",
p->if_xname);
KASSERTMSG(i < cnt,
"no memory for unconfig, parent=%s", p->if_xname);
error = vlan_unconfig_locked(ifv, nmibs[i]);
if (!error) {
nmibs[i] = NULL;
@ -1607,8 +1603,8 @@ vlan_input(struct ifnet *ifp, struct mbuf *m)
KASSERT(mib->ifvm_encaplen == ETHER_VLAN_ENCAP_LEN);
ifv = mib->ifvm_ifvlan;
if ((ifv->ifv_if.if_flags & (IFF_UP|IFF_RUNNING)) !=
(IFF_UP|IFF_RUNNING)) {
if ((ifv->ifv_if.if_flags & (IFF_UP | IFF_RUNNING)) !=
(IFF_UP | IFF_RUNNING)) {
m_freem(m);
ifp->if_noproto++;
goto out;