aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r6040.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/r6040.c')
-rw-r--r--drivers/net/r6040.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 53bbddfc8c95..cf3a082bc89d 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -49,8 +49,8 @@
49#include <asm/processor.h> 49#include <asm/processor.h>
50 50
51#define DRV_NAME "r6040" 51#define DRV_NAME "r6040"
52#define DRV_VERSION "0.19" 52#define DRV_VERSION "0.20"
53#define DRV_RELDATE "18Dec2008" 53#define DRV_RELDATE "07Jan2009"
54 54
55/* PHY CHIP Address */ 55/* PHY CHIP Address */
56#define PHY1_ADDR 1 /* For MAC1 */ 56#define PHY1_ADDR 1 /* For MAC1 */
@@ -200,7 +200,7 @@ struct r6040_private {
200 200
201static char version[] __devinitdata = KERN_INFO DRV_NAME 201static char version[] __devinitdata = KERN_INFO DRV_NAME
202 ": RDC R6040 NAPI net driver," 202 ": RDC R6040 NAPI net driver,"
203 "version "DRV_VERSION " (" DRV_RELDATE ")\n"; 203 "version "DRV_VERSION " (" DRV_RELDATE ")";
204 204
205static int phy_table[] = { PHY1_ADDR, PHY2_ADDR }; 205static int phy_table[] = { PHY1_ADDR, PHY2_ADDR };
206 206
@@ -330,7 +330,7 @@ static int r6040_alloc_rxbufs(struct net_device *dev)
330 do { 330 do {
331 skb = netdev_alloc_skb(dev, MAX_BUF_SIZE); 331 skb = netdev_alloc_skb(dev, MAX_BUF_SIZE);
332 if (!skb) { 332 if (!skb) {
333 printk(KERN_ERR "%s: failed to alloc skb for rx\n", dev->name); 333 printk(KERN_ERR DRV_NAME "%s: failed to alloc skb for rx\n", dev->name);
334 rc = -ENOMEM; 334 rc = -ENOMEM;
335 goto err_exit; 335 goto err_exit;
336 } 336 }
@@ -1077,20 +1077,20 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1077 /* this should always be supported */ 1077 /* this should always be supported */
1078 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 1078 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
1079 if (err) { 1079 if (err) {
1080 printk(KERN_ERR DRV_NAME "32-bit PCI DMA addresses" 1080 printk(KERN_ERR DRV_NAME ": 32-bit PCI DMA addresses"
1081 "not supported by the card\n"); 1081 "not supported by the card\n");
1082 goto err_out; 1082 goto err_out;
1083 } 1083 }
1084 err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 1084 err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
1085 if (err) { 1085 if (err) {
1086 printk(KERN_ERR DRV_NAME "32-bit PCI DMA addresses" 1086 printk(KERN_ERR DRV_NAME ": 32-bit PCI DMA addresses"
1087 "not supported by the card\n"); 1087 "not supported by the card\n");
1088 goto err_out; 1088 goto err_out;
1089 } 1089 }
1090 1090
1091 /* IO Size check */ 1091 /* IO Size check */
1092 if (pci_resource_len(pdev, 0) < io_size) { 1092 if (pci_resource_len(pdev, 0) < io_size) {
1093 printk(KERN_ERR DRV_NAME "Insufficient PCI resources, aborting\n"); 1093 printk(KERN_ERR DRV_NAME ": Insufficient PCI resources, aborting\n");
1094 err = -EIO; 1094 err = -EIO;
1095 goto err_out; 1095 goto err_out;
1096 } 1096 }
@@ -1100,7 +1100,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1100 1100
1101 dev = alloc_etherdev(sizeof(struct r6040_private)); 1101 dev = alloc_etherdev(sizeof(struct r6040_private));
1102 if (!dev) { 1102 if (!dev) {
1103 printk(KERN_ERR DRV_NAME "Failed to allocate etherdev\n"); 1103 printk(KERN_ERR DRV_NAME ": Failed to allocate etherdev\n");
1104 err = -ENOMEM; 1104 err = -ENOMEM;
1105 goto err_out; 1105 goto err_out;
1106 } 1106 }
@@ -1116,11 +1116,15 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1116 1116
1117 ioaddr = pci_iomap(pdev, bar, io_size); 1117 ioaddr = pci_iomap(pdev, bar, io_size);
1118 if (!ioaddr) { 1118 if (!ioaddr) {
1119 printk(KERN_ERR "ioremap failed for device %s\n", 1119 printk(KERN_ERR DRV_NAME ": ioremap failed for device %s\n",
1120 pci_name(pdev)); 1120 pci_name(pdev));
1121 err = -EIO; 1121 err = -EIO;
1122 goto err_out_free_res; 1122 goto err_out_free_res;
1123 } 1123 }
1124 /* If PHY status change register is still set to zero it means the
1125 * bootloader didn't initialize it */
1126 if (ioread16(ioaddr + PHY_CC) == 0)
1127 iowrite16(0x9f07, ioaddr + PHY_CC);
1124 1128
1125 /* Init system & device */ 1129 /* Init system & device */
1126 lp->base = ioaddr; 1130 lp->base = ioaddr;
@@ -1137,6 +1141,11 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1137 adrp[1] = ioread16(ioaddr + MID_0M); 1141 adrp[1] = ioread16(ioaddr + MID_0M);
1138 adrp[2] = ioread16(ioaddr + MID_0H); 1142 adrp[2] = ioread16(ioaddr + MID_0H);
1139 1143
1144 /* Some bootloader/BIOSes do not initialize
1145 * MAC address, warn about that */
1146 if (!(adrp[0] || adrp[1] || adrp[2]))
1147 printk(KERN_WARNING DRV_NAME ": MAC address not initialized\n");
1148
1140 /* Link new device into r6040_root_dev */ 1149 /* Link new device into r6040_root_dev */
1141 lp->pdev = pdev; 1150 lp->pdev = pdev;
1142 lp->dev = dev; 1151 lp->dev = dev;