Commit c43ced18 authored by Santiago Leon's avatar Santiago Leon Committed by David S. Miller

ibmveth: Convert driver specific debug to netdev_dbg

Use netdev_dbg to standardise the debug output.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarSantiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e295fe83
...@@ -64,18 +64,12 @@ ...@@ -64,18 +64,12 @@
printk(KERN_ERR "(%s:%3.3d ua:%x) ERROR: " fmt, __FILE__, __LINE__ , adapter->vdev->unit_address, ## args) printk(KERN_ERR "(%s:%3.3d ua:%x) ERROR: " fmt, __FILE__, __LINE__ , adapter->vdev->unit_address, ## args)
#ifdef DEBUG #ifdef DEBUG
#define ibmveth_debug_printk_no_adapter(fmt, args...) \
printk(KERN_DEBUG "(%s:%3.3d): " fmt, __FILE__, __LINE__ , ## args)
#define ibmveth_debug_printk(fmt, args...) \
printk(KERN_DEBUG "(%s:%3.3d ua:%x): " fmt, __FILE__, __LINE__ , adapter->vdev->unit_address, ## args)
#define ibmveth_assert(expr) \ #define ibmveth_assert(expr) \
if(!(expr)) { \ if(!(expr)) { \
printk(KERN_DEBUG "assertion failed (%s:%3.3d ua:%x): %s\n", __FILE__, __LINE__, adapter->vdev->unit_address, #expr); \ printk(KERN_DEBUG "assertion failed (%s:%3.3d ua:%x): %s\n", __FILE__, __LINE__, adapter->vdev->unit_address, #expr); \
BUG(); \ BUG(); \
} }
#else #else
#define ibmveth_debug_printk_no_adapter(fmt, args...)
#define ibmveth_debug_printk(fmt, args...)
#define ibmveth_assert(expr) #define ibmveth_assert(expr)
#endif #endif
...@@ -248,7 +242,8 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc ...@@ -248,7 +242,8 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc
skb = netdev_alloc_skb(adapter->netdev, pool->buff_size); skb = netdev_alloc_skb(adapter->netdev, pool->buff_size);
if(!skb) { if(!skb) {
ibmveth_debug_printk("replenish: unable to allocate skb\n"); netdev_dbg(adapter->netdev,
"replenish: unable to allocate skb\n");
adapter->replenish_no_mem++; adapter->replenish_no_mem++;
break; break;
} }
...@@ -440,7 +435,8 @@ static void ibmveth_rxq_recycle_buffer(struct ibmveth_adapter *adapter) ...@@ -440,7 +435,8 @@ static void ibmveth_rxq_recycle_buffer(struct ibmveth_adapter *adapter)
lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc); lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);
if(lpar_rc != H_SUCCESS) { if(lpar_rc != H_SUCCESS) {
ibmveth_debug_printk("h_add_logical_lan_buffer failed during recycle rc=%ld", lpar_rc); netdev_dbg(adapter->netdev, "h_add_logical_lan_buffer failed "
"during recycle rc=%ld", lpar_rc);
ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator); ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator);
} }
...@@ -551,7 +547,7 @@ static int ibmveth_open(struct net_device *netdev) ...@@ -551,7 +547,7 @@ static int ibmveth_open(struct net_device *netdev)
int i; int i;
struct device *dev; struct device *dev;
ibmveth_debug_printk("open starting\n"); netdev_dbg(netdev, "open starting\n");
napi_enable(&adapter->napi); napi_enable(&adapter->napi);
...@@ -607,9 +603,9 @@ static int ibmveth_open(struct net_device *netdev) ...@@ -607,9 +603,9 @@ static int ibmveth_open(struct net_device *netdev)
rxq_desc.fields.flags_len = IBMVETH_BUF_VALID | adapter->rx_queue.queue_len; rxq_desc.fields.flags_len = IBMVETH_BUF_VALID | adapter->rx_queue.queue_len;
rxq_desc.fields.address = adapter->rx_queue.queue_dma; rxq_desc.fields.address = adapter->rx_queue.queue_dma;
ibmveth_debug_printk("buffer list @ 0x%p\n", adapter->buffer_list_addr); netdev_dbg(netdev, "buffer list @ 0x%p\n", adapter->buffer_list_addr);
ibmveth_debug_printk("filter list @ 0x%p\n", adapter->filter_list_addr); netdev_dbg(netdev, "filter list @ 0x%p\n", adapter->filter_list_addr);
ibmveth_debug_printk("receive q @ 0x%p\n", adapter->rx_queue.queue_addr); netdev_dbg(netdev, "receive q @ 0x%p\n", adapter->rx_queue.queue_addr);
h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE); h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
...@@ -639,7 +635,7 @@ static int ibmveth_open(struct net_device *netdev) ...@@ -639,7 +635,7 @@ static int ibmveth_open(struct net_device *netdev)
} }
} }
ibmveth_debug_printk("registering irq 0x%x\n", netdev->irq); netdev_dbg(netdev, "registering irq 0x%x\n", netdev->irq);
if((rc = request_irq(netdev->irq, ibmveth_interrupt, 0, netdev->name, netdev)) != 0) { if((rc = request_irq(netdev->irq, ibmveth_interrupt, 0, netdev->name, netdev)) != 0) {
ibmveth_error_printk("unable to request irq 0x%x, rc %d\n", netdev->irq, rc); ibmveth_error_printk("unable to request irq 0x%x, rc %d\n", netdev->irq, rc);
do { do {
...@@ -669,12 +665,12 @@ static int ibmveth_open(struct net_device *netdev) ...@@ -669,12 +665,12 @@ static int ibmveth_open(struct net_device *netdev)
return -ENOMEM; return -ENOMEM;
} }
ibmveth_debug_printk("initial replenish cycle\n"); netdev_dbg(netdev, "initial replenish cycle\n");
ibmveth_interrupt(netdev->irq, netdev); ibmveth_interrupt(netdev->irq, netdev);
netif_start_queue(netdev); netif_start_queue(netdev);
ibmveth_debug_printk("open complete\n"); netdev_dbg(netdev, "open complete\n");
return 0; return 0;
} }
...@@ -684,7 +680,7 @@ static int ibmveth_close(struct net_device *netdev) ...@@ -684,7 +680,7 @@ static int ibmveth_close(struct net_device *netdev)
struct ibmveth_adapter *adapter = netdev_priv(netdev); struct ibmveth_adapter *adapter = netdev_priv(netdev);
long lpar_rc; long lpar_rc;
ibmveth_debug_printk("close starting\n"); netdev_dbg(netdev, "close starting\n");
napi_disable(&adapter->napi); napi_disable(&adapter->napi);
...@@ -709,7 +705,7 @@ static int ibmveth_close(struct net_device *netdev) ...@@ -709,7 +705,7 @@ static int ibmveth_close(struct net_device *netdev)
ibmveth_cleanup(adapter); ibmveth_cleanup(adapter);
ibmveth_debug_printk("close complete\n"); netdev_dbg(netdev, "close complete\n");
return 0; return 0;
} }
...@@ -1109,7 +1105,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget) ...@@ -1109,7 +1105,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
if (!ibmveth_rxq_buffer_valid(adapter)) { if (!ibmveth_rxq_buffer_valid(adapter)) {
wmb(); /* suggested by larson1 */ wmb(); /* suggested by larson1 */
adapter->rx_invalid_buffer++; adapter->rx_invalid_buffer++;
ibmveth_debug_printk("recycling invalid buffer\n"); netdev_dbg(netdev, "recycling invalid buffer\n");
ibmveth_rxq_recycle_buffer(adapter); ibmveth_rxq_recycle_buffer(adapter);
} else { } else {
struct sk_buff *skb, *new_skb; struct sk_buff *skb, *new_skb;
...@@ -1359,7 +1355,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ ...@@ -1359,7 +1355,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
unsigned int *mcastFilterSize_p; unsigned int *mcastFilterSize_p;
ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n", dev_dbg(&dev->dev, "entering ibmveth_probe for UA 0x%x\n",
dev->unit_address); dev->unit_address);
mac_addr_p = (unsigned char *) vio_get_attribute(dev, mac_addr_p = (unsigned char *) vio_get_attribute(dev,
...@@ -1429,25 +1425,25 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ ...@@ -1429,25 +1425,25 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
kobject_uevent(kobj, KOBJ_ADD); kobject_uevent(kobj, KOBJ_ADD);
} }
ibmveth_debug_printk("adapter @ 0x%p\n", adapter); netdev_dbg(netdev, "adapter @ 0x%p\n", adapter);
adapter->buffer_list_dma = DMA_ERROR_CODE; adapter->buffer_list_dma = DMA_ERROR_CODE;
adapter->filter_list_dma = DMA_ERROR_CODE; adapter->filter_list_dma = DMA_ERROR_CODE;
adapter->rx_queue.queue_dma = DMA_ERROR_CODE; adapter->rx_queue.queue_dma = DMA_ERROR_CODE;
ibmveth_debug_printk("registering netdev...\n"); netdev_dbg(netdev, "registering netdev...\n");
ibmveth_set_csum_offload(netdev, 1, ibmveth_set_tx_csum_flags); ibmveth_set_csum_offload(netdev, 1, ibmveth_set_tx_csum_flags);
rc = register_netdev(netdev); rc = register_netdev(netdev);
if(rc) { if(rc) {
ibmveth_debug_printk("failed to register netdev rc=%d\n", rc); netdev_dbg(netdev, "failed to register netdev rc=%d\n", rc);
free_netdev(netdev); free_netdev(netdev);
return rc; return rc;
} }
ibmveth_debug_printk("registered\n"); netdev_dbg(netdev, "registered\n");
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment