fixv6sum fixv6csum
authorGuo-Fu Tseng <cooldavid@cooldavid.org>
Wed, 8 Jun 2011 13:05:31 +0000 (21:05 +0800)
committerGuo-Fu Tseng <cooldavid@cooldavid.org>
Wed, 8 Jun 2011 13:05:31 +0000 (21:05 +0800)
jme.c
jme.h

diff --git a/jme.c b/jme.c
index b883dc2..387434c 100644 (file)
--- a/jme.c
+++ b/jme.c
@@ -994,6 +994,16 @@ jme_rxsum_ok(struct jme_adapter *jme, u16 flags, struct sk_buff *skb)
        if (!(flags & (RXWBFLAG_TCPON | RXWBFLAG_UDPON | RXWBFLAG_IPV4)))
                return false;
 
+               /*              Hardware Workaround     , packet is IPv6 but checksum fail              */
+       if (flags & RXWBFLAG_IPV6) {
+       
+               printk("this is IPV6  packet : len=%d ", skb->len);
+               if ((flags & RXWBFLAG_TCPON) && (!(flags & RXWBFLAG_TCPCS)))
+                       return false;
+               if ((flags & RXWBFLAG_UDPON) && (!(flags & RXWBFLAG_UDPCS)))
+                       return false;
+       }
+       
        if (unlikely((flags & (RXWBFLAG_MF | RXWBFLAG_TCPON | RXWBFLAG_TCPCS))
                        == RXWBFLAG_TCPON)) {
                if (flags & RXWBFLAG_IPV4)
@@ -1058,7 +1068,8 @@ jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx)
 #else
                        skb_checksum_none_assert(skb);
 #endif
-
+               printk("flag=%04x , skb->ip_summed =%d \n",le16_to_cpu(rxdesc->descwb.flags), skb->ip_summed);
+               
                if (rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_TAGON)) {
                        if (jme->vlgrp) {
                                jme->jme_vlan_rx(skb, jme->vlgrp,
@@ -1765,7 +1776,7 @@ jme_phy_off(struct jme_adapter *jme)
        jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_BMCR, bmcr);
 
        if (new_phy_power_ctrl(jme->chip_main_rev))
-               jme_new_phy_off(jme);
+               jme_new_phy_off(jme); 
 }
 
 static int
@@ -2448,6 +2459,8 @@ jme_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p)
        p32 += 0x100 >> 2;
        mmapio_memcpy(jme, p32, JME_MISC, JME_MISC_LEN);
 
+        printk("===jread32=%x===\n",jread32(jme, JME_EXGP2));
+
        p32 += 0x100 >> 2;
        mmapio_memcpy(jme, p32, JME_RSS, JME_RSS_LEN);
 
@@ -3032,7 +3045,7 @@ jme_init_one(struct pci_dev *pdev,
        struct net_device *netdev;
        struct jme_adapter *jme;
        u16 bmcr, bmsr;
-       u32 apmc;
+       u32 apmc, phy_gp2;
 
        /*
         * set up PCI device basics
@@ -3248,6 +3261,11 @@ jme_init_one(struct pci_dev *pdev,
        }
        jme_load_macaddr(netdev);
 
+       phy_gp2 = jread32(jme, JME_EXGP2)|FIX_IPV6_CHECKSUM;
+       jwrite32(jme, JME_EXGP2,phy_gp2);
+       wmb();
+       printk("==%x=====\n", jread32(jme, JME_EXGP2)); 
+
        /*
         * Tell stack that we are not ready to work until open()
         */
diff --git a/jme.h b/jme.h
index 2a466bc..fff5d6b 100644 (file)
--- a/jme.h
+++ b/jme.h
@@ -638,7 +638,7 @@ enum jme_iomap_offsets {
 
 enum jme_iomap_lens {
        JME_MAC_LEN     = 0x80,
-       JME_PHY_LEN     = 0x58,
+       JME_PHY_LEN     = 0x70,
        JME_MISC_LEN    = 0x98,
        JME_RSS_LEN     = 0xFF,
 };
@@ -676,7 +676,7 @@ enum jme_iomap_regs {
        JME_PHY_LINK    = JME_PHY | 0x30, /* PHY Link Status Register */
        JME_SMBCSR      = JME_PHY | 0x40, /* SMB Control and Status */
        JME_SMBINTF     = JME_PHY | 0x44, /* SMB Interface */
-
+       JME_EXGP2       = JME_PHY | 0x60, /* General Purpose */                 //Aries undo
 
        JME_TMCSR       = JME_MISC | 0x00, /* Timer Control/Status Register */
        JME_GPREG0      = JME_MISC | 0x08, /* General purpose REG-0 */
@@ -943,6 +943,10 @@ enum jme_smi_bit_shift {
        SMI_REG_ADDR_SHIFT      = 11,
        SMI_PHY_ADDR_SHIFT      = 6,
 };
+//Aries undo
+enum jme_phy_GeneralPurpose_bit {
+       FIX_IPV6_CHECKSUM               = 0x40000000,
+};
 
 static inline u32 smi_reg_addr(int x)
 {