diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-06-17 12:04:25 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-06-17 23:59:38 -0400 |
commit | c7127a347be8141d395178194b98ecda8fefa1fc (patch) | |
tree | 7df2452c0e9838de5b82403c0b0df1ce17e0ad14 /drivers | |
parent | e1a74b375ca084add9164ae30ca0fdb9fe691ec9 (diff) |
sky2: chip version printout
Change how chip version is printed so that if an unknown version is detected
nothing breaks.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sky2.c | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index af7ea887118a..f9cd67d905b6 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -146,17 +146,6 @@ static const unsigned txqaddr[] = { Q_XA1, Q_XA2 }; | |||
146 | static const unsigned rxqaddr[] = { Q_R1, Q_R2 }; | 146 | static const unsigned rxqaddr[] = { Q_R1, Q_R2 }; |
147 | static const u32 portirq_msk[] = { Y2_IS_PORT_1, Y2_IS_PORT_2 }; | 147 | static const u32 portirq_msk[] = { Y2_IS_PORT_1, Y2_IS_PORT_2 }; |
148 | 148 | ||
149 | /* This driver supports yukon2 chipset only */ | ||
150 | static 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 | |||
160 | static void sky2_set_multicast(struct net_device *dev); | 149 | static void sky2_set_multicast(struct net_device *dev); |
161 | 150 | ||
162 | /* Access to PHY via serial interconnect */ | 151 | /* Access to PHY via serial interconnect */ |
@@ -4265,12 +4254,33 @@ static int __devinit pci_wake_enabled(struct pci_dev *dev) | |||
4265 | return value & PCI_PM_CTRL_PME_ENABLE; | 4254 | return value & PCI_PM_CTRL_PME_ENABLE; |
4266 | } | 4255 | } |
4267 | 4256 | ||
4257 | /* This driver supports yukon2 chipset only */ | ||
4258 | static const char *sky2_name(u8 chipid, char *buf, int sz) | ||
4259 | { | ||
4260 | const char *name[] = { | ||
4261 | "XL", /* 0xb3 */ | ||
4262 | "EC Ultra", /* 0xb4 */ | ||
4263 | "Extreme", /* 0xb5 */ | ||
4264 | "EC", /* 0xb6 */ | ||
4265 | "FE", /* 0xb7 */ | ||
4266 | "FE+", /* 0xb8 */ | ||
4267 | "Supreme", /* 0xb9 */ | ||
4268 | }; | ||
4269 | |||
4270 | if (chipid >= CHIP_ID_YUKON_XL && chipid < CHIP_ID_YUKON_SUPR) | ||
4271 | strncpy(buf, name[chipid - CHIP_ID_YUKON_XL], sz); | ||
4272 | else | ||
4273 | snprintf(buf, sz, "(chip %#x)", chipid); | ||
4274 | return buf; | ||
4275 | } | ||
4276 | |||
4268 | static int __devinit sky2_probe(struct pci_dev *pdev, | 4277 | static int __devinit sky2_probe(struct pci_dev *pdev, |
4269 | const struct pci_device_id *ent) | 4278 | const struct pci_device_id *ent) |
4270 | { | 4279 | { |
4271 | struct net_device *dev; | 4280 | struct net_device *dev; |
4272 | struct sky2_hw *hw; | 4281 | struct sky2_hw *hw; |
4273 | int err, using_dac = 0, wol_default; | 4282 | int err, using_dac = 0, wol_default; |
4283 | char buf1[16]; | ||
4274 | 4284 | ||
4275 | err = pci_enable_device(pdev); | 4285 | err = pci_enable_device(pdev); |
4276 | if (err) { | 4286 | if (err) { |
@@ -4341,10 +4351,10 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
4341 | if (err) | 4351 | if (err) |
4342 | goto err_out_iounmap; | 4352 | goto err_out_iounmap; |
4343 | 4353 | ||
4344 | dev_info(&pdev->dev, "v%s addr 0x%llx irq %d Yukon-%s (0x%x) rev %d\n", | 4354 | 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), | 4355 | DRV_VERSION, (unsigned long long)pci_resource_start(pdev, 0), |
4346 | pdev->irq, yukon2_name[hw->chip_id - CHIP_ID_YUKON_XL], | 4356 | pdev->irq, sky2_name(hw->chip_id, buf1, sizeof(buf1)), |
4347 | hw->chip_id, hw->chip_rev); | 4357 | hw->chip_rev); |
4348 | 4358 | ||
4349 | sky2_reset(hw); | 4359 | sky2_reset(hw); |
4350 | 4360 | ||