aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/mpoa_caches.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/atm/mpoa_caches.c')
-rw-r--r--net/atm/mpoa_caches.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
index fbf13cdcf46e..697a081533b5 100644
--- a/net/atm/mpoa_caches.c
+++ b/net/atm/mpoa_caches.c
@@ -22,7 +22,7 @@
22#define ddprintk(format,args...) 22#define ddprintk(format,args...)
23#endif 23#endif
24 24
25static in_cache_entry *in_cache_get(uint32_t dst_ip, 25static in_cache_entry *in_cache_get(__be32 dst_ip,
26 struct mpoa_client *client) 26 struct mpoa_client *client)
27{ 27{
28 in_cache_entry *entry; 28 in_cache_entry *entry;
@@ -42,9 +42,9 @@ static in_cache_entry *in_cache_get(uint32_t dst_ip,
42 return NULL; 42 return NULL;
43} 43}
44 44
45static in_cache_entry *in_cache_get_with_mask(uint32_t dst_ip, 45static in_cache_entry *in_cache_get_with_mask(__be32 dst_ip,
46 struct mpoa_client *client, 46 struct mpoa_client *client,
47 uint32_t mask) 47 __be32 mask)
48{ 48{
49 in_cache_entry *entry; 49 in_cache_entry *entry;
50 50
@@ -84,10 +84,10 @@ static in_cache_entry *in_cache_get_by_vcc(struct atm_vcc *vcc,
84 return NULL; 84 return NULL;
85} 85}
86 86
87static in_cache_entry *in_cache_add_entry(uint32_t dst_ip, 87static in_cache_entry *in_cache_add_entry(__be32 dst_ip,
88 struct mpoa_client *client) 88 struct mpoa_client *client)
89{ 89{
90 in_cache_entry* entry = kmalloc(sizeof(in_cache_entry), GFP_KERNEL); 90 in_cache_entry *entry = kzalloc(sizeof(in_cache_entry), GFP_KERNEL);
91 91
92 if (entry == NULL) { 92 if (entry == NULL) {
93 printk("mpoa: mpoa_caches.c: new_in_cache_entry: out of memory\n"); 93 printk("mpoa: mpoa_caches.c: new_in_cache_entry: out of memory\n");
@@ -95,7 +95,6 @@ static in_cache_entry *in_cache_add_entry(uint32_t dst_ip,
95 } 95 }
96 96
97 dprintk("mpoa: mpoa_caches.c: adding an ingress entry, ip = %u.%u.%u.%u\n", NIPQUAD(dst_ip)); 97 dprintk("mpoa: mpoa_caches.c: adding an ingress entry, ip = %u.%u.%u.%u\n", NIPQUAD(dst_ip));
98 memset(entry,0,sizeof(in_cache_entry));
99 98
100 atomic_set(&entry->use, 1); 99 atomic_set(&entry->use, 1);
101 dprintk("mpoa: mpoa_caches.c: new_in_cache_entry: about to lock\n"); 100 dprintk("mpoa: mpoa_caches.c: new_in_cache_entry: about to lock\n");
@@ -319,7 +318,7 @@ static void in_destroy_cache(struct mpoa_client *mpc)
319 return; 318 return;
320} 319}
321 320
322static eg_cache_entry *eg_cache_get_by_cache_id(uint32_t cache_id, struct mpoa_client *mpc) 321static eg_cache_entry *eg_cache_get_by_cache_id(__be32 cache_id, struct mpoa_client *mpc)
323{ 322{
324 eg_cache_entry *entry; 323 eg_cache_entry *entry;
325 324
@@ -339,7 +338,7 @@ static eg_cache_entry *eg_cache_get_by_cache_id(uint32_t cache_id, struct mpoa_c
339} 338}
340 339
341/* This can be called from any context since it saves CPU flags */ 340/* This can be called from any context since it saves CPU flags */
342static eg_cache_entry *eg_cache_get_by_tag(uint32_t tag, struct mpoa_client *mpc) 341static eg_cache_entry *eg_cache_get_by_tag(__be32 tag, struct mpoa_client *mpc)
343{ 342{
344 unsigned long flags; 343 unsigned long flags;
345 eg_cache_entry *entry; 344 eg_cache_entry *entry;
@@ -380,7 +379,7 @@ static eg_cache_entry *eg_cache_get_by_vcc(struct atm_vcc *vcc, struct mpoa_clie
380 return NULL; 379 return NULL;
381} 380}
382 381
383static eg_cache_entry *eg_cache_get_by_src_ip(uint32_t ipaddr, struct mpoa_client *mpc) 382static eg_cache_entry *eg_cache_get_by_src_ip(__be32 ipaddr, struct mpoa_client *mpc)
384{ 383{
385 eg_cache_entry *entry; 384 eg_cache_entry *entry;
386 385
@@ -447,7 +446,7 @@ static void eg_cache_remove_entry(eg_cache_entry *entry,
447 446
448static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, struct mpoa_client *client) 447static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, struct mpoa_client *client)
449{ 448{
450 eg_cache_entry *entry = kmalloc(sizeof(eg_cache_entry), GFP_KERNEL); 449 eg_cache_entry *entry = kzalloc(sizeof(eg_cache_entry), GFP_KERNEL);
451 450
452 if (entry == NULL) { 451 if (entry == NULL) {
453 printk("mpoa: mpoa_caches.c: new_eg_cache_entry: out of memory\n"); 452 printk("mpoa: mpoa_caches.c: new_eg_cache_entry: out of memory\n");
@@ -455,7 +454,6 @@ static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, struct mpoa_cli
455 } 454 }
456 455
457 dprintk("mpoa: mpoa_caches.c: adding an egress entry, ip = %u.%u.%u.%u, this should be our IP\n", NIPQUAD(msg->content.eg_info.eg_dst_ip)); 456 dprintk("mpoa: mpoa_caches.c: adding an egress entry, ip = %u.%u.%u.%u, this should be our IP\n", NIPQUAD(msg->content.eg_info.eg_dst_ip));
458 memset(entry, 0, sizeof(eg_cache_entry));
459 457
460 atomic_set(&entry->use, 1); 458 atomic_set(&entry->use, 1);
461 dprintk("mpoa: mpoa_caches.c: new_eg_cache_entry: about to lock\n"); 459 dprintk("mpoa: mpoa_caches.c: new_eg_cache_entry: about to lock\n");