diff options
author | Jay Cliburn <jacliburn@bellsouth.net> | 2008-02-03 04:50:08 +0300 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-17 14:49:25 +0300 |
commit | 5ca3bc3041b1cbbb3361a99bd666e907850a1a7a (patch) | |
tree | 003169a816afb1b433284bf3f08437af111ac4be /drivers/net/atlx | |
parent | 401c0aabec4b97320f962a0161a846d230a6f7aa (diff) | |
download | linux-5ca3bc3041b1cbbb3361a99bd666e907850a1a7a.tar.xz |
atl1: use csum_start
Use skb->csum_start for tx checksum offload preparation. Also swap
the variables css and cso so they hold the intended values of csum
start and offset, respectively.
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Acked-by: Chris Snook <csnook@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/atlx')
-rw-r--r-- | drivers/net/atlx/atl1.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index f4add3cafe24..99298222c8f6 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c @@ -1347,16 +1347,17 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb, u8 css, cso; if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { - cso = skb_transport_offset(skb); - css = cso + skb->csum_offset; - if (unlikely(cso & 0x1)) { + css = (u8) (skb->csum_start - skb_headroom(skb)); + cso = css + (u8) skb->csum_offset; + if (unlikely(css & 0x1)) { + /* L1 hardware requires an even number here */ dev_printk(KERN_DEBUG, &adapter->pdev->dev, "payload offset not an even number\n"); return -1; } - ptpd->word3 |= (cso & TPD_PLOADOFFSET_MASK) << + ptpd->word3 |= (css & TPD_PLOADOFFSET_MASK) << TPD_PLOADOFFSET_SHIFT; - ptpd->word3 |= (css & TPD_CCSUMOFFSET_MASK) << + ptpd->word3 |= (cso & TPD_CCSUMOFFSET_MASK) << TPD_CCSUMOFFSET_SHIFT; ptpd->word3 |= 1 << TPD_CUST_CSUM_EN_SHIFT; return true; |