diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2004-09-28 16:58:57 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2004-09-28 16:58:57 +0000 |
commit | ae87190605c9d85eaf9ba7728034f343685da32a (patch) | |
tree | 69185f16df2c97a1471af1140acddbd44dd6d4c3 | |
parent | f8cf3a1e10132d9a4e78a4b974af9a00db94d722 (diff) |
Use ETHER_MIN_LEN/ETHER_MAX_DIX_LEN
-rw-r--r-- | sys/dev/ic/dc.c | 10 | ||||
-rw-r--r-- | sys/dev/ic/dcreg.h | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_dc_pci.c | 4 |
3 files changed, 9 insertions, 11 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index 7b121916011..454f6358c87 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.68 2004/09/23 17:45:16 brad Exp $ */ +/* $OpenBSD: dc.c,v 1.69 2004/09/28 16:58:56 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -1933,7 +1933,7 @@ dc_newbuf(sc, i, m) c->dc_data = htole32( sc->dc_cdata.dc_rx_chain[i].sd_map->dm_segs[0].ds_addr + sizeof(u_int64_t)); - c->dc_ctl = htole32(DC_RXCTL_RLINK | DC_RXLEN); + c->dc_ctl = htole32(DC_RXCTL_RLINK | ETHER_MAX_DIX_LEN); c->dc_status = htole32(DC_RXSTAT_OWN); bus_dmamap_sync(sc->sc_dmat, sc->sc_listmap, @@ -2012,15 +2012,15 @@ dc_pnic_rx_bug_war(sc, idx) i = sc->dc_pnic_rx_bug_save; cur_rx = &sc->dc_ldata->dc_rx_list[idx]; ptr = sc->dc_pnic_rx_buf; - bzero(ptr, DC_RXLEN * 5); + bzero(ptr, ETHER_MAX_DIX_LEN * 5); /* Copy all the bytes from the bogus buffers. */ while (1) { c = &sc->dc_ldata->dc_rx_list[i]; rxstat = letoh32(c->dc_status); m = sc->dc_cdata.dc_rx_chain[i].sd_mbuf; - bcopy(mtod(m, char *), ptr, DC_RXLEN); - ptr += DC_RXLEN; + bcopy(mtod(m, char *), ptr, ETHER_MAX_DIX_LEN); + ptr += ETHER_MAX_DIX_LEN; /* If this is the last buffer, break out. */ if (i == idx || rxstat & DC_RXSTAT_LASTFRAG) break; diff --git a/sys/dev/ic/dcreg.h b/sys/dev/ic/dcreg.h index 96a76cf2265..78d3f37913f 100644 --- a/sys/dev/ic/dcreg.h +++ b/sys/dev/ic/dcreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dcreg.h,v 1.35 2004/08/04 14:47:30 mickey Exp $ */ +/* $OpenBSD: dcreg.h,v 1.36 2004/09/28 16:58:56 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -468,8 +468,6 @@ struct dc_desc { #define DC_MAXFRAGS 16 #define DC_RX_LIST_CNT 64 #define DC_TX_LIST_CNT 256 -#define DC_MIN_FRAMELEN 64 -#define DC_RXLEN 1536 #define DC_INC(x, y) (x) = (x + 1) % y @@ -477,7 +475,7 @@ struct dc_list_data { struct dc_desc dc_rx_list[DC_RX_LIST_CNT]; struct dc_desc dc_tx_list[DC_TX_LIST_CNT]; u_int32_t dc_sbuf[DC_SFRAME_LEN/sizeof(u_int32_t)]; - u_int8_t dc_pad[DC_MIN_FRAMELEN]; + u_int8_t dc_pad[ETHER_MIN_LEN]; }; /* software descriptor */ diff --git a/sys/dev/pci/if_dc_pci.c b/sys/dev/pci/if_dc_pci.c index 4ea861b3417..e372f42d82a 100644 --- a/sys/dev/pci/if_dc_pci.c +++ b/sys/dev/pci/if_dc_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_dc_pci.c,v 1.44 2004/08/04 15:02:29 mickey Exp $ */ +/* $OpenBSD: if_dc_pci.c,v 1.45 2004/09/28 16:58:56 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -423,7 +423,7 @@ void dc_pci_attach(parent, self, aux) sc->dc_type = DC_TYPE_PNIC; sc->dc_flags |= DC_TX_STORENFWD|DC_TX_INTR_ALWAYS; sc->dc_flags |= DC_PNIC_RX_BUG_WAR; - sc->dc_pnic_rx_buf = malloc(DC_RXLEN * 5, M_DEVBUF, + sc->dc_pnic_rx_buf = malloc(ETHER_MAX_DIX_LEN * 5, M_DEVBUF, M_NOWAIT); if (sc->dc_pnic_rx_buf == NULL) panic("dc_pci_attach"); |