summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2008-07-16 08:02:23 +0000
committeryongari <yongari@FreeBSD.org>2008-07-16 08:02:23 +0000
commitdc88e0e3e5bb00766977203967a6f933644147e6 (patch)
tree3dccbf6f8521f5895aec486b60fa74ad50d658c5 /sys/dev
parent7cf9955507e487543c1e66a8b23912017ef31a49 (diff)
downloadFreeBSD-src-dc88e0e3e5bb00766977203967a6f933644147e6.zip
FreeBSD-src-dc88e0e3e5bb00766977203967a6f933644147e6.tar.gz
Fix VR_RXSTAT_RX_OK bit definition which lasted for more than 9
years. All datasheet I have indicates the bit 15 is the VR_RXSTAT_RX_OK. The bit 14 is reserved for all Rhine family except VT6105M. VT6105M uses that bit to indicate a VLAN frame with matching CAM VLAN id. Use the VR_RXSTAT_RX_OK instead of VR_RXSTAT_RXERR when vr(4) checks the validity of received frame. This should fix occasional dropping frames on VT6105M. Tested by: Goran Lowkrantz ( goran.lowkrantz at ismobile dot com ) MFC after: 1 week
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/vr/if_vr.c4
-rw-r--r--sys/dev/vr/if_vrreg.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c
index e2cbb69..bbbf9f2 100644
--- a/sys/dev/vr/if_vr.c
+++ b/sys/dev/vr/if_vr.c
@@ -1324,8 +1324,8 @@ vr_rxeof(struct vr_softc *sc)
* We don't support SG in Rx path yet, so discard
* partial frame.
*/
- if ((rxstat & (VR_RXSTAT_RXERR | VR_RXSTAT_FIRSTFRAG |
- VR_RXSTAT_LASTFRAG)) !=
+ if ((rxstat & VR_RXSTAT_RX_OK) == 0 ||
+ (rxstat & (VR_RXSTAT_FIRSTFRAG | VR_RXSTAT_LASTFRAG)) !=
(VR_RXSTAT_FIRSTFRAG | VR_RXSTAT_LASTFRAG)) {
ifp->if_ierrors++;
sc->vr_stat.rx_errors++;
diff --git a/sys/dev/vr/if_vrreg.h b/sys/dev/vr/if_vrreg.h
index c51dc2f..a744786 100644
--- a/sys/dev/vr/if_vrreg.h
+++ b/sys/dev/vr/if_vrreg.h
@@ -455,7 +455,8 @@ struct vr_desc {
#define VR_RXSTAT_RX_PHYS 0x00000800
#define VR_RXSTAT_RX_BROAD 0x00001000
#define VR_RXSTAT_RX_MULTI 0x00002000
-#define VR_RXSTAT_RX_OK 0x00004000
+#define VR_RXSTAT_RX_VIDHIT 0x00004000 /* 6105M */
+#define VR_RXSTAT_RX_OK 0x00008000
#define VR_RXSTAT_RXLEN 0x07FF0000
#define VR_RXSTAT_RXLEN_EXT 0x78000000
#define VR_RXSTAT_OWN 0x80000000
OpenPOWER on IntegriCloud