summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2003-09-11 06:56:46 +0000
committerwpaul <wpaul@FreeBSD.org>2003-09-11 06:56:46 +0000
commitd4a3ccea7c9aa74a42d1df6d9a635c2b8054eaf5 (patch)
tree1f97f1d0d087d2e14ccbbed21f5e267a05ff56b1 /sys/pci
parent5d369f4c62f70ea67230f7be1aa4b7a62be2586b (diff)
downloadFreeBSD-src-d4a3ccea7c9aa74a42d1df6d9a635c2b8054eaf5.zip
FreeBSD-src-d4a3ccea7c9aa74a42d1df6d9a635c2b8054eaf5.tar.gz
- For the 8169 chips, read the station address by forcing an EEPROM
autoload and then copying the contends of the station address registers. For some reason, reading the EEPROM on the 8169S doesn't work right. This gets around the problem, and allows us to read the station address correctly on the 8169S. - Insert a delay after initiating packet transmition in re_diag() to allow lots of time for the frame to echo back to the host, and wait for both the 'RX complete' and 'timeout expired' bits in the ISR register to be set. - Deal more intelligently with the fact that the frame length field in the RX descriptor is a different width on the 8139C+ than it is on the 8169/8169S/8110S - For the 8169, you have to set bit 17 in the TX config register to enter digital loopback mode, but for the 8139C+, you have to set both bits 17 and 18. Take this into account so that re_diag() works properly for both types of chips.
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_rlreg.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/pci/if_rlreg.h b/sys/pci/if_rlreg.h
index 32edf6f..2f2d710 100644
--- a/sys/pci/if_rlreg.h
+++ b/sys/pci/if_rlreg.h
@@ -142,6 +142,7 @@
#define RL_LOOPTEST_OFF 0x00000000
#define RL_LOOPTEST_ON 0x00020000
+#define RL_LOOPTEST_ON_CPLUS 0x00060000
#define RL_HWREV_8169 0x00000000
#define RL_HWREV_8169S 0x04000000
@@ -530,7 +531,7 @@ struct rl_desc {
#define RL_RDESC_CMD_EOR 0x40000000
#define RL_RDESC_CMD_OWN 0x80000000
-#define RL_RDESC_CMD_BUFLEN 0x00003FFF
+#define RL_RDESC_CMD_BUFLEN 0x00001FFF
#define RL_RDESC_STAT_OWN 0x80000000
#define RL_RDESC_STAT_EOR 0x40000000
@@ -550,7 +551,8 @@ struct rl_desc {
#define RL_RDESC_STAT_IPSUMBAD 0x00008000 /* IP header checksum bad */
#define RL_RDESC_STAT_UDPSUMBAD 0x00004000 /* UDP checksum bad */
#define RL_RDESC_STAT_TCPSUMBAD 0x00002000 /* TCP checksum bad */
-#define RL_RDESC_STAT_FRAGLEN 0x00003FFF /* RX'ed frame/frag len */
+#define RL_RDESC_STAT_FRAGLEN 0x00001FFF /* RX'ed frame/frag len */
+#define RL_RDESC_STAT_GFRAGLEN 0x00003FFF /* RX'ed frame/frag len */
#define RL_RDESC_VLANCTL_TAG 0x00010000 /* VLAN tag available
(rl_vlandata valid)*/
@@ -595,8 +597,7 @@ struct rl_stats {
#define RL_IFQ_MAXLEN 512
#define RL_DESC_INC(x) (x = (x + 1) % RL_TX_DESC_CNT)
#define RL_OWN(x) (le32toh((x)->rl_cmdstat) & RL_RDESC_STAT_OWN)
-#define RL_RXBYTES(x) (le32toh((x)->rl_cmdstat) & \
- RL_RDESC_STAT_FRAGLEN)
+#define RL_RXBYTES(x) (le32toh((x)->rl_cmdstat) & sc->rl_rxlenmask)
#define RL_PKTSZ(x) ((x)/* >> 3*/)
#define RL_ADDR_LO(y) ((u_int64_t) (y) & 0xFFFFFFFF)
@@ -669,6 +670,7 @@ struct rl_softc {
struct mbuf *rl_head;
struct mbuf *rl_tail;
u_int32_t rl_hwrev;
+ u_int32_t rl_rxlenmask;
int rl_testmode;
int suspended; /* 0 = normal 1 = suspended */
#ifdef DEVICE_POLLING
OpenPOWER on IntegriCloud