summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1998-11-19 07:01:57 +0000
committerJason Wright <jason@cvs.openbsd.org>1998-11-19 07:01:57 +0000
commitb8e85c588fa827fdb5485d0af03a5dc0cdb01e82 (patch)
tree7f4edf45d7e54875894819636f56e26346bbd01e /sys/dev/pci
parent8c453d3e32af38ff43f66a22acb0997f12fac4f9 (diff)
Sync with FreeBSD:
o match Accton 1207D (MXP5030, 5038) o always do buffer copies on tx (it happened most of the time anyway) o fix up tx packets to minimum length
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_rl.c46
-rw-r--r--sys/dev/pci/if_rlreg.h16
2 files changed, 34 insertions, 28 deletions
diff --git a/sys/dev/pci/if_rl.c b/sys/dev/pci/if_rl.c
index 67797484652..942f1f82f9b 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.5 1998/11/18 21:42:08 jason Exp $ */
+/* $OpenBSD: if_rl.c,v 1.6 1998/11/19 07:01:55 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.1 1998/10/18 16:24:30 wpaul Exp $
+ * $FreeBSD: if_rl.c,v 1.2 1998/11/18 21:03:57 wpaul Exp $
*/
/*
@@ -945,6 +945,7 @@ static int rl_encap(sc, c, m_head)
struct mbuf *m_head;
{
struct mbuf *m;
+ struct mbuf *m_new = NULL;
/*
* There are two possible encapsulation mechanisms
@@ -961,35 +962,33 @@ static int rl_encap(sc, c, m_head)
m = m_head;
- if (m->m_pkthdr.len > MHLEN || (mtod(m, u_int32_t) & 0x00000003)) {
- struct mbuf *m_new = NULL;
+ MGETHDR(m_new, M_DONTWAIT, MT_DATA);
+ if (m_new == NULL) {
+ printf("%s: no memory for tx list", sc->sc_dev.dv_xname);
+ return(1);
+ }
+ if (m_head->m_pkthdr.len > MHLEN) {
+ MCLGET(m_new, M_DONTWAIT);
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
+ if (!(m_new->m_flags & M_EXT)) {
+ m_freem(m_new);
printf("%s: no memory for tx list",
sc->sc_dev.dv_xname);
return(1);
}
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("%s: no memory for tx list",
- sc->sc_dev.dv_xname);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
}
+ m_copydata(m_head, 0, m_head->m_pkthdr.len,
+ mtod(m_new, caddr_t));
+ m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
+ m_freem(m_head);
+ m_head = m_new;
/* Pad frames to at least 60 bytes. */
- if (m_head->m_pkthdr.len < RL_MIN_FRAMELEN)
+ if (m_head->m_pkthdr.len < RL_MIN_FRAMELEN) {
m_head->m_pkthdr.len +=
(RL_MIN_FRAMELEN - m_head->m_pkthdr.len);
+ m_head->m_len = m_head->m_pkthdr.len;
+ }
c->rl_mbuf = m_head;
@@ -1292,12 +1291,11 @@ rl_probe(parent, match, aux)
case PCI_PRODUCT_REALTEK_RT8139:
return 1;
}
- return 0;
}
- if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_REALTEK2) {
+ if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_ACCTON) {
switch (PCI_PRODUCT(pa->pa_id)) {
- case PCI_PRODUCT_REALTEK2_RT8139:
+ case PCI_PRODUCT_ACCTON_5030:
return 1;
}
}
diff --git a/sys/dev/pci/if_rlreg.h b/sys/dev/pci/if_rlreg.h
index 705164ebab8..bb1718f68ee 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.3 1998/11/18 21:42:10 jason Exp $ */
+/* $OpenBSD: if_rlreg.h,v 1.4 1998/11/19 07:01:56 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.1 1998/10/18 16:24:30 wpaul Exp $
+ * $FreeBSD: if_rlreg.h,v 1.2 1998/11/18 21:03:58 wpaul Exp $
*/
/*
@@ -369,14 +369,22 @@ struct rl_softc {
* RealTek PCI vendor ID
*/
#define RT_VENDORID 0x10EC
-#define RT_VENDORID_ALT 0x1211
+
+/*
+ * Accton PCI vendor ID
+ */
+#define ACCTON_VENDORID 0x1113
/*
* RealTek chip device IDs.
*/
#define RT_DEVICEID_8129 0x8129
#define RT_DEVICEID_8139 0x8139
-#define RT_DEVICEID_8139_ALT 0x1211
+
+/*
+ * Accton MPX 5030/5038 device ID.
+ */
+#define ACCTON_DEVICEID_5030 0x1211
/*
* Texas Instruments PHY identifiers