summaryrefslogtreecommitdiff
path: root/sys/dev/msk
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2009-05-25 06:09:18 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2009-05-25 06:09:18 +0000
commit262e9dcf36460d10194cc4d63e6cd615704b2c19 (patch)
treec86bffde8cf002bf79df2165297e39d488eb56d3 /sys/dev/msk
parent40d6bed8a77f26b0aff57adfabd77354abcde414 (diff)
Notes
Diffstat (limited to 'sys/dev/msk')
-rw-r--r--sys/dev/msk/if_msk.c38
-rw-r--r--sys/dev/msk/if_mskreg.h3
2 files changed, 29 insertions, 12 deletions
diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c
index 3ab8722d6645..f067247df8ee 100644
--- a/sys/dev/msk/if_msk.c
+++ b/sys/dev/msk/if_msk.c
@@ -2399,7 +2399,8 @@ msk_encap(struct msk_if_softc *sc_if, struct mbuf **m_head)
tcp_offset = offset = 0;
m = *m_head;
- if ((m->m_pkthdr.csum_flags & (MSK_CSUM_FEATURES | CSUM_TSO)) != 0) {
+ if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 &&
+ (m->m_pkthdr.csum_flags & (MSK_CSUM_FEATURES | CSUM_TSO)) != 0) {
/*
* Since mbuf has no protocol specific structure information
* in it we have to inspect protocol information here to
@@ -2526,11 +2527,18 @@ msk_encap(struct msk_if_softc *sc_if, struct mbuf **m_head)
/* Check TSO support. */
if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) {
- tso_mtu = offset + m->m_pkthdr.tso_segsz;
+ if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0)
+ tso_mtu = m->m_pkthdr.tso_segsz;
+ else
+ tso_mtu = offset + m->m_pkthdr.tso_segsz;
if (tso_mtu != sc_if->msk_cdata.msk_tso_mtu) {
tx_le = &sc_if->msk_rdata.msk_tx_ring[prod];
tx_le->msk_addr = htole32(tso_mtu);
- tx_le->msk_control = htole32(OP_LRGLEN | HW_OWNER);
+ if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0)
+ tx_le->msk_control = htole32(OP_MSS | HW_OWNER);
+ else
+ tx_le->msk_control =
+ htole32(OP_LRGLEN | HW_OWNER);
sc_if->msk_cdata.msk_tx_cnt++;
MSK_INC(prod, MSK_TX_RING_CNT);
sc_if->msk_cdata.msk_tso_mtu = tso_mtu;
@@ -2554,15 +2562,21 @@ msk_encap(struct msk_if_softc *sc_if, struct mbuf **m_head)
}
/* Check if we have to handle checksum offload. */
if (tso == 0 && (m->m_pkthdr.csum_flags & MSK_CSUM_FEATURES) != 0) {
- tx_le = &sc_if->msk_rdata.msk_tx_ring[prod];
- tx_le->msk_addr = htole32(((tcp_offset + m->m_pkthdr.csum_data)
- & 0xffff) | ((uint32_t)tcp_offset << 16));
- tx_le->msk_control = htole32(1 << 16 | (OP_TCPLISW | HW_OWNER));
- control = CALSUM | WR_SUM | INIT_SUM | LOCK_SUM;
- if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0)
- control |= UDPTCP;
- sc_if->msk_cdata.msk_tx_cnt++;
- MSK_INC(prod, MSK_TX_RING_CNT);
+ if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0)
+ control |= CALSUM;
+ else {
+ tx_le = &sc_if->msk_rdata.msk_tx_ring[prod];
+ tx_le->msk_addr = htole32(((tcp_offset +
+ m->m_pkthdr.csum_data) & 0xffff) |
+ ((uint32_t)tcp_offset << 16));
+ tx_le->msk_control = htole32(1 << 16 |
+ (OP_TCPLISW | HW_OWNER));
+ control = CALSUM | WR_SUM | INIT_SUM | LOCK_SUM;
+ if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0)
+ control |= UDPTCP;
+ sc_if->msk_cdata.msk_tx_cnt++;
+ MSK_INC(prod, MSK_TX_RING_CNT);
+ }
}
si = prod;
diff --git a/sys/dev/msk/if_mskreg.h b/sys/dev/msk/if_mskreg.h
index 660c7676d5c4..d32013c15cc0 100644
--- a/sys/dev/msk/if_mskreg.h
+++ b/sys/dev/msk/if_mskreg.h
@@ -2122,6 +2122,8 @@ struct msk_stat_desc {
#define OP_ADDR64VLAN (OP_ADDR64 | OP_VLAN)
#define OP_LRGLEN 0x24000000
#define OP_LRGLENVLAN (OP_LRGLEN | OP_VLAN)
+#define OP_MSS 0x28000000
+#define OP_MSSVLAN (OP_MSS | OP_VLAN)
#define OP_BUFFER 0x40000000
#define OP_PACKET 0x41000000
#define OP_LARGESEND 0x43000000
@@ -2386,6 +2388,7 @@ struct msk_if_softc {
#define MSK_FLAG_JUMBO 0x0008
#define MSK_FLAG_JUMBO_NOCSUM 0x0010
#define MSK_FLAG_RAMBUF 0x0020
+#define MSK_FLAG_DESCV2 0x0040
#define MSK_FLAG_SUSPEND 0x2000
#define MSK_FLAG_DETACH 0x4000
#define MSK_FLAG_LINK 0x8000