aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/br2684.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-08-28 18:22:09 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:48:27 -0400
commit522400623e240ad134cb4101b1fddc3245d2a7ed (patch)
treefb1f341426ae7cd5c977232c8084bf45819d1bea /net/atm/br2684.c
parent23f1f4eff85d3d2ec9ed589e3fdcbba59eaa083e (diff)
[ATM]: Replace DPRINTK() with pr_debug().
Get rid of using DPRINTK macro in ATM and use pr_debug (in kernel.h). Using the standard macro is cleaner and forces code to check for bad arguments and formatting. Fixes from Thomas Graf. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/br2684.c')
-rw-r--r--net/atm/br2684.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index c0f6861eefe3..81eb4f4cbe10 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -34,12 +34,6 @@ Author: Marcell GAL, 2000, XDSL Ltd, Hungary
34 */ 34 */
35/* #define FASTER_VERSION */ 35/* #define FASTER_VERSION */
36 36
37#ifdef DEBUG
38#define DPRINTK(format, args...) printk(KERN_DEBUG "br2684: " format, ##args)
39#else
40#define DPRINTK(format, args...)
41#endif
42
43#ifdef SKB_DEBUG 37#ifdef SKB_DEBUG
44static void skb_debug(const struct sk_buff *skb) 38static void skb_debug(const struct sk_buff *skb)
45{ 39{
@@ -180,7 +174,7 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
180 skb_debug(skb); 174 skb_debug(skb);
181 175
182 ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc; 176 ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
183 DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev); 177 pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev);
184 if (!atm_may_send(atmvcc, skb->truesize)) { 178 if (!atm_may_send(atmvcc, skb->truesize)) {
185 /* we free this here for now, because we cannot know in a higher 179 /* we free this here for now, because we cannot know in a higher
186 layer whether the skb point it supplied wasn't freed yet. 180 layer whether the skb point it supplied wasn't freed yet.
@@ -209,11 +203,11 @@ static int br2684_start_xmit(struct sk_buff *skb, struct net_device *dev)
209 struct br2684_dev *brdev = BRPRIV(dev); 203 struct br2684_dev *brdev = BRPRIV(dev);
210 struct br2684_vcc *brvcc; 204 struct br2684_vcc *brvcc;
211 205
212 DPRINTK("br2684_start_xmit, skb->dst=%p\n", skb->dst); 206 pr_debug("br2684_start_xmit, skb->dst=%p\n", skb->dst);
213 read_lock(&devs_lock); 207 read_lock(&devs_lock);
214 brvcc = pick_outgoing_vcc(skb, brdev); 208 brvcc = pick_outgoing_vcc(skb, brdev);
215 if (brvcc == NULL) { 209 if (brvcc == NULL) {
216 DPRINTK("no vcc attached to dev %s\n", dev->name); 210 pr_debug("no vcc attached to dev %s\n", dev->name);
217 brdev->stats.tx_errors++; 211 brdev->stats.tx_errors++;
218 brdev->stats.tx_carrier_errors++; 212 brdev->stats.tx_carrier_errors++;
219 /* netif_stop_queue(dev); */ 213 /* netif_stop_queue(dev); */
@@ -239,7 +233,7 @@ static int br2684_start_xmit(struct sk_buff *skb, struct net_device *dev)
239 233
240static struct net_device_stats *br2684_get_stats(struct net_device *dev) 234static struct net_device_stats *br2684_get_stats(struct net_device *dev)
241{ 235{
242 DPRINTK("br2684_get_stats\n"); 236 pr_debug("br2684_get_stats\n");
243 return &BRPRIV(dev)->stats; 237 return &BRPRIV(dev)->stats;
244} 238}
245 239
@@ -390,7 +384,7 @@ packet_fails_filter(__be16 type, struct br2684_vcc *brvcc, struct sk_buff *skb)
390 384
391static void br2684_close_vcc(struct br2684_vcc *brvcc) 385static void br2684_close_vcc(struct br2684_vcc *brvcc)
392{ 386{
393 DPRINTK("removing VCC %p from dev %p\n", brvcc, brvcc->device); 387 pr_debug("removing VCC %p from dev %p\n", brvcc, brvcc->device);
394 write_lock_irq(&devs_lock); 388 write_lock_irq(&devs_lock);
395 list_del(&brvcc->brvccs); 389 list_del(&brvcc->brvccs);
396 write_unlock_irq(&devs_lock); 390 write_unlock_irq(&devs_lock);
@@ -408,7 +402,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
408 struct br2684_dev *brdev = BRPRIV(net_dev); 402 struct br2684_dev *brdev = BRPRIV(net_dev);
409 int plen = sizeof(llc_oui_pid_pad) + ETH_HLEN; 403 int plen = sizeof(llc_oui_pid_pad) + ETH_HLEN;
410 404
411 DPRINTK("br2684_push\n"); 405 pr_debug("br2684_push\n");
412 406
413 if (unlikely(skb == NULL)) { 407 if (unlikely(skb == NULL)) {
414 /* skb==NULL means VCC is being destroyed */ 408 /* skb==NULL means VCC is being destroyed */
@@ -425,7 +419,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
425 419
426 skb_debug(skb); 420 skb_debug(skb);
427 atm_return(atmvcc, skb->truesize); 421 atm_return(atmvcc, skb->truesize);
428 DPRINTK("skb from brdev %p\n", brdev); 422 pr_debug("skb from brdev %p\n", brdev);
429 if (brvcc->encaps == e_llc) { 423 if (brvcc->encaps == e_llc) {
430 /* let us waste some time for checking the encapsulation. 424 /* let us waste some time for checking the encapsulation.
431 Note, that only 7 char is checked so frames with a valid FCS 425 Note, that only 7 char is checked so frames with a valid FCS
@@ -474,7 +468,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
474#endif /* CONFIG_ATM_BR2684_IPFILTER */ 468#endif /* CONFIG_ATM_BR2684_IPFILTER */
475 skb->dev = net_dev; 469 skb->dev = net_dev;
476 ATM_SKB(skb)->vcc = atmvcc; /* needed ? */ 470 ATM_SKB(skb)->vcc = atmvcc; /* needed ? */
477 DPRINTK("received packet's protocol: %x\n", ntohs(skb->protocol)); 471 pr_debug("received packet's protocol: %x\n", ntohs(skb->protocol));
478 skb_debug(skb); 472 skb_debug(skb);
479 if (unlikely(!(net_dev->flags & IFF_UP))) { 473 if (unlikely(!(net_dev->flags & IFF_UP))) {
480 /* sigh, interface is down */ 474 /* sigh, interface is down */
@@ -532,7 +526,7 @@ Note: we do not have explicit unassign, but look at _push()
532 err = -EINVAL; 526 err = -EINVAL;
533 goto error; 527 goto error;
534 } 528 }
535 DPRINTK("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc, be.encaps, 529 pr_debug("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc, be.encaps,
536 brvcc); 530 brvcc);
537 if (list_empty(&brdev->brvccs) && !brdev->mac_was_set) { 531 if (list_empty(&brdev->brvccs) && !brdev->mac_was_set) {
538 unsigned char *esi = atmvcc->dev->esi; 532 unsigned char *esi = atmvcc->dev->esi;
@@ -612,7 +606,7 @@ static int br2684_create(void __user *arg)
612 struct br2684_dev *brdev; 606 struct br2684_dev *brdev;
613 struct atm_newif_br2684 ni; 607 struct atm_newif_br2684 ni;
614 608
615 DPRINTK("br2684_create\n"); 609 pr_debug("br2684_create\n");
616 610
617 if (copy_from_user(&ni, arg, sizeof ni)) { 611 if (copy_from_user(&ni, arg, sizeof ni)) {
618 return -EFAULT; 612 return -EFAULT;
@@ -629,7 +623,7 @@ static int br2684_create(void __user *arg)
629 623
630 brdev = BRPRIV(netdev); 624 brdev = BRPRIV(netdev);
631 625
632 DPRINTK("registered netdev %s\n", netdev->name); 626 pr_debug("registered netdev %s\n", netdev->name);
633 /* open, stop, do_ioctl ? */ 627 /* open, stop, do_ioctl ? */
634 err = register_netdev(netdev); 628 err = register_netdev(netdev);
635 if (err < 0) { 629 if (err < 0) {