Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Replace a bunch of home-grown Ethernet related c...



details:   https://anonhg.NetBSD.org/src/rev/f43b29e3ee96
branches:  trunk
changeset: 510638:f43b29e3ee96
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Jun 03 03:29:44 2001 +0000

description:
Replace a bunch of home-grown Ethernet related constants with
ones defined in <net/if_ether.h>

diffstat:

 sys/dev/pci/if_ti.c    |  16 ++++++++--------
 sys/dev/pci/if_tireg.h |   8 ++------
 2 files changed, 10 insertions(+), 14 deletions(-)

diffs (94 lines):

diff -r 626539187756 -r f43b29e3ee96 sys/dev/pci/if_ti.c
--- a/sys/dev/pci/if_ti.c       Sun Jun 03 03:24:23 2001 +0000
+++ b/sys/dev/pci/if_ti.c       Sun Jun 03 03:29:44 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ti.c,v 1.21 2001/06/02 16:17:08 thorpej Exp $ */
+/* $NetBSD: if_ti.c,v 1.22 2001/06/03 03:29:44 thorpej Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -891,14 +891,14 @@
                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);
@@ -1082,8 +1082,8 @@
        SIMPLEQ_INIT(&sc->txdma_list);
        for (i = 0; i < TI_RSLOTS; i++) {
                /* I've seen mbufs with 30 fragments. */
-               if ((error = bus_dmamap_create(sc->sc_dmat, TI_JUMBO_FRAMELEN,
-                                              40, TI_JUMBO_FRAMELEN, 0,
+               if ((error = bus_dmamap_create(sc->sc_dmat, ETHER_MAX_LEN_JUMBO,
+                                              40, ETHER_MAX_LEN_JUMBO, 0,
                                               BUS_DMA_NOWAIT, &dmamap)) != 0) {
                        printf("%s: can't create tx map, error = %d\n",
                               sc->sc_dev.dv_xname, error);
@@ -1488,7 +1488,7 @@
        TI_HOSTADDR(rcb->ti_hostaddr) = sc->info_dmaaddr +
                ((caddr_t)&sc->ti_rdata->ti_rx_std_ring
                 - (caddr_t)sc->ti_rdata);
-       rcb->ti_max_len = TI_FRAMELEN;
+       rcb->ti_max_len = ETHER_MAX_LEN;
        rcb->ti_flags = 0;
        if (ifp->if_capenable & IFCAP_CSUM_IPv4)
                rcb->ti_flags |= TI_RCB_FLAG_IP_CKSUM;
@@ -1501,7 +1501,7 @@
        rcb = &sc->ti_rdata->ti_info.ti_jumbo_rx_rcb;
        TI_HOSTADDR(rcb->ti_hostaddr) = sc->info_dmaaddr +
            ((caddr_t)&sc->ti_rdata->ti_rx_jumbo_ring - (caddr_t)sc->ti_rdata);
-       rcb->ti_max_len = TI_JUMBO_FRAMELEN;
+       rcb->ti_max_len = ETHER_MAX_LEN_JUMBO;
        rcb->ti_flags = 0;
        if (ifp->if_capenable & IFCAP_CSUM_IPv4)
                rcb->ti_flags |= TI_RCB_FLAG_IP_CKSUM;
@@ -2657,7 +2657,7 @@
                error = ti_ether_ioctl(ifp, command, data);
                break;
        case SIOCSIFMTU:
-               if (ifr->ifr_mtu > TI_JUMBO_MTU)
+               if (ifr->ifr_mtu > ETHERMTU_JUMBO)
                        error = EINVAL;
                else {
                        ifp->if_mtu = ifr->ifr_mtu;
diff -r 626539187756 -r f43b29e3ee96 sys/dev/pci/if_tireg.h
--- a/sys/dev/pci/if_tireg.h    Sun Jun 03 03:24:23 2001 +0000
+++ b/sys/dev/pci/if_tireg.h    Sun Jun 03 03:29:44 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tireg.h,v 1.4 2001/05/15 14:37:36 lukem Exp $ */
+/* $NetBSD: if_tireg.h,v 1.5 2001/06/03 03:29:44 thorpej Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -768,11 +768,7 @@
 
 #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)
 #define TI_PAGE_SIZE           PAGE_SIZE
-#define TI_MIN_FRAMELEN                60
 
 /*
  * Buffer descriptor error flags.
@@ -994,7 +990,7 @@
 #define TI_JSLOTS      64 /* 256 */
 #define TI_RSLOTS      128
 
-#define TI_JRAWLEN (TI_JUMBO_FRAMELEN + ETHER_ALIGN + sizeof(u_int64_t))
+#define TI_JRAWLEN (ETHER_MAX_LEN_JUMBO + ETHER_ALIGN + sizeof(u_int64_t))
 #define TI_JLEN (TI_JRAWLEN + (sizeof(u_int64_t) - \
        (TI_JRAWLEN % sizeof(u_int64_t))))
 #define TI_JPAGESZ PAGE_SIZE



Home | Main Index | Thread Index | Old Index