aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 18:29:27 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 18:29:27 -0500
commit554f593d6c411e717a71ffdcb0cfb46bb2394502 (patch)
tree338e1629408a66cfc84d199c18deb22c6e682c22 /drivers/net
parentdebf798b1ed82053689d900670eb27fb2f1b4bd3 (diff)
parent95381c893dd71a534ab56f09b12a4e2118aa0f32 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [TG3]: Update driver version and reldate. [TG3]: Add 5755 nvram support [TG3]: Add 5755 support [IPV6]: ip6_xmit: remove unnecessary NULL ptr check [NET_SCHED]: cls_u32: remove unnecessary NULL-ptr check [IPV4]: Add fib rule netlink notifications [BNX2]: Update version and reldate [BNX2]: Separate tx producer and consumer fields [BNX2]: Move .h files to bnx2.c [BNX2]: Combine small mem allocations [BNX2]: Fix link change handling [PKTGEN]: Add MPLS extension.
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bnx2.c108
-rw-r--r--drivers/net/bnx2.h62
-rw-r--r--drivers/net/tg3.c84
-rw-r--r--drivers/net/tg3.h9
4 files changed, 173 insertions, 90 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 7d213707008a..2671da20a496 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -9,13 +9,54 @@
9 * Written by: Michael Chan (mchan@broadcom.com) 9 * Written by: Michael Chan (mchan@broadcom.com)
10 */ 10 */
11 11
12#include <linux/config.h>
13
14#include <linux/module.h>
15#include <linux/moduleparam.h>
16
17#include <linux/kernel.h>
18#include <linux/timer.h>
19#include <linux/errno.h>
20#include <linux/ioport.h>
21#include <linux/slab.h>
22#include <linux/vmalloc.h>
23#include <linux/interrupt.h>
24#include <linux/pci.h>
25#include <linux/init.h>
26#include <linux/netdevice.h>
27#include <linux/etherdevice.h>
28#include <linux/skbuff.h>
29#include <linux/dma-mapping.h>
30#include <asm/bitops.h>
31#include <asm/io.h>
32#include <asm/irq.h>
33#include <linux/delay.h>
34#include <asm/byteorder.h>
35#include <linux/time.h>
36#include <linux/ethtool.h>
37#include <linux/mii.h>
38#ifdef NETIF_F_HW_VLAN_TX
39#include <linux/if_vlan.h>
40#define BCM_VLAN 1
41#endif
42#ifdef NETIF_F_TSO
43#include <net/ip.h>
44#include <net/tcp.h>
45#include <net/checksum.h>
46#define BCM_TSO 1
47#endif
48#include <linux/workqueue.h>
49#include <linux/crc32.h>
50#include <linux/prefetch.h>
51#include <linux/cache.h>
52
12#include "bnx2.h" 53#include "bnx2.h"
13#include "bnx2_fw.h" 54#include "bnx2_fw.h"
14 55
15#define DRV_MODULE_NAME "bnx2" 56#define DRV_MODULE_NAME "bnx2"
16#define PFX DRV_MODULE_NAME ": " 57#define PFX DRV_MODULE_NAME ": "
17#define DRV_MODULE_VERSION "1.4.38" 58#define DRV_MODULE_VERSION "1.4.39"
18#define DRV_MODULE_RELDATE "February 10, 2006" 59#define DRV_MODULE_RELDATE "March 22, 2006"
19 60
20#define RUN_AT(x) (jiffies + (x)) 61#define RUN_AT(x) (jiffies + (x))
21 62
@@ -313,8 +354,6 @@ bnx2_disable_int(struct bnx2 *bp)
313static void 354static void
314bnx2_enable_int(struct bnx2 *bp) 355bnx2_enable_int(struct bnx2 *bp)
315{ 356{
316 u32 val;
317
318 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, 357 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
319 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | 358 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
320 BNX2_PCICFG_INT_ACK_CMD_MASK_INT | bp->last_status_idx); 359 BNX2_PCICFG_INT_ACK_CMD_MASK_INT | bp->last_status_idx);
@@ -322,8 +361,7 @@ bnx2_enable_int(struct bnx2 *bp)
322 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, 361 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
323 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | bp->last_status_idx); 362 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | bp->last_status_idx);
324 363
325 val = REG_RD(bp, BNX2_HC_COMMAND); 364 REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW);
326 REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW);
327} 365}
328 366
329static void 367static void
@@ -362,15 +400,11 @@ bnx2_free_mem(struct bnx2 *bp)
362{ 400{
363 int i; 401 int i;
364 402
365 if (bp->stats_blk) {
366 pci_free_consistent(bp->pdev, sizeof(struct statistics_block),
367 bp->stats_blk, bp->stats_blk_mapping);
368 bp->stats_blk = NULL;
369 }
370 if (bp->status_blk) { 403 if (bp->status_blk) {
371 pci_free_consistent(bp->pdev, sizeof(struct status_block), 404 pci_free_consistent(bp->pdev, bp->status_stats_size,
372 bp->status_blk, bp->status_blk_mapping); 405 bp->status_blk, bp->status_blk_mapping);
373 bp->status_blk = NULL; 406 bp->status_blk = NULL;
407 bp->stats_blk = NULL;
374 } 408 }
375 if (bp->tx_desc_ring) { 409 if (bp->tx_desc_ring) {
376 pci_free_consistent(bp->pdev, 410 pci_free_consistent(bp->pdev,
@@ -395,14 +429,13 @@ bnx2_free_mem(struct bnx2 *bp)
395static int 429static int
396bnx2_alloc_mem(struct bnx2 *bp) 430bnx2_alloc_mem(struct bnx2 *bp)
397{ 431{
398 int i; 432 int i, status_blk_size;
399 433
400 bp->tx_buf_ring = kmalloc(sizeof(struct sw_bd) * TX_DESC_CNT, 434 bp->tx_buf_ring = kzalloc(sizeof(struct sw_bd) * TX_DESC_CNT,
401 GFP_KERNEL); 435 GFP_KERNEL);
402 if (bp->tx_buf_ring == NULL) 436 if (bp->tx_buf_ring == NULL)
403 return -ENOMEM; 437 return -ENOMEM;
404 438
405 memset(bp->tx_buf_ring, 0, sizeof(struct sw_bd) * TX_DESC_CNT);
406 bp->tx_desc_ring = pci_alloc_consistent(bp->pdev, 439 bp->tx_desc_ring = pci_alloc_consistent(bp->pdev,
407 sizeof(struct tx_bd) * 440 sizeof(struct tx_bd) *
408 TX_DESC_CNT, 441 TX_DESC_CNT,
@@ -428,21 +461,22 @@ bnx2_alloc_mem(struct bnx2 *bp)
428 461
429 } 462 }
430 463
431 bp->status_blk = pci_alloc_consistent(bp->pdev, 464 /* Combine status and statistics blocks into one allocation. */
432 sizeof(struct status_block), 465 status_blk_size = L1_CACHE_ALIGN(sizeof(struct status_block));
466 bp->status_stats_size = status_blk_size +
467 sizeof(struct statistics_block);
468
469 bp->status_blk = pci_alloc_consistent(bp->pdev, bp->status_stats_size,
433 &bp->status_blk_mapping); 470 &bp->status_blk_mapping);
434 if (bp->status_blk == NULL) 471 if (bp->status_blk == NULL)
435 goto alloc_mem_err; 472 goto alloc_mem_err;
436 473
437 memset(bp->status_blk, 0, sizeof(struct status_block)); 474 memset(bp->status_blk, 0, bp->status_stats_size);
438 475
439 bp->stats_blk = pci_alloc_consistent(bp->pdev, 476 bp->stats_blk = (void *) ((unsigned long) bp->status_blk +
440 sizeof(struct statistics_block), 477 status_blk_size);
441 &bp->stats_blk_mapping);
442 if (bp->stats_blk == NULL)
443 goto alloc_mem_err;
444 478
445 memset(bp->stats_blk, 0, sizeof(struct statistics_block)); 479 bp->stats_blk_mapping = bp->status_blk_mapping + status_blk_size;
446 480
447 return 0; 481 return 0;
448 482
@@ -1926,6 +1960,13 @@ bnx2_poll(struct net_device *dev, int *budget)
1926 spin_lock(&bp->phy_lock); 1960 spin_lock(&bp->phy_lock);
1927 bnx2_phy_int(bp); 1961 bnx2_phy_int(bp);
1928 spin_unlock(&bp->phy_lock); 1962 spin_unlock(&bp->phy_lock);
1963
1964 /* This is needed to take care of transient status
1965 * during link changes.
1966 */
1967 REG_WR(bp, BNX2_HC_COMMAND,
1968 bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
1969 REG_RD(bp, BNX2_HC_COMMAND);
1929 } 1970 }
1930 1971
1931 if (bp->status_blk->status_tx_quick_consumer_index0 != bp->hw_tx_cons) 1972 if (bp->status_blk->status_tx_quick_consumer_index0 != bp->hw_tx_cons)
@@ -3307,6 +3348,8 @@ bnx2_init_chip(struct bnx2 *bp)
3307 3348
3308 udelay(20); 3349 udelay(20);
3309 3350
3351 bp->hc_cmd = REG_RD(bp, BNX2_HC_COMMAND);
3352
3310 return rc; 3353 return rc;
3311} 3354}
3312 3355
@@ -3746,7 +3789,6 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)
3746 struct sk_buff *skb, *rx_skb; 3789 struct sk_buff *skb, *rx_skb;
3747 unsigned char *packet; 3790 unsigned char *packet;
3748 u16 rx_start_idx, rx_idx; 3791 u16 rx_start_idx, rx_idx;
3749 u32 val;
3750 dma_addr_t map; 3792 dma_addr_t map;
3751 struct tx_bd *txbd; 3793 struct tx_bd *txbd;
3752 struct sw_bd *rx_buf; 3794 struct sw_bd *rx_buf;
@@ -3777,8 +3819,9 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)
3777 map = pci_map_single(bp->pdev, skb->data, pkt_size, 3819 map = pci_map_single(bp->pdev, skb->data, pkt_size,
3778 PCI_DMA_TODEVICE); 3820 PCI_DMA_TODEVICE);
3779 3821
3780 val = REG_RD(bp, BNX2_HC_COMMAND); 3822 REG_WR(bp, BNX2_HC_COMMAND,
3781 REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW_WO_INT); 3823 bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
3824
3782 REG_RD(bp, BNX2_HC_COMMAND); 3825 REG_RD(bp, BNX2_HC_COMMAND);
3783 3826
3784 udelay(5); 3827 udelay(5);
@@ -3802,8 +3845,9 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)
3802 3845
3803 udelay(100); 3846 udelay(100);
3804 3847
3805 val = REG_RD(bp, BNX2_HC_COMMAND); 3848 REG_WR(bp, BNX2_HC_COMMAND,
3806 REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW_WO_INT); 3849 bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
3850
3807 REG_RD(bp, BNX2_HC_COMMAND); 3851 REG_RD(bp, BNX2_HC_COMMAND);
3808 3852
3809 udelay(5); 3853 udelay(5);
@@ -3939,7 +3983,6 @@ static int
3939bnx2_test_intr(struct bnx2 *bp) 3983bnx2_test_intr(struct bnx2 *bp)
3940{ 3984{
3941 int i; 3985 int i;
3942 u32 val;
3943 u16 status_idx; 3986 u16 status_idx;
3944 3987
3945 if (!netif_running(bp->dev)) 3988 if (!netif_running(bp->dev))
@@ -3948,8 +3991,7 @@ bnx2_test_intr(struct bnx2 *bp)
3948 status_idx = REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD) & 0xffff; 3991 status_idx = REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD) & 0xffff;
3949 3992
3950 /* This register is not touched during run-time. */ 3993 /* This register is not touched during run-time. */
3951 val = REG_RD(bp, BNX2_HC_COMMAND); 3994 REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW);
3952 REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW);
3953 REG_RD(bp, BNX2_HC_COMMAND); 3995 REG_RD(bp, BNX2_HC_COMMAND);
3954 3996
3955 for (i = 0; i < 10; i++) { 3997 for (i = 0; i < 10; i++) {
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index fd4b7f2eb477..b87925f6a228 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -13,46 +13,6 @@
13#ifndef BNX2_H 13#ifndef BNX2_H
14#define BNX2_H 14#define BNX2_H
15 15
16#include <linux/config.h>
17
18#include <linux/module.h>
19#include <linux/moduleparam.h>
20
21#include <linux/kernel.h>
22#include <linux/timer.h>
23#include <linux/errno.h>
24#include <linux/ioport.h>
25#include <linux/slab.h>
26#include <linux/vmalloc.h>
27#include <linux/interrupt.h>
28#include <linux/pci.h>
29#include <linux/init.h>
30#include <linux/netdevice.h>
31#include <linux/etherdevice.h>
32#include <linux/skbuff.h>
33#include <linux/dma-mapping.h>
34#include <asm/bitops.h>
35#include <asm/io.h>
36#include <asm/irq.h>
37#include <linux/delay.h>
38#include <asm/byteorder.h>
39#include <linux/time.h>
40#include <linux/ethtool.h>
41#include <linux/mii.h>
42#ifdef NETIF_F_HW_VLAN_TX
43#include <linux/if_vlan.h>
44#define BCM_VLAN 1
45#endif
46#ifdef NETIF_F_TSO
47#include <net/ip.h>
48#include <net/tcp.h>
49#include <net/checksum.h>
50#define BCM_TSO 1
51#endif
52#include <linux/workqueue.h>
53#include <linux/crc32.h>
54#include <linux/prefetch.h>
55
56/* Hardware data structures and register definitions automatically 16/* Hardware data structures and register definitions automatically
57 * generated from RTL code. Do not modify. 17 * generated from RTL code. Do not modify.
58 */ 18 */
@@ -3917,15 +3877,17 @@ struct bnx2 {
3917#define USING_MSI_FLAG 0x20 3877#define USING_MSI_FLAG 0x20
3918#define ASF_ENABLE_FLAG 0x40 3878#define ASF_ENABLE_FLAG 0x40
3919 3879
3920 struct tx_bd *tx_desc_ring; 3880 /* Put tx producer and consumer fields in separate cache lines. */
3921 struct sw_bd *tx_buf_ring;
3922 u32 tx_prod_bseq;
3923 u16 tx_prod;
3924 u16 tx_cons;
3925 int tx_ring_size;
3926 3881
3927 u16 hw_tx_cons; 3882 u32 tx_prod_bseq __attribute__((aligned(L1_CACHE_BYTES)));
3928 u16 hw_rx_cons; 3883 u16 tx_prod;
3884
3885 struct tx_bd *tx_desc_ring;
3886 struct sw_bd *tx_buf_ring;
3887 int tx_ring_size;
3888
3889 u16 tx_cons __attribute__((aligned(L1_CACHE_BYTES)));
3890 u16 hw_tx_cons;
3929 3891
3930#ifdef BCM_VLAN 3892#ifdef BCM_VLAN
3931 struct vlan_group *vlgrp; 3893 struct vlan_group *vlgrp;
@@ -3939,6 +3901,7 @@ struct bnx2 {
3939 u32 rx_prod_bseq; 3901 u32 rx_prod_bseq;
3940 u16 rx_prod; 3902 u16 rx_prod;
3941 u16 rx_cons; 3903 u16 rx_cons;
3904 u16 hw_rx_cons;
3942 3905
3943 u32 rx_csum; 3906 u32 rx_csum;
3944 3907
@@ -4038,6 +4001,7 @@ struct bnx2 {
4038 struct statistics_block *stats_blk; 4001 struct statistics_block *stats_blk;
4039 dma_addr_t stats_blk_mapping; 4002 dma_addr_t stats_blk_mapping;
4040 4003
4004 u32 hc_cmd;
4041 u32 rx_mode; 4005 u32 rx_mode;
4042 4006
4043 u16 req_line_speed; 4007 u16 req_line_speed;
@@ -4082,6 +4046,8 @@ struct bnx2 {
4082 4046
4083 struct flash_spec *flash_info; 4047 struct flash_spec *flash_info;
4084 u32 flash_size; 4048 u32 flash_size;
4049
4050 int status_stats_size;
4085}; 4051};
4086 4052
4087static u32 bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset); 4053static u32 bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset);
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 88829eb9568e..b5473325bff4 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -69,8 +69,8 @@
69 69
70#define DRV_MODULE_NAME "tg3" 70#define DRV_MODULE_NAME "tg3"
71#define PFX DRV_MODULE_NAME ": " 71#define PFX DRV_MODULE_NAME ": "
72#define DRV_MODULE_VERSION "3.53" 72#define DRV_MODULE_VERSION "3.54"
73#define DRV_MODULE_RELDATE "Mar 22, 2006" 73#define DRV_MODULE_RELDATE "Mar 23, 2006"
74 74
75#define TG3_DEF_MAC_MODE 0 75#define TG3_DEF_MAC_MODE 0
76#define TG3_DEF_RX_MODE 0 76#define TG3_DEF_RX_MODE 0
@@ -225,6 +225,10 @@ static struct pci_device_id tg3_pci_tbl[] = {
225 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, 225 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
226 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5754M, 226 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5754M,
227 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, 227 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
228 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5755,
229 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
230 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5755M,
231 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
228 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5787, 232 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5787,
229 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, 233 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
230 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5787M, 234 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5787M,
@@ -4557,6 +4561,7 @@ static int tg3_chip_reset(struct tg3 *tp)
4557 } 4561 }
4558 4562
4559 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 || 4563 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 ||
4564 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
4560 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 4565 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)
4561 tw32(GRC_FASTBOOT_PC, 0); 4566 tw32(GRC_FASTBOOT_PC, 0);
4562 4567
@@ -6152,6 +6157,9 @@ static int tg3_reset_hw(struct tg3 *tp)
6152 gpio_mask |= GRC_LCLCTRL_GPIO_OE3 | 6157 gpio_mask |= GRC_LCLCTRL_GPIO_OE3 |
6153 GRC_LCLCTRL_GPIO_OUTPUT3; 6158 GRC_LCLCTRL_GPIO_OUTPUT3;
6154 6159
6160 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
6161 gpio_mask |= GRC_LCLCTRL_GPIO_UART_SEL;
6162
6155 tp->grc_local_ctrl |= tr32(GRC_LOCAL_CTRL) & gpio_mask; 6163 tp->grc_local_ctrl |= tr32(GRC_LOCAL_CTRL) & gpio_mask;
6156 6164
6157 /* GPIO1 must be driven high for eeprom write protect */ 6165 /* GPIO1 must be driven high for eeprom write protect */
@@ -6191,7 +6199,8 @@ static int tg3_reset_hw(struct tg3 *tp)
6191 } 6199 }
6192 6200
6193 /* Enable host coalescing bug fix */ 6201 /* Enable host coalescing bug fix */
6194 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 6202 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755) ||
6203 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787))
6195 val |= (1 << 29); 6204 val |= (1 << 29);
6196 6205
6197 tw32_f(WDMAC_MODE, val); 6206 tw32_f(WDMAC_MODE, val);
@@ -6249,6 +6258,9 @@ static int tg3_reset_hw(struct tg3 *tp)
6249 udelay(100); 6258 udelay(100);
6250 6259
6251 tp->rx_mode = RX_MODE_ENABLE; 6260 tp->rx_mode = RX_MODE_ENABLE;
6261 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
6262 tp->rx_mode |= RX_MODE_IPV6_CSUM_ENABLE;
6263
6252 tw32_f(MAC_RX_MODE, tp->rx_mode); 6264 tw32_f(MAC_RX_MODE, tp->rx_mode);
6253 udelay(10); 6265 udelay(10);
6254 6266
@@ -7907,7 +7919,8 @@ static int tg3_set_tx_csum(struct net_device *dev, u32 data)
7907 return 0; 7919 return 0;
7908 } 7920 }
7909 7921
7910 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 7922 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
7923 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)
7911 ethtool_op_set_tx_hw_csum(dev, data); 7924 ethtool_op_set_tx_hw_csum(dev, data);
7912 else 7925 else
7913 ethtool_op_set_tx_csum(dev, data); 7926 ethtool_op_set_tx_csum(dev, data);
@@ -8332,7 +8345,8 @@ static int tg3_test_memory(struct tg3 *tp)
8332 int i; 8345 int i;
8333 8346
8334 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) { 8347 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) {
8335 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 8348 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
8349 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)
8336 mem_tbl = mem_tbl_5755; 8350 mem_tbl = mem_tbl_5755;
8337 else 8351 else
8338 mem_tbl = mem_tbl_5705; 8352 mem_tbl = mem_tbl_5705;
@@ -8924,6 +8938,47 @@ static void __devinit tg3_get_5752_nvram_info(struct tg3 *tp)
8924 } 8938 }
8925} 8939}
8926 8940
8941static void __devinit tg3_get_5755_nvram_info(struct tg3 *tp)
8942{
8943 u32 nvcfg1;
8944
8945 nvcfg1 = tr32(NVRAM_CFG1);
8946
8947 /* NVRAM protection for TPM */
8948 if (nvcfg1 & (1 << 27))
8949 tp->tg3_flags2 |= TG3_FLG2_PROTECTED_NVRAM;
8950
8951 switch (nvcfg1 & NVRAM_CFG1_5752VENDOR_MASK) {
8952 case FLASH_5755VENDOR_ATMEL_EEPROM_64KHZ:
8953 case FLASH_5755VENDOR_ATMEL_EEPROM_376KHZ:
8954 tp->nvram_jedecnum = JEDEC_ATMEL;
8955 tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
8956 tp->nvram_pagesize = ATMEL_AT24C512_CHIP_SIZE;
8957
8958 nvcfg1 &= ~NVRAM_CFG1_COMPAT_BYPASS;
8959 tw32(NVRAM_CFG1, nvcfg1);
8960 break;
8961 case FLASH_5752VENDOR_ATMEL_FLASH_BUFFERED:
8962 case FLASH_5755VENDOR_ATMEL_FLASH_1:
8963 case FLASH_5755VENDOR_ATMEL_FLASH_2:
8964 case FLASH_5755VENDOR_ATMEL_FLASH_3:
8965 case FLASH_5755VENDOR_ATMEL_FLASH_4:
8966 tp->nvram_jedecnum = JEDEC_ATMEL;
8967 tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
8968 tp->tg3_flags2 |= TG3_FLG2_FLASH;
8969 tp->nvram_pagesize = 264;
8970 break;
8971 case FLASH_5752VENDOR_ST_M45PE10:
8972 case FLASH_5752VENDOR_ST_M45PE20:
8973 case FLASH_5752VENDOR_ST_M45PE40:
8974 tp->nvram_jedecnum = JEDEC_ST;
8975 tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
8976 tp->tg3_flags2 |= TG3_FLG2_FLASH;
8977 tp->nvram_pagesize = 256;
8978 break;
8979 }
8980}
8981
8927static void __devinit tg3_get_5787_nvram_info(struct tg3 *tp) 8982static void __devinit tg3_get_5787_nvram_info(struct tg3 *tp)
8928{ 8983{
8929 u32 nvcfg1; 8984 u32 nvcfg1;
@@ -8997,6 +9052,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
8997 9052
8998 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752) 9053 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752)
8999 tg3_get_5752_nvram_info(tp); 9054 tg3_get_5752_nvram_info(tp);
9055 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
9056 tg3_get_5755_nvram_info(tp);
9000 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 9057 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)
9001 tg3_get_5787_nvram_info(tp); 9058 tg3_get_5787_nvram_info(tp);
9002 else 9059 else
@@ -9310,6 +9367,7 @@ static int tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len,
9310 nvram_cmd |= NVRAM_CMD_LAST; 9367 nvram_cmd |= NVRAM_CMD_LAST;
9311 9368
9312 if ((GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5752) && 9369 if ((GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5752) &&
9370 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5755) &&
9313 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787) && 9371 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787) &&
9314 (tp->nvram_jedecnum == JEDEC_ST) && 9372 (tp->nvram_jedecnum == JEDEC_ST) &&
9315 (nvram_cmd & NVRAM_CMD_FIRST)) { 9373 (nvram_cmd & NVRAM_CMD_FIRST)) {
@@ -10044,6 +10102,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10044 10102
10045 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 || 10103 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 ||
10046 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 || 10104 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 ||
10105 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
10047 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || 10106 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 ||
10048 (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) 10107 (tp->tg3_flags2 & TG3_FLG2_5780_CLASS))
10049 tp->tg3_flags2 |= TG3_FLG2_5750_PLUS; 10108 tp->tg3_flags2 |= TG3_FLG2_5750_PLUS;
@@ -10053,7 +10112,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10053 tp->tg3_flags2 |= TG3_FLG2_5705_PLUS; 10112 tp->tg3_flags2 |= TG3_FLG2_5705_PLUS;
10054 10113
10055 if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) { 10114 if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) {
10056 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) { 10115 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
10116 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) {
10057 tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2; 10117 tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2;
10058 tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI; 10118 tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI;
10059 } else 10119 } else
@@ -10063,6 +10123,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10063 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 && 10123 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
10064 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750 && 10124 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750 &&
10065 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5752 && 10125 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5752 &&
10126 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5755 &&
10066 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787) 10127 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787)
10067 tp->tg3_flags2 |= TG3_FLG2_JUMBO_CAPABLE; 10128 tp->tg3_flags2 |= TG3_FLG2_JUMBO_CAPABLE;
10068 10129
@@ -10219,6 +10280,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10219 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752) 10280 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752)
10220 tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE3; 10281 tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE3;
10221 10282
10283 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
10284 tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_UART_SEL;
10285
10222 /* Force the chip into D0. */ 10286 /* Force the chip into D0. */
10223 err = tg3_set_power_state(tp, PCI_D0); 10287 err = tg3_set_power_state(tp, PCI_D0);
10224 if (err) { 10288 if (err) {
@@ -10274,6 +10338,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10274 tp->tg3_flags2 |= TG3_FLG2_PHY_5704_A0_BUG; 10338 tp->tg3_flags2 |= TG3_FLG2_PHY_5704_A0_BUG;
10275 10339
10276 if ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) && 10340 if ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) &&
10341 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5755) &&
10277 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787)) 10342 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787))
10278 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG; 10343 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG;
10279 10344
@@ -10413,7 +10478,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10413 /* All chips before 5787 can get confused if TX buffers 10478 /* All chips before 5787 can get confused if TX buffers
10414 * straddle the 4GB address boundary in some cases. 10479 * straddle the 4GB address boundary in some cases.
10415 */ 10480 */
10416 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 10481 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
10482 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)
10417 tp->dev->hard_start_xmit = tg3_start_xmit; 10483 tp->dev->hard_start_xmit = tg3_start_xmit;
10418 else 10484 else
10419 tp->dev->hard_start_xmit = tg3_start_xmit_dma_bug; 10485 tp->dev->hard_start_xmit = tg3_start_xmit_dma_bug;
@@ -11002,6 +11068,7 @@ static char * __devinit tg3_phy_string(struct tg3 *tp)
11002 case PHY_ID_BCM5752: return "5752"; 11068 case PHY_ID_BCM5752: return "5752";
11003 case PHY_ID_BCM5714: return "5714"; 11069 case PHY_ID_BCM5714: return "5714";
11004 case PHY_ID_BCM5780: return "5780"; 11070 case PHY_ID_BCM5780: return "5780";
11071 case PHY_ID_BCM5755: return "5755";
11005 case PHY_ID_BCM5787: return "5787"; 11072 case PHY_ID_BCM5787: return "5787";
11006 case PHY_ID_BCM8002: return "8002/serdes"; 11073 case PHY_ID_BCM8002: return "8002/serdes";
11007 case 0: return "serdes"; 11074 case 0: return "serdes";
@@ -11350,7 +11417,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
11350 * checksumming. 11417 * checksumming.
11351 */ 11418 */
11352 if ((tp->tg3_flags & TG3_FLAG_BROKEN_CHECKSUMS) == 0) { 11419 if ((tp->tg3_flags & TG3_FLAG_BROKEN_CHECKSUMS) == 0) {
11353 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 11420 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
11421 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)
11354 dev->features |= NETIF_F_HW_CSUM; 11422 dev->features |= NETIF_F_HW_CSUM;
11355 else 11423 else
11356 dev->features |= NETIF_F_IP_CSUM; 11424 dev->features |= NETIF_F_IP_CSUM;
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index baa34c4721db..c43cc3264202 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -138,6 +138,7 @@
138#define ASIC_REV_5752 0x06 138#define ASIC_REV_5752 0x06
139#define ASIC_REV_5780 0x08 139#define ASIC_REV_5780 0x08
140#define ASIC_REV_5714 0x09 140#define ASIC_REV_5714 0x09
141#define ASIC_REV_5755 0x0a
141#define ASIC_REV_5787 0x0b 142#define ASIC_REV_5787 0x0b
142#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) 143#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
143#define CHIPREV_5700_AX 0x70 144#define CHIPREV_5700_AX 0x70
@@ -456,6 +457,7 @@
456#define RX_MODE_PROMISC 0x00000100 457#define RX_MODE_PROMISC 0x00000100
457#define RX_MODE_NO_CRC_CHECK 0x00000200 458#define RX_MODE_NO_CRC_CHECK 0x00000200
458#define RX_MODE_KEEP_VLAN_TAG 0x00000400 459#define RX_MODE_KEEP_VLAN_TAG 0x00000400
460#define RX_MODE_IPV6_CSUM_ENABLE 0x01000000
459#define MAC_RX_STATUS 0x0000046c 461#define MAC_RX_STATUS 0x0000046c
460#define RX_STATUS_REMOTE_TX_XOFFED 0x00000001 462#define RX_STATUS_REMOTE_TX_XOFFED 0x00000001
461#define RX_STATUS_XOFF_RCVD 0x00000002 463#define RX_STATUS_XOFF_RCVD 0x00000002
@@ -1340,6 +1342,7 @@
1340#define GRC_LCLCTRL_CLEARINT 0x00000002 1342#define GRC_LCLCTRL_CLEARINT 0x00000002
1341#define GRC_LCLCTRL_SETINT 0x00000004 1343#define GRC_LCLCTRL_SETINT 0x00000004
1342#define GRC_LCLCTRL_INT_ON_ATTN 0x00000008 1344#define GRC_LCLCTRL_INT_ON_ATTN 0x00000008
1345#define GRC_LCLCTRL_GPIO_UART_SEL 0x00000010 /* 5755 only */
1343#define GRC_LCLCTRL_USE_SIG_DETECT 0x00000010 /* 5714/5780 only */ 1346#define GRC_LCLCTRL_USE_SIG_DETECT 0x00000010 /* 5714/5780 only */
1344#define GRC_LCLCTRL_USE_EXT_SIG_DETECT 0x00000020 /* 5714/5780 only */ 1347#define GRC_LCLCTRL_USE_EXT_SIG_DETECT 0x00000020 /* 5714/5780 only */
1345#define GRC_LCLCTRL_GPIO_INPUT3 0x00000020 1348#define GRC_LCLCTRL_GPIO_INPUT3 0x00000020
@@ -1441,6 +1444,9 @@
1441#define FLASH_5755VENDOR_ATMEL_FLASH_1 0x03400001 1444#define FLASH_5755VENDOR_ATMEL_FLASH_1 0x03400001
1442#define FLASH_5755VENDOR_ATMEL_FLASH_2 0x03400002 1445#define FLASH_5755VENDOR_ATMEL_FLASH_2 0x03400002
1443#define FLASH_5755VENDOR_ATMEL_FLASH_3 0x03400000 1446#define FLASH_5755VENDOR_ATMEL_FLASH_3 0x03400000
1447#define FLASH_5755VENDOR_ATMEL_FLASH_4 0x00000003
1448#define FLASH_5755VENDOR_ATMEL_EEPROM_64KHZ 0x03c00003
1449#define FLASH_5755VENDOR_ATMEL_EEPROM_376KHZ 0x03c00002
1444#define FLASH_5787VENDOR_ATMEL_EEPROM_64KHZ 0x03000003 1450#define FLASH_5787VENDOR_ATMEL_EEPROM_64KHZ 0x03000003
1445#define FLASH_5787VENDOR_ATMEL_EEPROM_376KHZ 0x03000002 1451#define FLASH_5787VENDOR_ATMEL_EEPROM_376KHZ 0x03000002
1446#define FLASH_5787VENDOR_MICRO_EEPROM_64KHZ 0x03000000 1452#define FLASH_5787VENDOR_MICRO_EEPROM_64KHZ 0x03000000
@@ -2259,6 +2265,7 @@ struct tg3 {
2259#define PHY_ID_BCM5752 0x60008100 2265#define PHY_ID_BCM5752 0x60008100
2260#define PHY_ID_BCM5714 0x60008340 2266#define PHY_ID_BCM5714 0x60008340
2261#define PHY_ID_BCM5780 0x60008350 2267#define PHY_ID_BCM5780 0x60008350
2268#define PHY_ID_BCM5755 0xbc050cc0
2262#define PHY_ID_BCM5787 0xbc050ce0 2269#define PHY_ID_BCM5787 0xbc050ce0
2263#define PHY_ID_BCM8002 0x60010140 2270#define PHY_ID_BCM8002 0x60010140
2264#define PHY_ID_INVALID 0xffffffff 2271#define PHY_ID_INVALID 0xffffffff
@@ -2286,7 +2293,7 @@ struct tg3 {
2286 (X) == PHY_ID_BCM5705 || (X) == PHY_ID_BCM5750 || \ 2293 (X) == PHY_ID_BCM5705 || (X) == PHY_ID_BCM5750 || \
2287 (X) == PHY_ID_BCM5752 || (X) == PHY_ID_BCM5714 || \ 2294 (X) == PHY_ID_BCM5752 || (X) == PHY_ID_BCM5714 || \
2288 (X) == PHY_ID_BCM5780 || (X) == PHY_ID_BCM5787 || \ 2295 (X) == PHY_ID_BCM5780 || (X) == PHY_ID_BCM5787 || \
2289 (X) == PHY_ID_BCM8002) 2296 (X) == PHY_ID_BCM5755 || (X) == PHY_ID_BCM8002)
2290 2297
2291 struct tg3_hw_stats *hw_stats; 2298 struct tg3_hw_stats *hw_stats;
2292 dma_addr_t stats_mapping; 2299 dma_addr_t stats_mapping;