Module Name: src
Committed By: msaitoh
Date: Wed Nov 22 03:45:16 UTC 2017
Modified Files:
src/sys/net: if_ether.h if_vlan.c if_vlanvar.h
Log Message:
No functional change:
- u_int16_t -> uint16_t
- u_short -> uint16_t
- tag_hash_func -> vlan_tag_hash
- 0 -> NULL because vlr_parent is a pointer.
To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/net/if_ether.h
cvs rdiff -u -r1.109 -r1.110 src/sys/net/if_vlan.c
cvs rdiff -u -r1.11 -r1.12 src/sys/net/if_vlanvar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if_ether.h
diff -u src/sys/net/if_ether.h:1.69 src/sys/net/if_ether.h:1.70
--- src/sys/net/if_ether.h:1.69 Wed Nov 22 02:35:24 2017
+++ src/sys/net/if_ether.h Wed Nov 22 03:45:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ether.h,v 1.69 2017/11/22 02:35:24 msaitoh Exp $ */
+/* $NetBSD: if_ether.h,v 1.70 2017/11/22 03:45:15 msaitoh Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -299,7 +299,7 @@ struct ether_multistep {
/* add VLAN tag to input/received packet */
static inline void
-vlan_set_tag(struct mbuf *m, u_int16_t vlantag)
+vlan_set_tag(struct mbuf *m, uint16_t vlantag)
{
/* VLAN tag contains priority, CFI and VLAN ID */
Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.109 src/sys/net/if_vlan.c:1.110
--- src/sys/net/if_vlan.c:1.109 Wed Nov 22 03:03:18 2017
+++ src/sys/net/if_vlan.c Wed Nov 22 03:45:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vlan.c,v 1.109 2017/11/22 03:03:18 ozaki-r Exp $ */
+/* $NetBSD: if_vlan.c,v 1.110 2017/11/22 03:45:15 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.109 2017/11/22 03:03:18 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.110 2017/11/22 03:45:15 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -207,6 +207,7 @@ static int vlan_unconfig_locked(struct i
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 *,
@@ -215,7 +216,6 @@ static void vlan_linkmib_update(struct i
struct ifvlan_linkmib *);
static struct ifvlan_linkmib* vlan_lookup_tag_psref(struct ifnet *,
uint16_t, struct psref *);
-static int tag_hash_func(uint16_t, u_long);
LIST_HEAD(vlan_ifvlist, ifvlan);
static struct {
@@ -508,7 +508,7 @@ vlan_config(struct ifvlan *ifv, struct i
ifv->ifv_if.if_type = p->if_type;
PSLIST_ENTRY_INIT(ifv, ifv_hash);
- idx = tag_hash_func(vid, ifv_hash.mask);
+ idx = vlan_tag_hash(vid, ifv_hash.mask);
mutex_enter(&ifv_hash.lock);
PSLIST_WRITER_INSERT_HEAD(&ifv_hash.lists[idx], ifv, ifv_hash);
@@ -680,7 +680,7 @@ vlan_hash_fini(void)
}
static int
-tag_hash_func(uint16_t tag, u_long mask)
+vlan_tag_hash(uint16_t tag, u_long mask)
{
uint32_t hash;
@@ -724,7 +724,7 @@ vlan_lookup_tag_psref(struct ifnet *ifp,
int s;
struct ifvlan *sc;
- idx = tag_hash_func(tag, ifv_hash.mask);
+ idx = vlan_tag_hash(tag, ifv_hash.mask);
s = pserialize_read_enter();
PSLIST_READER_FOREACH(sc, &ifv_hash.lists[idx], struct ifvlan,
@@ -941,7 +941,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd
error = EINVAL; /* check for valid tag */
break;
}
- if ((pr = ifunit(vlr.vlr_parent)) == 0) {
+ if ((pr = ifunit(vlr.vlr_parent)) == NULL) {
error = ENOENT;
break;
}
Index: src/sys/net/if_vlanvar.h
diff -u src/sys/net/if_vlanvar.h:1.11 src/sys/net/if_vlanvar.h:1.12
--- src/sys/net/if_vlanvar.h:1.11 Wed Nov 22 02:35:24 2017
+++ src/sys/net/if_vlanvar.h Wed Nov 22 03:45:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vlanvar.h,v 1.11 2017/11/22 02:35:24 msaitoh Exp $ */
+/* $NetBSD: if_vlanvar.h,v 1.12 2017/11/22 03:45:15 msaitoh Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -73,8 +73,8 @@ struct ether_vlan_header {
/* Configuration structure for SIOCSETVLAN and SIOCGETVLAN ioctls. */
struct vlanreq {
- char vlr_parent[IFNAMSIZ];
- u_short vlr_tag;
+ char vlr_parent[IFNAMSIZ];
+ uint16_t vlr_tag;
};
#define SIOCSETVLAN SIOCSIFGENERIC