aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
commit49e1900d4cc2e7bcecb681fe60f0990bec2dcce8 (patch)
tree253801ebf57e0a23856a2c7be129c2c178f62fdf /drivers/net/bnx2.c
parent34f6d749c0a328817d5e36274e53121c1db734dc (diff)
parentb9099ff63c75216d6ca10bce5a1abcd9293c27e6 (diff)
Merge branch 'linux-2.6' into for-2.6.22
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r--drivers/net/bnx2.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 0b7aded8dcfd..f98a2205a090 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -54,8 +54,8 @@
54 54
55#define DRV_MODULE_NAME "bnx2" 55#define DRV_MODULE_NAME "bnx2"
56#define PFX DRV_MODULE_NAME ": " 56#define PFX DRV_MODULE_NAME ": "
57#define DRV_MODULE_VERSION "1.5.7" 57#define DRV_MODULE_VERSION "1.5.8"
58#define DRV_MODULE_RELDATE "March 29, 2007" 58#define DRV_MODULE_RELDATE "April 24, 2007"
59 59
60#define RUN_AT(x) (jiffies + (x)) 60#define RUN_AT(x) (jiffies + (x))
61 61
@@ -1884,10 +1884,8 @@ bnx2_rx_int(struct bnx2 *bp, int budget)
1884 goto reuse_rx; 1884 goto reuse_rx;
1885 1885
1886 /* aligned copy */ 1886 /* aligned copy */
1887 memcpy(new_skb->data, 1887 skb_copy_from_linear_data_offset(skb, bp->rx_offset - 2,
1888 skb->data + bp->rx_offset - 2, 1888 new_skb->data, len + 2);
1889 len + 2);
1890
1891 skb_reserve(new_skb, 2); 1889 skb_reserve(new_skb, 2);
1892 skb_put(new_skb, len); 1890 skb_put(new_skb, len);
1893 1891
@@ -3421,6 +3419,9 @@ bnx2_init_chip(struct bnx2 *bp)
3421 val = REG_RD(bp, BNX2_MQ_CONFIG); 3419 val = REG_RD(bp, BNX2_MQ_CONFIG);
3422 val &= ~BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE; 3420 val &= ~BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE;
3423 val |= BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE_256; 3421 val |= BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE_256;
3422 if (CHIP_ID(bp) == CHIP_ID_5709_A0 || CHIP_ID(bp) == CHIP_ID_5709_A1)
3423 val |= BNX2_MQ_CONFIG_HALT_DIS;
3424
3424 REG_WR(bp, BNX2_MQ_CONFIG, val); 3425 REG_WR(bp, BNX2_MQ_CONFIG, val);
3425 3426
3426 val = 0x10000 + (MAX_CID_CNT * MB_KERNEL_CTX_SIZE); 3427 val = 0x10000 + (MAX_CID_CNT * MB_KERNEL_CTX_SIZE);
@@ -4510,6 +4511,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
4510 if ((mss = skb_shinfo(skb)->gso_size) && 4511 if ((mss = skb_shinfo(skb)->gso_size) &&
4511 (skb->len > (bp->dev->mtu + ETH_HLEN))) { 4512 (skb->len > (bp->dev->mtu + ETH_HLEN))) {
4512 u32 tcp_opt_len, ip_tcp_len; 4513 u32 tcp_opt_len, ip_tcp_len;
4514 struct iphdr *iph;
4513 4515
4514 if (skb_header_cloned(skb) && 4516 if (skb_header_cloned(skb) &&
4515 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { 4517 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
@@ -4517,25 +4519,23 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
4517 return NETDEV_TX_OK; 4519 return NETDEV_TX_OK;
4518 } 4520 }
4519 4521
4520 tcp_opt_len = ((skb->h.th->doff - 5) * 4);
4521 vlan_tag_flags |= TX_BD_FLAGS_SW_LSO; 4522 vlan_tag_flags |= TX_BD_FLAGS_SW_LSO;
4522 4523
4523 tcp_opt_len = 0; 4524 tcp_opt_len = 0;
4524 if (skb->h.th->doff > 5) { 4525 if (tcp_hdr(skb)->doff > 5)
4525 tcp_opt_len = (skb->h.th->doff - 5) << 2; 4526 tcp_opt_len = tcp_optlen(skb);
4526 } 4527
4527 ip_tcp_len = (skb->nh.iph->ihl << 2) + sizeof(struct tcphdr); 4528 ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr);
4528 4529
4529 skb->nh.iph->check = 0; 4530 iph = ip_hdr(skb);
4530 skb->nh.iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); 4531 iph->check = 0;
4531 skb->h.th->check = 4532 iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len);
4532 ~csum_tcpudp_magic(skb->nh.iph->saddr, 4533 tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
4533 skb->nh.iph->daddr, 4534 iph->daddr, 0,
4534 0, IPPROTO_TCP, 0); 4535 IPPROTO_TCP, 0);
4535 4536 if (tcp_opt_len || (iph->ihl > 5)) {
4536 if (tcp_opt_len || (skb->nh.iph->ihl > 5)) { 4537 vlan_tag_flags |= ((iph->ihl - 5) +
4537 vlan_tag_flags |= ((skb->nh.iph->ihl - 5) + 4538 (tcp_opt_len >> 2)) << 8;
4538 (tcp_opt_len >> 2)) << 8;
4539 } 4539 }
4540 } 4540 }
4541 else 4541 else