diff options
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 7d2525e76abb..ab25c225a07e 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -41,6 +41,7 @@ | |||
41 | 41 | ||
42 | #include <linux/dma-mapping.h> | 42 | #include <linux/dma-mapping.h> |
43 | #include <linux/vmalloc.h> | 43 | #include <linux/vmalloc.h> |
44 | #include <net/ip.h> | ||
44 | 45 | ||
45 | MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver"); | 46 | MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver"); |
46 | MODULE_LICENSE("GPL"); | 47 | MODULE_LICENSE("GPL"); |
@@ -778,9 +779,8 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
778 | if (skb_shinfo(skb)->gso_size > 0) { | 779 | if (skb_shinfo(skb)->gso_size > 0) { |
779 | 780 | ||
780 | no_of_desc++; | 781 | no_of_desc++; |
781 | if (((skb->nh.iph)->ihl * sizeof(u32)) + | 782 | if ((ip_hdrlen(skb) + tcp_hdrlen(skb) + |
782 | ((skb->h.th)->doff * sizeof(u32)) + | 783 | sizeof(struct ethhdr)) > |
783 | sizeof(struct ethhdr) > | ||
784 | (sizeof(struct cmd_desc_type0) - 2)) { | 784 | (sizeof(struct cmd_desc_type0) - 2)) { |
785 | no_of_desc++; | 785 | no_of_desc++; |
786 | } | 786 | } |
@@ -920,8 +920,10 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
920 | /* copy the next 64 bytes - should be enough except | 920 | /* copy the next 64 bytes - should be enough except |
921 | * for pathological case | 921 | * for pathological case |
922 | */ | 922 | */ |
923 | memcpy((void *)hwdesc, (void *)(skb->data) + | 923 | skb_copy_from_linear_data_offset(skb, first_hdr_len, |
924 | first_hdr_len, hdr_len - first_hdr_len); | 924 | hwdesc, |
925 | (hdr_len - | ||
926 | first_hdr_len)); | ||
925 | producer = get_next_index(producer, max_tx_desc_count); | 927 | producer = get_next_index(producer, max_tx_desc_count); |
926 | } | 928 | } |
927 | } | 929 | } |