Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci move SK_HASH_BITS to if_skreg.h and reuse in if_...
details: https://anonhg.NetBSD.org/src/rev/908921d33cac
branches: trunk
changeset: 319820:908921d33cac
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Tue Jun 12 21:36:34 2018 +0000
description:
move SK_HASH_BITS to if_skreg.h and reuse in if_msk.c (from OpenBSD)
diffstat:
sys/dev/pci/if_msk.c | 8 +++-----
sys/dev/pci/if_sk.c | 6 ++----
sys/dev/pci/if_skreg.h | 4 +++-
3 files changed, 8 insertions(+), 10 deletions(-)
diffs (79 lines):
diff -r 895255b03c2f -r 908921d33cac sys/dev/pci/if_msk.c
--- a/sys/dev/pci/if_msk.c Tue Jun 12 21:35:17 2018 +0000
+++ b/sys/dev/pci/if_msk.c Tue Jun 12 21:36:34 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.60 2018/06/12 20:27:54 jdolecek Exp $ */
+/* $NetBSD: if_msk.c,v 1.61 2018/06/12 21:36:34 jdolecek Exp $ */
/* $OpenBSD: if_msk.c,v 1.42 2007/01/17 02:43:02 krw Exp $ */
/*
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.60 2018/06/12 20:27:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.61 2018/06/12 21:36:34 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -329,8 +329,6 @@
SK_YU_READ_2(sc_if, YUKON_GPCR)));
}
-#define HASH_BITS 6
-
void
msk_setfilt(struct sk_if_softc *sc_if, void *addrv, int slot)
{
@@ -381,7 +379,7 @@
goto allmulti;
}
h = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN) &
- ((1 << HASH_BITS) - 1);
+ ((1 << SK_HASH_BITS) - 1);
if (h < 32)
hashes[0] |= (1 << h);
else
diff -r 895255b03c2f -r 908921d33cac sys/dev/pci/if_sk.c
--- a/sys/dev/pci/if_sk.c Tue Jun 12 21:35:17 2018 +0000
+++ b/sys/dev/pci/if_sk.c Tue Jun 12 21:36:34 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_sk.c,v 1.85 2016/12/15 09:28:05 ozaki-r Exp $ */
+/* $NetBSD: if_sk.c,v 1.86 2018/06/12 21:36:34 jdolecek Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -115,7 +115,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.85 2016/12/15 09:28:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.86 2018/06/12 21:36:34 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -552,8 +552,6 @@
YUKON_GPCR)));
}
-#define SK_HASH_BITS 6
-
u_int32_t
sk_xmac_hash(void *addr)
{
diff -r 895255b03c2f -r 908921d33cac sys/dev/pci/if_skreg.h
--- a/sys/dev/pci/if_skreg.h Tue Jun 12 21:35:17 2018 +0000
+++ b/sys/dev/pci/if_skreg.h Tue Jun 12 21:36:34 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_skreg.h,v 1.17 2018/06/12 20:27:54 jdolecek Exp $ */
+/* $NetBSD: if_skreg.h,v 1.18 2018/06/12 21:36:34 jdolecek Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -2345,4 +2345,6 @@
#define XM_RESAB_FDMODESEL 0x0020
#define XM_RESAB_HDMODESEL 0x0040
#define XM_RESAB_PAUSEBITS 0x0180
+
+#define SK_HASH_BITS 6
#endif /* _DEV_PCI_IF_SKREG_H_ */
Home |
Main Index |
Thread Index |
Old Index