According to wpaul's comment, 8139C+ only support 64 TX/RX descriptors
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 16 Oct 2008 12:46:40 +0000 (12:46 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 16 Oct 2008 12:46:40 +0000 (12:46 +0000)
sys/dev/netif/re/if_re.c
sys/dev/netif/re/if_revar.h

index b47e6a4..1c889a6 100644 (file)
@@ -33,7 +33,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/re/if_re.c,v 1.25 2004/06/09 14:34:01 naddy Exp $
- * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.83 2008/10/16 12:29:13 sephe Exp $
+ * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.84 2008/10/16 12:46:40 sephe Exp $
  */
 
 /*
@@ -1312,13 +1312,18 @@ re_attach(device_t dev)
        sc->re_dev = dev;
 #endif
 
-       sc->re_rx_desc_cnt = re_rx_desc_count;
-       if (sc->re_rx_desc_cnt > RE_RX_DESC_CNT_MAX)
-               sc->re_rx_desc_cnt = RE_RX_DESC_CNT_MAX;
+       if (RE_IS_8139CP(sc)) {
+               sc->re_rx_desc_cnt = RE_RX_DESC_CNT_8139CP;
+               sc->re_tx_desc_cnt = RE_TX_DESC_CNT_8139CP;
+       } else {
+               sc->re_rx_desc_cnt = re_rx_desc_count;
+               if (sc->re_rx_desc_cnt > RE_RX_DESC_CNT_MAX)
+                       sc->re_rx_desc_cnt = RE_RX_DESC_CNT_MAX;
 
-       sc->re_tx_desc_cnt = re_tx_desc_count;
-       if (sc->re_tx_desc_cnt > RE_TX_DESC_CNT_MAX)
-               sc->re_tx_desc_cnt = RE_TX_DESC_CNT_MAX;
+               sc->re_tx_desc_cnt = re_tx_desc_count;
+               if (sc->re_tx_desc_cnt > RE_TX_DESC_CNT_MAX)
+                       sc->re_tx_desc_cnt = RE_TX_DESC_CNT_MAX;
+       }
 
        qlen = RE_IFQ_MAXLEN;
        if (sc->re_tx_desc_cnt > qlen)
index c656894..e03ca7e 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/pci/if_rlreg.h,v 1.42 2004/05/24 19:39:23 jhb Exp $
- * $DragonFly: src/sys/dev/netif/re/if_revar.h,v 1.25 2008/10/16 12:29:13 sephe Exp $
+ * $DragonFly: src/sys/dev/netif/re/if_revar.h,v 1.26 2008/10/16 12:46:40 sephe Exp $
  */
 
+#define RE_RX_DESC_CNT_8139CP  64
+#define RE_TX_DESC_CNT_8139CP  64
+
 #define RE_RX_DESC_CNT_DEF     256
 #define RE_TX_DESC_CNT_DEF     256
 #define RE_RX_DESC_CNT_MAX     1024