X-Git-Url: http://bbs.cooldavid.org/git/?a=blobdiff_plain;f=jme.c;h=4e4613a3dc2ffd80c765ee3d13d56dcc78cda5fd;hb=refs%2Ftags%2Fbp-1.0.8.1;hp=ab6e154f466d636700443f26c7176a2fc8e94f05;hpb=e3b96dc93cf64b2ad559c7682f60a7596f655dbf;p=jme.git diff --git a/jme.c b/jme.c index ab6e154..4e4613a 100644 --- a/jme.c +++ b/jme.c @@ -59,6 +59,7 @@ module_param(no_extplug, int, 0); MODULE_PARM_DESC(no_extplug, "Do not use external plug signal for pseudo hot-plug."); +#ifndef JME_NEW_PM_API static void jme_pci_wakeup_enable(struct jme_adapter *jme, int enable) { @@ -71,6 +72,7 @@ jme_pci_wakeup_enable(struct jme_adapter *jme, int enable) pci_pme_active(jme->pdev, enable); #endif } +#endif static int jme_mdio_read(struct net_device *netdev, int phy, int reg) @@ -977,11 +979,29 @@ static u16 jme_udpsum(struct sk_buff *skb) { u16 csum = 0xFFFFu; +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21) + struct iphdr *iph; + int iphlen; + struct udphdr *udph; +#endif if (skb->len < (ETH_HLEN + sizeof(struct iphdr))) return csum; if (skb->protocol != htons(ETH_P_IP)) return csum; +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21) + iph = (struct iphdr *)skb_pull(skb, ETH_HLEN); + iphlen = (iph->ihl << 2); + if ((iph->protocol != IPPROTO_UDP) || + (skb->len < (iphlen + sizeof(struct udphdr)))) { + skb_push(skb, ETH_HLEN); + return csum; + } + udph = (struct udphdr *)skb_pull(skb, iphlen); + csum = udph->check; + skb_push(skb, iphlen); + skb_push(skb, ETH_HLEN); +#else skb_set_network_header(skb, ETH_HLEN); if ((ip_hdr(skb)->protocol != IPPROTO_UDP) || (skb->len < (ETH_HLEN + @@ -995,6 +1015,7 @@ jme_udpsum(struct sk_buff *skb) csum = udp_hdr(skb)->check; skb_reset_transport_header(skb); skb_reset_network_header(skb); +#endif return csum; }