aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-16 14:23:15 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-25 02:21:48 -0400
commit0294ca0d92c6539ec6e37edf65a0a5b033dd6d78 (patch)
tree417952d8807810e63e48f6b434704ae8d4f5af4d /net/batman-adv
parentbb079c82e4274e32ae7592096d7e70bf4fa571ab (diff)
batman-adv: Prefix soft-interface 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/soft-interface.c80
1 files changed, 41 insertions, 39 deletions
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index af676b818637..2de1d742119f 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -37,23 +37,23 @@
37#include "bridge_loop_avoidance.h" 37#include "bridge_loop_avoidance.h"
38 38
39 39
40static int bat_get_settings(struct net_device *dev, struct ethtool_cmd *cmd); 40static int batadv_get_settings(struct net_device *dev, struct ethtool_cmd *cmd);
41static void bat_get_drvinfo(struct net_device *dev, 41static void batadv_get_drvinfo(struct net_device *dev,
42 struct ethtool_drvinfo *info); 42 struct ethtool_drvinfo *info);
43static u32 bat_get_msglevel(struct net_device *dev); 43static u32 batadv_get_msglevel(struct net_device *dev);
44static void bat_set_msglevel(struct net_device *dev, u32 value); 44static void batadv_set_msglevel(struct net_device *dev, u32 value);
45static u32 bat_get_link(struct net_device *dev); 45static u32 batadv_get_link(struct net_device *dev);
46static void batadv_get_strings(struct net_device *dev, u32 stringset, u8 *data); 46static void batadv_get_strings(struct net_device *dev, u32 stringset, u8 *data);
47static void batadv_get_ethtool_stats(struct net_device *dev, 47static void batadv_get_ethtool_stats(struct net_device *dev,
48 struct ethtool_stats *stats, u64 *data); 48 struct ethtool_stats *stats, u64 *data);
49static int batadv_get_sset_count(struct net_device *dev, int stringset); 49static int batadv_get_sset_count(struct net_device *dev, int stringset);
50 50
51static const struct ethtool_ops bat_ethtool_ops = { 51static const struct ethtool_ops batadv_ethtool_ops = {
52 .get_settings = bat_get_settings, 52 .get_settings = batadv_get_settings,
53 .get_drvinfo = bat_get_drvinfo, 53 .get_drvinfo = batadv_get_drvinfo,
54 .get_msglevel = bat_get_msglevel, 54 .get_msglevel = batadv_get_msglevel,
55 .set_msglevel = bat_set_msglevel, 55 .set_msglevel = batadv_set_msglevel,
56 .get_link = bat_get_link, 56 .get_link = batadv_get_link,
57 .get_strings = batadv_get_strings, 57 .get_strings = batadv_get_strings,
58 .get_ethtool_stats = batadv_get_ethtool_stats, 58 .get_ethtool_stats = batadv_get_ethtool_stats,
59 .get_sset_count = batadv_get_sset_count, 59 .get_sset_count = batadv_get_sset_count,
@@ -78,25 +78,25 @@ int batadv_skb_head_push(struct sk_buff *skb, unsigned int len)
78 return 0; 78 return 0;
79} 79}
80 80
81static int interface_open(struct net_device *dev) 81static int batadv_interface_open(struct net_device *dev)
82{ 82{
83 netif_start_queue(dev); 83 netif_start_queue(dev);
84 return 0; 84 return 0;
85} 85}
86 86
87static int interface_release(struct net_device *dev) 87static int batadv_interface_release(struct net_device *dev)
88{ 88{
89 netif_stop_queue(dev); 89 netif_stop_queue(dev);
90 return 0; 90 return 0;
91} 91}
92 92
93static struct net_device_stats *interface_stats(struct net_device *dev) 93static struct net_device_stats *batadv_interface_stats(struct net_device *dev)
94{ 94{
95 struct bat_priv *bat_priv = netdev_priv(dev); 95 struct bat_priv *bat_priv = netdev_priv(dev);
96 return &bat_priv->stats; 96 return &bat_priv->stats;
97} 97}
98 98
99static int interface_set_mac_addr(struct net_device *dev, void *p) 99static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
100{ 100{
101 struct bat_priv *bat_priv = netdev_priv(dev); 101 struct bat_priv *bat_priv = netdev_priv(dev);
102 struct sockaddr *addr = p; 102 struct sockaddr *addr = p;
@@ -116,7 +116,7 @@ static int interface_set_mac_addr(struct net_device *dev, void *p)
116 return 0; 116 return 0;
117} 117}
118 118
119static int interface_change_mtu(struct net_device *dev, int new_mtu) 119static int batadv_interface_change_mtu(struct net_device *dev, int new_mtu)
120{ 120{
121 /* check ranges */ 121 /* check ranges */
122 if ((new_mtu < 68) || (new_mtu > batadv_hardif_min_mtu(dev))) 122 if ((new_mtu < 68) || (new_mtu > batadv_hardif_min_mtu(dev)))
@@ -127,7 +127,8 @@ static int interface_change_mtu(struct net_device *dev, int new_mtu)
127 return 0; 127 return 0;
128} 128}
129 129
130static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) 130static int batadv_interface_tx(struct sk_buff *skb,
131 struct net_device *soft_iface)
131{ 132{
132 struct ethhdr *ethhdr = (struct ethhdr *)skb->data; 133 struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
133 struct bat_priv *bat_priv = netdev_priv(soft_iface); 134 struct bat_priv *bat_priv = netdev_priv(soft_iface);
@@ -323,23 +324,23 @@ out:
323 return; 324 return;
324} 325}
325 326
326static const struct net_device_ops bat_netdev_ops = { 327static const struct net_device_ops batadv_netdev_ops = {
327 .ndo_open = interface_open, 328 .ndo_open = batadv_interface_open,
328 .ndo_stop = interface_release, 329 .ndo_stop = batadv_interface_release,
329 .ndo_get_stats = interface_stats, 330 .ndo_get_stats = batadv_interface_stats,
330 .ndo_set_mac_address = interface_set_mac_addr, 331 .ndo_set_mac_address = batadv_interface_set_mac_addr,
331 .ndo_change_mtu = interface_change_mtu, 332 .ndo_change_mtu = batadv_interface_change_mtu,
332 .ndo_start_xmit = interface_tx, 333 .ndo_start_xmit = batadv_interface_tx,
333 .ndo_validate_addr = eth_validate_addr 334 .ndo_validate_addr = eth_validate_addr
334}; 335};
335 336
336static void interface_setup(struct net_device *dev) 337static void batadv_interface_setup(struct net_device *dev)
337{ 338{
338 struct bat_priv *priv = netdev_priv(dev); 339 struct bat_priv *priv = netdev_priv(dev);
339 340
340 ether_setup(dev); 341 ether_setup(dev);
341 342
342 dev->netdev_ops = &bat_netdev_ops; 343 dev->netdev_ops = &batadv_netdev_ops;
343 dev->destructor = free_netdev; 344 dev->destructor = free_netdev;
344 dev->tx_queue_len = 0; 345 dev->tx_queue_len = 0;
345 346
@@ -353,7 +354,7 @@ static void interface_setup(struct net_device *dev)
353 /* generate random address */ 354 /* generate random address */
354 eth_hw_addr_random(dev); 355 eth_hw_addr_random(dev);
355 356
356 SET_ETHTOOL_OPS(dev, &bat_ethtool_ops); 357 SET_ETHTOOL_OPS(dev, &batadv_ethtool_ops);
357 358
358 memset(priv, 0, sizeof(*priv)); 359 memset(priv, 0, sizeof(*priv));
359} 360}
@@ -364,7 +365,8 @@ struct net_device *batadv_softif_create(const char *name)
364 struct bat_priv *bat_priv; 365 struct bat_priv *bat_priv;
365 int ret; 366 int ret;
366 367
367 soft_iface = alloc_netdev(sizeof(*bat_priv), name, interface_setup); 368 soft_iface = alloc_netdev(sizeof(*bat_priv), name,
369 batadv_interface_setup);
368 370
369 if (!soft_iface) 371 if (!soft_iface)
370 goto out; 372 goto out;
@@ -456,14 +458,14 @@ void batadv_softif_destroy(struct net_device *soft_iface)
456 458
457int batadv_softif_is_valid(const struct net_device *net_dev) 459int batadv_softif_is_valid(const struct net_device *net_dev)
458{ 460{
459 if (net_dev->netdev_ops->ndo_start_xmit == interface_tx) 461 if (net_dev->netdev_ops->ndo_start_xmit == batadv_interface_tx)
460 return 1; 462 return 1;
461 463
462 return 0; 464 return 0;
463} 465}
464 466
465/* ethtool */ 467/* ethtool */
466static int bat_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 468static int batadv_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
467{ 469{
468 cmd->supported = 0; 470 cmd->supported = 0;
469 cmd->advertising = 0; 471 cmd->advertising = 0;
@@ -479,8 +481,8 @@ static int bat_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
479 return 0; 481 return 0;
480} 482}
481 483
482static void bat_get_drvinfo(struct net_device *dev, 484static void batadv_get_drvinfo(struct net_device *dev,
483 struct ethtool_drvinfo *info) 485 struct ethtool_drvinfo *info)
484{ 486{
485 strcpy(info->driver, "B.A.T.M.A.N. advanced"); 487 strcpy(info->driver, "B.A.T.M.A.N. advanced");
486 strcpy(info->version, SOURCE_VERSION); 488 strcpy(info->version, SOURCE_VERSION);
@@ -488,16 +490,16 @@ static void bat_get_drvinfo(struct net_device *dev,
488 strcpy(info->bus_info, "batman"); 490 strcpy(info->bus_info, "batman");
489} 491}
490 492
491static u32 bat_get_msglevel(struct net_device *dev) 493static u32 batadv_get_msglevel(struct net_device *dev)
492{ 494{
493 return -EOPNOTSUPP; 495 return -EOPNOTSUPP;
494} 496}
495 497
496static void bat_set_msglevel(struct net_device *dev, u32 value) 498static void batadv_set_msglevel(struct net_device *dev, u32 value)
497{ 499{
498} 500}
499 501
500static u32 bat_get_link(struct net_device *dev) 502static u32 batadv_get_link(struct net_device *dev)
501{ 503{
502 return 1; 504 return 1;
503} 505}
@@ -508,7 +510,7 @@ static u32 bat_get_link(struct net_device *dev)
508 */ 510 */
509static const struct { 511static const struct {
510 const char name[ETH_GSTRING_LEN]; 512 const char name[ETH_GSTRING_LEN];
511} bat_counters_strings[] = { 513} batadv_counters_strings[] = {
512 { "forward" }, 514 { "forward" },
513 { "forward_bytes" }, 515 { "forward_bytes" },
514 { "mgmt_tx" }, 516 { "mgmt_tx" },
@@ -527,8 +529,8 @@ static void batadv_get_strings(struct net_device *dev, uint32_t stringset,
527 uint8_t *data) 529 uint8_t *data)
528{ 530{
529 if (stringset == ETH_SS_STATS) 531 if (stringset == ETH_SS_STATS)
530 memcpy(data, bat_counters_strings, 532 memcpy(data, batadv_counters_strings,
531 sizeof(bat_counters_strings)); 533 sizeof(batadv_counters_strings));
532} 534}
533 535
534static void batadv_get_ethtool_stats(struct net_device *dev, 536static void batadv_get_ethtool_stats(struct net_device *dev,