Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src split IFCAP_CSUM_xxx to IFCAP_CSUM_xxx_Rx and IFCAP_CSUM_xxx...
details: https://anonhg.NetBSD.org/src/rev/5272672666ff
branches: trunk
changeset: 580658:5272672666ff
user: yamt <yamt%NetBSD.org@localhost>
date: Mon May 02 15:34:31 2005 +0000
description:
split IFCAP_CSUM_xxx to IFCAP_CSUM_xxx_Rx and IFCAP_CSUM_xxx_Tx.
diffstat:
sbin/ifconfig/ifconfig.8 | 86 +++++++++++++++++++++++++++++++----------------
sbin/ifconfig/ifconfig.c | 50 +++++++++++++++++++++------
sys/dev/i2o/iopl.c | 30 ++++++++++------
sys/dev/ic/elinkxl.c | 10 +++--
sys/dev/ic/gem.c | 9 ++--
sys/dev/ic/hme.c | 9 ++--
sys/dev/ic/i82557.c | 13 +++---
sys/dev/ic/rtl8169.c | 15 +++++---
sys/dev/pci/if_bge.c | 8 ++-
sys/dev/pci/if_dge.c | 14 ++++---
sys/dev/pci/if_sip.c | 30 ++++++++++------
sys/dev/pci/if_stge.c | 10 +++--
sys/dev/pci/if_ti.c | 42 ++++++++++++----------
sys/dev/pci/if_txp.c | 12 +++--
sys/dev/pci/if_vge.c | 10 +++--
sys/dev/pci/if_wm.c | 14 ++++---
sys/net/if.c | 30 ++++++++++------
sys/net/if.h | 37 +++++++++++++------
sys/net/if_vlan.c | 12 +++--
19 files changed, 277 insertions(+), 164 deletions(-)
diffs (truncated from 1059 to 300 lines):
diff -r 75d8174a27d5 -r 5272672666ff sbin/ifconfig/ifconfig.8
--- a/sbin/ifconfig/ifconfig.8 Mon May 02 15:32:18 2005 +0000
+++ b/sbin/ifconfig/ifconfig.8 Mon May 02 15:34:31 2005 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: ifconfig.8,v 1.76 2005/03/18 14:18:06 wiz Exp $
+.\" $NetBSD: ifconfig.8,v 1.77 2005/05/02 15:35:16 yamt Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -513,47 +513,75 @@
.Pq inet6 only
Set valid lifetime for the address.
.It Cm ip4csum
-Enable hardware-assisted IPv4 header checksums on interfaces that
-support it.
+Shorthand of
+.Dq ip4csum-tx ip4csum-rx
.It Cm -ip4csum
-Disable hardware-assisted IPv4 header checksums on interfaces that
-support it.
+Shorthand of
+.Dq -ip4csum-tx -ip4csum-rx
.It Cm tcp4csum
-Enable hardware-assisted TCP/IPv4 checksums on interfaces that
-support it.
+Shorthand of
+.Dq tcp4csum-tx tcp4csum-rx
.It Cm -tcp4csum
-Disable hardware-assisted TCP/IPv4 checksums on interfaces that
-support it.
+Shorthand of
+.Dq -tcp4csum-tx -tcp4csum-rx
.It Cm udp4csum
-Enable hardware-assisted UDP/IPv4 checksums on interfaces that
-support it.
+Shorthand of
+.Dq udp4csum-tx udp4csum-rx
.It Cm -udp4csum
-Disable hardware-assisted UDP/IPv4 checksums on interfaces that
-support it.
+Shorthand of
+.Dq -udp4csum-tx -udp4csum-rx
.It Cm tcp6csum
-Enable hardware-assisted TCP/IPv6 checksums on interfaces that
-support it.
+Shorthand of
+.Dq tcp6csum-tx tcp6csum-rx
.It Cm -tcp6csum
-Disable hardware-assisted TCP/IPv6 checksums on interfaces that
-support it.
+Shorthand of
+.Dq -tcp6csum-tx -tcp6csum-rx
.It Cm udp6csum
-Enable hardware-assisted UDP/IPv6 checksums on interfaces that
-support it.
+Shorthand of
+.Dq udp6csum-tx udp6csum-rx
.It Cm -udp6csum
-Disable hardware-assisted UDP/IPv6 checksums on interfaces that
-support it.
+Shorthand of
+.Dq -udp6csum-tx -udp6csum-rx
+.It Cm ip4csum-tx
+Enable hardware-assisted IPv4 header checksums for the out-bound direction.
+.It Cm -ip4csum-tx
+Disable hardware-assisted IPv4 header checksums for the out-bound direction.
+.It Cm ip4csum-rx
+Enable hardware-assisted IPv4 header checksums for the in-bound direction.
+.It Cm -ip4csum-rx
+Disable hardware-assisted IPv4 header checksums for the in-bound direction.
+.It Cm tcp4csum-tx
+Enable hardware-assisted TCP/IPv4 checksums for the out-bound direction.
+.It Cm -tcp4csum-tx
+Disable hardware-assisted TCP/IPv4 checksums for the out-bound direction.
.It Cm tcp4csum-rx
-Enable hardware-assisted TCP/IPv4 checksums on interfaces that
-support it only for the in-bound direction.
+Enable hardware-assisted TCP/IPv4 checksums for the in-bound direction.
.It Cm -tcp4csum-rx
-Disable hardware-assisted TCP/IPv4 checksums on interfaces that
-support it only for the in-bound direction.
+Disable hardware-assisted TCP/IPv4 checksums for the in-bound direction.
+.It Cm udp4csum-tx
+Enable hardware-assisted UDP/IPv4 checksums for the out-bound direction.
+.It Cm -udp4csum-tx
+Disable hardware-assisted UDP/IPv4 checksums for the out-bound direction.
.It Cm udp4csum-rx
-Enable hardware-assisted UDP/IPv4 checksums on interfaces that
-support it only for the in-bound direction.
+Enable hardware-assisted UDP/IPv4 checksums for the in-bound direction.
.It Cm -udp4csum-rx
-Disable hardware-assisted UDP/IPv4 checksums on interfaces that
-support it only for the in-bound direction.
+Disable hardware-assisted UDP/IPv4 checksums for the in-bound direction.
+.It Cm tcp6csum-tx
+Enable hardware-assisted TCP/IPv6 checksums for the out-bound direction.
+.It Cm -tcp6csum-tx
+Disable hardware-assisted TCP/IPv6 checksums for the out-bound direction.
+.It Cm tcp6csum-rx
+Enable hardware-assisted TCP/IPv6 checksums for the in-bound direction.
+.It Cm -tcp6csum-rx
+Disable hardware-assisted TCP/IPv6 checksums for the in-bound direction.
+.It Cm udp6csum-tx
+Enable hardware-assisted UDP/IPv6 checksums for the out-bound direction.
+.It Cm -udp6csum-tx
+Disable hardware-assisted UDP/IPv6 checksums for the out-bound direction.
+.It Cm udp6csum-rx
+Enable hardware-assisted UDP/IPv6 checksums for the in-bound direction.
+.It Cm -udp6csum-rx
+Disable hardware-assisted UDP/IPv6 checksums for the in-bound direction.
.It Cm tso4
Enable hardware-assisted TCP/IPv4 segmentation on interfaces that
support it.
diff -r 75d8174a27d5 -r 5272672666ff sbin/ifconfig/ifconfig.c
--- a/sbin/ifconfig/ifconfig.c Mon May 02 15:32:18 2005 +0000
+++ b/sbin/ifconfig/ifconfig.c Mon May 02 15:34:31 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ifconfig.c,v 1.167 2005/03/20 02:51:47 thorpej Exp $ */
+/* $NetBSD: ifconfig.c,v 1.168 2005/05/02 15:35:16 yamt Exp $ */
/*-
* Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
#if 0
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#else
-__RCSID("$NetBSD: ifconfig.c,v 1.167 2005/03/20 02:51:47 thorpej Exp $");
+__RCSID("$NetBSD: ifconfig.c,v 1.168 2005/05/02 15:35:16 yamt Exp $");
#endif
#endif /* not lint */
@@ -267,20 +267,46 @@
{ "mode", NEXTARG, A_MEDIAMODE, setmediamode },
{ "instance", NEXTARG, A_MEDIAINST, setmediainst },
{ "inst", NEXTARG, A_MEDIAINST, setmediainst },
- { "ip4csum", IFCAP_CSUM_IPv4,0, setifcaps },
- { "-ip4csum", -IFCAP_CSUM_IPv4,0, setifcaps },
- { "tcp4csum", IFCAP_CSUM_TCPv4,0, setifcaps },
- { "-tcp4csum", -IFCAP_CSUM_TCPv4,0, setifcaps },
- { "udp4csum", IFCAP_CSUM_UDPv4,0, setifcaps },
- { "-udp4csum", -IFCAP_CSUM_UDPv4,0, setifcaps },
- { "tcp6csum", IFCAP_CSUM_TCPv6,0, setifcaps },
- { "-tcp6csum", -IFCAP_CSUM_TCPv6,0, setifcaps },
- { "udp6csum", IFCAP_CSUM_UDPv6,0, setifcaps },
- { "-udp6csum", -IFCAP_CSUM_UDPv6,0, setifcaps },
+ { "ip4csum-tx", IFCAP_CSUM_IPv4_Tx,0, setifcaps },
+ { "-ip4csum-tx",-IFCAP_CSUM_IPv4_Tx,0, setifcaps },
+ { "ip4csum-rx", IFCAP_CSUM_IPv4_Rx,0, setifcaps },
+ { "-ip4csum-rx",-IFCAP_CSUM_IPv4_Rx,0, setifcaps },
+ { "tcp4csum-tx",IFCAP_CSUM_TCPv4_Tx,0, setifcaps },
+ { "-tcp4csum-tx",-IFCAP_CSUM_TCPv4_Tx,0, setifcaps },
{ "tcp4csum-rx",IFCAP_CSUM_TCPv4_Rx,0, setifcaps },
{ "-tcp4csum-rx",-IFCAP_CSUM_TCPv4_Rx,0, setifcaps },
+ { "udp4csum-tx",IFCAP_CSUM_UDPv4_Tx,0, setifcaps },
+ { "-udp4csum-tx",-IFCAP_CSUM_UDPv4_Tx,0, setifcaps },
{ "udp4csum-rx",IFCAP_CSUM_UDPv4_Rx,0, setifcaps },
{ "-udp4csum-rx",-IFCAP_CSUM_UDPv4_Rx,0, setifcaps },
+ { "tcp6csum-tx",IFCAP_CSUM_TCPv6_Tx,0, setifcaps },
+ { "-tcp6csum-tx",-IFCAP_CSUM_TCPv6_Tx,0, setifcaps },
+ { "tcp6csum-rx",IFCAP_CSUM_TCPv6_Rx,0, setifcaps },
+ { "-tcp6csum-rx",-IFCAP_CSUM_TCPv6_Rx,0, setifcaps },
+ { "udp6csum-tx",IFCAP_CSUM_UDPv6_Tx,0, setifcaps },
+ { "-udp6csum-tx",-IFCAP_CSUM_UDPv6_Tx,0, setifcaps },
+ { "udp6csum-rx",IFCAP_CSUM_UDPv6_Rx,0, setifcaps },
+ { "-udp6csum-rx",-IFCAP_CSUM_UDPv6_Rx,0, setifcaps },
+ { "ip4csum", IFCAP_CSUM_IPv4_Tx|IFCAP_CSUM_IPv4_Rx,
+ 0, setifcaps },
+ { "-ip4csum", -(IFCAP_CSUM_IPv4_Tx|IFCAP_CSUM_IPv4_Rx),
+ 0, setifcaps },
+ { "tcp4csum", IFCAP_CSUM_TCPv4_Tx|IFCAP_CSUM_TCPv4_Rx,
+ 0, setifcaps },
+ { "-tcp4csum", -(IFCAP_CSUM_TCPv4_Tx|IFCAP_CSUM_TCPv4_Rx),
+ 0, setifcaps },
+ { "udp4csum", IFCAP_CSUM_UDPv4_Tx|IFCAP_CSUM_UDPv4_Rx,
+ 0, setifcaps },
+ { "-udp4csum", -(IFCAP_CSUM_UDPv4_Tx|IFCAP_CSUM_UDPv4_Rx),
+ 0, setifcaps },
+ { "tcp6csum", IFCAP_CSUM_TCPv6_Tx|IFCAP_CSUM_TCPv6_Rx,
+ 0, setifcaps },
+ { "-tcp6csum", -(IFCAP_CSUM_TCPv6_Tx|IFCAP_CSUM_TCPv6_Rx),
+ 0, setifcaps },
+ { "udp6csum", IFCAP_CSUM_UDPv6_Tx|IFCAP_CSUM_UDPv6_Rx,
+ 0, setifcaps },
+ { "-udp6csum", -(IFCAP_CSUM_UDPv6_Tx|IFCAP_CSUM_UDPv6_Rx),
+ 0, setifcaps },
{ "tso4", IFCAP_TSOv4, 0, setifcaps },
{ "-tso4", -IFCAP_TSOv4, 0, setifcaps },
{ "agrport", NEXTARG, 0, agraddport } ,
diff -r 75d8174a27d5 -r 5272672666ff sys/dev/i2o/iopl.c
--- a/sys/dev/i2o/iopl.c Mon May 02 15:32:18 2005 +0000
+++ b/sys/dev/i2o/iopl.c Mon May 02 15:34:31 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iopl.c,v 1.17 2005/02/27 00:27:00 perry Exp $ */
+/* $NetBSD: iopl.c,v 1.18 2005/05/02 15:34:31 yamt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iopl.c,v 1.17 2005/02/27 00:27:00 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iopl.c,v 1.18 2005/05/02 15:34:31 yamt Exp $");
#include "opt_i2o.h"
#include "opt_inet.h"
@@ -356,11 +356,11 @@
if (((le32toh(iop->sc_status.segnumber) >> 12) & 15) ==
I2O_VERSION_20) {
if ((tmp & I2O_LAN_MODES_IPV4_CHECKSUM) != 0)
- ifcap |= IFCAP_CSUM_IPv4;
+ ifcap |= IFCAP_CSUM_IPv4_Tx|IFCAP_CSUM_IPv4_Rx;
if ((tmp & I2O_LAN_MODES_TCP_CHECKSUM) != 0)
- ifcap |= IFCAP_CSUM_TCPv4;
+ ifcap |= IFCAP_CSUM_TCPv4_Tx|IFCAP_CSUM_TCPv4_Rx;
if ((tmp & I2O_LAN_MODES_UDP_CHECKSUM) != 0)
- ifcap |= IFCAP_CSUM_UDPv4;
+ ifcap |= IFCAP_CSUM_UDPv4_Tx|IFCAP_CSUM_UDPv4_Rx;
#ifdef notyet
if ((tmp & I2O_LAN_MODES_ICMP_CHECKSUM) != 0)
ifcap |= IFCAP_CSUM_ICMP;
@@ -1360,6 +1360,7 @@
int rv, s, flg;
u_int8_t hwaddr[8];
u_int32_t txmode, rxmode;
+ uint64_t ifcap;
sc = ifp->if_softc;
iop = (struct iop_softc *)sc->sc_dv.dv_parent;
@@ -1413,24 +1414,31 @@
rxmode = 0;
txmode = 0;
- if ((ifp->if_capenable & IFCAP_CSUM_IPv4) != 0) {
+ ifcap = ifp->if_capenable;
+ if ((ifcap & IFCAP_CSUM_IPv4_Tx) != 0) {
sc->sc_tx_tcw |= I2O_LAN_TCW_CKSUM_NETWORK;
+ txmode |= I2O_LAN_MODES_IPV4_CHECKSUM;
+ }
+ if ((ifcap & IFCAP_CSUM_IPv4_Rx) != 0) {
sc->sc_rx_csumflgs |= M_CSUM_IPv4;
- txmode |= I2O_LAN_MODES_IPV4_CHECKSUM;
rxmode |= I2O_LAN_MODES_IPV4_CHECKSUM;
}
- if ((ifp->if_capenable & IFCAP_CSUM_TCPv4) != 0) {
+ if ((ifcap & IFCAP_CSUM_TCPv4_Tx) != 0) {
sc->sc_tx_tcw |= I2O_LAN_TCW_CKSUM_TRANSPORT;
+ txmode |= I2O_LAN_MODES_TCP_CHECKSUM;
+ }
+ if ((ifcap & IFCAP_CSUM_TCPv4_Rx) != 0) {
sc->sc_rx_csumflgs |= M_CSUM_TCPv4;
- txmode |= I2O_LAN_MODES_TCP_CHECKSUM;
rxmode |= I2O_LAN_MODES_TCP_CHECKSUM;
}
- if ((ifp->if_capenable & IFCAP_CSUM_UDPv4) != 0) {
+ if ((ifcap & IFCAP_CSUM_UDPv4_Tx) != 0) {
sc->sc_tx_tcw |= I2O_LAN_TCW_CKSUM_TRANSPORT;
+ txmode |= I2O_LAN_MODES_UDP_CHECKSUM;
+ }
+ if ((ifcap & IFCAP_CSUM_UDPv4_Rx) != 0) {
sc->sc_rx_csumflgs |= M_CSUM_UDPv4;
- txmode |= I2O_LAN_MODES_UDP_CHECKSUM;
rxmode |= I2O_LAN_MODES_TCP_CHECKSUM;
}
diff -r 75d8174a27d5 -r 5272672666ff sys/dev/ic/elinkxl.c
--- a/sys/dev/ic/elinkxl.c Mon May 02 15:32:18 2005 +0000
+++ b/sys/dev/ic/elinkxl.c Mon May 02 15:34:31 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: elinkxl.c,v 1.79 2005/02/27 00:27:01 perry Exp $ */
+/* $NetBSD: elinkxl.c,v 1.80 2005/05/02 15:34:31 yamt Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.79 2005/02/27 00:27:01 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.80 2005/05/02 15:34:31 yamt Exp $");
#include "bpfilter.h"
#include "rnd.h"
@@ -439,8 +439,10 @@
* The 3c90xB has hardware IPv4/TCPv4/UDPv4 checksum support.
*/
if (sc->ex_conf & EX_CONF_90XB)
- sc->sc_ethercom.ec_if.if_capabilities |= IFCAP_CSUM_IPv4 |
- IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
+ sc->sc_ethercom.ec_if.if_capabilities |=
+ IFCAP_CSUM_IPv4_Tx | IFCAP_CSUM_IPv4_Rx |
+ IFCAP_CSUM_TCPv4_Tx | IFCAP_CSUM_TCPv4_Rx |
+ IFCAP_CSUM_UDPv4_Tx | IFCAP_CSUM_UDPv4_Rx;
if_attach(ifp);
ether_ifattach(ifp, macaddr);
diff -r 75d8174a27d5 -r 5272672666ff sys/dev/ic/gem.c
--- a/sys/dev/ic/gem.c Mon May 02 15:32:18 2005 +0000
Home |
Main Index |
Thread Index |
Old Index