Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Centralize ETHER_ALIGN into net/if_ether.h. Note that th...



details:   https://anonhg.NetBSD.org/src/rev/0fa789621828
branches:  trunk
changeset: 449397:0fa789621828
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Mar 05 08:25:01 2019 +0000

description:
Centralize ETHER_ALIGN into net/if_ether.h. Note that this commit also changes
if_upgt.c's ETHER_ALIGN from 0 to 2.

diffstat:

 sys/arch/arm/omap/if_cpsw.c          |   6 ++----
 sys/arch/arm/sunxi/sunxi_emac.c      |   6 ++----
 sys/arch/arm/ti/if_cpsw.c            |   6 ++----
 sys/arch/arm/xscale/ixp425_if_npe.c  |   8 ++------
 sys/arch/i386/stand/efiboot/efinet.c |   6 +-----
 sys/arch/mips/sibyte/dev/sbmac.c     |   6 ++----
 sys/arch/x86/pci/if_vmxreg.h         |   4 +---
 sys/dev/hyperv/if_hvn.c              |   8 ++------
 sys/dev/pci/if_age.c                 |   5 ++---
 sys/dev/pci/if_alc.c                 |   3 +--
 sys/dev/pci/if_ale.c                 |   5 ++---
 sys/dev/pci/if_bgereg.h              |   4 +---
 sys/dev/pci/if_bnxreg.h              |   4 +---
 sys/dev/pci/if_casvar.h              |   4 +---
 sys/dev/pci/if_nfereg.h              |   4 +---
 sys/dev/pci/if_skreg.h               |   3 +--
 sys/dev/pci/if_tireg.h               |   4 +---
 sys/dev/pci/if_vge.c                 |   5 ++---
 sys/dev/pci/ixgbe/ixgbe_netbsd.h     |   4 +---
 sys/dev/pcmcia/if_malo_pcmcia.c      |   5 ++---
 sys/dev/usb/if_auereg.h              |   3 +--
 sys/dev/usb/if_axenreg.h             |   4 +---
 sys/dev/usb/if_axereg.h              |   4 +---
 sys/dev/usb/if_cuereg.h              |   3 +--
 sys/dev/usb/if_kuereg.h              |   3 +--
 sys/dev/usb/if_mue.c                 |   6 ++----
 sys/dev/usb/if_smsc.c                |   5 ++---
 sys/dev/usb/if_udavreg.h             |   4 +---
 sys/dev/usb/if_upgt.c                |   5 ++---
 sys/dev/usb/if_urlreg.h              |   4 +---
 sys/dev/usb/if_urndis.c              |   5 ++---
 sys/net/if_ether.h                   |  10 +++++++++-
 sys/stand/efiboot/efinet.c           |   6 +-----
 33 files changed, 55 insertions(+), 107 deletions(-)

diffs (truncated from 717 to 300 lines):

diff -r b5cefa4fb5ab -r 0fa789621828 sys/arch/arm/omap/if_cpsw.c
--- a/sys/arch/arm/omap/if_cpsw.c       Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/arch/arm/omap/if_cpsw.c       Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cpsw.c,v 1.22 2019/01/22 03:42:25 msaitoh Exp $     */
+/*     $NetBSD: if_cpsw.c,v 1.23 2019/03/05 08:25:01 msaitoh Exp $     */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.22 2019/01/22 03:42:25 msaitoh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.23 2019/03/05 08:25:01 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -78,8 +78,6 @@
 #include <arch/arm/omap/sitara_cmreg.h>
 #include <arch/arm/omap/sitara_cm.h>
 
-#define ETHER_ALIGN (roundup2(ETHER_HDR_LEN, sizeof(uint32_t)) - ETHER_HDR_LEN)
-
 #define CPSW_TXFRAGS   16
 
 #define CPSW_CPPI_RAM_SIZE (0x2000)
