summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-12-15 02:33:05 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-12-15 02:33:05 +0000
commitc1d64c8983821a2ecaec39e8b7fff710bc816550 (patch)
treeac0083ee20101b7bf4d8bd58f6062584d9996166 /sys/dev
parent9f5821c8cbd7dee5fbbb49f780b01054394ef117 (diff)
revert 1.20 now that the new allocator is used to control the number of
RX buffers allocated. ok dlg@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_em.c25
-rw-r--r--sys/dev/pci/if_em.h4
2 files changed, 9 insertions, 20 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 231957d9562..5921a80d0c4 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.202 2008/12/06 11:39:38 dlg Exp $ */
+/* $OpenBSD: if_em.c,v 1.203 2008/12/15 02:33:04 brad Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -261,8 +261,13 @@ em_attach(struct device *parent, struct device *self, void *aux)
em_identify_hardware(sc);
/* Parameters (to be read from user) */
- sc->num_tx_desc = EM_MIN_TXD;
- sc->num_rx_desc = EM_MIN_RXD;
+ if (sc->hw.mac_type >= em_82544) {
+ sc->num_tx_desc = EM_MAX_TXD;
+ sc->num_rx_desc = EM_MAX_RXD;
+ } else {
+ sc->num_tx_desc = EM_MAX_TXD_82543;
+ sc->num_rx_desc = EM_MAX_RXD_82543;
+ }
sc->tx_int_delay = EM_TIDV;
sc->tx_abs_int_delay = EM_TADV;
sc->rx_int_delay = EM_RDTR;
@@ -663,20 +668,6 @@ em_init(void *arg)
em_stop(sc);
- if (ifp->if_flags & IFF_UP) {
- if (sc->hw.mac_type >= em_82544) {
- sc->num_tx_desc = EM_MAX_TXD;
- sc->num_rx_desc = EM_MAX_RXD;
- } else {
- sc->num_tx_desc = EM_MAX_TXD_82543;
- sc->num_rx_desc = EM_MAX_RXD_82543;
- }
- } else {
- sc->num_tx_desc = EM_MIN_TXD;
- sc->num_rx_desc = EM_MIN_RXD;
- }
- IFQ_SET_MAXLEN(&ifp->if_snd, sc->num_tx_desc - 1);
-
/*
* Packet Buffer Allocation (PBA)
* Writing PBA sets the receive portion of the buffer
diff --git a/sys/dev/pci/if_em.h b/sys/dev/pci/if_em.h
index f29ca89c848..528264d53df 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.26 2004/09/01 23:22:41 pdeuskar Exp $ */
-/* $OpenBSD: if_em.h,v 1.42 2008/12/05 00:08:17 brad Exp $ */
+/* $OpenBSD: if_em.h,v 1.43 2008/12/15 02:33:04 brad Exp $ */
#ifndef _EM_H_DEFINED_
#define _EM_H_DEFINED_
@@ -94,7 +94,6 @@ POSSIBILITY OF SUCH DAMAGE.
* desscriptors should meet the following condition.
* (num_tx_desc * sizeof(struct em_tx_desc)) % 128 == 0
*/
-#define EM_MIN_TXD 12
#define EM_MAX_TXD_82543 256
#define EM_MAX_TXD 512
@@ -111,7 +110,6 @@ POSSIBILITY OF SUCH DAMAGE.
* desscriptors should meet the following condition.
* (num_tx_desc * sizeof(struct em_tx_desc)) % 128 == 0
*/
-#define EM_MIN_RXD 12
#define EM_MAX_RXD_82543 256
#define EM_MAX_RXD 256