Commit 5ca3bc30 authored by Jay Cliburn's avatar Jay Cliburn Committed by Jeff Garzik

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: default avatarJay Cliburn <jacliburn@bellsouth.net>
Acked-by: default avatarChris Snook <csnook@redhat.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 401c0aab
...@@ -1347,16 +1347,17 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb, ...@@ -1347,16 +1347,17 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
u8 css, cso; u8 css, cso;
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
cso = skb_transport_offset(skb); css = (u8) (skb->csum_start - skb_headroom(skb));
css = cso + skb->csum_offset; cso = css + (u8) skb->csum_offset;
if (unlikely(cso & 0x1)) { if (unlikely(css & 0x1)) {
/* L1 hardware requires an even number here */
dev_printk(KERN_DEBUG, &adapter->pdev->dev, dev_printk(KERN_DEBUG, &adapter->pdev->dev,
"payload offset not an even number\n"); "payload offset not an even number\n");
return -1; return -1;
} }
ptpd->word3 |= (cso & TPD_PLOADOFFSET_MASK) << ptpd->word3 |= (css & TPD_PLOADOFFSET_MASK) <<
TPD_PLOADOFFSET_SHIFT; TPD_PLOADOFFSET_SHIFT;
ptpd->word3 |= (css & TPD_CCSUMOFFSET_MASK) << ptpd->word3 |= (cso & TPD_CCSUMOFFSET_MASK) <<
TPD_CCSUMOFFSET_SHIFT; TPD_CCSUMOFFSET_SHIFT;
ptpd->word3 |= 1 << TPD_CUST_CSUM_EN_SHIFT; ptpd->word3 |= 1 << TPD_CUST_CSUM_EN_SHIFT;
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment