aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r--drivers/net/tulip/xircom_cb.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
index c84123fd635c..acfeeb980562 100644
--- a/drivers/net/tulip/xircom_cb.c
+++ b/drivers/net/tulip/xircom_cb.c
@@ -14,6 +14,8 @@
14 * $Id: xircom_cb.c,v 1.33 2001/03/19 14:02:07 arjanv Exp $ 14 * $Id: xircom_cb.c,v 1.33 2001/03/19 14:02:07 arjanv Exp $
15 */ 15 */
16 16
17#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18
17#include <linux/module.h> 19#include <linux/module.h>
18#include <linux/kernel.h> 20#include <linux/kernel.h>
19#include <linux/string.h> 21#include <linux/string.h>
@@ -234,7 +236,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
234 pci_write_config_word (pdev, PCI_STATUS,tmp16); 236 pci_write_config_word (pdev, PCI_STATUS,tmp16);
235 237
236 if (!request_region(pci_resource_start(pdev, 0), 128, "xircom_cb")) { 238 if (!request_region(pci_resource_start(pdev, 0), 128, "xircom_cb")) {
237 printk(KERN_ERR "xircom_probe: failed to allocate io-region\n"); 239 pr_err("%s: failed to allocate io-region\n", __func__);
238 return -ENODEV; 240 return -ENODEV;
239 } 241 }
240 242
@@ -245,7 +247,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
245 */ 247 */
246 dev = alloc_etherdev(sizeof(struct xircom_private)); 248 dev = alloc_etherdev(sizeof(struct xircom_private));
247 if (!dev) { 249 if (!dev) {
248 printk(KERN_ERR "xircom_probe: failed to allocate etherdev\n"); 250 pr_err("%s: failed to allocate etherdev\n", __func__);
249 goto device_fail; 251 goto device_fail;
250 } 252 }
251 private = netdev_priv(dev); 253 private = netdev_priv(dev);
@@ -253,12 +255,12 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
253 /* Allocate the send/receive buffers */ 255 /* Allocate the send/receive buffers */
254 private->rx_buffer = pci_alloc_consistent(pdev,8192,&private->rx_dma_handle); 256 private->rx_buffer = pci_alloc_consistent(pdev,8192,&private->rx_dma_handle);
255 if (private->rx_buffer == NULL) { 257 if (private->rx_buffer == NULL) {
256 printk(KERN_ERR "xircom_probe: no memory for rx buffer \n"); 258 pr_err("%s: no memory for rx buffer\n", __func__);
257 goto rx_buf_fail; 259 goto rx_buf_fail;
258 } 260 }
259 private->tx_buffer = pci_alloc_consistent(pdev,8192,&private->tx_dma_handle); 261 private->tx_buffer = pci_alloc_consistent(pdev,8192,&private->tx_dma_handle);
260 if (private->tx_buffer == NULL) { 262 if (private->tx_buffer == NULL) {
261 printk(KERN_ERR "xircom_probe: no memory for tx buffer \n"); 263 pr_err("%s: no memory for tx buffer\n", __func__);
262 goto tx_buf_fail; 264 goto tx_buf_fail;
263 } 265 }
264 266
@@ -281,11 +283,12 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
281 pci_set_drvdata(pdev, dev); 283 pci_set_drvdata(pdev, dev);
282 284
283 if (register_netdev(dev)) { 285 if (register_netdev(dev)) {
284 printk(KERN_ERR "xircom_probe: netdevice registration failed.\n"); 286 pr_err("%s: netdevice registration failed\n", __func__);
285 goto reg_fail; 287 goto reg_fail;
286 } 288 }
287 289
288 printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, pdev->revision, pdev->irq); 290 dev_info(&dev->dev, "Xircom cardbus revision %i at irq %i\n",
291 pdev->revision, pdev->irq);
289 /* start the transmitter to get a heartbeat */ 292 /* start the transmitter to get a heartbeat */
290 /* TODO: send 2 dummy packets here */ 293 /* TODO: send 2 dummy packets here */
291 transceiver_voodoo(private); 294 transceiver_voodoo(private);
@@ -347,8 +350,10 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance)
347 350
348#ifdef DEBUG 351#ifdef DEBUG
349 print_binary(status); 352 print_binary(status);
350 printk("tx status 0x%08x 0x%08x \n",card->tx_buffer[0],card->tx_buffer[4]); 353 printk("tx status 0x%08x 0x%08x \n",
351 printk("rx status 0x%08x 0x%08x \n",card->rx_buffer[0],card->rx_buffer[4]); 354 card->tx_buffer[0], card->tx_buffer[4]);
355 printk("rx status 0x%08x 0x%08x \n",
356 card->rx_buffer[0], card->rx_buffer[4]);
352#endif 357#endif
353 /* Handle shared irq and hotplug */ 358 /* Handle shared irq and hotplug */
354 if (status == 0 || status == 0xffffffff) { 359 if (status == 0 || status == 0xffffffff) {
@@ -358,9 +363,9 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance)
358 363
359 if (link_status_changed(card)) { 364 if (link_status_changed(card)) {
360 int newlink; 365 int newlink;
361 printk(KERN_DEBUG "xircom_cb: Link status has changed \n"); 366 printk(KERN_DEBUG "xircom_cb: Link status has changed\n");
362 newlink = link_status(card); 367 newlink = link_status(card);
363 printk(KERN_INFO "xircom_cb: Link is %i mbit \n",newlink); 368 dev_info(&dev->dev, "Link is %i mbit\n", newlink);
364 if (newlink) 369 if (newlink)
365 netif_carrier_on(dev); 370 netif_carrier_on(dev);
366 else 371 else
@@ -457,7 +462,8 @@ static int xircom_open(struct net_device *dev)
457 struct xircom_private *xp = netdev_priv(dev); 462 struct xircom_private *xp = netdev_priv(dev);
458 int retval; 463 int retval;
459 enter("xircom_open"); 464 enter("xircom_open");
460 printk(KERN_INFO "xircom cardbus adaptor found, registering as %s, using irq %i \n",dev->name,dev->irq); 465 pr_info("xircom cardbus adaptor found, registering as %s, using irq %i \n",
466 dev->name, dev->irq);
461 retval = request_irq(dev->irq, xircom_interrupt, IRQF_SHARED, dev->name, dev); 467 retval = request_irq(dev->irq, xircom_interrupt, IRQF_SHARED, dev->name, dev);
462 if (retval) { 468 if (retval) {
463 leave("xircom_open - No IRQ"); 469 leave("xircom_open - No IRQ");
@@ -770,7 +776,7 @@ static void activate_receiver(struct xircom_private *card)
770 udelay(50); 776 udelay(50);
771 counter--; 777 counter--;
772 if (counter <= 0) 778 if (counter <= 0)
773 printk(KERN_ERR "xircom_cb: Receiver failed to deactivate\n"); 779 pr_err("Receiver failed to deactivate\n");
774 } 780 }
775 781
776 /* enable the receiver */ 782 /* enable the receiver */
@@ -787,7 +793,7 @@ static void activate_receiver(struct xircom_private *card)
787 udelay(50); 793 udelay(50);
788 counter--; 794 counter--;
789 if (counter <= 0) 795 if (counter <= 0)
790 printk(KERN_ERR "xircom_cb: Receiver failed to re-activate\n"); 796 pr_err("Receiver failed to re-activate\n");
791 } 797 }
792 798
793 leave("activate_receiver"); 799 leave("activate_receiver");
@@ -818,7 +824,7 @@ static void deactivate_receiver(struct xircom_private *card)
818 udelay(50); 824 udelay(50);
819 counter--; 825 counter--;
820 if (counter <= 0) 826 if (counter <= 0)
821 printk(KERN_ERR "xircom_cb: Receiver failed to deactivate\n"); 827 pr_err("Receiver failed to deactivate\n");
822 } 828 }
823 829
824 830
@@ -861,7 +867,7 @@ static void activate_transmitter(struct xircom_private *card)
861 udelay(50); 867 udelay(50);
862 counter--; 868 counter--;
863 if (counter <= 0) 869 if (counter <= 0)
864 printk(KERN_ERR "xircom_cb: Transmitter failed to deactivate\n"); 870 pr_err("Transmitter failed to deactivate\n");
865 } 871 }
866 872
867 /* enable the transmitter */ 873 /* enable the transmitter */
@@ -878,7 +884,7 @@ static void activate_transmitter(struct xircom_private *card)
878 udelay(50); 884 udelay(50);
879 counter--; 885 counter--;
880 if (counter <= 0) 886 if (counter <= 0)
881 printk(KERN_ERR "xircom_cb: Transmitter failed to re-activate\n"); 887 pr_err("Transmitter failed to re-activate\n");
882 } 888 }
883 889
884 leave("activate_transmitter"); 890 leave("activate_transmitter");
@@ -909,7 +915,7 @@ static void deactivate_transmitter(struct xircom_private *card)
909 udelay(50); 915 udelay(50);
910 counter--; 916 counter--;
911 if (counter <= 0) 917 if (counter <= 0)
912 printk(KERN_ERR "xircom_cb: Transmitter failed to deactivate\n"); 918 pr_err("Transmitter failed to deactivate\n");
913 } 919 }
914 920
915 921
@@ -1184,7 +1190,7 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri
1184 struct sk_buff *skb; 1190 struct sk_buff *skb;
1185 1191
1186 if (pkt_len > 1518) { 1192 if (pkt_len > 1518) {
1187 printk(KERN_ERR "xircom_cb: Packet length %i is bogus \n",pkt_len); 1193 pr_err("Packet length %i is bogus\n", pkt_len);
1188 pkt_len = 1518; 1194 pkt_len = 1518;
1189 } 1195 }
1190 1196
@@ -1222,7 +1228,7 @@ static void investigate_write_descriptor(struct net_device *dev, struct xircom_p
1222 status = le32_to_cpu(card->tx_buffer[4*descnr]); 1228 status = le32_to_cpu(card->tx_buffer[4*descnr]);
1223#if 0 1229#if 0
1224 if (status & 0x8000) { /* Major error */ 1230 if (status & 0x8000) { /* Major error */
1225 printk(KERN_ERR "Major transmit error status %x \n", status); 1231 pr_err("Major transmit error status %x\n", status);
1226 card->tx_buffer[4*descnr] = 0; 1232 card->tx_buffer[4*descnr] = 0;
1227 netif_wake_queue (dev); 1233 netif_wake_queue (dev);
1228 } 1234 }