aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/atl1
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-25 20:55:53 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:16 -0400
commitea2ae17d6443abddc79480dc9f7af8feacabddc4 (patch)
tree2d6f48a5e4a40f761b5b510af9aac1fca55004cb /drivers/net/atl1
parentbadff6d01a8589a1c828b0bf118903ca38627f4e (diff)
[SK_BUFF]: Introduce skb_transport_offset()
For the quite common 'skb->h.raw - skb->data' sequence. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/atl1')
-rw-r--r--drivers/net/atl1/atl1_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index d2be79a30f8a..c26f8ce320e6 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1326,8 +1326,8 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
1326 u8 css, cso; 1326 u8 css, cso;
1327 1327
1328 if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { 1328 if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
1329 cso = skb->h.raw - skb->data; 1329 cso = skb_transport_offset(skb);
1330 css = (skb->h.raw + skb->csum_offset) - skb->data; 1330 css = cso + skb->csum;
1331 if (unlikely(cso & 0x1)) { 1331 if (unlikely(cso & 0x1)) {
1332 printk(KERN_DEBUG "%s: payload offset != even number\n", 1332 printk(KERN_DEBUG "%s: payload offset != even number\n",
1333 atl1_driver_name); 1333 atl1_driver_name);
@@ -1369,8 +1369,8 @@ static void atl1_tx_map(struct atl1_adapter *adapter,
1369 1369
1370 if (tcp_seg) { 1370 if (tcp_seg) {
1371 /* TSO/GSO */ 1371 /* TSO/GSO */
1372 proto_hdr_len = 1372 proto_hdr_len = (skb_transport_offset(skb) +
1373 ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); 1373 (skb->h.th->doff << 2));
1374 buffer_info->length = proto_hdr_len; 1374 buffer_info->length = proto_hdr_len;
1375 page = virt_to_page(skb->data); 1375 page = virt_to_page(skb->data);
1376 offset = (unsigned long)skb->data & ~PAGE_MASK; 1376 offset = (unsigned long)skb->data & ~PAGE_MASK;
@@ -1562,7 +1562,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1562 mss = skb_shinfo(skb)->gso_size; 1562 mss = skb_shinfo(skb)->gso_size;
1563 if (mss) { 1563 if (mss) {
1564 if (skb->protocol == htons(ETH_P_IP)) { 1564 if (skb->protocol == htons(ETH_P_IP)) {
1565 proto_hdr_len = ((skb->h.raw - skb->data) + 1565 proto_hdr_len = (skb_transport_offset(skb) +
1566 (skb->h.th->doff << 2)); 1566 (skb->h.th->doff << 2));
1567 if (unlikely(proto_hdr_len > len)) { 1567 if (unlikely(proto_hdr_len > len)) {
1568 dev_kfree_skb_any(skb); 1568 dev_kfree_skb_any(skb);