diff -r b5cefa4fb5ab -r 0fa789621828 sys/arch/arm/sunxi/sunxi_emac.c
--- a/sys/arch/arm/sunxi/sunxi_emac.c   Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/arch/arm/sunxi/sunxi_emac.c   Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_emac.c,v 1.22 2019/03/04 11:35:38 jmcneill Exp $ */
+/* $NetBSD: sunxi_emac.c,v 1.23 2019/03/05 08:25:02 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2016-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
 #include "opt_net_mpsafe.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.22 2019/03/04 11:35:38 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.23 2019/03/05 08:25:02 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -70,8 +70,6 @@
 
 #define        EMAC_IFNAME             "emac%d"
 
-#define        ETHER_ALIGN             2
-
 #define        EMAC_LOCK(sc)           mutex_enter(&(sc)->mtx)
 #define        EMAC_UNLOCK(sc)         mutex_exit(&(sc)->mtx)
 #define        EMAC_ASSERT_LOCKED(sc)  KASSERT(mutex_owned(&(sc)->mtx))
diff -r b5cefa4fb5ab -r 0fa789621828 sys/arch/arm/ti/if_cpsw.c
--- a/sys/arch/arm/ti/if_cpsw.c Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/arch/arm/ti/if_cpsw.c Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cpsw.c,v 1.3 2019/01/22 03:42:25 msaitoh Exp $      */
+/*     $NetBSD: if_cpsw.c,v 1.4 2019/03/05 08:25:02 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.3 2019/01/22 03:42:25 msaitoh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.4 2019/03/05 08:25:02 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -82,8 +82,6 @@
 #include <arch/arm/omap/sitara_cmreg.h>
 #include <arch/arm/omap/sitara_cm.h>
 
-#define ETHER_ALIGN (roundup2(ETHER_HDR_LEN, sizeof(uint32_t)) - ETHER_HDR_LEN)
-
 #define CPSW_TXFRAGS   16
 
 #define CPSW_CPPI_RAM_SIZE (0x2000)
diff -r b5cefa4fb5ab -r 0fa789621828 sys/arch/arm/xscale/ixp425_if_npe.c
--- a/sys/arch/arm/xscale/ixp425_if_npe.c       Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/arch/arm/xscale/ixp425_if_npe.c       Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ixp425_if_npe.c,v 1.36 2019/01/22 03:42:25 msaitoh Exp $ */
+/*     $NetBSD: ixp425_if_npe.c,v 1.37 2019/03/05 08:25:02 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2006 Sam Leffler.  All rights reserved.
@@ -28,7 +28,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.36 2019/01/22 03:42:25 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.37 2019/03/05 08:25:02 msaitoh Exp $");
 
 /*
  * Intel XScale NPE Ethernet driver.
@@ -235,10 +235,6 @@
 #define        NPE_TXBUF       128
 #define        NPE_RXBUF       64
 
-#ifndef ETHER_ALIGN
-#define        ETHER_ALIGN     2       /* XXX: Ditch this */
-#endif
-
 #define MAC2UINT64(addr)       (((uint64_t)addr[0] << 40)      \
                                    + ((uint64_t)addr[1] << 32) \
                                    + ((uint64_t)addr[2] << 24) \
diff -r b5cefa4fb5ab -r 0fa789621828 sys/arch/i386/stand/efiboot/efinet.c
--- a/sys/arch/i386/stand/efiboot/efinet.c      Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/arch/i386/stand/efiboot/efinet.c      Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: efinet.c,v 1.2 2018/09/03 16:29:25 riastradh Exp $     */
+/*     $NetBSD: efinet.c,v 1.3 2019/03/05 08:25:02 msaitoh Exp $       */
 
 /*-
  * Copyright (c) 2001 Doug Rabson
@@ -40,10 +40,6 @@
 #include <bootinfo.h>
 #include "devopen.h"
 
-#ifndef ETHER_ALIGN
-#define ETHER_ALIGN    2
-#endif
-
 #define ETHER_EXT_LEN  (ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_ALIGN)
 
 #if defined(DEBUG) || defined(ARP_DEBUG) || defined(BOOTP_DEBUG) || \
diff -r b5cefa4fb5ab -r 0fa789621828 sys/arch/mips/sibyte/dev/sbmac.c
--- a/sys/arch/mips/sibyte/dev/sbmac.c  Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/arch/mips/sibyte/dev/sbmac.c  Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbmac.c,v 1.54 2019/02/05 06:17:01 msaitoh Exp $ */
+/* $NetBSD: sbmac.c,v 1.55 2019/03/05 08:25:02 msaitoh Exp $ */
 
 /*
  * Copyright 2000, 2001, 2004
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.54 2019/02/05 06:17:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.55 2019/03/05 08:25:02 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_ns.h"
@@ -122,8 +122,6 @@
 #define        SBMAC_MAX_TXDESCR       256             /* should be 1024 */
 #define        SBMAC_MAX_RXDESCR       256             /* should be 512 */
 
