summaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_main.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo2007-03-13 00:09:15 +0100
committerDavid S. Miller2007-04-26 07:25:07 +0200
commitc9bdd4b5257406b0608385d19c40b5511decf4f6 (patch)
treefe5319c322a11c0b00e7ef0473762a8d1961da83 /drivers/net/netxen/netxen_nic_main.c
parent[SK_BUFF] ipmr: Missed one conversion to skb_network_header() (diff)
downloadkernel-qcow2-linux-c9bdd4b5257406b0608385d19c40b5511decf4f6.tar.gz
kernel-qcow2-linux-c9bdd4b5257406b0608385d19c40b5511decf4f6.tar.xz
kernel-qcow2-linux-c9bdd4b5257406b0608385d19c40b5511decf4f6.zip
[IP]: Introduce ip_hdrlen()
For the common sequence "skb->nh.iph->ihl * 4", removing a good number of open coded skb->nh.iph uses, now to go after the rest... Just out of curiosity, here are the idioms found to get the same result: skb->nh.iph->ihl << 2 skb->nh.iph->ihl<<2 skb->nh.iph->ihl * 4 skb->nh.iph->ihl*4 (skb->nh.iph)->ihl * sizeof(u32) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r--drivers/net/netxen/netxen_nic_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 7d2525e76abb..b548a30e5c8e 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -41,6 +41,7 @@
#include <linux/dma-mapping.h>
#include <linux/vmalloc.h>
+#include <net/ip.h>
MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver");
MODULE_LICENSE("GPL");
@@ -778,9 +779,8 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
if (skb_shinfo(skb)->gso_size > 0) {
no_of_desc++;
- if (((skb->nh.iph)->ihl * sizeof(u32)) +
- ((skb->h.th)->doff * sizeof(u32)) +
- sizeof(struct ethhdr) >
+ if ((ip_hdrlen(skb) + skb->h.th->doff * 4 +
+ sizeof(struct ethhdr)) >
(sizeof(struct cmd_desc_type0) - 2)) {
no_of_desc++;
}