aboutsummaryrefslogtreecommitdiffstats
path: root/net
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
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')
-rw-r--r--net/atm/br2684.c28
-rw-r--r--net/atm/clip.c62
-rw-r--r--net/atm/common.c23
-rw-r--r--net/atm/lec.c104
-rw-r--r--net/atm/pppoatm.c23
-rw-r--r--net/atm/raw.c12
-rw-r--r--net/atm/signaling.c25
-rw-r--r--net/atm/svc.c25
8 files changed, 120 insertions, 182 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) {
diff --git a/net/atm/clip.c b/net/atm/clip.c
index ecf0f79b94ae..806ea98567c6 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -40,14 +40,6 @@
40#include "resources.h" 40#include "resources.h"
41#include <net/atmclip.h> 41#include <net/atmclip.h>
42 42
43
44#if 0
45#define DPRINTK(format,args...) printk(format,##args)
46#else
47#define DPRINTK(format,args...)
48#endif
49
50
51static struct net_device *clip_devs; 43static struct net_device *clip_devs;
52static struct atm_vcc *atmarpd; 44static struct atm_vcc *atmarpd;
53static struct neigh_table clip_tbl; 45static struct neigh_table clip_tbl;
@@ -59,7 +51,7 @@ static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip)
59 struct atmarp_ctrl *ctrl; 51 struct atmarp_ctrl *ctrl;
60 struct sk_buff *skb; 52 struct sk_buff *skb;
61 53
62 DPRINTK("to_atmarpd(%d)\n", type); 54 pr_debug("to_atmarpd(%d)\n", type);
63 if (!atmarpd) 55 if (!atmarpd)
64 return -EUNATCH; 56 return -EUNATCH;
65 skb = alloc_skb(sizeof(struct atmarp_ctrl),GFP_ATOMIC); 57 skb = alloc_skb(sizeof(struct atmarp_ctrl),GFP_ATOMIC);
@@ -79,7 +71,7 @@ static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip)
79 71
80static void link_vcc(struct clip_vcc *clip_vcc, struct atmarp_entry *entry) 72static void link_vcc(struct clip_vcc *clip_vcc, struct atmarp_entry *entry)
81{ 73{
82 DPRINTK("link_vcc %p to entry %p (neigh %p)\n", clip_vcc, entry, 74 pr_debug("link_vcc %p to entry %p (neigh %p)\n", clip_vcc, entry,
83 entry->neigh); 75 entry->neigh);
84 clip_vcc->entry = entry; 76 clip_vcc->entry = entry;
85 clip_vcc->xoff = 0; /* @@@ may overrun buffer by one packet */ 77 clip_vcc->xoff = 0; /* @@@ may overrun buffer by one packet */
@@ -134,7 +126,7 @@ static int neigh_check_cb(struct neighbour *n)
134 unsigned long exp = cv->last_use + cv->idle_timeout; 126 unsigned long exp = cv->last_use + cv->idle_timeout;
135 127
136 if (cv->idle_timeout && time_after(jiffies, exp)) { 128 if (cv->idle_timeout && time_after(jiffies, exp)) {
137 DPRINTK("releasing vcc %p->%p of entry %p\n", 129 pr_debug("releasing vcc %p->%p of entry %p\n",
138 cv, cv->vcc, entry); 130 cv, cv->vcc, entry);
139 vcc_release_async(cv->vcc, -ETIMEDOUT); 131 vcc_release_async(cv->vcc, -ETIMEDOUT);
140 } 132 }
@@ -146,7 +138,7 @@ static int neigh_check_cb(struct neighbour *n)
146 if (atomic_read(&n->refcnt) > 1) { 138 if (atomic_read(&n->refcnt) > 1) {
147 struct sk_buff *skb; 139 struct sk_buff *skb;
148 140
149 DPRINTK("destruction postponed with ref %d\n", 141 pr_debug("destruction postponed with ref %d\n",
150 atomic_read(&n->refcnt)); 142 atomic_read(&n->refcnt));
151 143
152 while ((skb = skb_dequeue(&n->arp_queue)) != NULL) 144 while ((skb = skb_dequeue(&n->arp_queue)) != NULL)
@@ -155,7 +147,7 @@ static int neigh_check_cb(struct neighbour *n)
155 return 0; 147 return 0;
156 } 148 }
157 149
158 DPRINTK("expired neigh %p\n", n); 150 pr_debug("expired neigh %p\n", n);
159 return 1; 151 return 1;
160} 152}
161 153
@@ -171,14 +163,14 @@ static int clip_arp_rcv(struct sk_buff *skb)
171{ 163{
172 struct atm_vcc *vcc; 164 struct atm_vcc *vcc;
173 165
174 DPRINTK("clip_arp_rcv\n"); 166 pr_debug("clip_arp_rcv\n");
175 vcc = ATM_SKB(skb)->vcc; 167 vcc = ATM_SKB(skb)->vcc;
176 if (!vcc || !atm_charge(vcc, skb->truesize)) { 168 if (!vcc || !atm_charge(vcc, skb->truesize)) {
177 dev_kfree_skb_any(skb); 169 dev_kfree_skb_any(skb);
178 return 0; 170 return 0;
179 } 171 }
180 DPRINTK("pushing to %p\n", vcc); 172 pr_debug("pushing to %p\n", vcc);
181 DPRINTK("using %p\n", CLIP_VCC(vcc)->old_push); 173 pr_debug("using %p\n", CLIP_VCC(vcc)->old_push);
182 CLIP_VCC(vcc)->old_push(vcc, skb); 174 CLIP_VCC(vcc)->old_push(vcc, skb);
183 return 0; 175 return 0;
184} 176}
@@ -196,9 +188,9 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb)
196{ 188{
197 struct clip_vcc *clip_vcc = CLIP_VCC(vcc); 189 struct clip_vcc *clip_vcc = CLIP_VCC(vcc);
198 190
199 DPRINTK("clip push\n"); 191 pr_debug("clip push\n");
200 if (!skb) { 192 if (!skb) {
201 DPRINTK("removing VCC %p\n", clip_vcc); 193 pr_debug("removing VCC %p\n", clip_vcc);
202 if (clip_vcc->entry) 194 if (clip_vcc->entry)
203 unlink_clip_vcc(clip_vcc); 195 unlink_clip_vcc(clip_vcc);
204 clip_vcc->old_push(vcc, NULL); /* pass on the bad news */ 196 clip_vcc->old_push(vcc, NULL); /* pass on the bad news */
@@ -247,7 +239,7 @@ static void clip_pop(struct atm_vcc *vcc, struct sk_buff *skb)
247 int old; 239 int old;
248 unsigned long flags; 240 unsigned long flags;
249 241
250 DPRINTK("clip_pop(vcc %p)\n", vcc); 242 pr_debug("clip_pop(vcc %p)\n", vcc);
251 clip_vcc->old_pop(vcc, skb); 243 clip_vcc->old_pop(vcc, skb);
252 /* skb->dev == NULL in outbound ARP packets */ 244 /* skb->dev == NULL in outbound ARP packets */
253 if (!dev) 245 if (!dev)
@@ -263,7 +255,7 @@ static void clip_pop(struct atm_vcc *vcc, struct sk_buff *skb)
263 255
264static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb) 256static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb)
265{ 257{
266 DPRINTK("clip_neigh_solicit (neigh %p, skb %p)\n", neigh, skb); 258 pr_debug("clip_neigh_solicit (neigh %p, skb %p)\n", neigh, skb);
267 to_atmarpd(act_need, PRIV(neigh->dev)->number, NEIGH2ENTRY(neigh)->ip); 259 to_atmarpd(act_need, PRIV(neigh->dev)->number, NEIGH2ENTRY(neigh)->ip);
268} 260}
269 261
@@ -292,7 +284,7 @@ static int clip_constructor(struct neighbour *neigh)
292 struct in_device *in_dev; 284 struct in_device *in_dev;
293 struct neigh_parms *parms; 285 struct neigh_parms *parms;
294 286
295 DPRINTK("clip_constructor (neigh %p, entry %p)\n", neigh, entry); 287 pr_debug("clip_constructor (neigh %p, entry %p)\n", neigh, entry);
296 neigh->type = inet_addr_type(entry->ip); 288 neigh->type = inet_addr_type(entry->ip);
297 if (neigh->type != RTN_UNICAST) 289 if (neigh->type != RTN_UNICAST)
298 return -EINVAL; 290 return -EINVAL;
@@ -376,7 +368,7 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev)
376 int old; 368 int old;
377 unsigned long flags; 369 unsigned long flags;
378 370
379 DPRINTK("clip_start_xmit (skb %p)\n", skb); 371 pr_debug("clip_start_xmit (skb %p)\n", skb);
380 if (!skb->dst) { 372 if (!skb->dst) {
381 printk(KERN_ERR "clip_start_xmit: skb->dst == NULL\n"); 373 printk(KERN_ERR "clip_start_xmit: skb->dst == NULL\n");
382 dev_kfree_skb(skb); 374 dev_kfree_skb(skb);
@@ -412,9 +404,9 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev)
412 } 404 }
413 return 0; 405 return 0;
414 } 406 }
415 DPRINTK("neigh %p, vccs %p\n", entry, entry->vccs); 407 pr_debug("neigh %p, vccs %p\n", entry, entry->vccs);
416 ATM_SKB(skb)->vcc = vcc = entry->vccs->vcc; 408 ATM_SKB(skb)->vcc = vcc = entry->vccs->vcc;
417 DPRINTK("using neighbour %p, vcc %p\n", skb->dst->neighbour, vcc); 409 pr_debug("using neighbour %p, vcc %p\n", skb->dst->neighbour, vcc);
418 if (entry->vccs->encap) { 410 if (entry->vccs->encap) {
419 void *here; 411 void *here;
420 412
@@ -425,7 +417,7 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev)
425 atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); 417 atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
426 ATM_SKB(skb)->atm_options = vcc->atm_options; 418 ATM_SKB(skb)->atm_options = vcc->atm_options;
427 entry->vccs->last_use = jiffies; 419 entry->vccs->last_use = jiffies;
428 DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, vcc, vcc->dev); 420 pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, vcc, vcc->dev);
429 old = xchg(&entry->vccs->xoff, 1); /* assume XOFF ... */ 421 old = xchg(&entry->vccs->xoff, 1); /* assume XOFF ... */
430 if (old) { 422 if (old) {
431 printk(KERN_WARNING "clip_start_xmit: XOFF->XOFF transition\n"); 423 printk(KERN_WARNING "clip_start_xmit: XOFF->XOFF transition\n");
@@ -468,7 +460,7 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout)
468 clip_vcc = kmalloc(sizeof(struct clip_vcc), GFP_KERNEL); 460 clip_vcc = kmalloc(sizeof(struct clip_vcc), GFP_KERNEL);
469 if (!clip_vcc) 461 if (!clip_vcc)
470 return -ENOMEM; 462 return -ENOMEM;
471 DPRINTK("mkip clip_vcc %p vcc %p\n", clip_vcc, vcc); 463 pr_debug("mkip clip_vcc %p vcc %p\n", clip_vcc, vcc);
472 clip_vcc->vcc = vcc; 464 clip_vcc->vcc = vcc;
473 vcc->user_back = clip_vcc; 465 vcc->user_back = clip_vcc;
474 set_bit(ATM_VF_IS_CLIP, &vcc->flags); 466 set_bit(ATM_VF_IS_CLIP, &vcc->flags);
@@ -538,7 +530,7 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
538 printk(KERN_ERR "hiding hidden ATMARP entry\n"); 530 printk(KERN_ERR "hiding hidden ATMARP entry\n");
539 return 0; 531 return 0;
540 } 532 }
541 DPRINTK("setentry: remove\n"); 533 pr_debug("setentry: remove\n");
542 unlink_clip_vcc(clip_vcc); 534 unlink_clip_vcc(clip_vcc);
543 return 0; 535 return 0;
544 } 536 }
@@ -552,9 +544,9 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
552 entry = NEIGH2ENTRY(neigh); 544 entry = NEIGH2ENTRY(neigh);
553 if (entry != clip_vcc->entry) { 545 if (entry != clip_vcc->entry) {
554 if (!clip_vcc->entry) 546 if (!clip_vcc->entry)
555 DPRINTK("setentry: add\n"); 547 pr_debug("setentry: add\n");
556 else { 548 else {
557 DPRINTK("setentry: update\n"); 549 pr_debug("setentry: update\n");
558 unlink_clip_vcc(clip_vcc); 550 unlink_clip_vcc(clip_vcc);
559 } 551 }
560 link_vcc(clip_vcc, entry); 552 link_vcc(clip_vcc, entry);
@@ -611,7 +603,7 @@ static int clip_create(int number)
611 } 603 }
612 clip_priv->next = clip_devs; 604 clip_priv->next = clip_devs;
613 clip_devs = dev; 605 clip_devs = dev;
614 DPRINTK("registered (net:%s)\n", dev->name); 606 pr_debug("registered (net:%s)\n", dev->name);
615 return number; 607 return number;
616} 608}
617 609
@@ -631,16 +623,16 @@ static int clip_device_event(struct notifier_block *this, unsigned long event,
631 623
632 switch (event) { 624 switch (event) {
633 case NETDEV_UP: 625 case NETDEV_UP:
634 DPRINTK("clip_device_event NETDEV_UP\n"); 626 pr_debug("clip_device_event NETDEV_UP\n");
635 to_atmarpd(act_up, PRIV(dev)->number, 0); 627 to_atmarpd(act_up, PRIV(dev)->number, 0);
636 break; 628 break;
637 case NETDEV_GOING_DOWN: 629 case NETDEV_GOING_DOWN:
638 DPRINTK("clip_device_event NETDEV_DOWN\n"); 630 pr_debug("clip_device_event NETDEV_DOWN\n");
639 to_atmarpd(act_down, PRIV(dev)->number, 0); 631 to_atmarpd(act_down, PRIV(dev)->number, 0);
640 break; 632 break;
641 case NETDEV_CHANGE: 633 case NETDEV_CHANGE:
642 case NETDEV_CHANGEMTU: 634 case NETDEV_CHANGEMTU:
643 DPRINTK("clip_device_event NETDEV_CHANGE*\n"); 635 pr_debug("clip_device_event NETDEV_CHANGE*\n");
644 to_atmarpd(act_change, PRIV(dev)->number, 0); 636 to_atmarpd(act_change, PRIV(dev)->number, 0);
645 break; 637 break;
646 } 638 }
@@ -681,14 +673,14 @@ static struct notifier_block clip_inet_notifier = {
681 673
682static void atmarpd_close(struct atm_vcc *vcc) 674static void atmarpd_close(struct atm_vcc *vcc)
683{ 675{
684 DPRINTK("atmarpd_close\n"); 676 pr_debug("atmarpd_close\n");
685 677
686 rtnl_lock(); 678 rtnl_lock();
687 atmarpd = NULL; 679 atmarpd = NULL;
688 skb_queue_purge(&sk_atm(vcc)->sk_receive_queue); 680 skb_queue_purge(&sk_atm(vcc)->sk_receive_queue);
689 rtnl_unlock(); 681 rtnl_unlock();
690 682
691 DPRINTK("(done)\n"); 683 pr_debug("(done)\n");
692 module_put(THIS_MODULE); 684 module_put(THIS_MODULE);
693} 685}
694 686
diff --git a/net/atm/common.c b/net/atm/common.c
index 282d761454ba..299ec1eb872a 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -30,13 +30,6 @@
30#include "addr.h" /* address registry */ 30#include "addr.h" /* address registry */
31#include "signaling.h" /* for WAITING and sigd_attach */ 31#include "signaling.h" /* for WAITING and sigd_attach */
32 32
33
34#if 0
35#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
36#else
37#define DPRINTK(format,args...)
38#endif
39
40struct hlist_head vcc_hash[VCC_HTABLE_SIZE]; 33struct hlist_head vcc_hash[VCC_HTABLE_SIZE];
41DEFINE_RWLOCK(vcc_sklist_lock); 34DEFINE_RWLOCK(vcc_sklist_lock);
42 35
@@ -70,13 +63,13 @@ static struct sk_buff *alloc_tx(struct atm_vcc *vcc,unsigned int size)
70 struct sock *sk = sk_atm(vcc); 63 struct sock *sk = sk_atm(vcc);
71 64
72 if (atomic_read(&sk->sk_wmem_alloc) && !atm_may_send(vcc, size)) { 65 if (atomic_read(&sk->sk_wmem_alloc) && !atm_may_send(vcc, size)) {
73 DPRINTK("Sorry: wmem_alloc = %d, size = %d, sndbuf = %d\n", 66 pr_debug("Sorry: wmem_alloc = %d, size = %d, sndbuf = %d\n",
74 atomic_read(&sk->sk_wmem_alloc), size, 67 atomic_read(&sk->sk_wmem_alloc), size,
75 sk->sk_sndbuf); 68 sk->sk_sndbuf);
76 return NULL; 69 return NULL;
77 } 70 }
78 while (!(skb = alloc_skb(size,GFP_KERNEL))) schedule(); 71 while (!(skb = alloc_skb(size,GFP_KERNEL))) schedule();
79 DPRINTK("AlTx %d += %d\n", atomic_read(&sk->sk_wmem_alloc), 72 pr_debug("AlTx %d += %d\n", atomic_read(&sk->sk_wmem_alloc),
80 skb->truesize); 73 skb->truesize);
81 atomic_add(skb->truesize, &sk->sk_wmem_alloc); 74 atomic_add(skb->truesize, &sk->sk_wmem_alloc);
82 return skb; 75 return skb;
@@ -392,10 +385,10 @@ static int __vcc_connect(struct atm_vcc *vcc, struct atm_dev *dev, short vpi,
392 if (!error) error = adjust_tp(&vcc->qos.rxtp,vcc->qos.aal); 385 if (!error) error = adjust_tp(&vcc->qos.rxtp,vcc->qos.aal);
393 if (error) 386 if (error)
394 goto fail; 387 goto fail;
395 DPRINTK("VCC %d.%d, AAL %d\n",vpi,vci,vcc->qos.aal); 388 pr_debug("VCC %d.%d, AAL %d\n",vpi,vci,vcc->qos.aal);
396 DPRINTK(" TX: %d, PCR %d..%d, SDU %d\n",vcc->qos.txtp.traffic_class, 389 pr_debug(" TX: %d, PCR %d..%d, SDU %d\n",vcc->qos.txtp.traffic_class,
397 vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu); 390 vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu);
398 DPRINTK(" RX: %d, PCR %d..%d, SDU %d\n",vcc->qos.rxtp.traffic_class, 391 pr_debug(" RX: %d, PCR %d..%d, SDU %d\n",vcc->qos.rxtp.traffic_class,
399 vcc->qos.rxtp.min_pcr,vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu); 392 vcc->qos.rxtp.min_pcr,vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu);
400 393
401 if (dev->ops->open) { 394 if (dev->ops->open) {
@@ -420,7 +413,7 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci)
420 struct atm_vcc *vcc = ATM_SD(sock); 413 struct atm_vcc *vcc = ATM_SD(sock);
421 int error; 414 int error;
422 415
423 DPRINTK("vcc_connect (vpi %d, vci %d)\n",vpi,vci); 416 pr_debug("vcc_connect (vpi %d, vci %d)\n",vpi,vci);
424 if (sock->state == SS_CONNECTED) 417 if (sock->state == SS_CONNECTED)
425 return -EISCONN; 418 return -EISCONN;
426 if (sock->state != SS_UNCONNECTED) 419 if (sock->state != SS_UNCONNECTED)
@@ -433,7 +426,7 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci)
433 else 426 else
434 if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) 427 if (test_bit(ATM_VF_PARTIAL,&vcc->flags))
435 return -EINVAL; 428 return -EINVAL;
436 DPRINTK("vcc_connect (TX: cl %d,bw %d-%d,sdu %d; " 429 pr_debug("vcc_connect (TX: cl %d,bw %d-%d,sdu %d; "
437 "RX: cl %d,bw %d-%d,sdu %d,AAL %s%d)\n", 430 "RX: cl %d,bw %d-%d,sdu %d,AAL %s%d)\n",
438 vcc->qos.txtp.traffic_class,vcc->qos.txtp.min_pcr, 431 vcc->qos.txtp.traffic_class,vcc->qos.txtp.min_pcr,
439 vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu, 432 vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu,
@@ -504,7 +497,7 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
504 if (error) 497 if (error)
505 return error; 498 return error;
506 sock_recv_timestamp(msg, sk, skb); 499 sock_recv_timestamp(msg, sk, skb);
507 DPRINTK("RcvM %d -= %d\n", atomic_read(&sk->rmem_alloc), skb->truesize); 500 pr_debug("RcvM %d -= %d\n", atomic_read(&sk->sk_rmem_alloc), skb->truesize);
508 atm_return(vcc, skb->truesize); 501 atm_return(vcc, skb->truesize);
509 skb_free_datagram(sk, skb); 502 skb_free_datagram(sk, skb);
510 return copied; 503 return copied;
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 59d5aa3366f2..813a090dcaf4 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -48,12 +48,6 @@ static unsigned char bridge_ula_lec[] = { 0x01, 0x80, 0xc2, 0x00, 0x00 };
48#include "lec_arpc.h" 48#include "lec_arpc.h"
49#include "resources.h" 49#include "resources.h"
50 50
51#if 0
52#define DPRINTK printk
53#else
54#define DPRINTK(format,args...)
55#endif
56
57#define DUMP_PACKETS 0 /* 51#define DUMP_PACKETS 0 /*
58 * 0 = None, 52 * 0 = None,
59 * 1 = 30 first bytes 53 * 1 = 30 first bytes
@@ -273,7 +267,7 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
273 int i = 0; 267 int i = 0;
274#endif /* DUMP_PACKETS >0 */ 268#endif /* DUMP_PACKETS >0 */
275 269
276 DPRINTK("lec_start_xmit called\n"); 270 pr_debug("lec_start_xmit called\n");
277 if (!priv->lecd) { 271 if (!priv->lecd) {
278 printk("%s:No lecd attached\n", dev->name); 272 printk("%s:No lecd attached\n", dev->name);
279 priv->stats.tx_errors++; 273 priv->stats.tx_errors++;
@@ -281,7 +275,7 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
281 return -EUNATCH; 275 return -EUNATCH;
282 } 276 }
283 277
284 DPRINTK("skbuff head:%lx data:%lx tail:%lx end:%lx\n", 278 pr_debug("skbuff head:%lx data:%lx tail:%lx end:%lx\n",
285 (long)skb->head, (long)skb->data, (long)skb_tail_pointer(skb), 279 (long)skb->head, (long)skb->data, (long)skb_tail_pointer(skb),
286 (long)skb_end_pointer(skb)); 280 (long)skb_end_pointer(skb));
287#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) 281#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
@@ -292,7 +286,7 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
292 /* Make sure we have room for lec_id */ 286 /* Make sure we have room for lec_id */
293 if (skb_headroom(skb) < 2) { 287 if (skb_headroom(skb) < 2) {
294 288
295 DPRINTK("lec_start_xmit: reallocating skb\n"); 289 pr_debug("lec_start_xmit: reallocating skb\n");
296 skb2 = skb_realloc_headroom(skb, LEC_HEADER_LEN); 290 skb2 = skb_realloc_headroom(skb, LEC_HEADER_LEN);
297 kfree_skb(skb); 291 kfree_skb(skb);
298 if (skb2 == NULL) 292 if (skb2 == NULL)
@@ -373,22 +367,22 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
373#endif 367#endif
374 entry = NULL; 368 entry = NULL;
375 vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry); 369 vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry);
376 DPRINTK("%s:vcc:%p vcc_flags:%x, entry:%p\n", dev->name, 370 pr_debug("%s:vcc:%p vcc_flags:%x, entry:%p\n", dev->name,
377 vcc, vcc ? vcc->flags : 0, entry); 371 vcc, vcc ? vcc->flags : 0, entry);
378 if (!vcc || !test_bit(ATM_VF_READY, &vcc->flags)) { 372 if (!vcc || !test_bit(ATM_VF_READY, &vcc->flags)) {
379 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { 373 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) {
380 DPRINTK("%s:lec_start_xmit: queuing packet, ", 374 pr_debug("%s:lec_start_xmit: queuing packet, ",
381 dev->name); 375 dev->name);
382 DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", 376 pr_debug("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n",
383 lec_h->h_dest[0], lec_h->h_dest[1], 377 lec_h->h_dest[0], lec_h->h_dest[1],
384 lec_h->h_dest[2], lec_h->h_dest[3], 378 lec_h->h_dest[2], lec_h->h_dest[3],
385 lec_h->h_dest[4], lec_h->h_dest[5]); 379 lec_h->h_dest[4], lec_h->h_dest[5]);
386 skb_queue_tail(&entry->tx_wait, skb); 380 skb_queue_tail(&entry->tx_wait, skb);
387 } else { 381 } else {
388 DPRINTK 382 pr_debug
389 ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ", 383 ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ",
390 dev->name); 384 dev->name);
391 DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", 385 pr_debug("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n",
392 lec_h->h_dest[0], lec_h->h_dest[1], 386 lec_h->h_dest[0], lec_h->h_dest[1],
393 lec_h->h_dest[2], lec_h->h_dest[3], 387 lec_h->h_dest[2], lec_h->h_dest[3],
394 lec_h->h_dest[4], lec_h->h_dest[5]); 388 lec_h->h_dest[4], lec_h->h_dest[5]);
@@ -402,8 +396,8 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
402#endif /* DUMP_PACKETS > 0 */ 396#endif /* DUMP_PACKETS > 0 */
403 397
404 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { 398 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) {
405 DPRINTK("lec.c: emptying tx queue, "); 399 pr_debug("lec.c: emptying tx queue, ");
406 DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", 400 pr_debug("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n",
407 lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2], 401 lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2],
408 lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]); 402 lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]);
409 lec_send(vcc, skb2, priv); 403 lec_send(vcc, skb2, priv);
@@ -464,7 +458,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
464 mesg = (struct atmlec_msg *)skb->data; 458 mesg = (struct atmlec_msg *)skb->data;
465 tmp = skb->data; 459 tmp = skb->data;
466 tmp += sizeof(struct atmlec_msg); 460 tmp += sizeof(struct atmlec_msg);
467 DPRINTK("%s: msg from zeppelin:%d\n", dev->name, mesg->type); 461 pr_debug("%s: msg from zeppelin:%d\n", dev->name, mesg->type);
468 switch (mesg->type) { 462 switch (mesg->type) {
469 case l_set_mac_addr: 463 case l_set_mac_addr:
470 for (i = 0; i < 6; i++) { 464 for (i = 0; i < 6; i++) {
@@ -500,9 +494,9 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
500 mesg->content.normal.atm_addr, 494 mesg->content.normal.atm_addr,
501 mesg->content.normal.flag, 495 mesg->content.normal.flag,
502 mesg->content.normal.targetless_le_arp); 496 mesg->content.normal.targetless_le_arp);
503 DPRINTK("lec: in l_arp_update\n"); 497 pr_debug("lec: in l_arp_update\n");
504 if (mesg->sizeoftlvs != 0) { /* LANE2 3.1.5 */ 498 if (mesg->sizeoftlvs != 0) { /* LANE2 3.1.5 */
505 DPRINTK("lec: LANE2 3.1.5, got tlvs, size %d\n", 499 pr_debug("lec: LANE2 3.1.5, got tlvs, size %d\n",
506 mesg->sizeoftlvs); 500 mesg->sizeoftlvs);
507 lane2_associate_ind(dev, mesg->content.normal.mac_addr, 501 lane2_associate_ind(dev, mesg->content.normal.mac_addr,
508 tmp, mesg->sizeoftlvs); 502 tmp, mesg->sizeoftlvs);
@@ -544,7 +538,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
544 { 538 {
545 struct net_bridge_fdb_entry *f; 539 struct net_bridge_fdb_entry *f;
546 540
547 DPRINTK 541 pr_debug
548 ("%s: bridge zeppelin asks about 0x%02x:%02x:%02x:%02x:%02x:%02x\n", 542 ("%s: bridge zeppelin asks about 0x%02x:%02x:%02x:%02x:%02x:%02x\n",
549 dev->name, mesg->content.proxy.mac_addr[0], 543 dev->name, mesg->content.proxy.mac_addr[0],
550 mesg->content.proxy.mac_addr[1], 544 mesg->content.proxy.mac_addr[1],
@@ -564,7 +558,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
564 struct sk_buff *skb2; 558 struct sk_buff *skb2;
565 struct sock *sk; 559 struct sock *sk;
566 560
567 DPRINTK 561 pr_debug
568 ("%s: entry found, responding to zeppelin\n", 562 ("%s: entry found, responding to zeppelin\n",
569 dev->name); 563 dev->name);
570 skb2 = 564 skb2 =
@@ -670,7 +664,7 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type,
670 sk->sk_data_ready(sk, skb->len); 664 sk->sk_data_ready(sk, skb->len);
671 665
672 if (data != NULL) { 666 if (data != NULL) {
673 DPRINTK("lec: about to send %d bytes of data\n", data->len); 667 pr_debug("lec: about to send %d bytes of data\n", data->len);
674 atm_force_charge(priv->lecd, data->truesize); 668 atm_force_charge(priv->lecd, data->truesize);
675 skb_queue_tail(&sk->sk_receive_queue, data); 669 skb_queue_tail(&sk->sk_receive_queue, data);
676 sk->sk_data_ready(sk, skb->len); 670 sk->sk_data_ready(sk, skb->len);
@@ -742,7 +736,7 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
742 vcc->vpi, vcc->vci); 736 vcc->vpi, vcc->vci);
743#endif 737#endif
744 if (!skb) { 738 if (!skb) {
745 DPRINTK("%s: null skb\n", dev->name); 739 pr_debug("%s: null skb\n", dev->name);
746 lec_vcc_close(priv, vcc); 740 lec_vcc_close(priv, vcc);
747 return; 741 return;
748 } 742 }
@@ -766,7 +760,7 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
766 if (memcmp(skb->data, lec_ctrl_magic, 4) == 0) { /* Control frame, to daemon */ 760 if (memcmp(skb->data, lec_ctrl_magic, 4) == 0) { /* Control frame, to daemon */
767 struct sock *sk = sk_atm(vcc); 761 struct sock *sk = sk_atm(vcc);
768 762
769 DPRINTK("%s: To daemon\n", dev->name); 763 pr_debug("%s: To daemon\n", dev->name);
770 skb_queue_tail(&sk->sk_receive_queue, skb); 764 skb_queue_tail(&sk->sk_receive_queue, skb);
771 sk->sk_data_ready(sk, skb->len); 765 sk->sk_data_ready(sk, skb->len);
772 } else { /* Data frame, queue to protocol handlers */ 766 } else { /* Data frame, queue to protocol handlers */
@@ -780,7 +774,7 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
780 * Probably looping back, or if lecd is missing, 774 * Probably looping back, or if lecd is missing,
781 * lecd has gone down 775 * lecd has gone down
782 */ 776 */
783 DPRINTK("Ignoring frame...\n"); 777 pr_debug("Ignoring frame...\n");
784 dev_kfree_skb(skb); 778 dev_kfree_skb(skb);
785 return; 779 return;
786 } 780 }
@@ -1442,9 +1436,9 @@ static void lane2_associate_ind(struct net_device *dev, u8 *mac_addr,
1442#include <net/route.h> 1436#include <net/route.h>
1443 1437
1444#if 0 1438#if 0
1445#define DPRINTK(format,args...) 1439#define pr_debug(format,args...)
1446/* 1440/*
1447#define DPRINTK printk 1441#define pr_debug printk
1448*/ 1442*/
1449#endif 1443#endif
1450#define DEBUG_ARP_TABLE 0 1444#define DEBUG_ARP_TABLE 0
@@ -1513,7 +1507,7 @@ lec_arp_add(struct lec_priv *priv, struct lec_arp_table *entry)
1513 tmp = &priv->lec_arp_tables[HASH(entry->mac_addr[ETH_ALEN - 1])]; 1507 tmp = &priv->lec_arp_tables[HASH(entry->mac_addr[ETH_ALEN - 1])];
1514 hlist_add_head(&entry->next, tmp); 1508 hlist_add_head(&entry->next, tmp);
1515 1509
1516 DPRINTK("LEC_ARP: Added entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", 1510 pr_debug("LEC_ARP: Added entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n",
1517 0xff & entry->mac_addr[0], 0xff & entry->mac_addr[1], 1511 0xff & entry->mac_addr[0], 0xff & entry->mac_addr[1],
1518 0xff & entry->mac_addr[2], 0xff & entry->mac_addr[3], 1512 0xff & entry->mac_addr[2], 0xff & entry->mac_addr[3],
1519 0xff & entry->mac_addr[4], 0xff & entry->mac_addr[5]); 1513 0xff & entry->mac_addr[4], 0xff & entry->mac_addr[5]);
@@ -1555,7 +1549,7 @@ lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove)
1555 } 1549 }
1556 skb_queue_purge(&to_remove->tx_wait); /* FIXME: good place for this? */ 1550 skb_queue_purge(&to_remove->tx_wait); /* FIXME: good place for this? */
1557 1551
1558 DPRINTK("LEC_ARP: Removed entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", 1552 pr_debug("LEC_ARP: Removed entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n",
1559 0xff & to_remove->mac_addr[0], 0xff & to_remove->mac_addr[1], 1553 0xff & to_remove->mac_addr[0], 0xff & to_remove->mac_addr[1],
1560 0xff & to_remove->mac_addr[2], 0xff & to_remove->mac_addr[3], 1554 0xff & to_remove->mac_addr[2], 0xff & to_remove->mac_addr[3],
1561 0xff & to_remove->mac_addr[4], 0xff & to_remove->mac_addr[5]); 1555 0xff & to_remove->mac_addr[4], 0xff & to_remove->mac_addr[5]);
@@ -1777,7 +1771,7 @@ static struct lec_arp_table *lec_arp_find(struct lec_priv *priv,
1777 struct hlist_head *head; 1771 struct hlist_head *head;
1778 struct lec_arp_table *entry; 1772 struct lec_arp_table *entry;
1779 1773
1780 DPRINTK("LEC_ARP: lec_arp_find :%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", 1774 pr_debug("LEC_ARP: lec_arp_find :%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n",
1781 mac_addr[0] & 0xff, mac_addr[1] & 0xff, mac_addr[2] & 0xff, 1775 mac_addr[0] & 0xff, mac_addr[1] & 0xff, mac_addr[2] & 0xff,
1782 mac_addr[3] & 0xff, mac_addr[4] & 0xff, mac_addr[5] & 0xff); 1776 mac_addr[3] & 0xff, mac_addr[4] & 0xff, mac_addr[5] & 0xff);
1783 1777
@@ -1819,7 +1813,7 @@ static void lec_arp_expire_arp(unsigned long data)
1819 1813
1820 entry = (struct lec_arp_table *)data; 1814 entry = (struct lec_arp_table *)data;
1821 1815
1822 DPRINTK("lec_arp_expire_arp\n"); 1816 pr_debug("lec_arp_expire_arp\n");
1823 if (entry->status == ESI_ARP_PENDING) { 1817 if (entry->status == ESI_ARP_PENDING) {
1824 if (entry->no_tries <= entry->priv->max_retry_count) { 1818 if (entry->no_tries <= entry->priv->max_retry_count) {
1825 if (entry->is_rdesc) 1819 if (entry->is_rdesc)
@@ -1843,7 +1837,7 @@ static void lec_arp_expire_vcc(unsigned long data)
1843 1837
1844 del_timer(&to_remove->timer); 1838 del_timer(&to_remove->timer);
1845 1839
1846 DPRINTK("LEC_ARP %p %p: lec_arp_expire_vcc vpi:%d vci:%d\n", 1840 pr_debug("LEC_ARP %p %p: lec_arp_expire_vcc vpi:%d vci:%d\n",
1847 to_remove, priv, 1841 to_remove, priv,
1848 to_remove->vcc ? to_remove->recv_vcc->vpi : 0, 1842 to_remove->vcc ? to_remove->recv_vcc->vpi : 0,
1849 to_remove->vcc ? to_remove->recv_vcc->vci : 0); 1843 to_remove->vcc ? to_remove->recv_vcc->vci : 0);
@@ -1883,7 +1877,7 @@ static void lec_arp_check_expire(struct work_struct *work)
1883 unsigned long time_to_check; 1877 unsigned long time_to_check;
1884 int i; 1878 int i;
1885 1879
1886 DPRINTK("lec_arp_check_expire %p\n", priv); 1880 pr_debug("lec_arp_check_expire %p\n", priv);
1887 now = jiffies; 1881 now = jiffies;
1888restart: 1882restart:
1889 spin_lock_irqsave(&priv->lec_arp_lock, flags); 1883 spin_lock_irqsave(&priv->lec_arp_lock, flags);
@@ -1895,13 +1889,13 @@ restart:
1895 else 1889 else
1896 time_to_check = priv->aging_time; 1890 time_to_check = priv->aging_time;
1897 1891
1898 DPRINTK("About to expire: %lx - %lx > %lx\n", 1892 pr_debug("About to expire: %lx - %lx > %lx\n",
1899 now, entry->last_used, time_to_check); 1893 now, entry->last_used, time_to_check);
1900 if (time_after(now, entry->last_used + time_to_check) 1894 if (time_after(now, entry->last_used + time_to_check)
1901 && !(entry->flags & LEC_PERMANENT_FLAG) 1895 && !(entry->flags & LEC_PERMANENT_FLAG)
1902 && !(entry->mac_addr[0] & 0x01)) { /* LANE2: 7.1.20 */ 1896 && !(entry->mac_addr[0] & 0x01)) { /* LANE2: 7.1.20 */
1903 /* Remove entry */ 1897 /* Remove entry */
1904 DPRINTK("LEC:Entry timed out\n"); 1898 pr_debug("LEC:Entry timed out\n");
1905 lec_arp_remove(priv, entry); 1899 lec_arp_remove(priv, entry);
1906 lec_arp_put(entry); 1900 lec_arp_put(entry);
1907 } else { 1901 } else {
@@ -1999,7 +1993,7 @@ static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv,
1999 entry->packets_flooded < 1993 entry->packets_flooded <
2000 priv->maximum_unknown_frame_count) { 1994 priv->maximum_unknown_frame_count) {
2001 entry->packets_flooded++; 1995 entry->packets_flooded++;
2002 DPRINTK("LEC_ARP: Flooding..\n"); 1996 pr_debug("LEC_ARP: Flooding..\n");
2003 found = priv->mcast_vcc; 1997 found = priv->mcast_vcc;
2004 goto out; 1998 goto out;
2005 } 1999 }
@@ -2010,13 +2004,13 @@ static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv,
2010 */ 2004 */
2011 lec_arp_hold(entry); 2005 lec_arp_hold(entry);
2012 *ret_entry = entry; 2006 *ret_entry = entry;
2013 DPRINTK("lec: entry->status %d entry->vcc %p\n", entry->status, 2007 pr_debug("lec: entry->status %d entry->vcc %p\n", entry->status,
2014 entry->vcc); 2008 entry->vcc);
2015 found = NULL; 2009 found = NULL;
2016 } else { 2010 } else {
2017 /* No matching entry was found */ 2011 /* No matching entry was found */
2018 entry = make_entry(priv, mac_to_find); 2012 entry = make_entry(priv, mac_to_find);
2019 DPRINTK("LEC_ARP: Making entry\n"); 2013 pr_debug("LEC_ARP: Making entry\n");
2020 if (!entry) { 2014 if (!entry) {
2021 found = priv->mcast_vcc; 2015 found = priv->mcast_vcc;
2022 goto out; 2016 goto out;
@@ -2053,7 +2047,7 @@ lec_addr_delete(struct lec_priv *priv, unsigned char *atm_addr,
2053 struct lec_arp_table *entry; 2047 struct lec_arp_table *entry;
2054 int i; 2048 int i;
2055 2049
2056 DPRINTK("lec_addr_delete\n"); 2050 pr_debug("lec_addr_delete\n");
2057 spin_lock_irqsave(&priv->lec_arp_lock, flags); 2051 spin_lock_irqsave(&priv->lec_arp_lock, flags);
2058 for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) { 2052 for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) {
2059 hlist_for_each_entry_safe(entry, node, next, &priv->lec_arp_tables[i], next) { 2053 hlist_for_each_entry_safe(entry, node, next, &priv->lec_arp_tables[i], next) {
@@ -2084,8 +2078,8 @@ lec_arp_update(struct lec_priv *priv, unsigned char *mac_addr,
2084 struct lec_arp_table *entry, *tmp; 2078 struct lec_arp_table *entry, *tmp;
2085 int i; 2079 int i;
2086 2080
2087 DPRINTK("lec:%s", (targetless_le_arp) ? "targetless " : " "); 2081 pr_debug("lec:%s", (targetless_le_arp) ? "targetless " : " ");
2088 DPRINTK("lec_arp_update mac:%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n", 2082 pr_debug("lec_arp_update mac:%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n",
2089 mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], 2083 mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3],
2090 mac_addr[4], mac_addr[5]); 2084 mac_addr[4], mac_addr[5]);
2091 2085
@@ -2122,7 +2116,7 @@ lec_arp_update(struct lec_priv *priv, unsigned char *mac_addr,
2122 entry->flags |= LEC_REMOTE_FLAG; 2116 entry->flags |= LEC_REMOTE_FLAG;
2123 else 2117 else
2124 entry->flags &= ~LEC_REMOTE_FLAG; 2118 entry->flags &= ~LEC_REMOTE_FLAG;
2125 DPRINTK("After update\n"); 2119 pr_debug("After update\n");
2126 dump_arp_table(priv); 2120 dump_arp_table(priv);
2127 goto out; 2121 goto out;
2128 } 2122 }
@@ -2166,7 +2160,7 @@ lec_arp_update(struct lec_priv *priv, unsigned char *mac_addr,
2166 entry->status = ESI_VC_PENDING; 2160 entry->status = ESI_VC_PENDING;
2167 send_to_lecd(priv, l_svc_setup, entry->mac_addr, atm_addr, NULL); 2161 send_to_lecd(priv, l_svc_setup, entry->mac_addr, atm_addr, NULL);
2168 } 2162 }
2169 DPRINTK("After update2\n"); 2163 pr_debug("After update2\n");
2170 dump_arp_table(priv); 2164 dump_arp_table(priv);
2171out: 2165out:
2172 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); 2166 spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
@@ -2189,7 +2183,7 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
2189 if (ioc_data->receive == 2) { 2183 if (ioc_data->receive == 2) {
2190 /* Vcc for Multicast Forward. No timer, LANEv2 7.1.20 and 2.3.5.3 */ 2184 /* Vcc for Multicast Forward. No timer, LANEv2 7.1.20 and 2.3.5.3 */
2191 2185
2192 DPRINTK("LEC_ARP: Attaching mcast forward\n"); 2186 pr_debug("LEC_ARP: Attaching mcast forward\n");
2193#if 0 2187#if 0
2194 entry = lec_arp_find(priv, bus_mac); 2188 entry = lec_arp_find(priv, bus_mac);
2195 if (!entry) { 2189 if (!entry) {
@@ -2214,7 +2208,7 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
2214 * Vcc which we don't want to make default vcc, 2208 * Vcc which we don't want to make default vcc,
2215 * attach it anyway. 2209 * attach it anyway.
2216 */ 2210 */
2217 DPRINTK 2211 pr_debug
2218 ("LEC_ARP:Attaching data direct, not default: " 2212 ("LEC_ARP:Attaching data direct, not default: "
2219 "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n", 2213 "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n",
2220 ioc_data->atm_addr[0], ioc_data->atm_addr[1], 2214 ioc_data->atm_addr[0], ioc_data->atm_addr[1],
@@ -2242,7 +2236,7 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
2242 dump_arp_table(priv); 2236 dump_arp_table(priv);
2243 goto out; 2237 goto out;
2244 } 2238 }
2245 DPRINTK 2239 pr_debug
2246 ("LEC_ARP:Attaching data direct, default: " 2240 ("LEC_ARP:Attaching data direct, default: "
2247 "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n", 2241 "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n",
2248 ioc_data->atm_addr[0], ioc_data->atm_addr[1], 2242 ioc_data->atm_addr[0], ioc_data->atm_addr[1],
@@ -2260,8 +2254,8 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
2260 if (memcmp 2254 if (memcmp
2261 (ioc_data->atm_addr, entry->atm_addr, 2255 (ioc_data->atm_addr, entry->atm_addr,
2262 ATM_ESA_LEN) == 0) { 2256 ATM_ESA_LEN) == 0) {
2263 DPRINTK("LEC_ARP: Attaching data direct\n"); 2257 pr_debug("LEC_ARP: Attaching data direct\n");
2264 DPRINTK("Currently -> Vcc: %d, Rvcc:%d\n", 2258 pr_debug("Currently -> Vcc: %d, Rvcc:%d\n",
2265 entry->vcc ? entry->vcc->vci : 0, 2259 entry->vcc ? entry->vcc->vci : 0,
2266 entry->recv_vcc ? entry->recv_vcc-> 2260 entry->recv_vcc ? entry->recv_vcc->
2267 vci : 0); 2261 vci : 0);
@@ -2303,7 +2297,7 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
2303 } 2297 }
2304 } 2298 }
2305 if (found_entry) { 2299 if (found_entry) {
2306 DPRINTK("After vcc was added\n"); 2300 pr_debug("After vcc was added\n");
2307 dump_arp_table(priv); 2301 dump_arp_table(priv);
2308 goto out; 2302 goto out;
2309 } 2303 }
@@ -2323,7 +2317,7 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
2323 entry->timer.expires = jiffies + priv->vcc_timeout_period; 2317 entry->timer.expires = jiffies + priv->vcc_timeout_period;
2324 entry->timer.function = lec_arp_expire_vcc; 2318 entry->timer.function = lec_arp_expire_vcc;
2325 add_timer(&entry->timer); 2319 add_timer(&entry->timer);
2326 DPRINTK("After vcc was added\n"); 2320 pr_debug("After vcc was added\n");
2327 dump_arp_table(priv); 2321 dump_arp_table(priv);
2328out: 2322out:
2329 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); 2323 spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
@@ -2336,7 +2330,7 @@ static void lec_flush_complete(struct lec_priv *priv, unsigned long tran_id)
2336 struct lec_arp_table *entry; 2330 struct lec_arp_table *entry;
2337 int i; 2331 int i;
2338 2332
2339 DPRINTK("LEC:lec_flush_complete %lx\n", tran_id); 2333 pr_debug("LEC:lec_flush_complete %lx\n", tran_id);
2340restart: 2334restart:
2341 spin_lock_irqsave(&priv->lec_arp_lock, flags); 2335 spin_lock_irqsave(&priv->lec_arp_lock, flags);
2342 for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) { 2336 for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) {
@@ -2353,7 +2347,7 @@ restart:
2353 entry->last_used = jiffies; 2347 entry->last_used = jiffies;
2354 entry->status = ESI_FORWARD_DIRECT; 2348 entry->status = ESI_FORWARD_DIRECT;
2355 lec_arp_put(entry); 2349 lec_arp_put(entry);
2356 DPRINTK("LEC_ARP: Flushed\n"); 2350 pr_debug("LEC_ARP: Flushed\n");
2357 goto restart; 2351 goto restart;
2358 } 2352 }
2359 } 2353 }
@@ -2376,7 +2370,7 @@ lec_set_flush_tran_id(struct lec_priv *priv,
2376 hlist_for_each_entry(entry, node, &priv->lec_arp_tables[i], next) { 2370 hlist_for_each_entry(entry, node, &priv->lec_arp_tables[i], next) {
2377 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) { 2371 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) {
2378 entry->flush_tran_id = tran_id; 2372 entry->flush_tran_id = tran_id;
2379 DPRINTK("Set flush transaction id to %lx for %p\n", 2373 pr_debug("Set flush transaction id to %lx for %p\n",
2380 tran_id, entry); 2374 tran_id, entry);
2381 } 2375 }
2382 } 2376 }
@@ -2427,7 +2421,7 @@ static void lec_vcc_close(struct lec_priv *priv, struct atm_vcc *vcc)
2427 struct lec_arp_table *entry; 2421 struct lec_arp_table *entry;
2428 int i; 2422 int i;
2429 2423
2430 DPRINTK("LEC_ARP: lec_vcc_close vpi:%d vci:%d\n", vcc->vpi, vcc->vci); 2424 pr_debug("LEC_ARP: lec_vcc_close vpi:%d vci:%d\n", vcc->vpi, vcc->vci);
2431 dump_arp_table(priv); 2425 dump_arp_table(priv);
2432 2426
2433 spin_lock_irqsave(&priv->lec_arp_lock, flags); 2427 spin_lock_irqsave(&priv->lec_arp_lock, flags);
@@ -2510,7 +2504,7 @@ lec_arp_check_empties(struct lec_priv *priv,
2510 goto out; 2504 goto out;
2511 } 2505 }
2512 } 2506 }
2513 DPRINTK("LEC_ARP: Arp_check_empties: entry not found!\n"); 2507 pr_debug("LEC_ARP: Arp_check_empties: entry not found!\n");
2514out: 2508out:
2515 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); 2509 spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
2516} 2510}
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c
index 19d5dfc0702f..0af84cd4f65b 100644
--- a/net/atm/pppoatm.c
+++ b/net/atm/pppoatm.c
@@ -46,13 +46,6 @@
46 46
47#include "common.h" 47#include "common.h"
48 48
49#if 0
50#define DPRINTK(format, args...) \
51 printk(KERN_DEBUG "pppoatm: " format, ##args)
52#else
53#define DPRINTK(format, args...)
54#endif
55
56enum pppoatm_encaps { 49enum pppoatm_encaps {
57 e_autodetect = PPPOATM_ENCAPS_AUTODETECT, 50 e_autodetect = PPPOATM_ENCAPS_AUTODETECT,
58 e_vc = PPPOATM_ENCAPS_VC, 51 e_vc = PPPOATM_ENCAPS_VC,
@@ -139,9 +132,9 @@ static void pppoatm_unassign_vcc(struct atm_vcc *atmvcc)
139static void pppoatm_push(struct atm_vcc *atmvcc, struct sk_buff *skb) 132static void pppoatm_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
140{ 133{
141 struct pppoatm_vcc *pvcc = atmvcc_to_pvcc(atmvcc); 134 struct pppoatm_vcc *pvcc = atmvcc_to_pvcc(atmvcc);
142 DPRINTK("pppoatm push\n"); 135 pr_debug("pppoatm push\n");
143 if (skb == NULL) { /* VCC was closed */ 136 if (skb == NULL) { /* VCC was closed */
144 DPRINTK("removing ATMPPP VCC %p\n", pvcc); 137 pr_debug("removing ATMPPP VCC %p\n", pvcc);
145 pppoatm_unassign_vcc(atmvcc); 138 pppoatm_unassign_vcc(atmvcc);
146 atmvcc->push(atmvcc, NULL); /* Pass along bad news */ 139 atmvcc->push(atmvcc, NULL); /* Pass along bad news */
147 return; 140 return;
@@ -172,9 +165,8 @@ static void pppoatm_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
172 pvcc->chan.mtu += LLC_LEN; 165 pvcc->chan.mtu += LLC_LEN;
173 break; 166 break;
174 } 167 }
175 DPRINTK("(unit %d): Couldn't autodetect yet " 168 pr_debug("Couldn't autodetect yet "
176 "(skb: %02X %02X %02X %02X %02X %02X)\n", 169 "(skb: %02X %02X %02X %02X %02X %02X)\n",
177 pvcc->chan.unit,
178 skb->data[0], skb->data[1], skb->data[2], 170 skb->data[0], skb->data[1], skb->data[2],
179 skb->data[3], skb->data[4], skb->data[5]); 171 skb->data[3], skb->data[4], skb->data[5]);
180 goto error; 172 goto error;
@@ -202,8 +194,7 @@ static int pppoatm_send(struct ppp_channel *chan, struct sk_buff *skb)
202{ 194{
203 struct pppoatm_vcc *pvcc = chan_to_pvcc(chan); 195 struct pppoatm_vcc *pvcc = chan_to_pvcc(chan);
204 ATM_SKB(skb)->vcc = pvcc->atmvcc; 196 ATM_SKB(skb)->vcc = pvcc->atmvcc;
205 DPRINTK("(unit %d): pppoatm_send (skb=0x%p, vcc=0x%p)\n", 197 pr_debug("pppoatm_send (skb=0x%p, vcc=0x%p)\n", skb, pvcc->atmvcc);
206 pvcc->chan.unit, skb, pvcc->atmvcc);
207 if (skb->data[0] == '\0' && (pvcc->flags & SC_COMP_PROT)) 198 if (skb->data[0] == '\0' && (pvcc->flags & SC_COMP_PROT))
208 (void) skb_pull(skb, 1); 199 (void) skb_pull(skb, 1);
209 switch (pvcc->encaps) { /* LLC encapsulation needed */ 200 switch (pvcc->encaps) { /* LLC encapsulation needed */
@@ -228,16 +219,14 @@ static int pppoatm_send(struct ppp_channel *chan, struct sk_buff *skb)
228 goto nospace; 219 goto nospace;
229 break; 220 break;
230 case e_autodetect: 221 case e_autodetect:
231 DPRINTK("(unit %d): Trying to send without setting encaps!\n", 222 pr_debug("Trying to send without setting encaps!\n");
232 pvcc->chan.unit);
233 kfree_skb(skb); 223 kfree_skb(skb);
234 return 1; 224 return 1;
235 } 225 }
236 226
237 atomic_add(skb->truesize, &sk_atm(ATM_SKB(skb)->vcc)->sk_wmem_alloc); 227 atomic_add(skb->truesize, &sk_atm(ATM_SKB(skb)->vcc)->sk_wmem_alloc);
238 ATM_SKB(skb)->atm_options = ATM_SKB(skb)->vcc->atm_options; 228 ATM_SKB(skb)->atm_options = ATM_SKB(skb)->vcc->atm_options;
239 DPRINTK("(unit %d): atm_skb(%p)->vcc(%p)->dev(%p)\n", 229 pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, ATM_SKB(skb)->vcc,
240 pvcc->chan.unit, skb, ATM_SKB(skb)->vcc,
241 ATM_SKB(skb)->vcc->dev); 230 ATM_SKB(skb)->vcc->dev);
242 return ATM_SKB(skb)->vcc->send(ATM_SKB(skb)->vcc, skb) 231 return ATM_SKB(skb)->vcc->send(ATM_SKB(skb)->vcc, skb)
243 ? DROP_PACKET : 1; 232 ? DROP_PACKET : 1;
diff --git a/net/atm/raw.c b/net/atm/raw.c
index 1378f61c5c31..b0a2d8cb6744 100644
--- a/net/atm/raw.c
+++ b/net/atm/raw.c
@@ -13,14 +13,6 @@
13#include "common.h" 13#include "common.h"
14#include "protocols.h" 14#include "protocols.h"
15 15
16
17#if 0
18#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
19#else
20#define DPRINTK(format,args...)
21#endif
22
23
24/* 16/*
25 * SKB == NULL indicates that the link is being closed 17 * SKB == NULL indicates that the link is being closed
26 */ 18 */
@@ -40,8 +32,8 @@ static void atm_pop_raw(struct atm_vcc *vcc,struct sk_buff *skb)
40{ 32{
41 struct sock *sk = sk_atm(vcc); 33 struct sock *sk = sk_atm(vcc);
42 34
43 DPRINTK("APopR (%d) %d -= %d\n", vcc->vci, sk->sk_wmem_alloc, 35 pr_debug("APopR (%d) %d -= %d\n", vcc->vci,
44 skb->truesize); 36 atomic_read(&sk->sk_wmem_alloc), skb->truesize);
45 atomic_sub(skb->truesize, &sk->sk_wmem_alloc); 37 atomic_sub(skb->truesize, &sk->sk_wmem_alloc);
46 dev_kfree_skb_any(skb); 38 dev_kfree_skb_any(skb);
47 sk->sk_write_space(sk); 39 sk->sk_write_space(sk);
diff --git a/net/atm/signaling.c b/net/atm/signaling.c
index d14baaf1f4c3..bced78b77f12 100644
--- a/net/atm/signaling.c
+++ b/net/atm/signaling.c
@@ -23,13 +23,6 @@
23 Danger: may cause nasty hangs if the demon 23 Danger: may cause nasty hangs if the demon
24 crashes. */ 24 crashes. */
25 25
26#if 0
27#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
28#else
29#define DPRINTK(format,args...)
30#endif
31
32
33struct atm_vcc *sigd = NULL; 26struct atm_vcc *sigd = NULL;
34#ifdef WAIT_FOR_DEMON 27#ifdef WAIT_FOR_DEMON
35static DECLARE_WAIT_QUEUE_HEAD(sigd_sleep); 28static DECLARE_WAIT_QUEUE_HEAD(sigd_sleep);
@@ -44,14 +37,14 @@ static void sigd_put_skb(struct sk_buff *skb)
44 add_wait_queue(&sigd_sleep,&wait); 37 add_wait_queue(&sigd_sleep,&wait);
45 while (!sigd) { 38 while (!sigd) {
46 set_current_state(TASK_UNINTERRUPTIBLE); 39 set_current_state(TASK_UNINTERRUPTIBLE);
47 DPRINTK("atmsvc: waiting for signaling demon...\n"); 40 pr_debug("atmsvc: waiting for signaling demon...\n");
48 schedule(); 41 schedule();
49 } 42 }
50 current->state = TASK_RUNNING; 43 current->state = TASK_RUNNING;
51 remove_wait_queue(&sigd_sleep,&wait); 44 remove_wait_queue(&sigd_sleep,&wait);
52#else 45#else
53 if (!sigd) { 46 if (!sigd) {
54 DPRINTK("atmsvc: no signaling demon\n"); 47 pr_debug("atmsvc: no signaling demon\n");
55 kfree_skb(skb); 48 kfree_skb(skb);
56 return; 49 return;
57 } 50 }
@@ -96,9 +89,9 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb)
96 89
97 msg = (struct atmsvc_msg *) skb->data; 90 msg = (struct atmsvc_msg *) skb->data;
98 atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); 91 atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
99 DPRINTK("sigd_send %d (0x%lx)\n",(int) msg->type,
100 (unsigned long) msg->vcc);
101 vcc = *(struct atm_vcc **) &msg->vcc; 92 vcc = *(struct atm_vcc **) &msg->vcc;
93 pr_debug("sigd_send %d (0x%lx)\n",(int) msg->type,
94 (unsigned long) vcc);
102 sk = sk_atm(vcc); 95 sk = sk_atm(vcc);
103 96
104 switch (msg->type) { 97 switch (msg->type) {
@@ -130,7 +123,7 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb)
130 case as_indicate: 123 case as_indicate:
131 vcc = *(struct atm_vcc **) &msg->listen_vcc; 124 vcc = *(struct atm_vcc **) &msg->listen_vcc;
132 sk = sk_atm(vcc); 125 sk = sk_atm(vcc);
133 DPRINTK("as_indicate!!!\n"); 126 pr_debug("as_indicate!!!\n");
134 lock_sock(sk); 127 lock_sock(sk);
135 if (sk_acceptq_is_full(sk)) { 128 if (sk_acceptq_is_full(sk)) {
136 sigd_enq(NULL,as_reject,vcc,NULL,NULL); 129 sigd_enq(NULL,as_reject,vcc,NULL,NULL);
@@ -139,7 +132,7 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb)
139 } 132 }
140 sk->sk_ack_backlog++; 133 sk->sk_ack_backlog++;
141 skb_queue_tail(&sk->sk_receive_queue, skb); 134 skb_queue_tail(&sk->sk_receive_queue, skb);
142 DPRINTK("waking sk->sk_sleep 0x%p\n", sk->sk_sleep); 135 pr_debug("waking sk->sk_sleep 0x%p\n", sk->sk_sleep);
143 sk->sk_state_change(sk); 136 sk->sk_state_change(sk);
144as_indicate_complete: 137as_indicate_complete:
145 release_sock(sk); 138 release_sock(sk);
@@ -176,7 +169,7 @@ void sigd_enq2(struct atm_vcc *vcc,enum atmsvc_msg_type type,
176 struct atmsvc_msg *msg; 169 struct atmsvc_msg *msg;
177 static unsigned session = 0; 170 static unsigned session = 0;
178 171
179 DPRINTK("sigd_enq %d (0x%p)\n",(int) type,vcc); 172 pr_debug("sigd_enq %d (0x%p)\n",(int) type,vcc);
180 while (!(skb = alloc_skb(sizeof(struct atmsvc_msg),GFP_KERNEL))) 173 while (!(skb = alloc_skb(sizeof(struct atmsvc_msg),GFP_KERNEL)))
181 schedule(); 174 schedule();
182 msg = (struct atmsvc_msg *) skb_put(skb,sizeof(struct atmsvc_msg)); 175 msg = (struct atmsvc_msg *) skb_put(skb,sizeof(struct atmsvc_msg));
@@ -226,7 +219,7 @@ static void sigd_close(struct atm_vcc *vcc)
226 struct sock *s; 219 struct sock *s;
227 int i; 220 int i;
228 221
229 DPRINTK("sigd_close\n"); 222 pr_debug("sigd_close\n");
230 sigd = NULL; 223 sigd = NULL;
231 if (skb_peek(&sk_atm(vcc)->sk_receive_queue)) 224 if (skb_peek(&sk_atm(vcc)->sk_receive_queue))
232 printk(KERN_ERR "sigd_close: closing with requests pending\n"); 225 printk(KERN_ERR "sigd_close: closing with requests pending\n");
@@ -263,7 +256,7 @@ static struct atm_dev sigd_dev = {
263int sigd_attach(struct atm_vcc *vcc) 256int sigd_attach(struct atm_vcc *vcc)
264{ 257{
265 if (sigd) return -EADDRINUSE; 258 if (sigd) return -EADDRINUSE;
266 DPRINTK("sigd_attach\n"); 259 pr_debug("sigd_attach\n");
267 sigd = vcc; 260 sigd = vcc;
268 vcc->dev = &sigd_dev; 261 vcc->dev = &sigd_dev;
269 vcc_insert_socket(sk_atm(vcc)); 262 vcc_insert_socket(sk_atm(vcc));
diff --git a/net/atm/svc.c b/net/atm/svc.c
index 876ec7b47a2f..53d04c7992cf 100644
--- a/net/atm/svc.c
+++ b/net/atm/svc.c
@@ -25,17 +25,8 @@
25#include "signaling.h" 25#include "signaling.h"
26#include "addr.h" 26#include "addr.h"
27 27
28
29#if 0
30#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
31#else
32#define DPRINTK(format,args...)
33#endif
34
35
36static int svc_create(struct socket *sock,int protocol); 28static int svc_create(struct socket *sock,int protocol);
37 29
38
39/* 30/*
40 * Note: since all this is still nicely synchronized with the signaling demon, 31 * Note: since all this is still nicely synchronized with the signaling demon,
41 * there's no need to protect sleep loops with clis. If signaling is 32 * there's no need to protect sleep loops with clis. If signaling is
@@ -55,7 +46,7 @@ static void svc_disconnect(struct atm_vcc *vcc)
55 struct sk_buff *skb; 46 struct sk_buff *skb;
56 struct sock *sk = sk_atm(vcc); 47 struct sock *sk = sk_atm(vcc);
57 48
58 DPRINTK("svc_disconnect %p\n",vcc); 49 pr_debug("svc_disconnect %p\n",vcc);
59 if (test_bit(ATM_VF_REGIS,&vcc->flags)) { 50 if (test_bit(ATM_VF_REGIS,&vcc->flags)) {
60 prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); 51 prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
61 sigd_enq(vcc,as_close,NULL,NULL,NULL); 52 sigd_enq(vcc,as_close,NULL,NULL,NULL);
@@ -69,7 +60,7 @@ static void svc_disconnect(struct atm_vcc *vcc)
69 as_indicate has been answered */ 60 as_indicate has been answered */
70 while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) { 61 while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) {
71 atm_return(vcc, skb->truesize); 62 atm_return(vcc, skb->truesize);
72 DPRINTK("LISTEN REL\n"); 63 pr_debug("LISTEN REL\n");
73 sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0); 64 sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0);
74 dev_kfree_skb(skb); 65 dev_kfree_skb(skb);
75 } 66 }
@@ -85,7 +76,7 @@ static int svc_release(struct socket *sock)
85 76
86 if (sk) { 77 if (sk) {
87 vcc = ATM_SD(sock); 78 vcc = ATM_SD(sock);
88 DPRINTK("svc_release %p\n", vcc); 79 pr_debug("svc_release %p\n", vcc);
89 clear_bit(ATM_VF_READY, &vcc->flags); 80 clear_bit(ATM_VF_READY, &vcc->flags);
90 /* VCC pointer is used as a reference, so we must not free it 81 /* VCC pointer is used as a reference, so we must not free it
91 (thereby subjecting it to re-use) before all pending connections 82 (thereby subjecting it to re-use) before all pending connections
@@ -162,7 +153,7 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr,
162 struct atm_vcc *vcc = ATM_SD(sock); 153 struct atm_vcc *vcc = ATM_SD(sock);
163 int error; 154 int error;
164 155
165 DPRINTK("svc_connect %p\n",vcc); 156 pr_debug("svc_connect %p\n",vcc);
166 lock_sock(sk); 157 lock_sock(sk);
167 if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) { 158 if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) {
168 error = -EINVAL; 159 error = -EINVAL;
@@ -224,7 +215,7 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr,
224 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); 215 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
225 continue; 216 continue;
226 } 217 }
227 DPRINTK("*ABORT*\n"); 218 pr_debug("*ABORT*\n");
228 /* 219 /*
229 * This is tricky: 220 * This is tricky:
230 * Kernel ---close--> Demon 221 * Kernel ---close--> Demon
@@ -295,7 +286,7 @@ static int svc_listen(struct socket *sock,int backlog)
295 struct atm_vcc *vcc = ATM_SD(sock); 286 struct atm_vcc *vcc = ATM_SD(sock);
296 int error; 287 int error;
297 288
298 DPRINTK("svc_listen %p\n",vcc); 289 pr_debug("svc_listen %p\n",vcc);
299 lock_sock(sk); 290 lock_sock(sk);
300 /* let server handle listen on unbound sockets */ 291 /* let server handle listen on unbound sockets */
301 if (test_bit(ATM_VF_SESSION,&vcc->flags)) { 292 if (test_bit(ATM_VF_SESSION,&vcc->flags)) {
@@ -341,7 +332,7 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags)
341 332
342 new_vcc = ATM_SD(newsock); 333 new_vcc = ATM_SD(newsock);
343 334
344 DPRINTK("svc_accept %p -> %p\n",old_vcc,new_vcc); 335 pr_debug("svc_accept %p -> %p\n",old_vcc,new_vcc);
345 while (1) { 336 while (1) {
346 DEFINE_WAIT(wait); 337 DEFINE_WAIT(wait);
347 338
@@ -545,7 +536,7 @@ static int svc_addparty(struct socket *sock, struct sockaddr *sockaddr,
545 error = -EINPROGRESS; 536 error = -EINPROGRESS;
546 goto out; 537 goto out;
547 } 538 }
548 DPRINTK("svc_addparty added wait queue\n"); 539 pr_debug("svc_addparty added wait queue\n");
549 while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) { 540 while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) {
550 schedule(); 541 schedule();
551 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); 542 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);