-#define        ETHER_ALIGN     2
-
 /* DMA Descriptor structure */
 
 typedef struct sbdmadscr_s {
diff -r b5cefa4fb5ab -r 0fa789621828 sys/arch/x86/pci/if_vmxreg.h
--- a/sys/arch/x86/pci/if_vmxreg.h      Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/arch/x86/pci/if_vmxreg.h      Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vmxreg.h,v 1.2 2016/11/25 05:29:54 hikaru Exp $     */
+/*     $NetBSD: if_vmxreg.h,v 1.3 2019/03/05 08:25:02 msaitoh Exp $    */
 /*     $OpenBSD: if_vmxreg.h,v 1.3 2013/08/28 10:19:19 reyk Exp $      */
 
 /*
@@ -43,8 +43,6 @@
        uint64_t error;
 } __packed;
 
-#define ETHER_ALIGN 2
-
 /* interrupt moderation levels */
 #define UPT1_IMOD_NONE     0           /* no moderation */
 #define UPT1_IMOD_HIGHEST  7           /* least interrupts */
diff -r b5cefa4fb5ab -r 0fa789621828 sys/dev/hyperv/if_hvn.c
--- a/sys/dev/hyperv/if_hvn.c   Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/dev/hyperv/if_hvn.c   Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_hvn.c,v 1.1 2019/02/15 08:54:01 nonaka Exp $        */
+/*     $NetBSD: if_hvn.c,v 1.2 2019/03/05 08:25:02 msaitoh Exp $       */
 /*     $OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $       */
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.1 2019/02/15 08:54:01 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2 2019/03/05 08:25:02 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -68,10 +68,6 @@
 #define EVL_PRIO_BITS  13
 #endif
 
-#ifndef ETHER_ALIGN
-#define ETHER_ALIGN    2
-#endif
-
 #define HVN_NVS_MSGSIZE                        32
 #define HVN_NVS_BUFSIZE                        PAGE_SIZE
 
diff -r b5cefa4fb5ab -r 0fa789621828 sys/dev/pci/if_age.c
--- a/sys/dev/pci/if_age.c      Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/dev/pci/if_age.c      Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_age.c,v 1.55 2019/01/22 03:42:27 msaitoh Exp $ */
+/*     $NetBSD: if_age.c,v 1.56 2019/03/05 08:25:02 msaitoh Exp $ */
 /*     $OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $        */
 
 /*-
@@ -31,7 +31,7 @@
 /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.55 2019/01/22 03:42:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.56 2019/03/05 08:25:02 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -124,7 +124,6 @@
 int agedebug = 0;
 #define        DPRINTF(x)      do { if (agedebug) printf x; } while (0)
 
-#define ETHER_ALIGN 2
 #define AGE_CSUM_FEATURES      (M_CSUM_TCPv4 | M_CSUM_UDPv4)
 
 static int
diff -r b5cefa4fb5ab -r 0fa789621828 sys/dev/pci/if_alc.c
--- a/sys/dev/pci/if_alc.c      Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/dev/pci/if_alc.c      Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_alc.c,v 1.30 2019/01/22 03:42:27 msaitoh Exp $      */
+/*     $NetBSD: if_alc.c,v 1.31 2019/03/05 08:25:02 msaitoh Exp $      */
 /*     $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $        */
 /*-
  * Copyright (c) 2009, Pyun YongHyeon <yongari%FreeBSD.org@localhost>
@@ -175,7 +175,6 @@
 int alcdebug = 0;
 #define        DPRINTF(x)      do { if (alcdebug) printf x; } while (0)
 
-#define ETHER_ALIGN            2
 #define ALC_CSUM_FEATURES      (M_CSUM_TCPv4 | M_CSUM_UDPv4)
 
 static int
diff -r b5cefa4fb5ab -r 0fa789621828 sys/dev/pci/if_ale.c
--- a/sys/dev/pci/if_ale.c      Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/dev/pci/if_ale.c      Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ale.c,v 1.27 2019/01/22 03:42:27 msaitoh Exp $      */
+/*     $NetBSD: if_ale.c,v 1.28 2019/03/05 08:25:02 msaitoh Exp $      */
 
 /*-
  * Copyright (c) 2008, Pyun YongHyeon <yongari%FreeBSD.org@localhost>
@@ -32,7 +32,7 @@
 /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.27 2019/01/22 03:42:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.28 2019/03/05 08:25:02 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -124,7 +124,6 @@
 int aledebug = 0;
 #define DPRINTF(x)     do { if (aledebug) printf x; } while (0)
 
-#define ETHER_ALIGN 2
 #define ALE_CSUM_FEATURES      (M_CSUM_TCPv4 | M_CSUM_UDPv4)
 
 static int
diff -r b5cefa4fb5ab -r 0fa789621828 sys/dev/pci/if_bgereg.h
--- a/sys/dev/pci/if_bgereg.h   Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/dev/pci/if_bgereg.h   Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bgereg.h,v 1.95 2019/02/20 17:00:20 msaitoh Exp $   */
+/*     $NetBSD: if_bgereg.h,v 1.96 2019/03/05 08:25:02 msaitoh Exp $   */
 /*
  * Copyright (c) 2001 Wind River Systems
  * Copyright (c) 1997, 1998, 1999, 2001
@@ -2629,8 +2629,6 @@
  * boundary.
  */
 
-#define ETHER_ALIGN 2
-
 #define BGE_FRAMELEN           ETHER_MAX_LEN
 #define BGE_MAX_FRAMELEN       1536
 #define BGE_JUMBO_FRAMELEN     ETHER_MAX_LEN_JUMBO
diff -r b5cefa4fb5ab -r 0fa789621828 sys/dev/pci/if_bnxreg.h
--- a/sys/dev/pci/if_bnxreg.h   Tue Mar 05 08:17:44 2019 +0000
+++ b/sys/dev/pci/if_bnxreg.h   Tue Mar 05 08:25:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bnxreg.h,v 1.19 2018/06/03 10:01:22 maxv Exp $      */
+/*     $NetBSD: if_bnxreg.h,v 1.20 2019/03/05 08:25:02 msaitoh Exp $   */
 /*     $OpenBSD: if_bnxreg.h,v 1.33 2009/09/05 16:02:28 claudio Exp $  */
 
 /*-



Home | Main Index | Thread Index | Old Index