diff options
author | 2004-08-05 19:57:16 +0000 | |
---|---|---|
committer | 2004-08-05 19:57:16 +0000 | |
commit | e14fcbbf7c6f1f54243283366a277bcc6fa09945 (patch) | |
tree | a70ae49ff6ca24bcf6f35bcd4b488821fc015c17 | |
parent | Get rid of some statistics stuff that is no longer needed but helped in the (diff) | |
download | wireguard-openbsd-e14fcbbf7c6f1f54243283366a277bcc6fa09945.tar.xz wireguard-openbsd-e14fcbbf7c6f1f54243283366a277bcc6fa09945.zip |
remove some separate per driver constants and use
ETHER_MAX_LEN_JUMBO/ETHERMTU_JUMBO where appropriate.
ok mcbride@ henning@ mickey@
-rw-r--r-- | sys/dev/ic/rtl81x9reg.h | 5 | ||||
-rw-r--r-- | sys/dev/pci/if_bge.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/if_bgereg.h | 7 | ||||
-rw-r--r-- | sys/dev/pci/if_lge.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_lgereg.h | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_nge.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_ngereg.h | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_sk.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_skreg.h | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_ti.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/if_tireg.h | 7 |
11 files changed, 29 insertions, 44 deletions
diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h index f67ba936697..fd5fc3d9c52 100644 --- a/sys/dev/ic/rtl81x9reg.h +++ b/sys/dev/ic/rtl81x9reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9reg.h,v 1.12 2004/06/05 07:39:54 pvalchev Exp $ */ +/* $OpenBSD: rtl81x9reg.h,v 1.13 2004/08/05 19:57:16 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -574,9 +574,6 @@ struct rl_stats { #define RL_ADDR_LO(y) ((u_int64_t) (y) & 0xFFFFFFFF) #define RL_ADDR_HI(y) ((u_int64_t) (y) >> 32) -#define RL_JUMBO_FRAMELEN 9018 -#define RL_JUMBO_MTU (RL_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) - #define MAX_NUM_MULTICAST_ADDRESSES 128 #define RL_INC(x) (x = (x + 1) % RL_TX_LIST_CNT) diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index ce1e83b99f9..4ba9e36770b 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.27 2004/05/29 23:07:48 naddy Exp $ */ +/* $OpenBSD: if_bge.c,v 1.28 2004/08/05 19:57:17 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2001 @@ -767,12 +767,12 @@ bge_newbuf_jumbo(sc, i, m) } /* Attach the buffer to the mbuf. */ - m_new->m_len = m_new->m_pkthdr.len = BGE_JUMBO_FRAMELEN; - MEXTADD(m_new, buf, BGE_JUMBO_FRAMELEN, 0, bge_jfree, sc); + m_new->m_len = m_new->m_pkthdr.len = ETHER_MAX_LEN_JUMBO; + MEXTADD(m_new, buf, ETHER_MAX_LEN_JUMBO, 0, bge_jfree, sc); } else { m_new = m; m_new->m_data = m_new->m_ext.ext_buf; - m_new->m_ext.ext_size = BGE_JUMBO_FRAMELEN; + m_new->m_ext.ext_size = ETHER_MAX_LEN_JUMBO; } if (!sc->bge_rx_alignment_bug) @@ -2673,7 +2673,7 @@ bge_ioctl(ifp, command, data) case SIOCSIFMTU: /* Disallow jumbo frames on 5705. */ if ((sc->bge_asicrev == BGE_ASICREV_BCM5705 && - ifr->ifr_mtu > ETHERMTU) || ifr->ifr_mtu > BGE_JUMBO_MTU) + ifr->ifr_mtu > ETHERMTU) || ifr->ifr_mtu > ETHERMTU_JUMBO) error = EINVAL; else ifp->if_mtu = ifr->ifr_mtu; diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h index 8344c640d27..6d5eee9df52 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.9 2004/05/19 11:36:59 brad Exp $ */ +/* $OpenBSD: if_bgereg.h,v 1.10 2004/08/05 19:57:17 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2001 @@ -2036,10 +2036,7 @@ struct bge_gib { * boundary. */ -#define BGE_FRAMELEN 1518 #define BGE_MAX_FRAMELEN 1536 -#define BGE_JUMBO_FRAMELEN 9018 -#define BGE_JUMBO_MTU (BGE_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) #define BGE_PAGE_SIZE PAGE_SIZE #define BGE_MIN_FRAMELEN 60 @@ -2102,7 +2099,7 @@ struct vpd_key { #define BGE_MSLOTS 256 #define BGE_JSLOTS 384 -#define BGE_JRAWLEN (BGE_JUMBO_FRAMELEN + ETHER_ALIGN) +#define BGE_JRAWLEN (ETHER_MAX_LEN_JUMBO + ETHER_ALIGN) #define BGE_JLEN (BGE_JRAWLEN + (sizeof(u_int64_t) - \ (BGE_JRAWLEN % sizeof(u_int64_t)))) #define BGE_JPAGESZ PAGE_SIZE diff --git a/sys/dev/pci/if_lge.c b/sys/dev/pci/if_lge.c index fba9b562c4b..a5b0a297174 100644 --- a/sys/dev/pci/if_lge.c +++ b/sys/dev/pci/if_lge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lge.c,v 1.15 2004/06/05 20:24:30 mcbride Exp $ */ +/* $OpenBSD: if_lge.c,v 1.16 2004/08/05 19:57:17 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -759,7 +759,7 @@ int lge_newbuf(sc, c, m) MCLINITREFERENCE(m_new); } else { m_new = m; - m_new->m_len = m_new->m_pkthdr.len = LGE_JUMBO_FRAMELEN; + m_new->m_len = m_new->m_pkthdr.len = ETHER_MAX_LEN_JUMBO; m_new->m_data = m_new->m_ext.ext_buf; } @@ -1493,7 +1493,7 @@ int lge_ioctl(ifp, command, data) } break; case SIOCSIFMTU: - if (ifr->ifr_mtu > LGE_JUMBO_MTU) + if (ifr->ifr_mtu > ETHERMTU_JUMBO) error = EINVAL; else ifp->if_mtu = ifr->ifr_mtu; diff --git a/sys/dev/pci/if_lgereg.h b/sys/dev/pci/if_lgereg.h index 0d1643dc701..719cfa18c76 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.2 2004/05/19 11:37:00 brad Exp $ */ +/* $OpenBSD: if_lgereg.h,v 1.3 2004/08/05 19:57:17 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -486,11 +486,9 @@ struct lge_mii_frame { #define LGE_MII_WRITEOP 0x01 #define LGE_MII_TURNAROUND 0x02 -#define LGE_JUMBO_FRAMELEN 9018 -#define LGE_JUMBO_MTU (LGE_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) #define LGE_JSLOTS 384 -#define LGE_JRAWLEN (LGE_JUMBO_FRAMELEN + ETHER_ALIGN) +#define LGE_JRAWLEN (ETHER_MAX_LEN_JUMBO + ETHER_ALIGN) #define LGE_JLEN (LGE_JRAWLEN + (sizeof(u_int64_t) - \ (LGE_JRAWLEN % sizeof(u_int64_t)))) #define LGE_JPAGESZ PAGE_SIZE diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c index abbc79ec123..8a4c19afbe8 100644 --- a/sys/dev/pci/if_nge.c +++ b/sys/dev/pci/if_nge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nge.c,v 1.28 2004/05/30 01:51:51 mcbride Exp $ */ +/* $OpenBSD: if_nge.c,v 1.29 2004/08/05 19:57:17 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -2118,7 +2118,7 @@ nge_ioctl(ifp, command, data) switch(command) { case SIOCSIFMTU: - if (ifr->ifr_mtu > NGE_JUMBO_MTU || ifr->ifr_mtu < ETHERMIN) + if (ifr->ifr_mtu > ETHERMTU_JUMBO || ifr->ifr_mtu < ETHERMIN) error = EINVAL; else { ifp->if_mtu = ifr->ifr_mtu; diff --git a/sys/dev/pci/if_ngereg.h b/sys/dev/pci/if_ngereg.h index b39b7170eae..e62ecb02acd 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.4 2004/05/19 11:37:00 brad Exp $ */ +/* $OpenBSD: if_ngereg.h,v 1.5 2004/08/05 19:57:17 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -613,11 +613,9 @@ struct nge_mii_frame { #define NGE_MII_WRITEOP 0x01 #define NGE_MII_TURNAROUND 0x02 -#define NGE_JUMBO_FRAMELEN 9018 -#define NGE_JUMBO_MTU (NGE_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) #define NGE_JSLOTS 384 -#define NGE_JRAWLEN (NGE_JUMBO_FRAMELEN + ETHER_ALIGN + sizeof(u_int64_t)) +#define NGE_JRAWLEN (ETHER_MAX_LEN_JUMBO + ETHER_ALIGN + sizeof(u_int64_t)) #define NGE_JLEN (NGE_JRAWLEN + (sizeof(u_int64_t) - \ (NGE_JRAWLEN % sizeof(u_int64_t)))) #define NGE_MCLBYTES (NGE_JLEN - sizeof(u_int64_t)) diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index faaf1ba90da..4a8d8e6400b 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.42 2004/08/04 19:37:26 mcbride Exp $ */ +/* $OpenBSD: if_sk.c,v 1.43 2004/08/05 19:57:17 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -982,7 +982,7 @@ sk_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } break; case SIOCSIFMTU: - if (ifr->ifr_mtu > SK_JUMBO_MTU) + if (ifr->ifr_mtu > ETHERMTU_JUMBO) error = EINVAL; else ifp->if_mtu = ifr->ifr_mtu; diff --git a/sys/dev/pci/if_skreg.h b/sys/dev/pci/if_skreg.h index 44e7c97f84f..412a0629f1b 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.12 2004/08/04 19:37:26 mcbride Exp $ */ +/* $OpenBSD: if_skreg.h,v 1.13 2004/08/05 19:57:17 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1314,11 +1314,9 @@ struct sk_tx_desc { * layers. To be safe, we allocate 1.5 times the number of * receive descriptors. */ -#define SK_JUMBO_FRAMELEN 9018 -#define SK_JUMBO_MTU (SK_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) #define SK_JSLOTS 384 -#define SK_JRAWLEN (SK_JUMBO_FRAMELEN + ETHER_ALIGN) +#define SK_JRAWLEN (ETHER_MAX_LEN_JUMBO + ETHER_ALIGN) #define SK_JLEN SK_JRAWLEN #define SK_MCLBYTES SK_JLEN #define SK_JPAGESZ PAGE_SIZE diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c index 7f79329235d..fcb40591454 100644 --- a/sys/dev/pci/if_ti.c +++ b/sys/dev/pci/if_ti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ti.c,v 1.51 2004/06/18 20:33:56 mcbride Exp $ */ +/* $OpenBSD: if_ti.c,v 1.52 2004/08/05 19:57:17 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -881,14 +881,14 @@ int ti_newbuf_jumbo(sc, i, m) m_new->m_data = m_new->m_ext.ext_buf = (void *)buf; m_new->m_flags |= M_EXT; m_new->m_len = m_new->m_pkthdr.len = - m_new->m_ext.ext_size = TI_JUMBO_FRAMELEN; + m_new->m_ext.ext_size = ETHER_MAX_LEN_JUMBO; m_new->m_ext.ext_free = ti_jfree; m_new->m_ext.ext_arg = sc; MCLINITREFERENCE(m_new); } else { m_new = m; m_new->m_data = m_new->m_ext.ext_buf; - m_new->m_ext.ext_size = TI_JUMBO_FRAMELEN; + m_new->m_ext.ext_size = ETHER_MAX_LEN_JUMBO; } m_adj(m_new, ETHER_ALIGN); @@ -1060,7 +1060,7 @@ int ti_init_tx_ring(sc) SLIST_INIT(&sc->ti_tx_map_listhead); for (i = 0; i < TI_TX_RING_CNT; i++) { - if (bus_dmamap_create(sc->sc_dmatag, TI_JUMBO_FRAMELEN, + if (bus_dmamap_create(sc->sc_dmatag, ETHER_MAX_LEN_JUMBO, TI_NTXSEG, MCLBYTES, 0, BUS_DMA_NOWAIT, &dmamap)) return(ENOBUFS); @@ -1457,7 +1457,7 @@ int ti_gibinit(sc) /* Set up the jumbo receive ring. */ rcb = &sc->ti_rdata->ti_info.ti_jumbo_rx_rcb; TI_HOSTADDR(rcb->ti_hostaddr) = TI_RING_DMA_ADDR(sc, ti_rx_jumbo_ring); - rcb->ti_max_len = TI_JUMBO_FRAMELEN; + rcb->ti_max_len = ETHER_MAX_LEN_JUMBO; rcb->ti_flags = 0; rcb->ti_flags |= TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM; #if NVLAN > 0 @@ -2583,7 +2583,7 @@ int ti_ioctl(ifp, command, data) } break; case SIOCSIFMTU: - if (ifr->ifr_mtu > TI_JUMBO_FRAMELEN - ETHER_HDR_LEN) { + if (ifr->ifr_mtu > ETHERMTU_JUMBO) { error = EINVAL; } else { ifp->if_mtu = ifr->ifr_mtu; diff --git a/sys/dev/pci/if_tireg.h b/sys/dev/pci/if_tireg.h index 9c9813a53b8..f0b1a2ad489 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.14 2004/05/19 11:37:00 brad Exp $ */ +/* $OpenBSD: if_tireg.h,v 1.15 2004/08/05 19:57:17 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -768,9 +768,6 @@ struct ti_tx_desc { * boundary. */ -#define TI_FRAMELEN 1518 -#define TI_JUMBO_FRAMELEN 9018 -#define TI_JUMBO_MTU (TI_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) #define TI_PAGE_SIZE PAGE_SIZE #define TI_MIN_FRAMELEN 60 @@ -981,7 +978,7 @@ struct ti_event_desc { #define TI_MSLOTS 256 #define TI_JSLOTS 384 -#define TI_JRAWLEN (TI_JUMBO_FRAMELEN + ETHER_ALIGN) +#define TI_JRAWLEN (ETHER_MAX_LEN_JUMBO + ETHER_ALIGN) #define TI_JLEN (TI_JRAWLEN + (sizeof(u_int64_t) - \ (TI_JRAWLEN % sizeof(u_int64_t)))) #define TI_JPAGESZ PAGE_SIZE |