aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-06-18 00:37:14 -0400
committerDavid S. Miller <davem@davemloft.net>2008-06-18 00:37:14 -0400
commit5bbc1722d52ad3df062d5742a7e958276e57ebd7 (patch)
tree8aa544f9a8623fba2fae933819627ceb839eac1f /drivers/net/sky2.c
parent30902dc3cb0ea1cfc7ac2b17bcf478ff98420d74 (diff)
parentae7b6487ec9c2e2a1551b9d291aa0dbbe0addf48 (diff)
Merge branch 'davem-next' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c66
1 files changed, 43 insertions, 23 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 7f1cfc48e1b2..64b7effe49dd 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -51,7 +51,7 @@
51#include "sky2.h" 51#include "sky2.h"
52 52
53#define DRV_NAME "sky2" 53#define DRV_NAME "sky2"
54#define DRV_VERSION "1.21" 54#define DRV_VERSION "1.22"
55#define PFX DRV_NAME " " 55#define PFX DRV_NAME " "
56 56
57/* 57/*
@@ -98,7 +98,7 @@ static int disable_msi = 0;
98module_param(disable_msi, int, 0); 98module_param(disable_msi, int, 0);
99MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); 99MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
100 100
101static const struct pci_device_id sky2_id_table[] = { 101static DEFINE_PCI_DEVICE_TABLE(sky2_id_table) = {
102 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, /* SK-9Sxx */ 102 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, /* SK-9Sxx */
103 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, /* SK-9Exx */ 103 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, /* SK-9Exx */
104 { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) }, /* DGE-560T */ 104 { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) }, /* DGE-560T */
@@ -136,6 +136,7 @@ static const struct pci_device_id sky2_id_table[] = {
136 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436C) }, /* 88E8072 */ 136 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436C) }, /* 88E8072 */
137 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436D) }, /* 88E8055 */ 137 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436D) }, /* 88E8055 */
138 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4370) }, /* 88E8075 */ 138 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4370) }, /* 88E8075 */
139 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4380) }, /* 88E8057 */
139 { 0 } 140 { 0 }
140}; 141};
141 142
@@ -146,17 +147,6 @@ static const unsigned txqaddr[] = { Q_XA1, Q_XA2 };
146static const unsigned rxqaddr[] = { Q_R1, Q_R2 }; 147static const unsigned rxqaddr[] = { Q_R1, Q_R2 };
147static const u32 portirq_msk[] = { Y2_IS_PORT_1, Y2_IS_PORT_2 }; 148static const u32 portirq_msk[] = { Y2_IS_PORT_1, Y2_IS_PORT_2 };
148 149
149/* This driver supports yukon2 chipset only */
150static const char *yukon2_name[] = {
151 "XL", /* 0xb3 */
152 "EC Ultra", /* 0xb4 */
153 "Extreme", /* 0xb5 */
154 "EC", /* 0xb6 */
155 "FE", /* 0xb7 */
156 "FE+", /* 0xb8 */
157 "Supreme", /* 0xb9 */
158};
159
160static void sky2_set_multicast(struct net_device *dev); 150static void sky2_set_multicast(struct net_device *dev);
161 151
162/* Access to PHY via serial interconnect */ 152/* Access to PHY via serial interconnect */
@@ -658,8 +648,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
658 ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); 648 ledover |= PHY_M_LED_MO_RX(MO_LED_OFF);
659 } 649 }
660 650
661 if (hw->chip_id == CHIP_ID_YUKON_EC_U && 651 if (hw->chip_id == CHIP_ID_YUKON_EC_U || hw->chip_id == CHIP_ID_YUKON_UL_2) {
662 hw->chip_rev == CHIP_REV_YU_EC_U_A1) {
663 /* apply fixes in PHY AFE */ 652 /* apply fixes in PHY AFE */
664 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 255); 653 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 255);
665 654
@@ -667,9 +656,11 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
667 gm_phy_write(hw, port, 0x18, 0xaa99); 656 gm_phy_write(hw, port, 0x18, 0xaa99);
668 gm_phy_write(hw, port, 0x17, 0x2011); 657 gm_phy_write(hw, port, 0x17, 0x2011);
669 658
670 /* fix for IEEE A/B Symmetry failure in 1000BASE-T */ 659 if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
671 gm_phy_write(hw, port, 0x18, 0xa204); 660 /* fix for IEEE A/B Symmetry failure in 1000BASE-T */
672 gm_phy_write(hw, port, 0x17, 0x2002); 661 gm_phy_write(hw, port, 0x18, 0xa204);
662 gm_phy_write(hw, port, 0x17, 0x2002);
663 }
673 664
674 /* set page register to 0 */ 665 /* set page register to 0 */
675 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 0); 666 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 0);
@@ -678,7 +669,8 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
678 /* apply workaround for integrated resistors calibration */ 669 /* apply workaround for integrated resistors calibration */
679 gm_phy_write(hw, port, PHY_MARV_PAGE_ADDR, 17); 670 gm_phy_write(hw, port, PHY_MARV_PAGE_ADDR, 17);
680 gm_phy_write(hw, port, PHY_MARV_PAGE_DATA, 0x3f60); 671 gm_phy_write(hw, port, PHY_MARV_PAGE_DATA, 0x3f60);
681 } else if (hw->chip_id != CHIP_ID_YUKON_EX) { 672 } else if (hw->chip_id != CHIP_ID_YUKON_EX &&
673 hw->chip_id < CHIP_ID_YUKON_SUPR) {
682 /* no effect on Yukon-XL */ 674 /* no effect on Yukon-XL */
683 gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); 675 gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl);
684 676
@@ -2818,6 +2810,7 @@ static u32 sky2_mhz(const struct sky2_hw *hw)
2818 case CHIP_ID_YUKON_EC_U: 2810 case CHIP_ID_YUKON_EC_U:
2819 case CHIP_ID_YUKON_EX: 2811 case CHIP_ID_YUKON_EX:
2820 case CHIP_ID_YUKON_SUPR: 2812 case CHIP_ID_YUKON_SUPR:
2813 case CHIP_ID_YUKON_UL_2:
2821 return 125; 2814 return 125;
2822 2815
2823 case CHIP_ID_YUKON_FE: 2816 case CHIP_ID_YUKON_FE:
@@ -2910,6 +2903,11 @@ static int __devinit sky2_init(struct sky2_hw *hw)
2910 | SKY2_HW_ADV_POWER_CTL; 2903 | SKY2_HW_ADV_POWER_CTL;
2911 break; 2904 break;
2912 2905
2906 case CHIP_ID_YUKON_UL_2:
2907 hw->flags = SKY2_HW_GIGABIT
2908 | SKY2_HW_ADV_POWER_CTL;
2909 break;
2910
2913 default: 2911 default:
2914 dev_err(&hw->pdev->dev, "unsupported chip type 0x%x\n", 2912 dev_err(&hw->pdev->dev, "unsupported chip type 0x%x\n",
2915 hw->chip_id); 2913 hw->chip_id);
@@ -4265,12 +4263,34 @@ static int __devinit pci_wake_enabled(struct pci_dev *dev)
4265 return value & PCI_PM_CTRL_PME_ENABLE; 4263 return value & PCI_PM_CTRL_PME_ENABLE;
4266} 4264}
4267 4265
4266/* This driver supports yukon2 chipset only */
4267static const char *sky2_name(u8 chipid, char *buf, int sz)
4268{
4269 const char *name[] = {
4270 "XL", /* 0xb3 */
4271 "EC Ultra", /* 0xb4 */
4272 "Extreme", /* 0xb5 */
4273 "EC", /* 0xb6 */
4274 "FE", /* 0xb7 */
4275 "FE+", /* 0xb8 */
4276 "Supreme", /* 0xb9 */
4277 "UL 2", /* 0xba */
4278 };
4279
4280 if (chipid >= CHIP_ID_YUKON_XL && chipid < CHIP_ID_YUKON_UL_2)
4281 strncpy(buf, name[chipid - CHIP_ID_YUKON_XL], sz);
4282 else
4283 snprintf(buf, sz, "(chip %#x)", chipid);
4284 return buf;
4285}
4286
4268static int __devinit sky2_probe(struct pci_dev *pdev, 4287static int __devinit sky2_probe(struct pci_dev *pdev,
4269 const struct pci_device_id *ent) 4288 const struct pci_device_id *ent)
4270{ 4289{
4271 struct net_device *dev; 4290 struct net_device *dev;
4272 struct sky2_hw *hw; 4291 struct sky2_hw *hw;
4273 int err, using_dac = 0, wol_default; 4292 int err, using_dac = 0, wol_default;
4293 char buf1[16];
4274 4294
4275 err = pci_enable_device(pdev); 4295 err = pci_enable_device(pdev);
4276 if (err) { 4296 if (err) {
@@ -4341,10 +4361,10 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
4341 if (err) 4361 if (err)
4342 goto err_out_iounmap; 4362 goto err_out_iounmap;
4343 4363
4344 dev_info(&pdev->dev, "v%s addr 0x%llx irq %d Yukon-%s (0x%x) rev %d\n", 4364 dev_info(&pdev->dev, "v%s addr 0x%llx irq %d Yukon-2 %s rev %d\n",
4345 DRV_VERSION, (unsigned long long)pci_resource_start(pdev, 0), 4365 DRV_VERSION, (unsigned long long)pci_resource_start(pdev, 0),
4346 pdev->irq, yukon2_name[hw->chip_id - CHIP_ID_YUKON_XL], 4366 pdev->irq, sky2_name(hw->chip_id, buf1, sizeof(buf1)),
4347 hw->chip_id, hw->chip_rev); 4367 hw->chip_rev);
4348 4368
4349 sky2_reset(hw); 4369 sky2_reset(hw);
4350 4370