aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-01-26 06:40:20 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-27 00:16:05 -0500
commitb50c2ea72a8ed6bc2a954019b6feb6ca41fce07e (patch)
tree0144f31cb8638cfb051bae879dbcfcbf2a28f80d /net/atm
parentb4c84ec0fd9ec2297b796443051554d062007ba3 (diff)
net/atm: Cleanup dprint/ddprintk #defines and uses
Move "mpoa:%s: ", __func__/__FILE__ to #defines Remove mpoa __func__/__FILE__ from dprintk uses Add and use #define dprint_cont where appropriate Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm')
-rw-r--r--net/atm/mpc.c153
-rw-r--r--net/atm/mpoa_caches.c50
-rw-r--r--net/atm/mpoa_proc.c28
3 files changed, 124 insertions, 107 deletions
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 55dba22e44b..a6521c8aa88 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -38,21 +38,31 @@
38 */ 38 */
39 39
40#if 0 40#if 0
41#define dprintk(format, args...) printk(KERN_DEBUG format, ##args) /* debug */ 41#define dprintk(format, args...) \
42 printk(KERN_DEBUG "mpoa:%s: " format, __func__, ##args)
43#define dprintk_cont(format, args...) printk(KERN_CONT format, ##args)
42#else 44#else
43#define dprintk(format, args...) \ 45#define dprintk(format, args...) \
44 do { if (0) printk(KERN_DEBUG format, ##args); } while (0) 46 do { if (0) \
47 printk(KERN_DEBUG "mpoa:%s: " format, __func__, ##args);\
48 } while (0)
49#define dprintk_cont(format, args...) \
50 do { if (0) printk(KERN_CONT format, ##args); } while (0)
45#endif 51#endif
46 52
47#if 0 53#if 0
48#define ddprintk printk(KERN_DEBUG format, ##args) /* more debug */ 54#define ddprintk(format, args...) \
55 printk(KERN_DEBUG "mpoa:%s: " format, __func__, ##args)
56#define ddprintk_cont(format, args...) printk(KERN_CONT format, ##args)
49#else 57#else
50#define ddprintk(format, args...) \ 58#define ddprintk(format, args...) \
51 do { if (0) printk(KERN_DEBUG format, ##args); } while (0) 59 do { if (0) \
60 printk(KERN_DEBUG "mpoa:%s: " format, __func__, ##args);\
61 } while (0)
62#define ddprintk_cont(format, args...) \
63 do { if (0) printk(KERN_CONT format, ##args); } while (0)
52#endif 64#endif
53 65
54
55
56#define MPOA_TAG_LEN 4 66#define MPOA_TAG_LEN 4
57 67
58/* mpc_daemon -> kernel */ 68/* mpc_daemon -> kernel */
@@ -302,7 +312,7 @@ static struct mpoa_client *alloc_mpc(void)
302static void start_mpc(struct mpoa_client *mpc, struct net_device *dev) 312static void start_mpc(struct mpoa_client *mpc, struct net_device *dev)
303{ 313{
304 314
305 dprintk("mpoa: (%s) start_mpc:\n", mpc->dev->name); 315 dprintk("(%s)\n", mpc->dev->name);
306 if (!dev->netdev_ops) 316 if (!dev->netdev_ops)
307 pr_info("(%s) not starting\n", dev->name); 317 pr_info("(%s) not starting\n", dev->name);
308 else { 318 else {
@@ -316,14 +326,14 @@ static void start_mpc(struct mpoa_client *mpc, struct net_device *dev)
316static void stop_mpc(struct mpoa_client *mpc) 326static void stop_mpc(struct mpoa_client *mpc)
317{ 327{
318 struct net_device *dev = mpc->dev; 328 struct net_device *dev = mpc->dev;
319 dprintk("mpoa: (%s) stop_mpc:", mpc->dev->name); 329 dprintk("(%s)", mpc->dev->name);
320 330
321 /* Lets not nullify lec device's dev->hard_start_xmit */ 331 /* Lets not nullify lec device's dev->hard_start_xmit */
322 if (dev->netdev_ops != &mpc->new_ops) { 332 if (dev->netdev_ops != &mpc->new_ops) {
323 dprintk(" mpc already stopped, not fatal\n"); 333 dprintk_cont(" mpc already stopped, not fatal\n");
324 return; 334 return;
325 } 335 }
326 dprintk("\n"); 336 dprintk_cont("\n");
327 337
328 dev->netdev_ops = mpc->old_ops; 338 dev->netdev_ops = mpc->old_ops;
329 mpc->old_ops = NULL; 339 mpc->old_ops = NULL;
@@ -371,7 +381,7 @@ static void lane2_assoc_ind(struct net_device *dev, const u8 *mac_addr,
371 struct mpoa_client *mpc; 381 struct mpoa_client *mpc;
372 382
373 mpoa_device_type = number_of_mps_macs = 0; /* silence gcc */ 383 mpoa_device_type = number_of_mps_macs = 0; /* silence gcc */
374 dprintk("mpoa: (%s) lane2_assoc_ind: received TLV(s), ", dev->name); 384 dprintk("(%s) received TLV(s), ", dev->name);
375 dprintk("total length of all TLVs %d\n", sizeoftlvs); 385 dprintk("total length of all TLVs %d\n", sizeoftlvs);
376 mpc = find_mpc_by_lec(dev); /* Sampo-Fix: moved here from below */ 386 mpc = find_mpc_by_lec(dev); /* Sampo-Fix: moved here from below */
377 if (mpc == NULL) { 387 if (mpc == NULL) {
@@ -402,7 +412,7 @@ static void lane2_assoc_ind(struct net_device *dev, const u8 *mac_addr,
402 } 412 }
403 mpoa_device_type = *tlvs++; 413 mpoa_device_type = *tlvs++;
404 number_of_mps_macs = *tlvs++; 414 number_of_mps_macs = *tlvs++;
405 dprintk("mpoa: (%s) MPOA device type '%s', ", 415 dprintk("(%s) MPOA device type '%s', ",
406 dev->name, mpoa_device_type_string(mpoa_device_type)); 416 dev->name, mpoa_device_type_string(mpoa_device_type));
407 if (mpoa_device_type == MPS_AND_MPC && 417 if (mpoa_device_type == MPS_AND_MPC &&
408 length < (42 + number_of_mps_macs*ETH_ALEN)) { /* :) */ 418 length < (42 + number_of_mps_macs*ETH_ALEN)) { /* :) */
@@ -417,7 +427,7 @@ static void lane2_assoc_ind(struct net_device *dev, const u8 *mac_addr,
417 } 427 }
418 if (mpoa_device_type != MPS && 428 if (mpoa_device_type != MPS &&
419 mpoa_device_type != MPS_AND_MPC) { 429 mpoa_device_type != MPS_AND_MPC) {
420 dprintk("ignoring non-MPS device\n"); 430 dprintk("ignoring non-MPS device ");
421 if (mpoa_device_type == MPC) 431 if (mpoa_device_type == MPC)
422 tlvs += 20; 432 tlvs += 20;
423 continue; /* we are only interested in MPSs */ 433 continue; /* we are only interested in MPSs */
@@ -427,7 +437,8 @@ static void lane2_assoc_ind(struct net_device *dev, const u8 *mac_addr,
427 pr_info("(%s) MPS_AND_MPC has zero MACs\n", dev->name); 437 pr_info("(%s) MPS_AND_MPC has zero MACs\n", dev->name);
428 continue; /* someone should read the spec */ 438 continue; /* someone should read the spec */
429 } 439 }
430 dprintk("this MPS has %d MAC addresses\n", number_of_mps_macs); 440 dprintk_cont("this MPS has %d MAC addresses\n",
441 number_of_mps_macs);
431 442
432 /* 443 /*
433 * ok, now we can go and tell our daemon 444 * ok, now we can go and tell our daemon
@@ -498,7 +509,7 @@ static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc)
498 iph = (struct iphdr *)buff; 509 iph = (struct iphdr *)buff;
499 ipaddr = iph->daddr; 510 ipaddr = iph->daddr;
500 511
501 ddprintk("mpoa: (%s) send_via_shortcut: ipaddr 0x%x\n", 512 ddprintk("(%s) ipaddr 0x%x\n",
502 mpc->dev->name, ipaddr); 513 mpc->dev->name, ipaddr);
503 514
504 entry = mpc->in_ops->get(ipaddr, mpc); 515 entry = mpc->in_ops->get(ipaddr, mpc);
@@ -510,17 +521,17 @@ static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc)
510 } 521 }
511 /* threshold not exceeded or VCC not ready */ 522 /* threshold not exceeded or VCC not ready */
512 if (mpc->in_ops->cache_hit(entry, mpc) != OPEN) { 523 if (mpc->in_ops->cache_hit(entry, mpc) != OPEN) {
513 ddprintk("mpoa: (%s) send_via_shortcut: cache_hit: returns != OPEN\n", 524 ddprintk("(%s) cache_hit: returns != OPEN\n",
514 mpc->dev->name); 525 mpc->dev->name);
515 mpc->in_ops->put(entry); 526 mpc->in_ops->put(entry);
516 return 1; 527 return 1;
517 } 528 }
518 529
519 ddprintk("mpoa: (%s) send_via_shortcut: using shortcut\n", 530 ddprintk("(%s) using shortcut\n",
520 mpc->dev->name); 531 mpc->dev->name);
521 /* MPOA spec A.1.4, MPOA client must decrement IP ttl at least by one */ 532 /* MPOA spec A.1.4, MPOA client must decrement IP ttl at least by one */
522 if (iph->ttl <= 1) { 533 if (iph->ttl <= 1) {
523 ddprintk("mpoa: (%s) send_via_shortcut: IP ttl = %u, using LANE\n", 534 ddprintk("(%s) IP ttl = %u, using LANE\n",
524 mpc->dev->name, iph->ttl); 535 mpc->dev->name, iph->ttl);
525 mpc->in_ops->put(entry); 536 mpc->in_ops->put(entry);
526 return 1; 537 return 1;
@@ -530,7 +541,7 @@ static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc)
530 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); 541 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
531 542
532 if (entry->ctrl_info.tag != 0) { 543 if (entry->ctrl_info.tag != 0) {
533 ddprintk("mpoa: (%s) send_via_shortcut: adding tag 0x%x\n", 544 ddprintk("(%s) adding tag 0x%x\n",
534 mpc->dev->name, entry->ctrl_info.tag); 545 mpc->dev->name, entry->ctrl_info.tag);
535 tagged_llc_snap_hdr.tag = entry->ctrl_info.tag; 546 tagged_llc_snap_hdr.tag = entry->ctrl_info.tag;
536 skb_pull(skb, ETH_HLEN); /* get rid of Eth header */ 547 skb_pull(skb, ETH_HLEN); /* get rid of Eth header */
@@ -655,25 +666,23 @@ static void mpc_vcc_close(struct atm_vcc *vcc, struct net_device *dev)
655 return; 666 return;
656 } 667 }
657 668
658 dprintk("mpoa: (%s) mpc_vcc_close:\n", dev->name); 669 dprintk("(%s)\n", dev->name);
659 in_entry = mpc->in_ops->get_by_vcc(vcc, mpc); 670 in_entry = mpc->in_ops->get_by_vcc(vcc, mpc);
660 if (in_entry) { 671 if (in_entry) {
661 dprintk("mpoa: (%s) mpc_vcc_close: ingress SVC closed ip = %pI4\n", 672 dprintk("(%s) ingress SVC closed ip = %pI4\n",
662 mpc->dev->name, &in_entry->ctrl_info.in_dst_ip); 673 mpc->dev->name, &in_entry->ctrl_info.in_dst_ip);
663 in_entry->shortcut = NULL; 674 in_entry->shortcut = NULL;
664 mpc->in_ops->put(in_entry); 675 mpc->in_ops->put(in_entry);
665 } 676 }
666 eg_entry = mpc->eg_ops->get_by_vcc(vcc, mpc); 677 eg_entry = mpc->eg_ops->get_by_vcc(vcc, mpc);
667 if (eg_entry) { 678 if (eg_entry) {
668 dprintk("mpoa: (%s) mpc_vcc_close: egress SVC closed\n", 679 dprintk("(%s) egress SVC closed\n", mpc->dev->name);
669 mpc->dev->name);
670 eg_entry->shortcut = NULL; 680 eg_entry->shortcut = NULL;
671 mpc->eg_ops->put(eg_entry); 681 mpc->eg_ops->put(eg_entry);
672 } 682 }
673 683
674 if (in_entry == NULL && eg_entry == NULL) 684 if (in_entry == NULL && eg_entry == NULL)
675 dprintk("mpoa: (%s) mpc_vcc_close: unused vcc closed\n", 685 dprintk("(%s) unused vcc closed\n", dev->name);
676 dev->name);
677 686
678 return; 687 return;
679} 688}
@@ -687,10 +696,9 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
687 __be32 tag; 696 __be32 tag;
688 char *tmp; 697 char *tmp;
689 698
690 ddprintk("mpoa: (%s) mpc_push:\n", dev->name); 699 ddprintk("(%s)\n", dev->name);
691 if (skb == NULL) { 700 if (skb == NULL) {
692 dprintk("mpoa: (%s) mpc_push: null skb, closing VCC\n", 701 dprintk("(%s) null skb, closing VCC\n", dev->name);
693 dev->name);
694 mpc_vcc_close(vcc, dev); 702 mpc_vcc_close(vcc, dev);
695 return; 703 return;
696 } 704 }
@@ -700,8 +708,7 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
700 sizeof(struct llc_snap_hdr)) == 0) { 708 sizeof(struct llc_snap_hdr)) == 0) {
701 struct sock *sk = sk_atm(vcc); 709 struct sock *sk = sk_atm(vcc);
702 710
703 dprintk("mpoa: (%s) mpc_push: control packet arrived\n", 711 dprintk("(%s) control packet arrived\n", dev->name);
704 dev->name);
705 /* Pass control packets to daemon */ 712 /* Pass control packets to daemon */
706 skb_queue_tail(&sk->sk_receive_queue, skb); 713 skb_queue_tail(&sk->sk_receive_queue, skb);
707 sk->sk_data_ready(sk, skb->len); 714 sk->sk_data_ready(sk, skb->len);
@@ -719,8 +726,7 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
719 726
720 if (memcmp(skb->data, &llc_snap_mpoa_data_tagged, 727 if (memcmp(skb->data, &llc_snap_mpoa_data_tagged,
721 sizeof(struct llc_snap_hdr)) == 0) { /* MPOA tagged data */ 728 sizeof(struct llc_snap_hdr)) == 0) { /* MPOA tagged data */
722 ddprintk("mpoa: (%s) mpc_push: tagged data packet arrived\n", 729 ddprintk("(%s) tagged data packet arrived\n", dev->name);
723 dev->name);
724 730
725 } else if (memcmp(skb->data, &llc_snap_mpoa_data, 731 } else if (memcmp(skb->data, &llc_snap_mpoa_data,
726 sizeof(struct llc_snap_hdr)) == 0) { /* MPOA data */ 732 sizeof(struct llc_snap_hdr)) == 0) { /* MPOA data */
@@ -813,8 +819,7 @@ static int atm_mpoa_mpoad_attach(struct atm_vcc *vcc, int arg)
813 819
814 mpc = find_mpc_by_itfnum(arg); 820 mpc = find_mpc_by_itfnum(arg);
815 if (mpc == NULL) { 821 if (mpc == NULL) {
816 dprintk("mpoa: mpoad_attach: allocating new mpc for itf %d\n", 822 dprintk("allocating new mpc for itf %d\n", arg);
817 arg);
818 mpc = alloc_mpc(); 823 mpc = alloc_mpc();
819 if (mpc == NULL) 824 if (mpc == NULL)
820 return -ENOMEM; 825 return -ENOMEM;
@@ -923,55 +928,54 @@ static int msg_from_mpoad(struct atm_vcc *vcc, struct sk_buff *skb)
923 pr_info("no mpc found\n"); 928 pr_info("no mpc found\n");
924 return 0; 929 return 0;
925 } 930 }
926 dprintk("mpoa: (%s) msg_from_mpoad:", 931 dprintk("(%s)", mpc->dev ? mpc->dev->name : "<unknown>");
927 (mpc->dev) ? mpc->dev->name : "<unknown>");
928 switch (mesg->type) { 932 switch (mesg->type) {
929 case MPOA_RES_REPLY_RCVD: 933 case MPOA_RES_REPLY_RCVD:
930 dprintk(" mpoa_res_reply_rcvd\n"); 934 dprintk_cont("mpoa_res_reply_rcvd\n");
931 MPOA_res_reply_rcvd(mesg, mpc); 935 MPOA_res_reply_rcvd(mesg, mpc);
932 break; 936 break;
933 case MPOA_TRIGGER_RCVD: 937 case MPOA_TRIGGER_RCVD:
934 dprintk(" mpoa_trigger_rcvd\n"); 938 dprintk_cont("mpoa_trigger_rcvd\n");
935 MPOA_trigger_rcvd(mesg, mpc); 939 MPOA_trigger_rcvd(mesg, mpc);
936 break; 940 break;
937 case INGRESS_PURGE_RCVD: 941 case INGRESS_PURGE_RCVD:
938 dprintk(" nhrp_purge_rcvd\n"); 942 dprintk_cont("nhrp_purge_rcvd\n");
939 ingress_purge_rcvd(mesg, mpc); 943 ingress_purge_rcvd(mesg, mpc);
940 break; 944 break;
941 case EGRESS_PURGE_RCVD: 945 case EGRESS_PURGE_RCVD:
942 dprintk(" egress_purge_reply_rcvd\n"); 946 dprintk_cont("egress_purge_reply_rcvd\n");
943 egress_purge_rcvd(mesg, mpc); 947 egress_purge_rcvd(mesg, mpc);
944 break; 948 break;
945 case MPS_DEATH: 949 case MPS_DEATH:
946 dprintk(" mps_death\n"); 950 dprintk_cont("mps_death\n");
947 mps_death(mesg, mpc); 951 mps_death(mesg, mpc);
948 break; 952 break;
949 case CACHE_IMPOS_RCVD: 953 case CACHE_IMPOS_RCVD:
950 dprintk(" cache_impos_rcvd\n"); 954 dprintk_cont("cache_impos_rcvd\n");
951 MPOA_cache_impos_rcvd(mesg, mpc); 955 MPOA_cache_impos_rcvd(mesg, mpc);
952 break; 956 break;
953 case SET_MPC_CTRL_ADDR: 957 case SET_MPC_CTRL_ADDR:
954 dprintk(" set_mpc_ctrl_addr\n"); 958 dprintk_cont("set_mpc_ctrl_addr\n");
955 set_mpc_ctrl_addr_rcvd(mesg, mpc); 959 set_mpc_ctrl_addr_rcvd(mesg, mpc);
956 break; 960 break;
957 case SET_MPS_MAC_ADDR: 961 case SET_MPS_MAC_ADDR:
958 dprintk(" set_mps_mac_addr\n"); 962 dprintk_cont("set_mps_mac_addr\n");
959 set_mps_mac_addr_rcvd(mesg, mpc); 963 set_mps_mac_addr_rcvd(mesg, mpc);
960 break; 964 break;
961 case CLEAN_UP_AND_EXIT: 965 case CLEAN_UP_AND_EXIT:
962 dprintk(" clean_up_and_exit\n"); 966 dprintk_cont("clean_up_and_exit\n");
963 clean_up(mesg, mpc, DIE); 967 clean_up(mesg, mpc, DIE);
964 break; 968 break;
965 case RELOAD: 969 case RELOAD:
966 dprintk(" reload\n"); 970 dprintk_cont("reload\n");
967 clean_up(mesg, mpc, RELOAD); 971 clean_up(mesg, mpc, RELOAD);
968 break; 972 break;
969 case SET_MPC_PARAMS: 973 case SET_MPC_PARAMS:
970 dprintk(" set_mpc_params\n"); 974 dprintk_cont("set_mpc_params\n");
971 mpc->parameters = mesg->content.params; 975 mpc->parameters = mesg->content.params;
972 break; 976 break;
973 default: 977 default:
974 dprintk(" unknown message %d\n", mesg->type); 978 dprintk_cont("unknown message %d\n", mesg->type);
975 break; 979 break;
976 } 980 }
977 kfree_skb(skb); 981 kfree_skb(skb);
@@ -1027,8 +1031,7 @@ static int mpoa_event_listener(struct notifier_block *mpoa_notifier,
1027 priv->lane2_ops->associate_indicator = lane2_assoc_ind; 1031 priv->lane2_ops->associate_indicator = lane2_assoc_ind;
1028 mpc = find_mpc_by_itfnum(priv->itfnum); 1032 mpc = find_mpc_by_itfnum(priv->itfnum);
1029 if (mpc == NULL) { 1033 if (mpc == NULL) {
1030 dprintk("mpoa: mpoa_event_listener: allocating new mpc for %s\n", 1034 dprintk("allocating new mpc for %s\n", dev->name);
1031 dev->name);
1032 mpc = alloc_mpc(); 1035 mpc = alloc_mpc();
1033 if (mpc == NULL) { 1036 if (mpc == NULL) {
1034 pr_info("no new mpc"); 1037 pr_info("no new mpc");
@@ -1038,14 +1041,14 @@ static int mpoa_event_listener(struct notifier_block *mpoa_notifier,
1038 mpc->dev_num = priv->itfnum; 1041 mpc->dev_num = priv->itfnum;
1039 mpc->dev = dev; 1042 mpc->dev = dev;
1040 dev_hold(dev); 1043 dev_hold(dev);
1041 dprintk("mpoa: (%s) was initialized\n", dev->name); 1044 dprintk("(%s) was initialized\n", dev->name);
1042 break; 1045 break;
1043 case NETDEV_UNREGISTER: 1046 case NETDEV_UNREGISTER:
1044 /* the lec device was deallocated */ 1047 /* the lec device was deallocated */
1045 mpc = find_mpc_by_lec(dev); 1048 mpc = find_mpc_by_lec(dev);
1046 if (mpc == NULL) 1049 if (mpc == NULL)
1047 break; 1050 break;
1048 dprintk("mpoa: device (%s) was deallocated\n", dev->name); 1051 dprintk("device (%s) was deallocated\n", dev->name);
1049 stop_mpc(mpc); 1052 stop_mpc(mpc);
1050 dev_put(mpc->dev); 1053 dev_put(mpc->dev);
1051 mpc->dev = NULL; 1054 mpc->dev = NULL;
@@ -1143,7 +1146,7 @@ static void check_qos_and_open_shortcut(struct k_message *msg,
1143 entry->shortcut = eg_entry->shortcut; 1146 entry->shortcut = eg_entry->shortcut;
1144 } 1147 }
1145 if (entry->shortcut) { 1148 if (entry->shortcut) {
1146 dprintk("mpoa: (%s) using egress SVC to reach %pI4\n", 1149 dprintk("(%s) using egress SVC to reach %pI4\n",
1147 client->dev->name, &dst_ip); 1150 client->dev->name, &dst_ip);
1148 client->eg_ops->put(eg_entry); 1151 client->eg_ops->put(eg_entry);
1149 return; 1152 return;
@@ -1170,16 +1173,16 @@ static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1170 __be32 dst_ip = msg->content.in_info.in_dst_ip; 1173 __be32 dst_ip = msg->content.in_info.in_dst_ip;
1171 in_cache_entry *entry = mpc->in_ops->get(dst_ip, mpc); 1174 in_cache_entry *entry = mpc->in_ops->get(dst_ip, mpc);
1172 1175
1173 dprintk("mpoa: (%s) MPOA_res_reply_rcvd: ip %pI4\n", 1176 dprintk("(%s) ip %pI4\n",
1174 mpc->dev->name, &dst_ip); 1177 mpc->dev->name, &dst_ip);
1175 ddprintk("mpoa: (%s) MPOA_res_reply_rcvd() entry = %p", 1178 ddprintk("(%s) entry = %p",
1176 mpc->dev->name, entry); 1179 mpc->dev->name, entry);
1177 if (entry == NULL) { 1180 if (entry == NULL) {
1178 pr_info("(%s) ARGH, received res. reply for an entry that doesn't exist.\n", 1181 pr_info("(%s) ARGH, received res. reply for an entry that doesn't exist.\n",
1179 mpc->dev->name); 1182 mpc->dev->name);
1180 return; 1183 return;
1181 } 1184 }
1182 ddprintk(" entry_state = %d ", entry->entry_state); 1185 ddprintk_cont(" entry_state = %d ", entry->entry_state);
1183 1186
1184 if (entry->entry_state == INGRESS_RESOLVED) { 1187 if (entry->entry_state == INGRESS_RESOLVED) {
1185 pr_info("(%s) RESOLVED entry!\n", mpc->dev->name); 1188 pr_info("(%s) RESOLVED entry!\n", mpc->dev->name);
@@ -1191,7 +1194,7 @@ static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1191 do_gettimeofday(&(entry->tv)); 1194 do_gettimeofday(&(entry->tv));
1192 do_gettimeofday(&(entry->reply_wait)); /* Used in refreshing func from now on */ 1195 do_gettimeofday(&(entry->reply_wait)); /* Used in refreshing func from now on */
1193 entry->refresh_time = 0; 1196 entry->refresh_time = 0;
1194 ddprintk("entry->shortcut = %p\n", entry->shortcut); 1197 ddprintk_cont("entry->shortcut = %p\n", entry->shortcut);
1195 1198
1196 if (entry->entry_state == INGRESS_RESOLVING && 1199 if (entry->entry_state == INGRESS_RESOLVING &&
1197 entry->shortcut != NULL) { 1200 entry->shortcut != NULL) {
@@ -1228,7 +1231,7 @@ static void ingress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1228 } 1231 }
1229 1232
1230 do { 1233 do {
1231 dprintk("mpoa: (%s) ingress_purge_rcvd: removing an ingress entry, ip = %pI4\n", 1234 dprintk("(%s) removing an ingress entry, ip = %pI4\n",
1232 mpc->dev->name, &dst_ip); 1235 mpc->dev->name, &dst_ip);
1233 write_lock_bh(&mpc->ingress_lock); 1236 write_lock_bh(&mpc->ingress_lock);
1234 mpc->in_ops->remove_entry(entry, mpc); 1237 mpc->in_ops->remove_entry(entry, mpc);
@@ -1246,7 +1249,7 @@ static void egress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1246 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(cache_id, mpc); 1249 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(cache_id, mpc);
1247 1250
1248 if (entry == NULL) { 1251 if (entry == NULL) {
1249 dprintk("mpoa: (%s) egress_purge_rcvd: purge for a non-existing entry\n", 1252 dprintk("(%s) purge for a non-existing entry\n",
1250 mpc->dev->name); 1253 mpc->dev->name);
1251 return; 1254 return;
1252 } 1255 }
@@ -1266,7 +1269,7 @@ static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry)
1266 struct k_message *purge_msg; 1269 struct k_message *purge_msg;
1267 struct sk_buff *skb; 1270 struct sk_buff *skb;
1268 1271
1269 dprintk("mpoa: purge_egress_shortcut: entering\n"); 1272 dprintk("entering\n");
1270 if (vcc == NULL) { 1273 if (vcc == NULL) {
1271 pr_info("vcc == NULL\n"); 1274 pr_info("vcc == NULL\n");
1272 return; 1275 return;
@@ -1290,7 +1293,7 @@ static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry)
1290 sk = sk_atm(vcc); 1293 sk = sk_atm(vcc);
1291 skb_queue_tail(&sk->sk_receive_queue, skb); 1294 skb_queue_tail(&sk->sk_receive_queue, skb);
1292 sk->sk_data_ready(sk, skb->len); 1295 sk->sk_data_ready(sk, skb->len);
1293 dprintk("mpoa: purge_egress_shortcut: exiting:\n"); 1296 dprintk("exiting\n");
1294 1297
1295 return; 1298 return;
1296} 1299}
@@ -1303,7 +1306,7 @@ static void mps_death(struct k_message *msg, struct mpoa_client *mpc)
1303{ 1306{
1304 eg_cache_entry *entry; 1307 eg_cache_entry *entry;
1305 1308
1306 dprintk("mpoa: (%s) mps_death:\n", mpc->dev->name); 1309 dprintk("(%s)\n", mpc->dev->name);
1307 1310
1308 if (memcmp(msg->MPS_ctrl, mpc->mps_ctrl_addr, ATM_ESA_LEN)) { 1311 if (memcmp(msg->MPS_ctrl, mpc->mps_ctrl_addr, ATM_ESA_LEN)) {
1309 pr_info("(%s) wrong MPS\n", mpc->dev->name); 1312 pr_info("(%s) wrong MPS\n", mpc->dev->name);
@@ -1332,7 +1335,7 @@ static void MPOA_cache_impos_rcvd(struct k_message *msg,
1332 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(msg->content.eg_info.cache_id, mpc); 1335 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(msg->content.eg_info.cache_id, mpc);
1333 1336
1334 holding_time = msg->content.eg_info.holding_time; 1337 holding_time = msg->content.eg_info.holding_time;
1335 dprintk("mpoa: (%s) MPOA_cache_impos_rcvd: entry = %p, holding_time = %u\n", 1338 dprintk("(%s) entry = %p, holding_time = %u\n",
1336 mpc->dev->name, entry, holding_time); 1339 mpc->dev->name, entry, holding_time);
1337 if (entry == NULL && holding_time) { 1340 if (entry == NULL && holding_time) {
1338 entry = mpc->eg_ops->add_entry(msg, mpc); 1341 entry = mpc->eg_ops->add_entry(msg, mpc);
@@ -1369,11 +1372,11 @@ static void set_mpc_ctrl_addr_rcvd(struct k_message *mesg,
1369 memcpy(&tlv[7], mesg->MPS_ctrl, ATM_ESA_LEN); /* MPC ctrl ATM addr */ 1372 memcpy(&tlv[7], mesg->MPS_ctrl, ATM_ESA_LEN); /* MPC ctrl ATM addr */
1370 memcpy(mpc->our_ctrl_addr, mesg->MPS_ctrl, ATM_ESA_LEN); 1373 memcpy(mpc->our_ctrl_addr, mesg->MPS_ctrl, ATM_ESA_LEN);
1371 1374
1372 dprintk("mpoa: (%s) setting MPC ctrl ATM address to ", 1375 dprintk("(%s) setting MPC ctrl ATM address to",
1373 (mpc->dev) ? mpc->dev->name : "<unknown>"); 1376 mpc->dev ? mpc->dev->name : "<unknown>");
1374 for (i = 7; i < sizeof(tlv); i++) 1377 for (i = 7; i < sizeof(tlv); i++)
1375 dprintk("%02x ", tlv[i]); 1378 dprintk_cont(" %02x", tlv[i]);
1376 dprintk("\n"); 1379 dprintk_cont("\n");
1377 1380
1378 if (mpc->dev) { 1381 if (mpc->dev) {
1379 priv = netdev_priv(mpc->dev); 1382 priv = netdev_priv(mpc->dev);
@@ -1424,7 +1427,7 @@ static void clean_up(struct k_message *msg, struct mpoa_client *mpc, int action)
1424 entry = mpc->eg_cache; 1427 entry = mpc->eg_cache;
1425 while (entry != NULL) { 1428 while (entry != NULL) {
1426 msg->content.eg_info = entry->ctrl_info; 1429 msg->content.eg_info = entry->ctrl_info;
1427 dprintk("mpoa: cache_id %u\n", entry->ctrl_info.cache_id); 1430 dprintk("cache_id %u\n", entry->ctrl_info.cache_id);
1428 msg_to_mpoad(msg, mpc); 1431 msg_to_mpoad(msg, mpc);
1429 entry = entry->next; 1432 entry = entry->next;
1430 } 1433 }
@@ -1537,15 +1540,15 @@ static void __exit atm_mpoa_cleanup(void)
1537 if (priv->lane2_ops != NULL) 1540 if (priv->lane2_ops != NULL)
1538 priv->lane2_ops->associate_indicator = NULL; 1541 priv->lane2_ops->associate_indicator = NULL;
1539 } 1542 }
1540 ddprintk("mpoa: cleanup_module: about to clear caches\n"); 1543 ddprintk("about to clear caches\n");
1541 mpc->in_ops->destroy_cache(mpc); 1544 mpc->in_ops->destroy_cache(mpc);
1542 mpc->eg_ops->destroy_cache(mpc); 1545 mpc->eg_ops->destroy_cache(mpc);
1543 ddprintk("mpoa: cleanup_module: caches cleared\n"); 1546 ddprintk("caches cleared\n");
1544 kfree(mpc->mps_macs); 1547 kfree(mpc->mps_macs);
1545 memset(mpc, 0, sizeof(struct mpoa_client)); 1548 memset(mpc, 0, sizeof(struct mpoa_client));
1546 ddprintk("mpoa: cleanup_module: about to kfree %p\n", mpc); 1549 ddprintk("about to kfree %p\n", mpc);
1547 kfree(mpc); 1550 kfree(mpc);
1548 ddprintk("mpoa: cleanup_module: next mpc is at %p\n", tmp); 1551 ddprintk("next mpc is at %p\n", tmp);
1549 mpc = tmp; 1552 mpc = tmp;
1550 } 1553 }
1551 1554
@@ -1553,7 +1556,7 @@ static void __exit atm_mpoa_cleanup(void)
1553 qos_head = NULL; 1556 qos_head = NULL;
1554 while (qos != NULL) { 1557 while (qos != NULL) {
1555 nextqos = qos->next; 1558 nextqos = qos->next;
1556 dprintk("mpoa: cleanup_module: freeing qos entry %p\n", qos); 1559 dprintk("freeing qos entry %p\n", qos);
1557 kfree(qos); 1560 kfree(qos);
1558 qos = nextqos; 1561 qos = nextqos;
1559 } 1562 }
diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
index de21cc66feb..4c141810eb6 100644
--- a/net/atm/mpoa_caches.c
+++ b/net/atm/mpoa_caches.c
@@ -11,17 +11,23 @@
11 */ 11 */
12 12
13#if 0 13#if 0
14#define dprintk(format, args...) printk(KERN_DEBUG format, ##args) /* debug */ 14#define dprintk(format, args...) \
15 printk(KERN_DEBUG "mpoa:%s: " format, __FILE__, ##args) /* debug */
15#else 16#else
16#define dprintk(format, args...) \ 17#define dprintk(format, args...) \
17 do { if (0) printk(KERN_DEBUG format, ##args); } while (0) 18 do { if (0) \
19 printk(KERN_DEBUG "mpoa:%s: " format, __FILE__, ##args);\
20 } while (0)
18#endif 21#endif
19 22
20#if 0 23#if 0
21#define ddprintk printk(KERN_DEBUG format, ##args) /* more debug */ 24#define ddprintk(format, args...) \
25 printk(KERN_DEBUG "mpoa:%s: " format, __FILE__, ##args) /* debug */
22#else 26#else
23#define ddprintk(format, args...) \ 27#define ddprintk(format, args...) \
24 do { if (0) printk(KERN_DEBUG format, ##args); } while (0) 28 do { if (0) \
29 printk(KERN_DEBUG "mpoa:%s: " format, __FILE__, ##args);\
30 } while (0)
25#endif 31#endif
26 32
27static in_cache_entry *in_cache_get(__be32 dst_ip, 33static in_cache_entry *in_cache_get(__be32 dst_ip,
@@ -96,11 +102,10 @@ static in_cache_entry *in_cache_add_entry(__be32 dst_ip,
96 return NULL; 102 return NULL;
97 } 103 }
98 104
99 dprintk("mpoa: mpoa_caches.c: adding an ingress entry, ip = %pI4\n", 105 dprintk("adding an ingress entry, ip = %pI4\n", &dst_ip);
100 &dst_ip);
101 106
102 atomic_set(&entry->use, 1); 107 atomic_set(&entry->use, 1);
103 dprintk("mpoa: mpoa_caches.c: new_in_cache_entry: about to lock\n"); 108 dprintk("new_in_cache_entry: about to lock\n");
104 write_lock_bh(&client->ingress_lock); 109 write_lock_bh(&client->ingress_lock);
105 entry->next = client->in_cache; 110 entry->next = client->in_cache;
106 entry->prev = NULL; 111 entry->prev = NULL;
@@ -118,7 +123,7 @@ static in_cache_entry *in_cache_add_entry(__be32 dst_ip,
118 atomic_inc(&entry->use); 123 atomic_inc(&entry->use);
119 124
120 write_unlock_bh(&client->ingress_lock); 125 write_unlock_bh(&client->ingress_lock);
121 dprintk("mpoa: mpoa_caches.c: new_in_cache_entry: unlocked\n"); 126 dprintk("new_in_cache_entry: unlocked\n");
122 127
123 return entry; 128 return entry;
124} 129}
@@ -154,7 +159,7 @@ static int cache_hit(in_cache_entry *entry, struct mpoa_client *mpc)
154 159
155 if (entry->count > mpc->parameters.mpc_p1 && 160 if (entry->count > mpc->parameters.mpc_p1 &&
156 entry->entry_state == INGRESS_INVALID) { 161 entry->entry_state == INGRESS_INVALID) {
157 dprintk("mpoa: (%s) mpoa_caches.c: threshold exceeded for ip %pI4, sending MPOA res req\n", 162 dprintk("(%s) threshold exceeded for ip %pI4, sending MPOA res req\n",
158 mpc->dev->name, &entry->ctrl_info.in_dst_ip); 163 mpc->dev->name, &entry->ctrl_info.in_dst_ip);
159 entry->entry_state = INGRESS_RESOLVING; 164 entry->entry_state = INGRESS_RESOLVING;
160 msg.type = SND_MPOA_RES_RQST; 165 msg.type = SND_MPOA_RES_RQST;
@@ -190,7 +195,7 @@ static void in_cache_remove_entry(in_cache_entry *entry,
190 struct k_message msg; 195 struct k_message msg;
191 196
192 vcc = entry->shortcut; 197 vcc = entry->shortcut;
193 dprintk("mpoa: mpoa_caches.c: removing an ingress entry, ip = %pI4\n", 198 dprintk("removing an ingress entry, ip = %pI4\n",
194 &entry->ctrl_info.in_dst_ip); 199 &entry->ctrl_info.in_dst_ip);
195 200
196 if (entry->prev != NULL) 201 if (entry->prev != NULL)
@@ -235,7 +240,7 @@ static void clear_count_and_expired(struct mpoa_client *client)
235 next_entry = entry->next; 240 next_entry = entry->next;
236 if ((now.tv_sec - entry->tv.tv_sec) 241 if ((now.tv_sec - entry->tv.tv_sec)
237 > entry->ctrl_info.holding_time) { 242 > entry->ctrl_info.holding_time) {
238 dprintk("mpoa: mpoa_caches.c: holding time expired, ip = %pI4\n", 243 dprintk("holding time expired, ip = %pI4\n",
239 &entry->ctrl_info.in_dst_ip); 244 &entry->ctrl_info.in_dst_ip);
240 client->in_ops->remove_entry(entry, client); 245 client->in_ops->remove_entry(entry, client);
241 } 246 }
@@ -302,7 +307,7 @@ static void refresh_entries(struct mpoa_client *client)
302 struct timeval now; 307 struct timeval now;
303 struct in_cache_entry *entry = client->in_cache; 308 struct in_cache_entry *entry = client->in_cache;
304 309
305 ddprintk("mpoa: mpoa_caches.c: refresh_entries\n"); 310 ddprintk("refresh_entries\n");
306 do_gettimeofday(&now); 311 do_gettimeofday(&now);
307 312
308 read_lock_bh(&client->ingress_lock); 313 read_lock_bh(&client->ingress_lock);
@@ -312,7 +317,7 @@ static void refresh_entries(struct mpoa_client *client)
312 entry->refresh_time = (2 * (entry->ctrl_info.holding_time))/3; 317 entry->refresh_time = (2 * (entry->ctrl_info.holding_time))/3;
313 if ((now.tv_sec - entry->reply_wait.tv_sec) > 318 if ((now.tv_sec - entry->reply_wait.tv_sec) >
314 entry->refresh_time) { 319 entry->refresh_time) {
315 dprintk("mpoa: mpoa_caches.c: refreshing an entry.\n"); 320 dprintk("refreshing an entry.\n");
316 entry->entry_state = INGRESS_REFRESHING; 321 entry->entry_state = INGRESS_REFRESHING;
317 322
318 } 323 }
@@ -435,7 +440,7 @@ static void eg_cache_remove_entry(eg_cache_entry *entry,
435 struct k_message msg; 440 struct k_message msg;
436 441
437 vcc = entry->shortcut; 442 vcc = entry->shortcut;
438 dprintk("mpoa: mpoa_caches.c: removing an egress entry.\n"); 443 dprintk("removing an egress entry.\n");
439 if (entry->prev != NULL) 444 if (entry->prev != NULL)
440 entry->prev->next = entry->next; 445 entry->prev->next = entry->next;
441 else 446 else
@@ -471,11 +476,11 @@ static eg_cache_entry *eg_cache_add_entry(struct k_message *msg,
471 return NULL; 476 return NULL;
472 } 477 }
473 478
474 dprintk("mpoa: mpoa_caches.c: adding an egress entry, ip = %pI4, this should be our IP\n", 479 dprintk("adding an egress entry, ip = %pI4, this should be our IP\n",
475 &msg->content.eg_info.eg_dst_ip); 480 &msg->content.eg_info.eg_dst_ip);
476 481
477 atomic_set(&entry->use, 1); 482 atomic_set(&entry->use, 1);
478 dprintk("mpoa: mpoa_caches.c: new_eg_cache_entry: about to lock\n"); 483 dprintk("new_eg_cache_entry: about to lock\n");
479 write_lock_irq(&client->egress_lock); 484 write_lock_irq(&client->egress_lock);
480 entry->next = client->eg_cache; 485 entry->next = client->eg_cache;
481 entry->prev = NULL; 486 entry->prev = NULL;
@@ -487,14 +492,13 @@ static eg_cache_entry *eg_cache_add_entry(struct k_message *msg,
487 entry->ctrl_info = msg->content.eg_info; 492 entry->ctrl_info = msg->content.eg_info;
488 do_gettimeofday(&(entry->tv)); 493 do_gettimeofday(&(entry->tv));
489 entry->entry_state = EGRESS_RESOLVED; 494 entry->entry_state = EGRESS_RESOLVED;
490 dprintk("mpoa: mpoa_caches.c: new_eg_cache_entry cache_id %u\n", 495 dprintk("new_eg_cache_entry cache_id %u\n",
491 ntohl(entry->ctrl_info.cache_id)); 496 ntohl(entry->ctrl_info.cache_id));
492 dprintk("mpoa: mpoa_caches.c: mps_ip = %pI4\n", 497 dprintk("mps_ip = %pI4\n", &entry->ctrl_info.mps_ip);
493 &entry->ctrl_info.mps_ip);
494 atomic_inc(&entry->use); 498 atomic_inc(&entry->use);
495 499
496 write_unlock_irq(&client->egress_lock); 500 write_unlock_irq(&client->egress_lock);
497 dprintk("mpoa: mpoa_caches.c: new_eg_cache_entry: unlocked\n"); 501 dprintk("new_eg_cache_entry: unlocked\n");
498 502
499 return entry; 503 return entry;
500} 504}
@@ -524,7 +528,7 @@ static void clear_expired(struct mpoa_client *client)
524 > entry->ctrl_info.holding_time) { 528 > entry->ctrl_info.holding_time) {
525 msg.type = SND_EGRESS_PURGE; 529 msg.type = SND_EGRESS_PURGE;
526 msg.content.eg_info = entry->ctrl_info; 530 msg.content.eg_info = entry->ctrl_info;
527 dprintk("mpoa: mpoa_caches.c: egress_cache: holding time expired, cache_id = %u.\n", 531 dprintk("egress_cache: holding time expired, cache_id = %u.\n",
528 ntohl(entry->ctrl_info.cache_id)); 532 ntohl(entry->ctrl_info.cache_id));
529 msg_to_mpoad(&msg, client); 533 msg_to_mpoad(&msg, client);
530 client->eg_ops->remove_entry(entry, client); 534 client->eg_ops->remove_entry(entry, client);
diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c
index aae4a87c22a..b9bdb98427e 100644
--- a/net/atm/mpoa_proc.c
+++ b/net/atm/mpoa_proc.c
@@ -21,10 +21,23 @@
21 */ 21 */
22 22
23#if 1 23#if 1
24#define dprintk(format, args...) printk(KERN_DEBUG format, ##args) /* debug */ 24#define dprintk(format, args...) \
25 printk(KERN_DEBUG "mpoa:%s: " format, __FILE__, ##args) /* debug */
25#else 26#else
26#define dprintk(format, args...) \ 27#define dprintk(format, args...) \
27 do { if (0) printk(KERN_DEBUG format, ##args); } while (0) 28 do { if (0) \
29 printk(KERN_DEBUG "mpoa:%s: " format, __FILE__, ##args);\
30 } while (0)
31#endif
32
33#if 0
34#define ddprintk(format, args...) \
35 printk(KERN_DEBUG "mpoa:%s: " format, __FILE__, ##args) /* debug */
36#else
37#define ddprintk(format, args...) \
38 do { if (0) \
39 printk(KERN_DEBUG "mpoa:%s: " format, __FILE__, ##args);\
40 } while (0)
28#endif 41#endif
29 42
30#define STAT_FILE_NAME "mpc" /* Our statistic file's name */ 43#define STAT_FILE_NAME "mpc" /* Our statistic file's name */
@@ -258,12 +271,9 @@ static int parse_qos(const char *buff)
258 qos.rxtp.max_pcr = rx_pcr; 271 qos.rxtp.max_pcr = rx_pcr;
259 qos.rxtp.max_sdu = rx_sdu; 272 qos.rxtp.max_sdu = rx_sdu;
260 qos.aal = ATM_AAL5; 273 qos.aal = ATM_AAL5;
261 dprintk("mpoa: mpoa_proc.c: parse_qos(): setting qos paramameters to tx=%d,%d rx=%d,%d\n", 274 dprintk("parse_qos(): setting qos paramameters to tx=%d,%d rx=%d,%d\n",
262 qos.txtp.max_pcr, 275 qos.txtp.max_pcr, qos.txtp.max_sdu,
263 qos.txtp.max_sdu, 276 qos.rxtp.max_pcr, qos.rxtp.max_sdu);
264 qos.rxtp.max_pcr,
265 qos.rxtp.max_sdu
266 );
267 277
268 atm_mpoa_add_qos(ipaddr, &qos); 278 atm_mpoa_add_qos(ipaddr, &qos);
269 return 1; 279 return 1;