aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-18 20:43:48 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:24 -0400
commitab6a5bb6b28a970104a34f0f6959b73cf61bdc72 (patch)
tree54cfa7d4fe00d0c28a60022b075afc0856d6fc2b /drivers/net/netxen
parent88c7664f13bd1a36acb8566b93892a4c58759ac6 (diff)
[TCP]: Introduce tcp_hdrlen() and tcp_optlen()
The ip_hdrlen() buddy, created to reduce the number of skb->h.th-> uses and to avoid the longer, open coded equivalent. Ditched a no-op in bnx2 in the process. I wonder if we should have a BUG_ON(skb->h.th->doff < 5) in tcp_optlen()... 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')
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c3
-rw-r--r--drivers/net/netxen/netxen_nic_main.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 09ca2192cbfa..0fba8f190762 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -374,8 +374,7 @@ void netxen_tso_check(struct netxen_adapter *adapter,
374{ 374{
375 if (desc->mss) { 375 if (desc->mss) {
376 desc->total_hdr_length = (sizeof(struct ethhdr) + 376 desc->total_hdr_length = (sizeof(struct ethhdr) +
377 ip_hdrlen(skb) + 377 ip_hdrlen(skb) + tcp_hdrlen(skb));
378 skb->h.th->doff * 4);
379 netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO); 378 netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO);
380 } else if (skb->ip_summed == CHECKSUM_PARTIAL) { 379 } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
381 if (ip_hdr(skb)->protocol == IPPROTO_TCP) { 380 if (ip_hdr(skb)->protocol == IPPROTO_TCP) {
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index b548a30e5c8e..b488e94bc4c0 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -779,7 +779,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
779 if (skb_shinfo(skb)->gso_size > 0) { 779 if (skb_shinfo(skb)->gso_size > 0) {
780 780
781 no_of_desc++; 781 no_of_desc++;
782 if ((ip_hdrlen(skb) + skb->h.th->doff * 4 + 782 if ((ip_hdrlen(skb) + tcp_hdrlen(skb) +
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++;