summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1999-02-26 21:25:45 +0000
committerJason Wright <jason@cvs.openbsd.org>1999-02-26 21:25:45 +0000
commit004b18a91803abee9d3721d108861a549d6bd7ab (patch)
tree0afc726f7b75919e7a8b234b72c4f0a4fb58cfaa
parentf3cc3cd57f00259563b53b555b7e8cb27789c706 (diff)
Sync with FreeBSD:
o fix multicast hash calculation (return the right set of bits) o make sure ifp->if_snd.ifq_maxlen is initialized o use RL_CMD_EMPTY_RXBUF instead of magic constant 1 o make sure the delta 8139 boards are setup correctly
-rw-r--r--sys/dev/pci/if_rl.c16
-rw-r--r--sys/dev/pci/if_rlreg.h34
2 files changed, 36 insertions, 14 deletions
diff --git a/sys/dev/pci/if_rl.c b/sys/dev/pci/if_rl.c
index 8524248e20f..1b5f8320763 100644
--- a/sys/dev/pci/if_rl.c
+++ b/sys/dev/pci/if_rl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rl.c,v 1.12 1999/02/26 17:05:54 jason Exp $ */
+/* $OpenBSD: if_rl.c,v 1.13 1999/02/26 21:25:44 jason Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -31,7 +31,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: if_rl.c,v 1.8 1998/12/24 18:39:48 wpaul Exp $
+ * $FreeBSD: if_rl.c,v 1.12 1999/02/23 15:38:25 wpaul Exp $
*/
/*
@@ -491,7 +491,7 @@ static int rl_mii_writereg(sc, frame)
}
/*
- * Calculate CRC of a multicast group address, return the lower 6 bits.
+ * Calculate CRC of a multicast group address, return the upper 6 bits.
*/
static u_int8_t rl_calchash(addr)
caddr_t addr;
@@ -515,7 +515,7 @@ static u_int8_t rl_calchash(addr)
}
/* return the filter bit position */
- return(crc & 0x0000003F);
+ return(crc >> 26);
}
/*
@@ -537,7 +537,7 @@ static void rl_setmulti(sc)
rxfilt = CSR_READ_4(sc, RL_RXCFG);
- if (ifp->if_flags & IFF_ALLMULTI) {
+ if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
rxfilt |= RL_RXCFG_RX_MULTI;
CSR_WRITE_4(sc, RL_RXCFG, rxfilt);
CSR_WRITE_4(sc, RL_MAR0, 0xFFFFFFFF);
@@ -661,7 +661,7 @@ static void rl_rxeof(sc)
else
max_bytes = limit - cur_rx;
- while((CSR_READ_1(sc, RL_COMMAND) & 1) == 0) {
+ while((CSR_READ_1(sc, RL_COMMAND) & RL_CMD_EMPTY_RXBUF) == 0) {
rxbufpos = sc->rl_cdata.rl_rx_buf + cur_rx;
rxstat = *(u_int32_t *)rxbufpos;
@@ -1378,7 +1378,8 @@ rl_attach(parent, self, aux)
rl_read_eeprom(sc, (caddr_t)&rl_did, RL_EE_PCI_DID, 1, 0);
- if (rl_did == RT_DEVICEID_8139 || rl_did == ACCTON_DEVICEID_5030)
+ if (rl_did == RT_DEVICEID_8139 || rl_did == ACCTON_DEVICEID_5030 ||
+ rl_did == DELTA_DEVICEID_8139)
sc->rl_type = RL_8139;
else if (rl_did == RT_DEVICEID_8129)
sc->rl_type = RL_8129;
@@ -1427,6 +1428,7 @@ rl_attach(parent, self, aux)
ifp->if_start = rl_start;
ifp->if_watchdog = rl_watchdog;
ifp->if_baudrate = 10000000;
+ ifp->if_snd.ifq_maxlen = RL_TX_LIST_CNT - 1;
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
/*
diff --git a/sys/dev/pci/if_rlreg.h b/sys/dev/pci/if_rlreg.h
index d1b89e6e7b7..688cac6f20a 100644
--- a/sys/dev/pci/if_rlreg.h
+++ b/sys/dev/pci/if_rlreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rlreg.h,v 1.6 1998/12/31 02:35:14 jason Exp $ */
+/* $OpenBSD: if_rlreg.h,v 1.7 1999/02/26 21:25:43 jason Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -31,7 +31,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: if_rlreg.h,v 1.4 1998/12/10 19:02:07 wpaul Exp $
+ * $FreeBSD: if_rlreg.h,v 1.5 1999/02/23 15:38:25 wpaul Exp $
*/
/*
@@ -371,22 +371,42 @@ struct rl_softc {
#define RT_VENDORID 0x10EC
/*
- * Accton PCI vendor ID
- */
-#define ACCTON_VENDORID 0x1113
-
-/*
* RealTek chip device IDs.
*/
#define RT_DEVICEID_8129 0x8129
#define RT_DEVICEID_8139 0x8139
/*
+ * Accton PCI vendor ID
+ */
+#define ACCTON_VENDORID 0x1113
+
+/*
* Accton MPX 5030/5038 device ID.
*/
#define ACCTON_DEVICEID_5030 0x1211
/*
+ * Delta Electronics Vendor ID.
+ */
+#define DELTA_VENDORID 0x1500
+
+/*
+ * Delta device IDs.
+ */
+#define DELTA_DEVICEID_8139 0x1360
+
+/*
+ * Addtron vendor ID.
+ */
+#define ADDTRON_VENDORID 0x4033
+
+/*
+ * Addtron device IDs.
+ */
+#define ADDTRON_DEVICEID_8139 0x1360
+
+/*
* Texas Instruments PHY identifiers
*/
#define TI_PHY_VENDORID 0x4000