diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-16 14:23:15 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-25 02:21:48 -0400 |
commit | 0294ca0d92c6539ec6e37edf65a0a5b033dd6d78 (patch) | |
tree | 417952d8807810e63e48f6b434704ae8d4f5af4d /net/batman-adv | |
parent | bb079c82e4274e32ae7592096d7e70bf4fa571ab (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.c | 80 |
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 | ||
40 | static int bat_get_settings(struct net_device *dev, struct ethtool_cmd *cmd); | 40 | static int batadv_get_settings(struct net_device *dev, struct ethtool_cmd *cmd); |
41 | static void bat_get_drvinfo(struct net_device *dev, | 41 | static void batadv_get_drvinfo(struct net_device *dev, |
42 | struct ethtool_drvinfo *info); | 42 | struct ethtool_drvinfo *info); |
43 | static u32 bat_get_msglevel(struct net_device *dev); | 43 | static u32 batadv_get_msglevel(struct net_device *dev); |
44 | static void bat_set_msglevel(struct net_device *dev, u32 value); | 44 | static void batadv_set_msglevel(struct net_device *dev, u32 value); |
45 | static u32 bat_get_link(struct net_device *dev); | 45 | static u32 batadv_get_link(struct net_device *dev); |
46 | static void batadv_get_strings(struct net_device *dev, u32 stringset, u8 *data); | 46 | static void batadv_get_strings(struct net_device *dev, u32 stringset, u8 *data); |
47 | static void batadv_get_ethtool_stats(struct net_device *dev, | 47 | static void batadv_get_ethtool_stats(struct net_device *dev, |
48 | struct ethtool_stats *stats, u64 *data); | 48 | struct ethtool_stats *stats, u64 *data); |
49 | static int batadv_get_sset_count(struct net_device *dev, int stringset); | 49 | static int batadv_get_sset_count(struct net_device *dev, int stringset); |
50 | 50 | ||
51 | static const struct ethtool_ops bat_ethtool_ops = { | 51 | static 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 | ||
81 | static int interface_open(struct net_device *dev) | 81 | static 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 | ||
87 | static int interface_release(struct net_device *dev) | 87 | static 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 | ||
93 | static struct net_device_stats *interface_stats(struct net_device *dev) | 93 | static 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 | ||
99 | static int interface_set_mac_addr(struct net_device *dev, void *p) | 99 | static 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 | ||
119 | static int interface_change_mtu(struct net_device *dev, int new_mtu) | 119 | static 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 | ||
130 | static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) | 130 | static 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 | ||
326 | static const struct net_device_ops bat_netdev_ops = { | 327 | static 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 | ||
336 | static void interface_setup(struct net_device *dev) | 337 | static 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 | ||
457 | int batadv_softif_is_valid(const struct net_device *net_dev) | 459 | int 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 */ |
466 | static int bat_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | 468 | static 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 | ||
482 | static void bat_get_drvinfo(struct net_device *dev, | 484 | static 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 | ||
491 | static u32 bat_get_msglevel(struct net_device *dev) | 493 | static u32 batadv_get_msglevel(struct net_device *dev) |
492 | { | 494 | { |
493 | return -EOPNOTSUPP; | 495 | return -EOPNOTSUPP; |
494 | } | 496 | } |
495 | 497 | ||
496 | static void bat_set_msglevel(struct net_device *dev, u32 value) | 498 | static void batadv_set_msglevel(struct net_device *dev, u32 value) |
497 | { | 499 | { |
498 | } | 500 | } |
499 | 501 | ||
500 | static u32 bat_get_link(struct net_device *dev) | 502 | static 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 | */ |
509 | static const struct { | 511 | static 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 | ||
534 | static void batadv_get_ethtool_stats(struct net_device *dev, | 536 | static void batadv_get_ethtool_stats(struct net_device *dev, |