diff options
Diffstat (limited to 'drivers/net/epic100.c')
-rw-r--r-- | drivers/net/epic100.c | 93 |
1 files changed, 21 insertions, 72 deletions
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index 9f3e09a3d88c..a67650ccf084 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c | |||
@@ -19,62 +19,15 @@ | |||
19 | 19 | ||
20 | Information and updates available at | 20 | Information and updates available at |
21 | http://www.scyld.com/network/epic100.html | 21 | http://www.scyld.com/network/epic100.html |
22 | [this link no longer provides anything useful -jgarzik] | ||
22 | 23 | ||
23 | --------------------------------------------------------------------- | 24 | --------------------------------------------------------------------- |
24 | 25 | ||
25 | Linux kernel-specific changes: | ||
26 | |||
27 | LK1.1.2 (jgarzik): | ||
28 | * Merge becker version 1.09 (4/08/2000) | ||
29 | |||
30 | LK1.1.3: | ||
31 | * Major bugfix to 1.09 driver (Francis Romieu) | ||
32 | |||
33 | LK1.1.4 (jgarzik): | ||
34 | * Merge becker test version 1.09 (5/29/2000) | ||
35 | |||
36 | LK1.1.5: | ||
37 | * Fix locking (jgarzik) | ||
38 | * Limit 83c175 probe to ethernet-class PCI devices (rgooch) | ||
39 | |||
40 | LK1.1.6: | ||
41 | * Merge becker version 1.11 | ||
42 | * Move pci_enable_device before any PCI BAR len checks | ||
43 | |||
44 | LK1.1.7: | ||
45 | * { fill me in } | ||
46 | |||
47 | LK1.1.8: | ||
48 | * ethtool driver info support (jgarzik) | ||
49 | |||
50 | LK1.1.9: | ||
51 | * ethtool media get/set support (jgarzik) | ||
52 | |||
53 | LK1.1.10: | ||
54 | * revert MII transceiver init change (jgarzik) | ||
55 | |||
56 | LK1.1.11: | ||
57 | * implement ETHTOOL_[GS]SET, _NWAY_RST, _[GS]MSGLVL, _GLINK (jgarzik) | ||
58 | * replace some MII-related magic numbers with constants | ||
59 | |||
60 | LK1.1.12: | ||
61 | * fix power-up sequence | ||
62 | |||
63 | LK1.1.13: | ||
64 | * revert version 1.1.12, power-up sequence "fix" | ||
65 | |||
66 | LK1.1.14 (Kryzsztof Halasa): | ||
67 | * fix spurious bad initializations | ||
68 | * pound phy a la SMSC's app note on the subject | ||
69 | |||
70 | AC1.1.14ac | ||
71 | * fix power up/down for ethtool that broke in 1.11 | ||
72 | |||
73 | */ | 26 | */ |
74 | 27 | ||
75 | #define DRV_NAME "epic100" | 28 | #define DRV_NAME "epic100" |
76 | #define DRV_VERSION "1.11+LK1.1.14+AC1.1.14" | 29 | #define DRV_VERSION "2.0" |
77 | #define DRV_RELDATE "June 2, 2004" | 30 | #define DRV_RELDATE "June 27, 2006" |
78 | 31 | ||
79 | /* The user-configurable values. | 32 | /* The user-configurable values. |
80 | These may be modified when a driver module is loaded.*/ | 33 | These may be modified when a driver module is loaded.*/ |
@@ -204,19 +157,15 @@ typedef enum { | |||
204 | 157 | ||
205 | struct epic_chip_info { | 158 | struct epic_chip_info { |
206 | const char *name; | 159 | const char *name; |
207 | int io_size; /* Needed for I/O region check or ioremap(). */ | ||
208 | int drv_flags; /* Driver use, intended as capability flags. */ | 160 | int drv_flags; /* Driver use, intended as capability flags. */ |
209 | }; | 161 | }; |
210 | 162 | ||
211 | 163 | ||
212 | /* indexed by chip_t */ | 164 | /* indexed by chip_t */ |
213 | static const struct epic_chip_info pci_id_tbl[] = { | 165 | static const struct epic_chip_info pci_id_tbl[] = { |
214 | { "SMSC EPIC/100 83c170", | 166 | { "SMSC EPIC/100 83c170", TYPE2_INTR | NO_MII | MII_PWRDWN }, |
215 | EPIC_TOTAL_SIZE, TYPE2_INTR | NO_MII | MII_PWRDWN }, | 167 | { "SMSC EPIC/100 83c170", TYPE2_INTR }, |
216 | { "SMSC EPIC/100 83c170", | 168 | { "SMSC EPIC/C 83c175", TYPE2_INTR | MII_PWRDWN }, |
217 | EPIC_TOTAL_SIZE, TYPE2_INTR }, | ||
218 | { "SMSC EPIC/C 83c175", | ||
219 | EPIC_TOTAL_SIZE, TYPE2_INTR | MII_PWRDWN }, | ||
220 | }; | 169 | }; |
221 | 170 | ||
222 | 171 | ||
@@ -385,8 +334,8 @@ static int __devinit epic_init_one (struct pci_dev *pdev, | |||
385 | goto out; | 334 | goto out; |
386 | irq = pdev->irq; | 335 | irq = pdev->irq; |
387 | 336 | ||
388 | if (pci_resource_len(pdev, 0) < pci_id_tbl[chip_idx].io_size) { | 337 | if (pci_resource_len(pdev, 0) < EPIC_TOTAL_SIZE) { |
389 | printk (KERN_ERR "card %d: no PCI region space\n", card_idx); | 338 | dev_err(&pdev->dev, "no PCI region space\n"); |
390 | ret = -ENODEV; | 339 | ret = -ENODEV; |
391 | goto err_out_disable; | 340 | goto err_out_disable; |
392 | } | 341 | } |
@@ -401,7 +350,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev, | |||
401 | 350 | ||
402 | dev = alloc_etherdev(sizeof (*ep)); | 351 | dev = alloc_etherdev(sizeof (*ep)); |
403 | if (!dev) { | 352 | if (!dev) { |
404 | printk (KERN_ERR "card %d: no memory for eth device\n", card_idx); | 353 | dev_err(&pdev->dev, "no memory for eth device\n"); |
405 | goto err_out_free_res; | 354 | goto err_out_free_res; |
406 | } | 355 | } |
407 | SET_MODULE_OWNER(dev); | 356 | SET_MODULE_OWNER(dev); |
@@ -413,7 +362,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev, | |||
413 | ioaddr = pci_resource_start (pdev, 1); | 362 | ioaddr = pci_resource_start (pdev, 1); |
414 | ioaddr = (long) ioremap (ioaddr, pci_resource_len (pdev, 1)); | 363 | ioaddr = (long) ioremap (ioaddr, pci_resource_len (pdev, 1)); |
415 | if (!ioaddr) { | 364 | if (!ioaddr) { |
416 | printk (KERN_ERR DRV_NAME " %d: ioremap failed\n", card_idx); | 365 | dev_err(&pdev->dev, "ioremap failed\n"); |
417 | goto err_out_free_netdev; | 366 | goto err_out_free_netdev; |
418 | } | 367 | } |
419 | #endif | 368 | #endif |
@@ -473,8 +422,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev, | |||
473 | ((u16 *)dev->dev_addr)[i] = le16_to_cpu(inw(ioaddr + LAN0 + i*4)); | 422 | ((u16 *)dev->dev_addr)[i] = le16_to_cpu(inw(ioaddr + LAN0 + i*4)); |
474 | 423 | ||
475 | if (debug > 2) { | 424 | if (debug > 2) { |
476 | printk(KERN_DEBUG DRV_NAME "(%s): EEPROM contents\n", | 425 | dev_printk(KERN_DEBUG, &pdev->dev, "EEPROM contents:\n"); |
477 | pci_name(pdev)); | ||
478 | for (i = 0; i < 64; i++) | 426 | for (i = 0; i < 64; i++) |
479 | printk(" %4.4x%s", read_eeprom(ioaddr, i), | 427 | printk(" %4.4x%s", read_eeprom(ioaddr, i), |
480 | i % 16 == 15 ? "\n" : ""); | 428 | i % 16 == 15 ? "\n" : ""); |
@@ -496,21 +444,23 @@ static int __devinit epic_init_one (struct pci_dev *pdev, | |||
496 | int mii_status = mdio_read(dev, phy, MII_BMSR); | 444 | int mii_status = mdio_read(dev, phy, MII_BMSR); |
497 | if (mii_status != 0xffff && mii_status != 0x0000) { | 445 | if (mii_status != 0xffff && mii_status != 0x0000) { |
498 | ep->phys[phy_idx++] = phy; | 446 | ep->phys[phy_idx++] = phy; |
499 | printk(KERN_INFO DRV_NAME "(%s): MII transceiver #%d control " | 447 | dev_info(&pdev->dev, |
500 | "%4.4x status %4.4x.\n", | 448 | "MII transceiver #%d control " |
501 | pci_name(pdev), phy, mdio_read(dev, phy, 0), mii_status); | 449 | "%4.4x status %4.4x.\n", |
450 | phy, mdio_read(dev, phy, 0), mii_status); | ||
502 | } | 451 | } |
503 | } | 452 | } |
504 | ep->mii_phy_cnt = phy_idx; | 453 | ep->mii_phy_cnt = phy_idx; |
505 | if (phy_idx != 0) { | 454 | if (phy_idx != 0) { |
506 | phy = ep->phys[0]; | 455 | phy = ep->phys[0]; |
507 | ep->mii.advertising = mdio_read(dev, phy, MII_ADVERTISE); | 456 | ep->mii.advertising = mdio_read(dev, phy, MII_ADVERTISE); |
508 | printk(KERN_INFO DRV_NAME "(%s): Autonegotiation advertising %4.4x link " | 457 | dev_info(&pdev->dev, |
458 | "Autonegotiation advertising %4.4x link " | ||
509 | "partner %4.4x.\n", | 459 | "partner %4.4x.\n", |
510 | pci_name(pdev), ep->mii.advertising, mdio_read(dev, phy, 5)); | 460 | ep->mii.advertising, mdio_read(dev, phy, 5)); |
511 | } else if ( ! (ep->chip_flags & NO_MII)) { | 461 | } else if ( ! (ep->chip_flags & NO_MII)) { |
512 | printk(KERN_WARNING DRV_NAME "(%s): ***WARNING***: No MII transceiver found!\n", | 462 | dev_warn(&pdev->dev, |
513 | pci_name(pdev)); | 463 | "***WARNING***: No MII transceiver found!\n"); |
514 | /* Use the known PHY address of the EPII. */ | 464 | /* Use the known PHY address of the EPII. */ |
515 | ep->phys[0] = 3; | 465 | ep->phys[0] = 3; |
516 | } | 466 | } |
@@ -525,8 +475,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev, | |||
525 | /* The lower four bits are the media type. */ | 475 | /* The lower four bits are the media type. */ |
526 | if (duplex) { | 476 | if (duplex) { |
527 | ep->mii.force_media = ep->mii.full_duplex = 1; | 477 | ep->mii.force_media = ep->mii.full_duplex = 1; |
528 | printk(KERN_INFO DRV_NAME "(%s): Forced full duplex operation requested.\n", | 478 | dev_info(&pdev->dev, "Forced full duplex requested.\n"); |
529 | pci_name(pdev)); | ||
530 | } | 479 | } |
531 | dev->if_port = ep->default_port = option; | 480 | dev->if_port = ep->default_port = option; |
532 | 481 | ||