aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/mpc.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2007-02-09 09:24:29 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-11 02:19:16 -0500
commitf7d57453d20e27de69ecafd121005e9d13a0f427 (patch)
tree68fc3b10116cbd4e20411a08fd7f6cc2510c3442 /net/atm/mpc.c
parented4477b96049fe2908c63f854bf8e37c6df4a635 (diff)
[NET] ATM: Fix whitespace errors.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/mpc.c')
-rw-r--r--net/atm/mpc.c130
1 files changed, 65 insertions, 65 deletions
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index c18f73715ef9..cb3c004ff022 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -32,7 +32,7 @@
32#include "resources.h" 32#include "resources.h"
33 33
34/* 34/*
35 * mpc.c: Implementation of MPOA client kernel part 35 * mpc.c: Implementation of MPOA client kernel part
36 */ 36 */
37 37
38#if 0 38#if 0
@@ -80,17 +80,17 @@ static struct llc_snap_hdr llc_snap_mpoa_ctrl = {
80 0xaa, 0xaa, 0x03, 80 0xaa, 0xaa, 0x03,
81 {0x00, 0x00, 0x5e}, 81 {0x00, 0x00, 0x5e},
82 {0x00, 0x03} /* For MPOA control PDUs */ 82 {0x00, 0x03} /* For MPOA control PDUs */
83}; 83};
84static struct llc_snap_hdr llc_snap_mpoa_data = { 84static struct llc_snap_hdr llc_snap_mpoa_data = {
85 0xaa, 0xaa, 0x03, 85 0xaa, 0xaa, 0x03,
86 {0x00, 0x00, 0x00}, 86 {0x00, 0x00, 0x00},
87 {0x08, 0x00} /* This is for IP PDUs only */ 87 {0x08, 0x00} /* This is for IP PDUs only */
88}; 88};
89static struct llc_snap_hdr llc_snap_mpoa_data_tagged = { 89static struct llc_snap_hdr llc_snap_mpoa_data_tagged = {
90 0xaa, 0xaa, 0x03, 90 0xaa, 0xaa, 0x03,
91 {0x00, 0x00, 0x00}, 91 {0x00, 0x00, 0x00},
92 {0x88, 0x4c} /* This is for tagged data PDUs */ 92 {0x88, 0x4c} /* This is for tagged data PDUs */
93}; 93};
94 94
95static struct notifier_block mpoa_notifier = { 95static struct notifier_block mpoa_notifier = {
96 mpoa_event_listener, 96 mpoa_event_listener,
@@ -106,12 +106,12 @@ static DEFINE_TIMER(mpc_timer, NULL, 0, 0);
106static struct mpoa_client *find_mpc_by_itfnum(int itf) 106static struct mpoa_client *find_mpc_by_itfnum(int itf)
107{ 107{
108 struct mpoa_client *mpc; 108 struct mpoa_client *mpc;
109 109
110 mpc = mpcs; /* our global linked list */ 110 mpc = mpcs; /* our global linked list */
111 while (mpc != NULL) { 111 while (mpc != NULL) {
112 if (mpc->dev_num == itf) 112 if (mpc->dev_num == itf)
113 return mpc; 113 return mpc;
114 mpc = mpc->next; 114 mpc = mpc->next;
115 } 115 }
116 116
117 return NULL; /* not found */ 117 return NULL; /* not found */
@@ -120,7 +120,7 @@ static struct mpoa_client *find_mpc_by_itfnum(int itf)
120static struct mpoa_client *find_mpc_by_vcc(struct atm_vcc *vcc) 120static struct mpoa_client *find_mpc_by_vcc(struct atm_vcc *vcc)
121{ 121{
122 struct mpoa_client *mpc; 122 struct mpoa_client *mpc;
123 123
124 mpc = mpcs; /* our global linked list */ 124 mpc = mpcs; /* our global linked list */
125 while (mpc != NULL) { 125 while (mpc != NULL) {
126 if (mpc->mpoad_vcc == vcc) 126 if (mpc->mpoad_vcc == vcc)
@@ -134,7 +134,7 @@ static struct mpoa_client *find_mpc_by_vcc(struct atm_vcc *vcc)
134static struct mpoa_client *find_mpc_by_lec(struct net_device *dev) 134static struct mpoa_client *find_mpc_by_lec(struct net_device *dev)
135{ 135{
136 struct mpoa_client *mpc; 136 struct mpoa_client *mpc;
137 137
138 mpc = mpcs; /* our global linked list */ 138 mpc = mpcs; /* our global linked list */
139 while (mpc != NULL) { 139 while (mpc != NULL) {
140 if (mpc->dev == dev) 140 if (mpc->dev == dev)
@@ -190,7 +190,7 @@ struct atm_mpoa_qos *atm_mpoa_search_qos(__be32 dst_ip)
190 } 190 }
191 191
192 return qos; 192 return qos;
193} 193}
194 194
195/* 195/*
196 * Returns 0 for failure 196 * Returns 0 for failure
@@ -245,7 +245,7 @@ static struct net_device *find_lec_by_itfnum(int itf)
245 245
246 sprintf(name, "lec%d", itf); 246 sprintf(name, "lec%d", itf);
247 dev = dev_get_by_name(name); 247 dev = dev_get_by_name(name);
248 248
249 return dev; 249 return dev;
250} 250}
251 251
@@ -265,25 +265,25 @@ static struct mpoa_client *alloc_mpc(void)
265 mpc->parameters.mpc_p2 = MPC_P2; 265 mpc->parameters.mpc_p2 = MPC_P2;
266 memset(mpc->parameters.mpc_p3,0,sizeof(mpc->parameters.mpc_p3)); 266 memset(mpc->parameters.mpc_p3,0,sizeof(mpc->parameters.mpc_p3));
267 mpc->parameters.mpc_p4 = MPC_P4; 267 mpc->parameters.mpc_p4 = MPC_P4;
268 mpc->parameters.mpc_p5 = MPC_P5; 268 mpc->parameters.mpc_p5 = MPC_P5;
269 mpc->parameters.mpc_p6 = MPC_P6; 269 mpc->parameters.mpc_p6 = MPC_P6;
270 270
271 mpcs = mpc; 271 mpcs = mpc;
272 272
273 return mpc; 273 return mpc;
274} 274}
275 275
276/* 276/*
277 * 277 *
278 * start_mpc() puts the MPC on line. All the packets destined 278 * start_mpc() puts the MPC on line. All the packets destined
279 * to the lec underneath us are now being monitored and 279 * to the lec underneath us are now being monitored and
280 * shortcuts will be established. 280 * shortcuts will be established.
281 * 281 *
282 */ 282 */
283static void start_mpc(struct mpoa_client *mpc, struct net_device *dev) 283static void start_mpc(struct mpoa_client *mpc, struct net_device *dev)
284{ 284{
285 285
286 dprintk("mpoa: (%s) start_mpc:\n", mpc->dev->name); 286 dprintk("mpoa: (%s) start_mpc:\n", mpc->dev->name);
287 if (dev->hard_start_xmit == NULL) { 287 if (dev->hard_start_xmit == NULL) {
288 printk("mpoa: (%s) start_mpc: dev->hard_start_xmit == NULL, not starting\n", 288 printk("mpoa: (%s) start_mpc: dev->hard_start_xmit == NULL, not starting\n",
289 dev->name); 289 dev->name);
@@ -297,8 +297,8 @@ static void start_mpc(struct mpoa_client *mpc, struct net_device *dev)
297 297
298static void stop_mpc(struct mpoa_client *mpc) 298static void stop_mpc(struct mpoa_client *mpc)
299{ 299{
300 300
301 dprintk("mpoa: (%s) stop_mpc:", mpc->dev->name); 301 dprintk("mpoa: (%s) stop_mpc:", mpc->dev->name);
302 302
303 /* Lets not nullify lec device's dev->hard_start_xmit */ 303 /* Lets not nullify lec device's dev->hard_start_xmit */
304 if (mpc->dev->hard_start_xmit != mpc_send_packet) { 304 if (mpc->dev->hard_start_xmit != mpc_send_packet) {
@@ -309,7 +309,7 @@ static void stop_mpc(struct mpoa_client *mpc)
309 mpc->dev->hard_start_xmit = mpc->old_hard_start_xmit; 309 mpc->dev->hard_start_xmit = mpc->old_hard_start_xmit;
310 mpc->old_hard_start_xmit = NULL; 310 mpc->old_hard_start_xmit = NULL;
311 /* close_shortcuts(mpc); ??? FIXME */ 311 /* close_shortcuts(mpc); ??? FIXME */
312 312
313 return; 313 return;
314} 314}
315 315
@@ -358,7 +358,7 @@ static void lane2_assoc_ind(struct net_device *dev, uint8_t *mac_addr,
358 uint8_t length, mpoa_device_type, number_of_mps_macs; 358 uint8_t length, mpoa_device_type, number_of_mps_macs;
359 uint8_t *end_of_tlvs; 359 uint8_t *end_of_tlvs;
360 struct mpoa_client *mpc; 360 struct mpoa_client *mpc;
361 361
362 mpoa_device_type = number_of_mps_macs = 0; /* silence gcc */ 362 mpoa_device_type = number_of_mps_macs = 0; /* silence gcc */
363 dprintk("mpoa: (%s) lane2_assoc_ind: received TLV(s), ", dev->name); 363 dprintk("mpoa: (%s) lane2_assoc_ind: received TLV(s), ", dev->name);
364 dprintk("total length of all TLVs %d\n", sizeoftlvs); 364 dprintk("total length of all TLVs %d\n", sizeoftlvs);
@@ -377,7 +377,7 @@ static void lane2_assoc_ind(struct net_device *dev, uint8_t *mac_addr,
377 printk("TLV value extends past its buffer, aborting parse\n"); 377 printk("TLV value extends past its buffer, aborting parse\n");
378 return; 378 return;
379 } 379 }
380 380
381 if (type == 0) { 381 if (type == 0) {
382 printk("mpoa: (%s) lane2_assoc_ind: TLV type was 0, returning\n", dev->name); 382 printk("mpoa: (%s) lane2_assoc_ind: TLV type was 0, returning\n", dev->name);
383 return; 383 return;
@@ -412,10 +412,10 @@ static void lane2_assoc_ind(struct net_device *dev, uint8_t *mac_addr,
412 continue; /* someone should read the spec */ 412 continue; /* someone should read the spec */
413 } 413 }
414 dprintk("this MPS has %d MAC addresses\n", number_of_mps_macs); 414 dprintk("this MPS has %d MAC addresses\n", number_of_mps_macs);
415 415
416 /* ok, now we can go and tell our daemon the control address of MPS */ 416 /* ok, now we can go and tell our daemon the control address of MPS */
417 send_set_mps_ctrl_addr(tlvs, mpc); 417 send_set_mps_ctrl_addr(tlvs, mpc);
418 418
419 tlvs = copy_macs(mpc, mac_addr, tlvs, number_of_mps_macs, mpoa_device_type); 419 tlvs = copy_macs(mpc, mac_addr, tlvs, number_of_mps_macs, mpoa_device_type);
420 if (tlvs == NULL) return; 420 if (tlvs == NULL) return;
421 } 421 }
@@ -474,7 +474,7 @@ static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc)
474 iph = (struct iphdr *)buff; 474 iph = (struct iphdr *)buff;
475 ipaddr = iph->daddr; 475 ipaddr = iph->daddr;
476 476
477 ddprintk("mpoa: (%s) send_via_shortcut: ipaddr 0x%x\n", mpc->dev->name, ipaddr); 477 ddprintk("mpoa: (%s) send_via_shortcut: ipaddr 0x%x\n", mpc->dev->name, ipaddr);
478 478
479 entry = mpc->in_ops->get(ipaddr, mpc); 479 entry = mpc->in_ops->get(ipaddr, mpc);
480 if (entry == NULL) { 480 if (entry == NULL) {
@@ -483,15 +483,15 @@ static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc)
483 return 1; 483 return 1;
484 } 484 }
485 if (mpc->in_ops->cache_hit(entry, mpc) != OPEN){ /* threshold not exceeded or VCC not ready */ 485 if (mpc->in_ops->cache_hit(entry, mpc) != OPEN){ /* threshold not exceeded or VCC not ready */
486 ddprintk("mpoa: (%s) send_via_shortcut: cache_hit: returns != OPEN\n", mpc->dev->name); 486 ddprintk("mpoa: (%s) send_via_shortcut: cache_hit: returns != OPEN\n", mpc->dev->name);
487 mpc->in_ops->put(entry); 487 mpc->in_ops->put(entry);
488 return 1; 488 return 1;
489 } 489 }
490 490
491 ddprintk("mpoa: (%s) send_via_shortcut: using shortcut\n", mpc->dev->name); 491 ddprintk("mpoa: (%s) send_via_shortcut: using shortcut\n", mpc->dev->name);
492 /* MPOA spec A.1.4, MPOA client must decrement IP ttl at least by one */ 492 /* MPOA spec A.1.4, MPOA client must decrement IP ttl at least by one */
493 if (iph->ttl <= 1) { 493 if (iph->ttl <= 1) {
494 ddprintk("mpoa: (%s) send_via_shortcut: IP ttl = %u, using LANE\n", mpc->dev->name, iph->ttl); 494 ddprintk("mpoa: (%s) send_via_shortcut: IP ttl = %u, using LANE\n", mpc->dev->name, iph->ttl);
495 mpc->in_ops->put(entry); 495 mpc->in_ops->put(entry);
496 return 1; 496 return 1;
497 } 497 }
@@ -529,7 +529,7 @@ static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev)
529 struct mpoa_client *mpc; 529 struct mpoa_client *mpc;
530 struct ethhdr *eth; 530 struct ethhdr *eth;
531 int i = 0; 531 int i = 0;
532 532
533 mpc = find_mpc_by_lec(dev); /* this should NEVER fail */ 533 mpc = find_mpc_by_lec(dev); /* this should NEVER fail */
534 if(mpc == NULL) { 534 if(mpc == NULL) {
535 printk("mpoa: (%s) mpc_send_packet: no MPC found\n", dev->name); 535 printk("mpoa: (%s) mpc_send_packet: no MPC found\n", dev->name);
@@ -549,7 +549,7 @@ static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev)
549 549
550 non_ip: 550 non_ip:
551 retval = mpc->old_hard_start_xmit(skb,dev); 551 retval = mpc->old_hard_start_xmit(skb,dev);
552 552
553 return retval; 553 return retval;
554} 554}
555 555
@@ -569,11 +569,11 @@ static int atm_mpoa_vcc_attach(struct atm_vcc *vcc, void __user *arg)
569 ipaddr = ioc_data.ipaddr; 569 ipaddr = ioc_data.ipaddr;
570 if (ioc_data.dev_num < 0 || ioc_data.dev_num >= MAX_LEC_ITF) 570 if (ioc_data.dev_num < 0 || ioc_data.dev_num >= MAX_LEC_ITF)
571 return -EINVAL; 571 return -EINVAL;
572 572
573 mpc = find_mpc_by_itfnum(ioc_data.dev_num); 573 mpc = find_mpc_by_itfnum(ioc_data.dev_num);
574 if (mpc == NULL) 574 if (mpc == NULL)
575 return -EINVAL; 575 return -EINVAL;
576 576
577 if (ioc_data.type == MPC_SOCKET_INGRESS) { 577 if (ioc_data.type == MPC_SOCKET_INGRESS) {
578 in_entry = mpc->in_ops->get(ipaddr, mpc); 578 in_entry = mpc->in_ops->get(ipaddr, mpc);
579 if (in_entry == NULL || in_entry->entry_state < INGRESS_RESOLVED) { 579 if (in_entry == NULL || in_entry->entry_state < INGRESS_RESOLVED) {
@@ -604,7 +604,7 @@ static void mpc_vcc_close(struct atm_vcc *vcc, struct net_device *dev)
604 struct mpoa_client *mpc; 604 struct mpoa_client *mpc;
605 in_cache_entry *in_entry; 605 in_cache_entry *in_entry;
606 eg_cache_entry *eg_entry; 606 eg_cache_entry *eg_entry;
607 607
608 mpc = find_mpc_by_lec(dev); 608 mpc = find_mpc_by_lec(dev);
609 if (mpc == NULL) { 609 if (mpc == NULL) {
610 printk("mpoa: (%s) mpc_vcc_close: close for unknown MPC\n", dev->name); 610 printk("mpoa: (%s) mpc_vcc_close: close for unknown MPC\n", dev->name);
@@ -640,14 +640,14 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
640 struct mpoa_client *mpc; 640 struct mpoa_client *mpc;
641 __be32 tag; 641 __be32 tag;
642 char *tmp; 642 char *tmp;
643 643
644 ddprintk("mpoa: (%s) mpc_push:\n", dev->name); 644 ddprintk("mpoa: (%s) mpc_push:\n", dev->name);
645 if (skb == NULL) { 645 if (skb == NULL) {
646 dprintk("mpoa: (%s) mpc_push: null skb, closing VCC\n", dev->name); 646 dprintk("mpoa: (%s) mpc_push: null skb, closing VCC\n", dev->name);
647 mpc_vcc_close(vcc, dev); 647 mpc_vcc_close(vcc, dev);
648 return; 648 return;
649 } 649 }
650 650
651 skb->dev = dev; 651 skb->dev = dev;
652 if (memcmp(skb->data, &llc_snap_mpoa_ctrl, sizeof(struct llc_snap_hdr)) == 0) { 652 if (memcmp(skb->data, &llc_snap_mpoa_ctrl, sizeof(struct llc_snap_hdr)) == 0) {
653 struct sock *sk = sk_atm(vcc); 653 struct sock *sk = sk_atm(vcc);
@@ -693,11 +693,11 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
693 dev_kfree_skb_any(skb); 693 dev_kfree_skb_any(skb);
694 return; 694 return;
695 } 695 }
696 696
697 /* 697 /*
698 * See if ingress MPC is using shortcut we opened as a return channel. 698 * See if ingress MPC is using shortcut we opened as a return channel.
699 * This means we have a bi-directional vcc opened by us. 699 * This means we have a bi-directional vcc opened by us.
700 */ 700 */
701 if (eg->shortcut == NULL) { 701 if (eg->shortcut == NULL) {
702 eg->shortcut = vcc; 702 eg->shortcut = vcc;
703 printk("mpoa: (%s) mpc_push: egress SVC in use\n", dev->name); 703 printk("mpoa: (%s) mpc_push: egress SVC in use\n", dev->name);
@@ -743,7 +743,7 @@ static int atm_mpoa_mpoad_attach (struct atm_vcc *vcc, int arg)
743 struct mpoa_client *mpc; 743 struct mpoa_client *mpc;
744 struct lec_priv *priv; 744 struct lec_priv *priv;
745 int err; 745 int err;
746 746
747 if (mpcs == NULL) { 747 if (mpcs == NULL) {
748 init_timer(&mpc_timer); 748 init_timer(&mpc_timer);
749 mpc_timer_refresh(); 749 mpc_timer_refresh();
@@ -755,7 +755,7 @@ static int atm_mpoa_mpoad_attach (struct atm_vcc *vcc, int arg)
755 return err; 755 return err;
756 } 756 }
757 } 757 }
758 758
759 mpc = find_mpc_by_itfnum(arg); 759 mpc = find_mpc_by_itfnum(arg);
760 if (mpc == NULL) { 760 if (mpc == NULL) {
761 dprintk("mpoa: mpoad_attach: allocating new mpc for itf %d\n", arg); 761 dprintk("mpoa: mpoad_attach: allocating new mpc for itf %d\n", arg);
@@ -776,7 +776,7 @@ static int atm_mpoa_mpoad_attach (struct atm_vcc *vcc, int arg)
776 dev_put(mpc->dev); 776 dev_put(mpc->dev);
777 mpc->dev = NULL; 777 mpc->dev = NULL;
778 } else 778 } else
779 priv->lane2_ops->associate_indicator = lane2_assoc_ind; 779 priv->lane2_ops->associate_indicator = lane2_assoc_ind;
780 } 780 }
781 781
782 mpc->mpoad_vcc = vcc; 782 mpc->mpoad_vcc = vcc;
@@ -788,7 +788,7 @@ static int atm_mpoa_mpoad_attach (struct atm_vcc *vcc, int arg)
788 if (mpc->dev) { 788 if (mpc->dev) {
789 char empty[ATM_ESA_LEN]; 789 char empty[ATM_ESA_LEN];
790 memset(empty, 0, ATM_ESA_LEN); 790 memset(empty, 0, ATM_ESA_LEN);
791 791
792 start_mpc(mpc, mpc->dev); 792 start_mpc(mpc, mpc->dev);
793 /* set address if mpcd e.g. gets killed and restarted. 793 /* set address if mpcd e.g. gets killed and restarted.
794 * If we do not do it now we have to wait for the next LE_ARP 794 * If we do not do it now we have to wait for the next LE_ARP
@@ -806,7 +806,7 @@ static void send_set_mps_ctrl_addr(char *addr, struct mpoa_client *mpc)
806 struct k_message mesg; 806 struct k_message mesg;
807 807
808 memcpy (mpc->mps_ctrl_addr, addr, ATM_ESA_LEN); 808 memcpy (mpc->mps_ctrl_addr, addr, ATM_ESA_LEN);
809 809
810 mesg.type = SET_MPS_CTRL_ADDR; 810 mesg.type = SET_MPS_CTRL_ADDR;
811 memcpy(mesg.MPS_ctrl, addr, ATM_ESA_LEN); 811 memcpy(mesg.MPS_ctrl, addr, ATM_ESA_LEN);
812 msg_to_mpoad(&mesg, mpc); 812 msg_to_mpoad(&mesg, mpc);
@@ -828,7 +828,7 @@ static void mpoad_close(struct atm_vcc *vcc)
828 printk("mpoa: mpoad_close: close for non-present mpoad\n"); 828 printk("mpoa: mpoad_close: close for non-present mpoad\n");
829 return; 829 return;
830 } 830 }
831 831
832 mpc->mpoad_vcc = NULL; 832 mpc->mpoad_vcc = NULL;
833 if (mpc->dev) { 833 if (mpc->dev) {
834 struct lec_priv *priv = (struct lec_priv *)mpc->dev->priv; 834 struct lec_priv *priv = (struct lec_priv *)mpc->dev->priv;
@@ -844,7 +844,7 @@ static void mpoad_close(struct atm_vcc *vcc)
844 atm_return(vcc, skb->truesize); 844 atm_return(vcc, skb->truesize);
845 kfree_skb(skb); 845 kfree_skb(skb);
846 } 846 }
847 847
848 printk("mpoa: (%s) going down\n", 848 printk("mpoa: (%s) going down\n",
849 (mpc->dev) ? mpc->dev->name : "<unknown>"); 849 (mpc->dev) ? mpc->dev->name : "<unknown>");
850 module_put(THIS_MODULE); 850 module_put(THIS_MODULE);
@@ -857,11 +857,11 @@ static void mpoad_close(struct atm_vcc *vcc)
857 */ 857 */
858static int msg_from_mpoad(struct atm_vcc *vcc, struct sk_buff *skb) 858static int msg_from_mpoad(struct atm_vcc *vcc, struct sk_buff *skb)
859{ 859{
860 860
861 struct mpoa_client *mpc = find_mpc_by_vcc(vcc); 861 struct mpoa_client *mpc = find_mpc_by_vcc(vcc);
862 struct k_message *mesg = (struct k_message*)skb->data; 862 struct k_message *mesg = (struct k_message*)skb->data;
863 atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); 863 atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
864 864
865 if (mpc == NULL) { 865 if (mpc == NULL) {
866 printk("mpoa: msg_from_mpoad: no mpc found\n"); 866 printk("mpoa: msg_from_mpoad: no mpc found\n");
867 return 0; 867 return 0;
@@ -938,7 +938,7 @@ int msg_to_mpoad(struct k_message *mesg, struct mpoa_client *mpc)
938 skb_put(skb, sizeof(struct k_message)); 938 skb_put(skb, sizeof(struct k_message));
939 memcpy(skb->data, mesg, sizeof(struct k_message)); 939 memcpy(skb->data, mesg, sizeof(struct k_message));
940 atm_force_charge(mpc->mpoad_vcc, skb->truesize); 940 atm_force_charge(mpc->mpoad_vcc, skb->truesize);
941 941
942 sk = sk_atm(mpc->mpoad_vcc); 942 sk = sk_atm(mpc->mpoad_vcc);
943 skb_queue_tail(&sk->sk_receive_queue, skb); 943 skb_queue_tail(&sk->sk_receive_queue, skb);
944 sk->sk_data_ready(sk, skb->len); 944 sk->sk_data_ready(sk, skb->len);
@@ -955,7 +955,7 @@ static int mpoa_event_listener(struct notifier_block *mpoa_notifier, unsigned lo
955 dev = (struct net_device *)dev_ptr; 955 dev = (struct net_device *)dev_ptr;
956 if (dev->name == NULL || strncmp(dev->name, "lec", 3)) 956 if (dev->name == NULL || strncmp(dev->name, "lec", 3))
957 return NOTIFY_DONE; /* we are only interested in lec:s */ 957 return NOTIFY_DONE; /* we are only interested in lec:s */
958 958
959 switch (event) { 959 switch (event) {
960 case NETDEV_REGISTER: /* a new lec device was allocated */ 960 case NETDEV_REGISTER: /* a new lec device was allocated */
961 priv = (struct lec_priv *)dev->priv; 961 priv = (struct lec_priv *)dev->priv;
@@ -1043,7 +1043,7 @@ static void MPOA_trigger_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1043 mpc->in_ops->put(entry); 1043 mpc->in_ops->put(entry);
1044 return; 1044 return;
1045 } 1045 }
1046 1046
1047 if(entry->entry_state == INGRESS_INVALID){ 1047 if(entry->entry_state == INGRESS_INVALID){
1048 entry->entry_state = INGRESS_RESOLVING; 1048 entry->entry_state = INGRESS_RESOLVING;
1049 msg->type = SND_MPOA_RES_RQST; 1049 msg->type = SND_MPOA_RES_RQST;
@@ -1053,7 +1053,7 @@ static void MPOA_trigger_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1053 mpc->in_ops->put(entry); 1053 mpc->in_ops->put(entry);
1054 return; 1054 return;
1055 } 1055 }
1056 1056
1057 printk("mpoa: (%s) MPOA_trigger_rcvd: entry already in resolving state\n", 1057 printk("mpoa: (%s) MPOA_trigger_rcvd: entry already in resolving state\n",
1058 (mpc->dev) ? mpc->dev->name : "<unknown>"); 1058 (mpc->dev) ? mpc->dev->name : "<unknown>");
1059 mpc->in_ops->put(entry); 1059 mpc->in_ops->put(entry);
@@ -1062,7 +1062,7 @@ static void MPOA_trigger_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1062 1062
1063/* 1063/*
1064 * Things get complicated because we have to check if there's an egress 1064 * Things get complicated because we have to check if there's an egress
1065 * shortcut with suitable traffic parameters we could use. 1065 * shortcut with suitable traffic parameters we could use.
1066 */ 1066 */
1067static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_client *client, in_cache_entry *entry) 1067static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_client *client, in_cache_entry *entry)
1068{ 1068{
@@ -1079,7 +1079,7 @@ static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_clien
1079 else if(eg_entry->shortcut->qos.txtp.max_pcr > 0) 1079 else if(eg_entry->shortcut->qos.txtp.max_pcr > 0)
1080 entry->shortcut = eg_entry->shortcut; 1080 entry->shortcut = eg_entry->shortcut;
1081 } 1081 }
1082 if(entry->shortcut){ 1082 if(entry->shortcut){
1083 dprintk("mpoa: (%s) using egress SVC to reach %u.%u.%u.%u\n",client->dev->name, NIPQUAD(dst_ip)); 1083 dprintk("mpoa: (%s) using egress SVC to reach %u.%u.%u.%u\n",client->dev->name, NIPQUAD(dst_ip));
1084 client->eg_ops->put(eg_entry); 1084 client->eg_ops->put(eg_entry);
1085 return; 1085 return;
@@ -1094,7 +1094,7 @@ static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_clien
1094 { 1094 {
1095 msg->qos = qos->qos; 1095 msg->qos = qos->qos;
1096 printk("mpoa: (%s) trying to get a CBR shortcut\n",client->dev->name); 1096 printk("mpoa: (%s) trying to get a CBR shortcut\n",client->dev->name);
1097 } 1097 }
1098 else memset(&msg->qos,0,sizeof(struct atm_qos)); 1098 else memset(&msg->qos,0,sizeof(struct atm_qos));
1099 msg_to_mpoad(msg, client); 1099 msg_to_mpoad(msg, client);
1100 return; 1100 return;
@@ -1111,7 +1111,7 @@ static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1111 printk("\nmpoa: (%s) ARGH, received res. reply for an entry that doesn't exist.\n", mpc->dev->name); 1111 printk("\nmpoa: (%s) ARGH, received res. reply for an entry that doesn't exist.\n", mpc->dev->name);
1112 return; 1112 return;
1113 } 1113 }
1114 ddprintk(" entry_state = %d ", entry->entry_state); 1114 ddprintk(" entry_state = %d ", entry->entry_state);
1115 1115
1116 if (entry->entry_state == INGRESS_RESOLVED) { 1116 if (entry->entry_state == INGRESS_RESOLVED) {
1117 printk("\nmpoa: (%s) MPOA_res_reply_rcvd for RESOLVED entry!\n", mpc->dev->name); 1117 printk("\nmpoa: (%s) MPOA_res_reply_rcvd for RESOLVED entry!\n", mpc->dev->name);
@@ -1126,7 +1126,7 @@ static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1126 ddprintk("entry->shortcut = %p\n", entry->shortcut); 1126 ddprintk("entry->shortcut = %p\n", entry->shortcut);
1127 1127
1128 if(entry->entry_state == INGRESS_RESOLVING && entry->shortcut != NULL){ 1128 if(entry->entry_state == INGRESS_RESOLVING && entry->shortcut != NULL){
1129 entry->entry_state = INGRESS_RESOLVED; 1129 entry->entry_state = INGRESS_RESOLVED;
1130 mpc->in_ops->put(entry); 1130 mpc->in_ops->put(entry);
1131 return; /* Shortcut already open... */ 1131 return; /* Shortcut already open... */
1132 } 1132 }
@@ -1137,7 +1137,7 @@ static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1137 mpc->in_ops->put(entry); 1137 mpc->in_ops->put(entry);
1138 return; 1138 return;
1139 } 1139 }
1140 1140
1141 check_qos_and_open_shortcut(msg, mpc, entry); 1141 check_qos_and_open_shortcut(msg, mpc, entry);
1142 entry->entry_state = INGRESS_RESOLVED; 1142 entry->entry_state = INGRESS_RESOLVED;
1143 mpc->in_ops->put(entry); 1143 mpc->in_ops->put(entry);
@@ -1169,13 +1169,13 @@ static void ingress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1169 } while (entry != NULL); 1169 } while (entry != NULL);
1170 1170
1171 return; 1171 return;
1172} 1172}
1173 1173
1174static void egress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc) 1174static void egress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1175{ 1175{
1176 __be32 cache_id = msg->content.eg_info.cache_id; 1176 __be32 cache_id = msg->content.eg_info.cache_id;
1177 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(cache_id, mpc); 1177 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(cache_id, mpc);
1178 1178
1179 if (entry == NULL) { 1179 if (entry == NULL) {
1180 dprintk("mpoa: (%s) egress_purge_rcvd: purge for a non-existing entry\n", mpc->dev->name); 1180 dprintk("mpoa: (%s) egress_purge_rcvd: purge for a non-existing entry\n", mpc->dev->name);
1181 return; 1181 return;
@@ -1188,7 +1188,7 @@ static void egress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1188 mpc->eg_ops->put(entry); 1188 mpc->eg_ops->put(entry);
1189 1189
1190 return; 1190 return;
1191} 1191}
1192 1192
1193static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry) 1193static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry)
1194{ 1194{
@@ -1259,7 +1259,7 @@ static void MPOA_cache_impos_rcvd( struct k_message * msg, struct mpoa_client *
1259{ 1259{
1260 uint16_t holding_time; 1260 uint16_t holding_time;
1261 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(msg->content.eg_info.cache_id, mpc); 1261 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(msg->content.eg_info.cache_id, mpc);
1262 1262
1263 holding_time = msg->content.eg_info.holding_time; 1263 holding_time = msg->content.eg_info.holding_time;
1264 dprintk("mpoa: (%s) MPOA_cache_impos_rcvd: entry = %p, holding_time = %u\n", 1264 dprintk("mpoa: (%s) MPOA_cache_impos_rcvd: entry = %p, holding_time = %u\n",
1265 mpc->dev->name, entry, holding_time); 1265 mpc->dev->name, entry, holding_time);
@@ -1272,13 +1272,13 @@ static void MPOA_cache_impos_rcvd( struct k_message * msg, struct mpoa_client *
1272 mpc->eg_ops->update(entry, holding_time); 1272 mpc->eg_ops->update(entry, holding_time);
1273 return; 1273 return;
1274 } 1274 }
1275 1275
1276 write_lock_irq(&mpc->egress_lock); 1276 write_lock_irq(&mpc->egress_lock);
1277 mpc->eg_ops->remove_entry(entry, mpc); 1277 mpc->eg_ops->remove_entry(entry, mpc);
1278 write_unlock_irq(&mpc->egress_lock); 1278 write_unlock_irq(&mpc->egress_lock);
1279 1279
1280 mpc->eg_ops->put(entry); 1280 mpc->eg_ops->put(entry);
1281 1281
1282 return; 1282 return;
1283} 1283}
1284 1284
@@ -1328,7 +1328,7 @@ static void set_mps_mac_addr_rcvd(struct k_message *msg, struct mpoa_client *cli
1328 return; 1328 return;
1329 } 1329 }
1330 client->number_of_mps_macs = 1; 1330 client->number_of_mps_macs = 1;
1331 1331
1332 return; 1332 return;
1333} 1333}
1334 1334
@@ -1364,7 +1364,7 @@ static void mpc_timer_refresh(void)
1364 mpc_timer.data = mpc_timer.expires; 1364 mpc_timer.data = mpc_timer.expires;
1365 mpc_timer.function = mpc_cache_check; 1365 mpc_timer.function = mpc_cache_check;
1366 add_timer(&mpc_timer); 1366 add_timer(&mpc_timer);
1367 1367
1368 return; 1368 return;
1369} 1369}
1370 1370
@@ -1373,7 +1373,7 @@ static void mpc_cache_check( unsigned long checking_time )
1373 struct mpoa_client *mpc = mpcs; 1373 struct mpoa_client *mpc = mpcs;
1374 static unsigned long previous_resolving_check_time; 1374 static unsigned long previous_resolving_check_time;
1375 static unsigned long previous_refresh_time; 1375 static unsigned long previous_refresh_time;
1376 1376
1377 while( mpc != NULL ){ 1377 while( mpc != NULL ){
1378 mpc->in_ops->clear_count(mpc); 1378 mpc->in_ops->clear_count(mpc);
1379 mpc->eg_ops->clear_expired(mpc); 1379 mpc->eg_ops->clear_expired(mpc);
@@ -1388,7 +1388,7 @@ static void mpc_cache_check( unsigned long checking_time )
1388 mpc = mpc->next; 1388 mpc = mpc->next;
1389 } 1389 }
1390 mpc_timer_refresh(); 1390 mpc_timer_refresh();
1391 1391
1392 return; 1392 return;
1393} 1393}
1394 1394