summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2004-05-19 11:37:01 +0000
committerBrad Smith <brad@cvs.openbsd.org>2004-05-19 11:37:01 +0000
commit4cc8db214e7d0cd1ee251b2911f21020c7deda58 (patch)
treee805d3bfa9992c89de8c30d5145beb920725655e
parent757b5ac062ae44ec2edff9c36a5d01de68d93813 (diff)
remove duplication, use ETHER_ALIGN from if_ether.h
-rw-r--r--sys/dev/ic/dcreg.h3
-rw-r--r--sys/dev/ic/rtl81x9.c14
-rw-r--r--sys/dev/ic/rtl81x9reg.h4
-rw-r--r--sys/dev/pci/if_bgereg.h4
-rw-r--r--sys/dev/pci/if_em.h3
-rw-r--r--sys/dev/pci/if_lgereg.h3
-rw-r--r--sys/dev/pci/if_ngereg.h3
-rw-r--r--sys/dev/pci/if_sfreg.h4
-rw-r--r--sys/dev/pci/if_sisreg.h3
-rw-r--r--sys/dev/pci/if_skreg.h3
-rw-r--r--sys/dev/pci/if_stereg.h3
-rw-r--r--sys/dev/pci/if_tireg.h4
-rw-r--r--sys/dev/pci/if_vrreg.h3
-rw-r--r--sys/dev/pci/if_wbreg.h6
-rw-r--r--sys/dev/usb/if_auereg.h3
-rw-r--r--sys/dev/usb/if_axereg.h1
-rw-r--r--sys/dev/usb/if_cuereg.h3
-rw-r--r--sys/dev/usb/if_kuereg.h3
-rw-r--r--sys/dev/usb/if_urlreg.h5
19 files changed, 24 insertions, 51 deletions
diff --git a/sys/dev/ic/dcreg.h b/sys/dev/ic/dcreg.h
index 63d0e7584fb..463131cc26a 100644
--- a/sys/dev/ic/dcreg.h
+++ b/sys/dev/ic/dcreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dcreg.h,v 1.33 2003/10/21 18:58:49 jmc Exp $ */
+/* $OpenBSD: dcreg.h,v 1.34 2004/05/19 11:36:59 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -768,7 +768,6 @@ struct dc_softc {
bus_space_read_4(sc->dc_btag, sc->dc_bhandle, reg)
#define DC_TIMEOUT 1000
-#define ETHER_ALIGN 2
/*
* General constants that are fun to know.
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c
index 51e330f4d9d..dcd99aeca5c 100644
--- a/sys/dev/ic/rtl81x9.c
+++ b/sys/dev/ic/rtl81x9.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9.c,v 1.24 2004/05/07 01:42:48 tedu Exp $ */
+/* $OpenBSD: rtl81x9.c,v 1.25 2004/05/19 11:36:59 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -686,12 +686,12 @@ rl_rxeof(sc)
wrap = (sc->rl_cdata.rl_rx_buf + RL_RXBUFLEN) - rxbufpos;
if (total_len > wrap) {
- m = m_devget(rxbufpos - RL_ETHER_ALIGN,
- wrap + RL_ETHER_ALIGN, 0, ifp, NULL);
+ m = m_devget(rxbufpos - ETHER_ALIGN,
+ wrap + ETHER_ALIGN, 0, ifp, NULL);
if (m == NULL)
ifp->if_ierrors++;
else {
- m_adj(m, RL_ETHER_ALIGN);
+ m_adj(m, ETHER_ALIGN);
m_copyback(m, wrap, total_len - wrap,
sc->rl_cdata.rl_rx_buf);
m = m_pullup(m, sizeof(struct ether_header));
@@ -700,12 +700,12 @@ rl_rxeof(sc)
}
cur_rx = (total_len - wrap + ETHER_CRC_LEN);
} else {
- m = m_devget(rxbufpos - RL_ETHER_ALIGN,
- total_len + RL_ETHER_ALIGN, 0, ifp, NULL);
+ m = m_devget(rxbufpos - ETHER_ALIGN,
+ total_len + ETHER_ALIGN, 0, ifp, NULL);
if (m == NULL)
ifp->if_ierrors++;
else
- m_adj(m, RL_ETHER_ALIGN);
+ m_adj(m, ETHER_ALIGN);
cur_rx += total_len + 4 + ETHER_CRC_LEN;
}
diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h
index dbc1c2abd9f..587db89b156 100644
--- a/sys/dev/ic/rtl81x9reg.h
+++ b/sys/dev/ic/rtl81x9reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9reg.h,v 1.9 2004/04/07 15:47:52 mickey Exp $ */
+/* $OpenBSD: rtl81x9reg.h,v 1.10 2004/05/19 11:36:59 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -314,8 +314,6 @@
#define RL_RXCFG_CONFIG (RL_RX_FIFOTHRESH|RL_RX_MAXDMA|RL_RX_BUF_SZ)
#define RL_TXCFG_CONFIG (RL_TXCFG_IFG|RL_TX_MAXDMA)
-#define RL_ETHER_ALIGN 2
-
struct rl_chain_data {
u_int16_t cur_rx;
caddr_t rl_rx_buf;
diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h
index acb5d5a926b..8344c640d27 100644
--- a/sys/dev/pci/if_bgereg.h
+++ b/sys/dev/pci/if_bgereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bgereg.h,v 1.8 2004/03/19 21:57:36 miod Exp $ */
+/* $OpenBSD: if_bgereg.h,v 1.9 2004/05/19 11:36:59 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2001
@@ -2036,8 +2036,6 @@ struct bge_gib {
* boundary.
*/
-#define ETHER_ALIGN 2
-
#define BGE_FRAMELEN 1518
#define BGE_MAX_FRAMELEN 1536
#define BGE_JUMBO_FRAMELEN 9018
diff --git a/sys/dev/pci/if_em.h b/sys/dev/pci/if_em.h
index 1009d48fd42..2ca50df8bc9 100644
--- a/sys/dev/pci/if_em.h
+++ b/sys/dev/pci/if_em.h
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
/*$FreeBSD: if_em.h,v 1.24 2003/11/14 18:02:24 pdeuskar Exp $*/
-/* $OpenBSD: if_em.h,v 1.5 2004/04/26 17:17:15 deraadt Exp $ */
+/* $OpenBSD: if_em.h,v 1.6 2004/05/19 11:37:00 brad Exp $ */
#ifndef _EM_H_DEFINED_
#define _EM_H_DEFINED_
@@ -195,7 +195,6 @@ POSSIBILITY OF SUCH DAMAGE.
#define MAX_NUM_MULTICAST_ADDRESSES 128
#define PCI_ANY_ID (~0U)
-#define ETHER_ALIGN 2
/* Defines for printing debug information */
#define DEBUG_INIT 0
diff --git a/sys/dev/pci/if_lgereg.h b/sys/dev/pci/if_lgereg.h
index 26b46623294..0d1643dc701 100644
--- a/sys/dev/pci/if_lgereg.h
+++ b/sys/dev/pci/if_lgereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_lgereg.h,v 1.1 2001/09/04 20:36:38 nate Exp $ */
+/* $OpenBSD: if_lgereg.h,v 1.2 2004/05/19 11:37:00 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
@@ -553,7 +553,6 @@ struct lge_softc {
bus_space_read_1(sc->lge_btag, sc->lge_bhandle, reg)
#define LGE_TIMEOUT 1000
-#define ETHER_ALIGN 2
#define LGE_RXLEN 1536
#define LGE_MIN_FRAMELEN 60
diff --git a/sys/dev/pci/if_ngereg.h b/sys/dev/pci/if_ngereg.h
index 9a537de1978..b39b7170eae 100644
--- a/sys/dev/pci/if_ngereg.h
+++ b/sys/dev/pci/if_ngereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ngereg.h,v 1.3 2002/09/21 15:29:46 nate Exp $ */
+/* $OpenBSD: if_ngereg.h,v 1.4 2004/05/19 11:37:00 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
@@ -678,7 +678,6 @@ struct nge_softc {
bus_space_read_4(sc->nge_btag, sc->nge_bhandle, reg)
#define NGE_TIMEOUT 1000
-#define ETHER_ALIGN 2
#define NGE_RXLEN 1536
#define NGE_MIN_FRAMELEN 60
diff --git a/sys/dev/pci/if_sfreg.h b/sys/dev/pci/if_sfreg.h
index 3249d2bfac7..75df0d267b9 100644
--- a/sys/dev/pci/if_sfreg.h
+++ b/sys/dev/pci/if_sfreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sfreg.h,v 1.6 2003/06/29 17:19:17 avsm Exp $ */
+/* $OpenBSD: if_sfreg.h,v 1.7 2004/05/19 11:37:00 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -998,8 +998,6 @@ struct sf_type {
#define SF_INC(x, y) (x) = (x + 1) % y
-#define ETHER_ALIGN 2
-
/*
* Note: alignment is important here: each list must be aligned to
* a 256-byte boundary. It turns out that each ring is some multiple
diff --git a/sys/dev/pci/if_sisreg.h b/sys/dev/pci/if_sisreg.h
index a7cc43a71e9..bd419b5256a 100644
--- a/sys/dev/pci/if_sisreg.h
+++ b/sys/dev/pci/if_sisreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sisreg.h,v 1.16 2004/04/26 05:16:41 deraadt Exp $ */
+/* $OpenBSD: if_sisreg.h,v 1.17 2004/05/19 11:37:00 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@@ -448,7 +448,6 @@ struct sis_softc {
bus_space_read_4(sc->sis_btag, sc->sis_bhandle, reg)
#define SIS_TIMEOUT 1000
-#define ETHER_ALIGN 2
#define SIS_RXLEN 1536
#define SIS_MIN_FRAMELEN 60
diff --git a/sys/dev/pci/if_skreg.h b/sys/dev/pci/if_skreg.h
index 33967d2f40f..b4ed8f78f46 100644
--- a/sys/dev/pci/if_skreg.h
+++ b/sys/dev/pci/if_skreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_skreg.h,v 1.10 2003/08/12 05:23:06 nate Exp $ */
+/* $OpenBSD: if_skreg.h,v 1.11 2004/05/19 11:37:00 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -1447,4 +1447,3 @@ struct skc_attach_args {
#define SK_MAXUNIT 256
#define SK_TIMEOUT 1000
-#define ETHER_ALIGN 2
diff --git a/sys/dev/pci/if_stereg.h b/sys/dev/pci/if_stereg.h
index 7539cee110e..82ff0e98cd1 100644
--- a/sys/dev/pci/if_stereg.h
+++ b/sys/dev/pci/if_stereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_stereg.h,v 1.5 2003/06/29 17:20:03 avsm Exp $ */
+/* $OpenBSD: if_stereg.h,v 1.6 2004/05/19 11:37:00 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -458,7 +458,6 @@ struct ste_desc_onefrag {
#define STE_TIMEOUT 1000
#define STE_MIN_FRAMELEN 60
#define STE_PACKET_SIZE 1536
-#define ETHER_ALIGN 2
#define STE_RX_LIST_CNT 128
#define STE_TX_LIST_CNT 256
#define STE_INC(x, y) (x) = (x + 1) % y
diff --git a/sys/dev/pci/if_tireg.h b/sys/dev/pci/if_tireg.h
index a393a1d7713..9c9813a53b8 100644
--- a/sys/dev/pci/if_tireg.h
+++ b/sys/dev/pci/if_tireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tireg.h,v 1.13 2003/02/26 19:02:50 nate Exp $ */
+/* $OpenBSD: if_tireg.h,v 1.14 2004/05/19 11:37:00 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -768,8 +768,6 @@ struct ti_tx_desc {
* boundary.
*/
-#define ETHER_ALIGN 2
-
#define TI_FRAMELEN 1518
#define TI_JUMBO_FRAMELEN 9018
#define TI_JUMBO_MTU (TI_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
diff --git a/sys/dev/pci/if_vrreg.h b/sys/dev/pci/if_vrreg.h
index 32681dc204d..f6e27bf80f1 100644
--- a/sys/dev/pci/if_vrreg.h
+++ b/sys/dev/pci/if_vrreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vrreg.h,v 1.11 2003/10/12 02:53:59 jason Exp $ */
+/* $OpenBSD: if_vrreg.h,v 1.12 2004/05/19 11:37:00 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -495,7 +495,6 @@ struct vr_softc {
bus_space_read_1(sc->vr_btag, sc->vr_bhandle, reg)
#define VR_TIMEOUT 1000
-#define ETHER_ALIGN 2
/*
* General constants that are fun to know.
diff --git a/sys/dev/pci/if_wbreg.h b/sys/dev/pci/if_wbreg.h
index d0ce208078a..6bd85dc4b65 100644
--- a/sys/dev/pci/if_wbreg.h
+++ b/sys/dev/pci/if_wbreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wbreg.h,v 1.6 2001/06/23 22:03:13 fgsch Exp $ */
+/* $OpenBSD: if_wbreg.h,v 1.7 2004/05/19 11:37:00 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -457,10 +457,6 @@ struct wb_softc {
#define WB_PME_EN 0x0010
#define WB_PME_STATUS 0x8000
-#ifndef ETHER_ALIGN
-#define ETHER_ALIGN 2
-#endif
-
#ifdef __alpha__
#undef vtophys
#define vtophys(va) alpha_XXX_dmamap((vm_offset_t)va)
diff --git a/sys/dev/usb/if_auereg.h b/sys/dev/usb/if_auereg.h
index fa99c008107..9b5da5e2e39 100644
--- a/sys/dev/usb/if_auereg.h
+++ b/sys/dev/usb/if_auereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_auereg.h,v 1.6 2002/04/01 21:47:07 nate Exp $ */
+/* $OpenBSD: if_auereg.h,v 1.7 2004/05/19 11:37:00 brad Exp $ */
/* $NetBSD: if_auereg.h,v 1.16 2001/10/10 02:14:17 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -279,7 +279,6 @@ struct aue_softc {
};
#define AUE_TIMEOUT 1000
-#define ETHER_ALIGN 2
#define AUE_BUFSZ 1536
#define AUE_MIN_FRAMELEN 60
#define AUE_TX_TIMEOUT 10000 /* ms */
diff --git a/sys/dev/usb/if_axereg.h b/sys/dev/usb/if_axereg.h
index f8ec0188cf8..cd406d3fe19 100644
--- a/sys/dev/usb/if_axereg.h
+++ b/sys/dev/usb/if_axereg.h
@@ -107,7 +107,6 @@
#define AXE_CONFIG_NO 1
#define AXE_IFACE_IDX 0
-#define ETHER_ALIGN 2
/*
* The interrupt endpoint is currently unused
* by the ASIX part.
diff --git a/sys/dev/usb/if_cuereg.h b/sys/dev/usb/if_cuereg.h
index 997d3101fe5..a8ec8c8872e 100644
--- a/sys/dev/usb/if_cuereg.h
+++ b/sys/dev/usb/if_cuereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cuereg.h,v 1.5 2001/10/31 04:24:44 nate Exp $ */
+/* $OpenBSD: if_cuereg.h,v 1.6 2004/05/19 11:37:00 brad Exp $ */
/* $NetBSD: if_cuereg.h,v 1.14 2001/01/21 22:09:24 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -118,7 +118,6 @@
#define CUE_MCAST_TABLE_LEN 64
#define CUE_TIMEOUT 1000
-#define ETHER_ALIGN 2
#define CUE_BUFSZ 1536
#define CUE_MIN_FRAMELEN 60
#define CUE_RX_FRAMES 1
diff --git a/sys/dev/usb/if_kuereg.h b/sys/dev/usb/if_kuereg.h
index eb3cf15b913..8c4bf56739e 100644
--- a/sys/dev/usb/if_kuereg.h
+++ b/sys/dev/usb/if_kuereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_kuereg.h,v 1.4 2001/10/31 04:24:44 nate Exp $ */
+/* $OpenBSD: if_kuereg.h,v 1.5 2004/05/19 11:37:00 brad Exp $ */
/* $NetBSD: if_kuereg.h,v 1.11 2001/01/21 02:35:31 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -115,7 +115,6 @@ struct kue_ether_desc {
#define KUE_RXFILT_MULTICAST 0x0010
#define KUE_TIMEOUT 1000
-#define ETHER_ALIGN 2
#define KUE_BUFSZ 1536
#define KUE_MIN_FRAMELEN 60
diff --git a/sys/dev/usb/if_urlreg.h b/sys/dev/usb/if_urlreg.h
index 2457b452171..fea304be34e 100644
--- a/sys/dev/usb/if_urlreg.h
+++ b/sys/dev/usb/if_urlreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urlreg.h,v 1.4 2002/07/29 02:59:05 nate Exp $ */
+/* $OpenBSD: if_urlreg.h,v 1.5 2004/05/19 11:37:00 brad Exp $ */
/* $NetBSD: if_urlreg.h,v 1.1 2002/03/28 21:09:11 ichiro Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -42,9 +42,6 @@
#define URL_TX_TIMEOUT 1000
#define URL_TIMEOUT 10000
-#define ETHER_ALIGN 2
-
-
/* Packet length */
#define URL_MAX_MTU 1536
#define URL_MIN_FRAME_LEN 60