Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/dev/pci Pull up revision 1.12 (requested by thorpej...



details:   https://anonhg.NetBSD.org/src/rev/7a3c8f593ba0
branches:  netbsd-1-6
changeset: 528386:7a3c8f593ba0
user:      lukem <lukem%NetBSD.org@localhost>
date:      Wed Jul 10 01:34:50 2002 +0000

description:
Pull up revision 1.12 (requested by thorpej in ticket #455):
* Shuffle the TODO list a bit.
* Fix outbound IPv4 header checksums (missing add of an offset).
* When enabling Rx TCP/UDP checksum offload, make sure that IPv4
  header checksum Rx offload is enabled on the chip, as well.

diffstat:

 sys/dev/pci/if_wm.c |  21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diffs (55 lines):

diff -r c650e618d8af -r 7a3c8f593ba0 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Wed Jul 10 01:26:44 2002 +0000
+++ b/sys/dev/pci/if_wm.c       Wed Jul 10 01:34:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.9.4.1 2002/07/10 01:26:44 lukem Exp $      */
+/*     $NetBSD: if_wm.c,v 1.9.4.2 2002/07/10 01:34:50 lukem Exp $      */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -41,18 +41,14 @@
  *
  * TODO (in order of importance):
  *
- *     - Fix hw VLAN assist.
- *
- *     - Make GMII work on the Livengood.
+ *     - Fix TCP/UDP checksums.
  *
- *     - Fix out-bound IP header checksums.
+ *     - Make GMII work on the i82543.
  *
- *     - Fix UDP checksums.
+ *     - Fix hw VLAN assist.
  *
  *     - Jumbo frames -- requires changes to network stack due to
  *       lame buffer length handling on chip.
- *
- * ...and, of course, performance tuning.
  */
 
 #include "bpfilter.h"
@@ -970,7 +966,7 @@
                WM_EVCNT_INCR(&sc->sc_ev_txipsum);
                fields |= htole32(WTX_IXSM);
                ipcs = htole32(WTX_TCPIP_IPCSS(offset) |
-                   WTX_TCPIP_IPCSO(offsetof(struct ip, ip_sum)) |
+                   WTX_TCPIP_IPCSO(offset + offsetof(struct ip, ip_sum)) |
                    WTX_TCPIP_IPCSE(offset + iphl - 1));
        } else
                ipcs = 0;
@@ -1964,9 +1960,12 @@
        else
                reg &= ~RXCSUM_IPOFL;
        if (ifp->if_capenable & (IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4))
-               reg |= RXCSUM_TUOFL;
-       else
+               reg |= RXCSUM_IPOFL | RXCSUM_TUOFL;
+       else {
                reg &= ~RXCSUM_TUOFL;
+               if ((ifp->if_capenable & IFCAP_CSUM_IPv4) == 0)
+                       reg &= ~RXCSUM_IPOFL;
+       }
        CSR_WRITE(sc, WMREG_RXCSUM, reg);
 
        /*



Home | Main Index | Thread Index | Old Index