aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSantiago Leon <santil@linux.vnet.ibm.com>2010-09-03 14:29:14 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-06 21:21:52 -0400
commitc43ced18a515bef29166f22c01a6d9062aa3008e (patch)
treeed2384361d33b1483419f5abcaadf16c72395acb /drivers
parente295fe83755213fb5991be577485525a7453213c (diff)
ibmveth: Convert driver specific debug to netdev_dbg
Use netdev_dbg to standardise the debug output. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ibmveth.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 5a4fca162e00..03eca309f326 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -64,18 +64,12 @@
64 printk(KERN_ERR "(%s:%3.3d ua:%x) ERROR: " fmt, __FILE__, __LINE__ , adapter->vdev->unit_address, ## args) 64 printk(KERN_ERR "(%s:%3.3d ua:%x) ERROR: " fmt, __FILE__, __LINE__ , adapter->vdev->unit_address, ## args)
65 65
66#ifdef DEBUG 66#ifdef DEBUG
67#define ibmveth_debug_printk_no_adapter(fmt, args...) \
68 printk(KERN_DEBUG "(%s:%3.3d): " fmt, __FILE__, __LINE__ , ## args)
69#define ibmveth_debug_printk(fmt, args...) \
70 printk(KERN_DEBUG "(%s:%3.3d ua:%x): " fmt, __FILE__, __LINE__ , adapter->vdev->unit_address, ## args)
71#define ibmveth_assert(expr) \ 67#define ibmveth_assert(expr) \
72 if(!(expr)) { \ 68 if(!(expr)) { \
73 printk(KERN_DEBUG "assertion failed (%s:%3.3d ua:%x): %s\n", __FILE__, __LINE__, adapter->vdev->unit_address, #expr); \ 69 printk(KERN_DEBUG "assertion failed (%s:%3.3d ua:%x): %s\n", __FILE__, __LINE__, adapter->vdev->unit_address, #expr); \
74 BUG(); \ 70 BUG(); \
75 } 71 }
76#else 72#else
77#define ibmveth_debug_printk_no_adapter(fmt, args...)
78#define ibmveth_debug_printk(fmt, args...)
79#define ibmveth_assert(expr) 73#define ibmveth_assert(expr)
80#endif 74#endif
81 75
@@ -248,7 +242,8 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc
248 skb = netdev_alloc_skb(adapter->netdev, pool->buff_size); 242 skb = netdev_alloc_skb(adapter->netdev, pool->buff_size);
249 243
250 if(!skb) { 244 if(!skb) {
251 ibmveth_debug_printk("replenish: unable to allocate skb\n"); 245 netdev_dbg(adapter->netdev,
246 "replenish: unable to allocate skb\n");
252 adapter->replenish_no_mem++; 247 adapter->replenish_no_mem++;
253 break; 248 break;
254 } 249 }
@@ -440,7 +435,8 @@ static void ibmveth_rxq_recycle_buffer(struct ibmveth_adapter *adapter)
440 lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc); 435 lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);
441 436
442 if(lpar_rc != H_SUCCESS) { 437 if(lpar_rc != H_SUCCESS) {
443 ibmveth_debug_printk("h_add_logical_lan_buffer failed during recycle rc=%ld", lpar_rc); 438 netdev_dbg(adapter->netdev, "h_add_logical_lan_buffer failed "
439 "during recycle rc=%ld", lpar_rc);
444 ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator); 440 ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator);
445 } 441 }
446 442
@@ -551,7 +547,7 @@ static int ibmveth_open(struct net_device *netdev)
551 int i; 547 int i;
552 struct device *dev; 548 struct device *dev;
553 549
554 ibmveth_debug_printk("open starting\n"); 550 netdev_dbg(netdev, "open starting\n");
555 551
556 napi_enable(&adapter->napi); 552 napi_enable(&adapter->napi);
557 553
@@ -607,9 +603,9 @@ static int ibmveth_open(struct net_device *netdev)
607 rxq_desc.fields.flags_len = IBMVETH_BUF_VALID | adapter->rx_queue.queue_len; 603 rxq_desc.fields.flags_len = IBMVETH_BUF_VALID | adapter->rx_queue.queue_len;
608 rxq_desc.fields.address = adapter->rx_queue.queue_dma; 604 rxq_desc.fields.address = adapter->rx_queue.queue_dma;
609 605
610 ibmveth_debug_printk("buffer list @ 0x%p\n", adapter->buffer_list_addr); 606 netdev_dbg(netdev, "buffer list @ 0x%p\n", adapter->buffer_list_addr);
611 ibmveth_debug_printk("filter list @ 0x%p\n", adapter->filter_list_addr); 607 netdev_dbg(netdev, "filter list @ 0x%p\n", adapter->filter_list_addr);
612 ibmveth_debug_printk("receive q @ 0x%p\n", adapter->rx_queue.queue_addr); 608 netdev_dbg(netdev, "receive q @ 0x%p\n", adapter->rx_queue.queue_addr);
613 609
614 h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE); 610 h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
615 611
@@ -639,7 +635,7 @@ static int ibmveth_open(struct net_device *netdev)
639 } 635 }
640 } 636 }
641 637
642 ibmveth_debug_printk("registering irq 0x%x\n", netdev->irq); 638 netdev_dbg(netdev, "registering irq 0x%x\n", netdev->irq);
643 if((rc = request_irq(netdev->irq, ibmveth_interrupt, 0, netdev->name, netdev)) != 0) { 639 if((rc = request_irq(netdev->irq, ibmveth_interrupt, 0, netdev->name, netdev)) != 0) {
644 ibmveth_error_printk("unable to request irq 0x%x, rc %d\n", netdev->irq, rc); 640 ibmveth_error_printk("unable to request irq 0x%x, rc %d\n", netdev->irq, rc);
645 do { 641 do {
@@ -669,12 +665,12 @@ static int ibmveth_open(struct net_device *netdev)
669 return -ENOMEM; 665 return -ENOMEM;
670 } 666 }
671 667
672 ibmveth_debug_printk("initial replenish cycle\n"); 668 netdev_dbg(netdev, "initial replenish cycle\n");
673 ibmveth_interrupt(netdev->irq, netdev); 669 ibmveth_interrupt(netdev->irq, netdev);
674 670
675 netif_start_queue(netdev); 671 netif_start_queue(netdev);
676 672
677 ibmveth_debug_printk("open complete\n"); 673 netdev_dbg(netdev, "open complete\n");
678 674
679 return 0; 675 return 0;
680} 676}
@@ -684,7 +680,7 @@ static int ibmveth_close(struct net_device *netdev)
684 struct ibmveth_adapter *adapter = netdev_priv(netdev); 680 struct ibmveth_adapter *adapter = netdev_priv(netdev);
685 long lpar_rc; 681 long lpar_rc;
686 682
687 ibmveth_debug_printk("close starting\n"); 683 netdev_dbg(netdev, "close starting\n");
688 684
689 napi_disable(&adapter->napi); 685 napi_disable(&adapter->napi);
690 686
@@ -709,7 +705,7 @@ static int ibmveth_close(struct net_device *netdev)
709 705
710 ibmveth_cleanup(adapter); 706 ibmveth_cleanup(adapter);
711 707
712 ibmveth_debug_printk("close complete\n"); 708 netdev_dbg(netdev, "close complete\n");
713 709
714 return 0; 710 return 0;
715} 711}
@@ -1109,7 +1105,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
1109 if (!ibmveth_rxq_buffer_valid(adapter)) { 1105 if (!ibmveth_rxq_buffer_valid(adapter)) {
1110 wmb(); /* suggested by larson1 */ 1106 wmb(); /* suggested by larson1 */
1111 adapter->rx_invalid_buffer++; 1107 adapter->rx_invalid_buffer++;
1112 ibmveth_debug_printk("recycling invalid buffer\n"); 1108 netdev_dbg(netdev, "recycling invalid buffer\n");
1113 ibmveth_rxq_recycle_buffer(adapter); 1109 ibmveth_rxq_recycle_buffer(adapter);
1114 } else { 1110 } else {
1115 struct sk_buff *skb, *new_skb; 1111 struct sk_buff *skb, *new_skb;
@@ -1359,8 +1355,8 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
1359 unsigned int *mcastFilterSize_p; 1355 unsigned int *mcastFilterSize_p;
1360 1356
1361 1357
1362 ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n", 1358 dev_dbg(&dev->dev, "entering ibmveth_probe for UA 0x%x\n",
1363 dev->unit_address); 1359 dev->unit_address);
1364 1360
1365 mac_addr_p = (unsigned char *) vio_get_attribute(dev, 1361 mac_addr_p = (unsigned char *) vio_get_attribute(dev,
1366 VETH_MAC_ADDR, NULL); 1362 VETH_MAC_ADDR, NULL);
@@ -1429,25 +1425,25 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
1429 kobject_uevent(kobj, KOBJ_ADD); 1425 kobject_uevent(kobj, KOBJ_ADD);
1430 } 1426 }
1431 1427
1432 ibmveth_debug_printk("adapter @ 0x%p\n", adapter); 1428 netdev_dbg(netdev, "adapter @ 0x%p\n", adapter);
1433 1429
1434 adapter->buffer_list_dma = DMA_ERROR_CODE; 1430 adapter->buffer_list_dma = DMA_ERROR_CODE;
1435 adapter->filter_list_dma = DMA_ERROR_CODE; 1431 adapter->filter_list_dma = DMA_ERROR_CODE;
1436 adapter->rx_queue.queue_dma = DMA_ERROR_CODE; 1432 adapter->rx_queue.queue_dma = DMA_ERROR_CODE;
1437 1433
1438 ibmveth_debug_printk("registering netdev...\n"); 1434 netdev_dbg(netdev, "registering netdev...\n");
1439 1435
1440 ibmveth_set_csum_offload(netdev, 1, ibmveth_set_tx_csum_flags); 1436 ibmveth_set_csum_offload(netdev, 1, ibmveth_set_tx_csum_flags);
1441 1437
1442 rc = register_netdev(netdev); 1438 rc = register_netdev(netdev);
1443 1439
1444 if(rc) { 1440 if(rc) {
1445 ibmveth_debug_printk("failed to register netdev rc=%d\n", rc); 1441 netdev_dbg(netdev, "failed to register netdev rc=%d\n", rc);
1446 free_netdev(netdev); 1442 free_netdev(netdev);
1447 return rc; 1443 return rc;
1448 } 1444 }
1449 1445
1450 ibmveth_debug_printk("registered\n"); 1446 netdev_dbg(netdev, "registered\n");
1451 1447
1452 return 0; 1448 return 0;
1453} 1449}