aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-12 12:33:59 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-25 02:21:43 -0400
commitaf4447f62927accb68d5a074fabc539ef57b2729 (patch)
tree407480790701ef7b50fbc02f0b722358d47fd90b /net/batman-adv
parent7f9f02cb83a6a85fea1482191405a9ce37558479 (diff)
batman-adv: Prefix icmp_socket local static functions with batadv_
All non-static symbols of batman-adv were prefixed with batadv_ to avoid collisions with other symbols of the kernel. Other symbols of batman-adv should use the same prefix to keep the naming scheme consistent. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/icmp_socket.c66
1 files changed, 34 insertions, 32 deletions
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index a3e80b6782af..b285c31bfa9e 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -26,18 +26,18 @@
26#include "originator.h" 26#include "originator.h"
27#include "hard-interface.h" 27#include "hard-interface.h"
28 28
29static struct socket_client *socket_client_hash[256]; 29static struct socket_client *batadv_socket_client_hash[256];
30 30
31static void bat_socket_add_packet(struct socket_client *socket_client, 31static void batadv_socket_add_packet(struct socket_client *socket_client,
32 struct icmp_packet_rr *icmp_packet, 32 struct icmp_packet_rr *icmp_packet,
33 size_t icmp_len); 33 size_t icmp_len);
34 34
35void batadv_socket_init(void) 35void batadv_socket_init(void)
36{ 36{
37 memset(socket_client_hash, 0, sizeof(socket_client_hash)); 37 memset(batadv_socket_client_hash, 0, sizeof(batadv_socket_client_hash));
38} 38}
39 39
40static int bat_socket_open(struct inode *inode, struct file *file) 40static int batadv_socket_open(struct inode *inode, struct file *file)
41{ 41{
42 unsigned int i; 42 unsigned int i;
43 struct socket_client *socket_client; 43 struct socket_client *socket_client;
@@ -49,14 +49,14 @@ static int bat_socket_open(struct inode *inode, struct file *file)
49 if (!socket_client) 49 if (!socket_client)
50 return -ENOMEM; 50 return -ENOMEM;
51 51
52 for (i = 0; i < ARRAY_SIZE(socket_client_hash); i++) { 52 for (i = 0; i < ARRAY_SIZE(batadv_socket_client_hash); i++) {
53 if (!socket_client_hash[i]) { 53 if (!batadv_socket_client_hash[i]) {
54 socket_client_hash[i] = socket_client; 54 batadv_socket_client_hash[i] = socket_client;
55 break; 55 break;
56 } 56 }
57 } 57 }
58 58
59 if (i == ARRAY_SIZE(socket_client_hash)) { 59 if (i == ARRAY_SIZE(batadv_socket_client_hash)) {
60 pr_err("Error - can't add another packet client: maximum number of clients reached\n"); 60 pr_err("Error - can't add another packet client: maximum number of clients reached\n");
61 kfree(socket_client); 61 kfree(socket_client);
62 return -EXFULL; 62 return -EXFULL;
@@ -75,7 +75,7 @@ static int bat_socket_open(struct inode *inode, struct file *file)
75 return 0; 75 return 0;
76} 76}
77 77
78static int bat_socket_release(struct inode *inode, struct file *file) 78static int batadv_socket_release(struct inode *inode, struct file *file)
79{ 79{
80 struct socket_client *socket_client = file->private_data; 80 struct socket_client *socket_client = file->private_data;
81 struct socket_packet *socket_packet; 81 struct socket_packet *socket_packet;
@@ -92,7 +92,7 @@ static int bat_socket_release(struct inode *inode, struct file *file)
92 kfree(socket_packet); 92 kfree(socket_packet);
93 } 93 }
94 94
95 socket_client_hash[socket_client->index] = NULL; 95 batadv_socket_client_hash[socket_client->index] = NULL;
96 spin_unlock_bh(&socket_client->lock); 96 spin_unlock_bh(&socket_client->lock);
97 97
98 kfree(socket_client); 98 kfree(socket_client);
@@ -101,8 +101,8 @@ static int bat_socket_release(struct inode *inode, struct file *file)
101 return 0; 101 return 0;
102} 102}
103 103
104static ssize_t bat_socket_read(struct file *file, char __user *buf, 104static ssize_t batadv_socket_read(struct file *file, char __user *buf,
105 size_t count, loff_t *ppos) 105 size_t count, loff_t *ppos)
106{ 106{
107 struct socket_client *socket_client = file->private_data; 107 struct socket_client *socket_client = file->private_data;
108 struct socket_packet *socket_packet; 108 struct socket_packet *socket_packet;
@@ -144,8 +144,8 @@ static ssize_t bat_socket_read(struct file *file, char __user *buf,
144 return packet_len; 144 return packet_len;
145} 145}
146 146
147static ssize_t bat_socket_write(struct file *file, const char __user *buff, 147static ssize_t batadv_socket_write(struct file *file, const char __user *buff,
148 size_t len, loff_t *off) 148 size_t len, loff_t *off)
149{ 149{
150 struct socket_client *socket_client = file->private_data; 150 struct socket_client *socket_client = file->private_data;
151 struct bat_priv *bat_priv = socket_client->bat_priv; 151 struct bat_priv *bat_priv = socket_client->bat_priv;
@@ -206,7 +206,8 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
206 if (icmp_packet->header.version != COMPAT_VERSION) { 206 if (icmp_packet->header.version != COMPAT_VERSION) {
207 icmp_packet->msg_type = PARAMETER_PROBLEM; 207 icmp_packet->msg_type = PARAMETER_PROBLEM;
208 icmp_packet->header.version = COMPAT_VERSION; 208 icmp_packet->header.version = COMPAT_VERSION;
209 bat_socket_add_packet(socket_client, icmp_packet, packet_len); 209 batadv_socket_add_packet(socket_client, icmp_packet,
210 packet_len);
210 goto free_skb; 211 goto free_skb;
211 } 212 }
212 213
@@ -239,7 +240,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
239 240
240dst_unreach: 241dst_unreach:
241 icmp_packet->msg_type = DESTINATION_UNREACHABLE; 242 icmp_packet->msg_type = DESTINATION_UNREACHABLE;
242 bat_socket_add_packet(socket_client, icmp_packet, packet_len); 243 batadv_socket_add_packet(socket_client, icmp_packet, packet_len);
243free_skb: 244free_skb:
244 kfree_skb(skb); 245 kfree_skb(skb);
245out: 246out:
@@ -252,7 +253,7 @@ out:
252 return len; 253 return len;
253} 254}
254 255
255static unsigned int bat_socket_poll(struct file *file, poll_table *wait) 256static unsigned int batadv_socket_poll(struct file *file, poll_table *wait)
256{ 257{
257 struct socket_client *socket_client = file->private_data; 258 struct socket_client *socket_client = file->private_data;
258 259
@@ -264,13 +265,13 @@ static unsigned int bat_socket_poll(struct file *file, poll_table *wait)
264 return 0; 265 return 0;
265} 266}
266 267
267static const struct file_operations fops = { 268static const struct file_operations batadv_fops = {
268 .owner = THIS_MODULE, 269 .owner = THIS_MODULE,
269 .open = bat_socket_open, 270 .open = batadv_socket_open,
270 .release = bat_socket_release, 271 .release = batadv_socket_release,
271 .read = bat_socket_read, 272 .read = batadv_socket_read,
272 .write = bat_socket_write, 273 .write = batadv_socket_write,
273 .poll = bat_socket_poll, 274 .poll = batadv_socket_poll,
274 .llseek = no_llseek, 275 .llseek = no_llseek,
275}; 276};
276 277
@@ -282,7 +283,7 @@ int batadv_socket_setup(struct bat_priv *bat_priv)
282 goto err; 283 goto err;
283 284
284 d = debugfs_create_file(ICMP_SOCKET, S_IFREG | S_IWUSR | S_IRUSR, 285 d = debugfs_create_file(ICMP_SOCKET, S_IFREG | S_IWUSR | S_IRUSR,
285 bat_priv->debug_dir, bat_priv, &fops); 286 bat_priv->debug_dir, bat_priv, &batadv_fops);
286 if (!d) 287 if (!d)
287 goto err; 288 goto err;
288 289
@@ -292,9 +293,9 @@ err:
292 return -ENOMEM; 293 return -ENOMEM;
293} 294}
294 295
295static void bat_socket_add_packet(struct socket_client *socket_client, 296static void batadv_socket_add_packet(struct socket_client *socket_client,
296 struct icmp_packet_rr *icmp_packet, 297 struct icmp_packet_rr *icmp_packet,
297 size_t icmp_len) 298 size_t icmp_len)
298{ 299{
299 struct socket_packet *socket_packet; 300 struct socket_packet *socket_packet;
300 301
@@ -312,7 +313,7 @@ static void bat_socket_add_packet(struct socket_client *socket_client,
312 /* while waiting for the lock the socket_client could have been 313 /* while waiting for the lock the socket_client could have been
313 * deleted 314 * deleted
314 */ 315 */
315 if (!socket_client_hash[icmp_packet->uid]) { 316 if (!batadv_socket_client_hash[icmp_packet->uid]) {
316 spin_unlock_bh(&socket_client->lock); 317 spin_unlock_bh(&socket_client->lock);
317 kfree(socket_packet); 318 kfree(socket_packet);
318 return; 319 return;
@@ -338,8 +339,9 @@ static void bat_socket_add_packet(struct socket_client *socket_client,
338void batadv_socket_receive_packet(struct icmp_packet_rr *icmp_packet, 339void batadv_socket_receive_packet(struct icmp_packet_rr *icmp_packet,
339 size_t icmp_len) 340 size_t icmp_len)
340{ 341{
341 struct socket_client *hash = socket_client_hash[icmp_packet->uid]; 342 struct socket_client *hash;
342 343
344 hash = batadv_socket_client_hash[icmp_packet->uid];
343 if (hash) 345 if (hash)
344 bat_socket_add_packet(hash, icmp_packet, icmp_len); 346 batadv_socket_add_packet(hash, icmp_packet, icmp_len);
345} 347}