aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r--drivers/net/bnx2.c75
1 files changed, 55 insertions, 20 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index ada5e9b9988c..ca5acc4736df 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -57,8 +57,8 @@
57 57
58#define DRV_MODULE_NAME "bnx2" 58#define DRV_MODULE_NAME "bnx2"
59#define PFX DRV_MODULE_NAME ": " 59#define PFX DRV_MODULE_NAME ": "
60#define DRV_MODULE_VERSION "1.5.2" 60#define DRV_MODULE_VERSION "1.5.3"
61#define DRV_MODULE_RELDATE "December 13, 2006" 61#define DRV_MODULE_RELDATE "January 8, 2007"
62 62
63#define RUN_AT(x) (jiffies + (x)) 63#define RUN_AT(x) (jiffies + (x))
64 64
@@ -1345,8 +1345,6 @@ bnx2_init_copper_phy(struct bnx2 *bp)
1345{ 1345{
1346 u32 val; 1346 u32 val;
1347 1347
1348 bp->phy_flags |= PHY_CRC_FIX_FLAG;
1349
1350 if (bp->phy_flags & PHY_CRC_FIX_FLAG) { 1348 if (bp->phy_flags & PHY_CRC_FIX_FLAG) {
1351 bnx2_write_phy(bp, 0x18, 0x0c00); 1349 bnx2_write_phy(bp, 0x18, 0x0c00);
1352 bnx2_write_phy(bp, 0x17, 0x000a); 1350 bnx2_write_phy(bp, 0x17, 0x000a);
@@ -3085,7 +3083,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
3085 int buf_size) 3083 int buf_size)
3086{ 3084{
3087 u32 written, offset32, len32; 3085 u32 written, offset32, len32;
3088 u8 *buf, start[4], end[4], *flash_buffer = NULL; 3086 u8 *buf, start[4], end[4], *align_buf = NULL, *flash_buffer = NULL;
3089 int rc = 0; 3087 int rc = 0;
3090 int align_start, align_end; 3088 int align_start, align_end;
3091 3089
@@ -3113,16 +3111,17 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
3113 } 3111 }
3114 3112
3115 if (align_start || align_end) { 3113 if (align_start || align_end) {
3116 buf = kmalloc(len32, GFP_KERNEL); 3114 align_buf = kmalloc(len32, GFP_KERNEL);
3117 if (buf == NULL) 3115 if (align_buf == NULL)
3118 return -ENOMEM; 3116 return -ENOMEM;
3119 if (align_start) { 3117 if (align_start) {
3120 memcpy(buf, start, 4); 3118 memcpy(align_buf, start, 4);
3121 } 3119 }
3122 if (align_end) { 3120 if (align_end) {
3123 memcpy(buf + len32 - 4, end, 4); 3121 memcpy(align_buf + len32 - 4, end, 4);
3124 } 3122 }
3125 memcpy(buf + align_start, data_buf, buf_size); 3123 memcpy(align_buf + align_start, data_buf, buf_size);
3124 buf = align_buf;
3126 } 3125 }
3127 3126
3128 if (bp->flash_info->buffered == 0) { 3127 if (bp->flash_info->buffered == 0) {
@@ -3256,11 +3255,8 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
3256 } 3255 }
3257 3256
3258nvram_write_end: 3257nvram_write_end:
3259 if (bp->flash_info->buffered == 0) 3258 kfree(flash_buffer);
3260 kfree(flash_buffer); 3259 kfree(align_buf);
3261
3262 if (align_start || align_end)
3263 kfree(buf);
3264 return rc; 3260 return rc;
3265} 3261}
3266 3262
@@ -5645,6 +5641,44 @@ poll_bnx2(struct net_device *dev)
5645} 5641}
5646#endif 5642#endif
5647 5643
5644static void __devinit
5645bnx2_get_5709_media(struct bnx2 *bp)
5646{
5647 u32 val = REG_RD(bp, BNX2_MISC_DUAL_MEDIA_CTRL);
5648 u32 bond_id = val & BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID;
5649 u32 strap;
5650
5651 if (bond_id == BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID_C)
5652 return;
5653 else if (bond_id == BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID_S) {
5654 bp->phy_flags |= PHY_SERDES_FLAG;
5655 return;
5656 }
5657
5658 if (val & BNX2_MISC_DUAL_MEDIA_CTRL_STRAP_OVERRIDE)
5659 strap = (val & BNX2_MISC_DUAL_MEDIA_CTRL_PHY_CTRL) >> 21;
5660 else
5661 strap = (val & BNX2_MISC_DUAL_MEDIA_CTRL_PHY_CTRL_STRAP) >> 8;
5662
5663 if (PCI_FUNC(bp->pdev->devfn) == 0) {
5664 switch (strap) {
5665 case 0x4:
5666 case 0x5:
5667 case 0x6:
5668 bp->phy_flags |= PHY_SERDES_FLAG;
5669 return;
5670 }
5671 } else {
5672 switch (strap) {
5673 case 0x1:
5674 case 0x2:
5675 case 0x4:
5676 bp->phy_flags |= PHY_SERDES_FLAG;
5677 return;
5678 }
5679 }
5680}
5681
5648static int __devinit 5682static int __devinit
5649bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) 5683bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5650{ 5684{
@@ -5865,10 +5899,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5865 bp->phy_addr = 1; 5899 bp->phy_addr = 1;
5866 5900
5867 /* Disable WOL support if we are running on a SERDES chip. */ 5901 /* Disable WOL support if we are running on a SERDES chip. */
5868 if (CHIP_NUM(bp) == CHIP_NUM_5709) { 5902 if (CHIP_NUM(bp) == CHIP_NUM_5709)
5869 if (CHIP_BOND_ID(bp) != BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID_C) 5903 bnx2_get_5709_media(bp);
5870 bp->phy_flags |= PHY_SERDES_FLAG; 5904 else if (CHIP_BOND_ID(bp) & CHIP_BOND_ID_SERDES_BIT)
5871 } else if (CHIP_BOND_ID(bp) & CHIP_BOND_ID_SERDES_BIT)
5872 bp->phy_flags |= PHY_SERDES_FLAG; 5905 bp->phy_flags |= PHY_SERDES_FLAG;
5873 5906
5874 if (bp->phy_flags & PHY_SERDES_FLAG) { 5907 if (bp->phy_flags & PHY_SERDES_FLAG) {
@@ -5880,7 +5913,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5880 if (reg & BNX2_SHARED_HW_CFG_PHY_2_5G) 5913 if (reg & BNX2_SHARED_HW_CFG_PHY_2_5G)
5881 bp->phy_flags |= PHY_2_5G_CAPABLE_FLAG; 5914 bp->phy_flags |= PHY_2_5G_CAPABLE_FLAG;
5882 } 5915 }
5883 } 5916 } else if (CHIP_NUM(bp) == CHIP_NUM_5706 ||
5917 CHIP_NUM(bp) == CHIP_NUM_5708)
5918 bp->phy_flags |= PHY_CRC_FIX_FLAG;
5884 5919
5885 if ((CHIP_ID(bp) == CHIP_ID_5708_A0) || 5920 if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||
5886 (CHIP_ID(bp) == CHIP_ID_5708_B0) || 5921 (CHIP_ID(bp) == CHIP_ID_5708_B0) ||