|
@@ -768,7 +768,8 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
|
|
/* dev and priv zeroed in alloc_etherdev */
|
|
/* dev and priv zeroed in alloc_etherdev */
|
|
dev = alloc_etherdev (sizeof (*tp));
|
|
dev = alloc_etherdev (sizeof (*tp));
|
|
if (dev == NULL) {
|
|
if (dev == NULL) {
|
|
- printk (KERN_ERR PFX "%s: Unable to alloc new net device\n", pci_name(pdev));
|
|
|
|
|
|
+ dev_printk (KERN_ERR, &pdev->dev,
|
|
|
|
+ "Unable to alloc new net device\n");
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
}
|
|
}
|
|
SET_MODULE_OWNER(dev);
|
|
SET_MODULE_OWNER(dev);
|
|
@@ -800,31 +801,35 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
|
|
#ifdef USE_IO_OPS
|
|
#ifdef USE_IO_OPS
|
|
/* make sure PCI base addr 0 is PIO */
|
|
/* make sure PCI base addr 0 is PIO */
|
|
if (!(pio_flags & IORESOURCE_IO)) {
|
|
if (!(pio_flags & IORESOURCE_IO)) {
|
|
- printk (KERN_ERR PFX "%s: region #0 not a PIO resource, aborting\n", pci_name(pdev));
|
|
|
|
|
|
+ dev_printk (KERN_ERR, &pdev->dev,
|
|
|
|
+ "region #0 not a PIO resource, aborting\n");
|
|
rc = -ENODEV;
|
|
rc = -ENODEV;
|
|
goto err_out;
|
|
goto err_out;
|
|
}
|
|
}
|
|
/* check for weird/broken PCI region reporting */
|
|
/* check for weird/broken PCI region reporting */
|
|
if (pio_len < RTL_MIN_IO_SIZE) {
|
|
if (pio_len < RTL_MIN_IO_SIZE) {
|
|
- printk (KERN_ERR PFX "%s: Invalid PCI I/O region size(s), aborting\n", pci_name(pdev));
|
|
|
|
|
|
+ dev_printk (KERN_ERR, &pdev->dev,
|
|
|
|
+ "Invalid PCI I/O region size(s), aborting\n");
|
|
rc = -ENODEV;
|
|
rc = -ENODEV;
|
|
goto err_out;
|
|
goto err_out;
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
/* make sure PCI base addr 1 is MMIO */
|
|
/* make sure PCI base addr 1 is MMIO */
|
|
if (!(mmio_flags & IORESOURCE_MEM)) {
|
|
if (!(mmio_flags & IORESOURCE_MEM)) {
|
|
- printk (KERN_ERR PFX "%s: region #1 not an MMIO resource, aborting\n", pci_name(pdev));
|
|
|
|
|
|
+ dev_printk (KERN_ERR, &pdev->dev,
|
|
|
|
+ "region #1 not an MMIO resource, aborting\n");
|
|
rc = -ENODEV;
|
|
rc = -ENODEV;
|
|
goto err_out;
|
|
goto err_out;
|
|
}
|
|
}
|
|
if (mmio_len < RTL_MIN_IO_SIZE) {
|
|
if (mmio_len < RTL_MIN_IO_SIZE) {
|
|
- printk (KERN_ERR PFX "%s: Invalid PCI mem region size(s), aborting\n", pci_name(pdev));
|
|
|
|
|
|
+ dev_printk (KERN_ERR, &pdev->dev,
|
|
|
|
+ "Invalid PCI mem region size(s), aborting\n");
|
|
rc = -ENODEV;
|
|
rc = -ENODEV;
|
|
goto err_out;
|
|
goto err_out;
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- rc = pci_request_regions (pdev, "8139too");
|
|
|
|
|
|
+ rc = pci_request_regions (pdev, DRV_NAME);
|
|
if (rc)
|
|
if (rc)
|
|
goto err_out;
|
|
goto err_out;
|
|
disable_dev_on_err = 1;
|
|
disable_dev_on_err = 1;
|
|
@@ -835,7 +840,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
|
|
#ifdef USE_IO_OPS
|
|
#ifdef USE_IO_OPS
|
|
ioaddr = ioport_map(pio_start, pio_len);
|
|
ioaddr = ioport_map(pio_start, pio_len);
|
|
if (!ioaddr) {
|
|
if (!ioaddr) {
|
|
- printk (KERN_ERR PFX "%s: cannot map PIO, aborting\n", pci_name(pdev));
|
|
|
|
|
|
+ dev_printk (KERN_ERR, &pdev->dev, "cannot map PIO, aborting\n");
|
|
rc = -EIO;
|
|
rc = -EIO;
|
|
goto err_out;
|
|
goto err_out;
|
|
}
|
|
}
|
|
@@ -846,7 +851,8 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
|
|
/* ioremap MMIO region */
|
|
/* ioremap MMIO region */
|
|
ioaddr = pci_iomap(pdev, 1, 0);
|
|
ioaddr = pci_iomap(pdev, 1, 0);
|
|
if (ioaddr == NULL) {
|
|
if (ioaddr == NULL) {
|
|
- printk (KERN_ERR PFX "%s: cannot remap MMIO, aborting\n", pci_name(pdev));
|
|
|
|
|
|
+ dev_printk (KERN_ERR, &pdev->dev,
|
|
|
|
+ "cannot remap MMIO, aborting\n");
|
|
rc = -EIO;
|
|
rc = -EIO;
|
|
goto err_out;
|
|
goto err_out;
|
|
}
|
|
}
|
|
@@ -860,8 +866,8 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
|
|
|
|
|
|
/* check for missing/broken hardware */
|
|
/* check for missing/broken hardware */
|
|
if (RTL_R32 (TxConfig) == 0xFFFFFFFF) {
|
|
if (RTL_R32 (TxConfig) == 0xFFFFFFFF) {
|
|
- printk (KERN_ERR PFX "%s: Chip not responding, ignoring board\n",
|
|
|
|
- pci_name(pdev));
|
|
|
|
|
|
+ dev_printk (KERN_ERR, &pdev->dev,
|
|
|
|
+ "Chip not responding, ignoring board\n");
|
|
rc = -EIO;
|
|
rc = -EIO;
|
|
goto err_out;
|
|
goto err_out;
|
|
}
|
|
}
|
|
@@ -875,9 +881,10 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
|
|
}
|
|
}
|
|
|
|
|
|
/* if unknown chip, assume array element #0, original RTL-8139 in this case */
|
|
/* if unknown chip, assume array element #0, original RTL-8139 in this case */
|
|
- printk (KERN_DEBUG PFX "%s: unknown chip version, assuming RTL-8139\n",
|
|
|
|
- pci_name(pdev));
|
|
|
|
- printk (KERN_DEBUG PFX "%s: TxConfig = 0x%lx\n", pci_name(pdev), RTL_R32 (TxConfig));
|
|
|
|
|
|
+ dev_printk (KERN_DEBUG, &pdev->dev,
|
|
|
|
+ "unknown chip version, assuming RTL-8139\n");
|
|
|
|
+ dev_printk (KERN_DEBUG, &pdev->dev,
|
|
|
|
+ "TxConfig = 0x%lx\n", RTL_R32 (TxConfig));
|
|
tp->chipset = 0;
|
|
tp->chipset = 0;
|
|
|
|
|
|
match:
|
|
match:
|
|
@@ -954,9 +961,11 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
|
|
|
|
|
|
if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
|
|
if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
|
|
pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) {
|
|
pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) {
|
|
- printk(KERN_INFO PFX "pci dev %s (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n",
|
|
|
|
- pci_name(pdev), pdev->vendor, pdev->device, pci_rev);
|
|
|
|
- printk(KERN_INFO PFX "Use the \"8139cp\" driver for improved performance and stability.\n");
|
|
|
|
|
|
+ dev_printk(KERN_INFO, &pdev->dev,
|
|
|
|
+ "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n",
|
|
|
|
+ pdev->vendor, pdev->device, pci_rev);
|
|
|
|
+ dev_printk(KERN_INFO, &pdev->dev,
|
|
|
|
+ "Use the \"8139cp\" driver for improved performance and stability.\n");
|
|
}
|
|
}
|
|
|
|
|
|
i = rtl8139_init_board (pdev, &dev);
|
|
i = rtl8139_init_board (pdev, &dev);
|