Commit e6c10f43 authored by Marek Lindner's avatar Marek Lindner

batman-adv: rename batman_if struct to hard_iface

Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
parent 4389e47a
...@@ -35,7 +35,7 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet, ...@@ -35,7 +35,7 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,
int packet_len, int packet_len,
unsigned long send_time, unsigned long send_time,
bool directlink, bool directlink,
struct batman_if *if_incoming, struct hard_iface *if_incoming,
struct forw_packet *forw_packet) struct forw_packet *forw_packet)
{ {
struct batman_packet *batman_packet = struct batman_packet *batman_packet =
...@@ -99,7 +99,7 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet, ...@@ -99,7 +99,7 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,
/* create a new aggregated packet and add this packet to it */ /* create a new aggregated packet and add this packet to it */
static void new_aggregated_packet(unsigned char *packet_buff, int packet_len, static void new_aggregated_packet(unsigned char *packet_buff, int packet_len,
unsigned long send_time, bool direct_link, unsigned long send_time, bool direct_link,
struct batman_if *if_incoming, struct hard_iface *if_incoming,
int own_packet) int own_packet)
{ {
struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
...@@ -188,7 +188,7 @@ static void aggregate(struct forw_packet *forw_packet_aggr, ...@@ -188,7 +188,7 @@ static void aggregate(struct forw_packet *forw_packet_aggr,
void add_bat_packet_to_list(struct bat_priv *bat_priv, void add_bat_packet_to_list(struct bat_priv *bat_priv,
unsigned char *packet_buff, int packet_len, unsigned char *packet_buff, int packet_len,
struct batman_if *if_incoming, char own_packet, struct hard_iface *if_incoming, char own_packet,
unsigned long send_time) unsigned long send_time)
{ {
/** /**
...@@ -247,7 +247,7 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv, ...@@ -247,7 +247,7 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv,
/* unpack the aggregated packets and process them one by one */ /* unpack the aggregated packets and process them one by one */
void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff, void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff,
int packet_len, struct batman_if *if_incoming) int packet_len, struct hard_iface *if_incoming)
{ {
struct batman_packet *batman_packet; struct batman_packet *batman_packet;
int buff_pos = 0; int buff_pos = 0;
......
...@@ -35,9 +35,9 @@ static inline int aggregated_packet(int buff_pos, int packet_len, int num_hna) ...@@ -35,9 +35,9 @@ static inline int aggregated_packet(int buff_pos, int packet_len, int num_hna)
void add_bat_packet_to_list(struct bat_priv *bat_priv, void add_bat_packet_to_list(struct bat_priv *bat_priv,
unsigned char *packet_buff, int packet_len, unsigned char *packet_buff, int packet_len,
struct batman_if *if_incoming, char own_packet, struct hard_iface *if_incoming, char own_packet,
unsigned long send_time); unsigned long send_time);
void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff, void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff,
int packet_len, struct batman_if *if_incoming); int packet_len, struct hard_iface *if_incoming);
#endif /* _NET_BATMAN_ADV_AGGREGATION_H_ */ #endif /* _NET_BATMAN_ADV_AGGREGATION_H_ */
...@@ -441,16 +441,16 @@ static ssize_t show_mesh_iface(struct kobject *kobj, struct attribute *attr, ...@@ -441,16 +441,16 @@ static ssize_t show_mesh_iface(struct kobject *kobj, struct attribute *attr,
char *buff) char *buff)
{ {
struct net_device *net_dev = kobj_to_netdev(kobj); struct net_device *net_dev = kobj_to_netdev(kobj);
struct batman_if *batman_if = get_batman_if_by_netdev(net_dev); struct hard_iface *hard_iface = hardif_get_by_netdev(net_dev);
ssize_t length; ssize_t length;
if (!batman_if) if (!hard_iface)
return 0; return 0;
length = sprintf(buff, "%s\n", batman_if->if_status == IF_NOT_IN_USE ? length = sprintf(buff, "%s\n", hard_iface->if_status == IF_NOT_IN_USE ?
"none" : batman_if->soft_iface->name); "none" : hard_iface->soft_iface->name);
hardif_free_ref(batman_if); hardif_free_ref(hard_iface);
return length; return length;
} }
...@@ -459,11 +459,11 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, ...@@ -459,11 +459,11 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
char *buff, size_t count) char *buff, size_t count)
{ {
struct net_device *net_dev = kobj_to_netdev(kobj); struct net_device *net_dev = kobj_to_netdev(kobj);
struct batman_if *batman_if = get_batman_if_by_netdev(net_dev); struct hard_iface *hard_iface = hardif_get_by_netdev(net_dev);
int status_tmp = -1; int status_tmp = -1;
int ret = count; int ret = count;
if (!batman_if) if (!hard_iface)
return count; return count;
if (buff[count - 1] == '\n') if (buff[count - 1] == '\n')
...@@ -472,7 +472,7 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, ...@@ -472,7 +472,7 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
if (strlen(buff) >= IFNAMSIZ) { if (strlen(buff) >= IFNAMSIZ) {
pr_err("Invalid parameter for 'mesh_iface' setting received: " pr_err("Invalid parameter for 'mesh_iface' setting received: "
"interface name too long '%s'\n", buff); "interface name too long '%s'\n", buff);
hardif_free_ref(batman_if); hardif_free_ref(hard_iface);
return -EINVAL; return -EINVAL;
} }
...@@ -481,28 +481,31 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, ...@@ -481,28 +481,31 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
else else
status_tmp = IF_I_WANT_YOU; status_tmp = IF_I_WANT_YOU;
if ((batman_if->if_status == status_tmp) || ((batman_if->soft_iface) && if (hard_iface->if_status == status_tmp)
(strncmp(batman_if->soft_iface->name, buff, IFNAMSIZ) == 0))) goto out;
if ((hard_iface->soft_iface) &&
(strncmp(hard_iface->soft_iface->name, buff, IFNAMSIZ) == 0))
goto out; goto out;
if (status_tmp == IF_NOT_IN_USE) { if (status_tmp == IF_NOT_IN_USE) {
rtnl_lock(); rtnl_lock();
hardif_disable_interface(batman_if); hardif_disable_interface(hard_iface);
rtnl_unlock(); rtnl_unlock();
goto out; goto out;
} }
/* if the interface already is in use */ /* if the interface already is in use */
if (batman_if->if_status != IF_NOT_IN_USE) { if (hard_iface->if_status != IF_NOT_IN_USE) {
rtnl_lock(); rtnl_lock();
hardif_disable_interface(batman_if); hardif_disable_interface(hard_iface);
rtnl_unlock(); rtnl_unlock();
} }
ret = hardif_enable_interface(batman_if, buff); ret = hardif_enable_interface(hard_iface, buff);
out: out:
hardif_free_ref(batman_if); hardif_free_ref(hard_iface);
return ret; return ret;
} }
...@@ -510,13 +513,13 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr, ...@@ -510,13 +513,13 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr,
char *buff) char *buff)
{ {
struct net_device *net_dev = kobj_to_netdev(kobj); struct net_device *net_dev = kobj_to_netdev(kobj);
struct batman_if *batman_if = get_batman_if_by_netdev(net_dev); struct hard_iface *hard_iface = hardif_get_by_netdev(net_dev);
ssize_t length; ssize_t length;
if (!batman_if) if (!hard_iface)
return 0; return 0;
switch (batman_if->if_status) { switch (hard_iface->if_status) {
case IF_TO_BE_REMOVED: case IF_TO_BE_REMOVED:
length = sprintf(buff, "disabling\n"); length = sprintf(buff, "disabling\n");
break; break;
...@@ -535,7 +538,7 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr, ...@@ -535,7 +538,7 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr,
break; break;
} }
hardif_free_ref(batman_if); hardif_free_ref(hard_iface);
return length; return length;
} }
......
This diff is collapsed.
...@@ -31,18 +31,18 @@ ...@@ -31,18 +31,18 @@
extern struct notifier_block hard_if_notifier; extern struct notifier_block hard_if_notifier;
struct batman_if *get_batman_if_by_netdev(struct net_device *net_dev); struct hard_iface *hardif_get_by_netdev(struct net_device *net_dev);
int hardif_enable_interface(struct batman_if *batman_if, char *iface_name); int hardif_enable_interface(struct hard_iface *hard_iface, char *iface_name);
void hardif_disable_interface(struct batman_if *batman_if); void hardif_disable_interface(struct hard_iface *hard_iface);
void hardif_remove_interfaces(void); void hardif_remove_interfaces(void);
int hardif_min_mtu(struct net_device *soft_iface); int hardif_min_mtu(struct net_device *soft_iface);
void update_min_mtu(struct net_device *soft_iface); void update_min_mtu(struct net_device *soft_iface);
void hardif_free_rcu(struct rcu_head *rcu); void hardif_free_rcu(struct rcu_head *rcu);
static inline void hardif_free_ref(struct batman_if *batman_if) static inline void hardif_free_ref(struct hard_iface *hard_iface)
{ {
if (atomic_dec_and_test(&batman_if->refcount)) if (atomic_dec_and_test(&hard_iface->refcount))
call_rcu(&batman_if->rcu, hardif_free_rcu); call_rcu(&hard_iface->rcu, hardif_free_rcu);
} }
#endif /* _NET_BATMAN_ADV_HARD_INTERFACE_H_ */ #endif /* _NET_BATMAN_ADV_HARD_INTERFACE_H_ */
...@@ -153,14 +153,14 @@ void dec_module_count(void) ...@@ -153,14 +153,14 @@ void dec_module_count(void)
int is_my_mac(uint8_t *addr) int is_my_mac(uint8_t *addr)
{ {
struct batman_if *batman_if; struct hard_iface *hard_iface;
rcu_read_lock(); rcu_read_lock();
list_for_each_entry_rcu(batman_if, &hardif_list, list) { list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
if (batman_if->if_status != IF_ACTIVE) if (hard_iface->if_status != IF_ACTIVE)
continue; continue;
if (compare_eth(batman_if->net_dev->dev_addr, addr)) { if (compare_eth(hard_iface->net_dev->dev_addr, addr)) {
rcu_read_unlock(); rcu_read_unlock();
return 1; return 1;
} }
......
...@@ -73,7 +73,7 @@ void neigh_node_free_ref(struct neigh_node *neigh_node) ...@@ -73,7 +73,7 @@ void neigh_node_free_ref(struct neigh_node *neigh_node)
struct neigh_node *create_neighbor(struct orig_node *orig_node, struct neigh_node *create_neighbor(struct orig_node *orig_node,
struct orig_node *orig_neigh_node, struct orig_node *orig_neigh_node,
uint8_t *neigh, uint8_t *neigh,
struct batman_if *if_incoming) struct hard_iface *if_incoming)
{ {
struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
struct neigh_node *neigh_node; struct neigh_node *neigh_node;
...@@ -487,9 +487,9 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num) ...@@ -487,9 +487,9 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
return 0; return 0;
} }
int orig_hash_add_if(struct batman_if *batman_if, int max_if_num) int orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num)
{ {
struct bat_priv *bat_priv = netdev_priv(batman_if->soft_iface); struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
struct hashtable_t *hash = bat_priv->orig_hash; struct hashtable_t *hash = bat_priv->orig_hash;
struct hlist_node *node; struct hlist_node *node;
struct hlist_head *head; struct hlist_head *head;
...@@ -572,13 +572,13 @@ static int orig_node_del_if(struct orig_node *orig_node, ...@@ -572,13 +572,13 @@ static int orig_node_del_if(struct orig_node *orig_node,
return 0; return 0;
} }
int orig_hash_del_if(struct batman_if *batman_if, int max_if_num) int orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num)
{ {
struct bat_priv *bat_priv = netdev_priv(batman_if->soft_iface); struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
struct hashtable_t *hash = bat_priv->orig_hash; struct hashtable_t *hash = bat_priv->orig_hash;
struct hlist_node *node; struct hlist_node *node;
struct hlist_head *head; struct hlist_head *head;
struct batman_if *batman_if_tmp; struct hard_iface *hard_iface_tmp;
struct orig_node *orig_node; struct orig_node *orig_node;
int i, ret; int i, ret;
...@@ -591,7 +591,7 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num) ...@@ -591,7 +591,7 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num)
hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
spin_lock_bh(&orig_node->ogm_cnt_lock); spin_lock_bh(&orig_node->ogm_cnt_lock);
ret = orig_node_del_if(orig_node, max_if_num, ret = orig_node_del_if(orig_node, max_if_num,
batman_if->if_num); hard_iface->if_num);
spin_unlock_bh(&orig_node->ogm_cnt_lock); spin_unlock_bh(&orig_node->ogm_cnt_lock);
if (ret == -1) if (ret == -1)
...@@ -602,22 +602,22 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num) ...@@ -602,22 +602,22 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num)
/* renumber remaining batman interfaces _inside_ of orig_hash_lock */ /* renumber remaining batman interfaces _inside_ of orig_hash_lock */
rcu_read_lock(); rcu_read_lock();
list_for_each_entry_rcu(batman_if_tmp, &hardif_list, list) { list_for_each_entry_rcu(hard_iface_tmp, &hardif_list, list) {
if (batman_if_tmp->if_status == IF_NOT_IN_USE) if (hard_iface_tmp->if_status == IF_NOT_IN_USE)
continue; continue;
if (batman_if == batman_if_tmp) if (hard_iface == hard_iface_tmp)
continue; continue;
if (batman_if->soft_iface != batman_if_tmp->soft_iface) if (hard_iface->soft_iface != hard_iface_tmp->soft_iface)
continue; continue;
if (batman_if_tmp->if_num > batman_if->if_num) if (hard_iface_tmp->if_num > hard_iface->if_num)
batman_if_tmp->if_num--; hard_iface_tmp->if_num--;
} }
rcu_read_unlock(); rcu_read_unlock();
batman_if->if_num = -1; hard_iface->if_num = -1;
return 0; return 0;
err: err:
......
...@@ -32,11 +32,11 @@ struct orig_node *get_orig_node(struct bat_priv *bat_priv, uint8_t *addr); ...@@ -32,11 +32,11 @@ struct orig_node *get_orig_node(struct bat_priv *bat_priv, uint8_t *addr);
struct neigh_node *create_neighbor(struct orig_node *orig_node, struct neigh_node *create_neighbor(struct orig_node *orig_node,
struct orig_node *orig_neigh_node, struct orig_node *orig_neigh_node,
uint8_t *neigh, uint8_t *neigh,
struct batman_if *if_incoming); struct hard_iface *if_incoming);
void neigh_node_free_ref(struct neigh_node *neigh_node); void neigh_node_free_ref(struct neigh_node *neigh_node);
int orig_seq_print_text(struct seq_file *seq, void *offset); int orig_seq_print_text(struct seq_file *seq, void *offset);
int orig_hash_add_if(struct batman_if *batman_if, int max_if_num); int orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num);
int orig_hash_del_if(struct batman_if *batman_if, int max_if_num); int orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num);
/* returns 1 if they are the same originator */ /* returns 1 if they are the same originator */
......
...@@ -35,9 +35,9 @@ ...@@ -35,9 +35,9 @@
#include "gateway_client.h" #include "gateway_client.h"
#include "unicast.h" #include "unicast.h"
void slide_own_bcast_window(struct batman_if *batman_if) void slide_own_bcast_window(struct hard_iface *hard_iface)
{ {
struct bat_priv *bat_priv = netdev_priv(batman_if->soft_iface); struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
struct hashtable_t *hash = bat_priv->orig_hash; struct hashtable_t *hash = bat_priv->orig_hash;
struct hlist_node *node; struct hlist_node *node;
struct hlist_head *head; struct hlist_head *head;
...@@ -52,11 +52,11 @@ void slide_own_bcast_window(struct batman_if *batman_if) ...@@ -52,11 +52,11 @@ void slide_own_bcast_window(struct batman_if *batman_if)
rcu_read_lock(); rcu_read_lock();
hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
spin_lock_bh(&orig_node->ogm_cnt_lock); spin_lock_bh(&orig_node->ogm_cnt_lock);
word_index = batman_if->if_num * NUM_WORDS; word_index = hard_iface->if_num * NUM_WORDS;
word = &(orig_node->bcast_own[word_index]); word = &(orig_node->bcast_own[word_index]);
bit_get_packet(bat_priv, word, 1, 0); bit_get_packet(bat_priv, word, 1, 0);
orig_node->bcast_own_sum[batman_if->if_num] = orig_node->bcast_own_sum[hard_iface->if_num] =
bit_packet_count(word); bit_packet_count(word);
spin_unlock_bh(&orig_node->ogm_cnt_lock); spin_unlock_bh(&orig_node->ogm_cnt_lock);
} }
...@@ -143,7 +143,7 @@ void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node, ...@@ -143,7 +143,7 @@ void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node,
static int is_bidirectional_neigh(struct orig_node *orig_node, static int is_bidirectional_neigh(struct orig_node *orig_node,
struct orig_node *orig_neigh_node, struct orig_node *orig_neigh_node,
struct batman_packet *batman_packet, struct batman_packet *batman_packet,
struct batman_if *if_incoming) struct hard_iface *if_incoming)
{ {
struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
struct neigh_node *neigh_node = NULL, *tmp_neigh_node; struct neigh_node *neigh_node = NULL, *tmp_neigh_node;
...@@ -368,7 +368,7 @@ static void update_orig(struct bat_priv *bat_priv, ...@@ -368,7 +368,7 @@ static void update_orig(struct bat_priv *bat_priv,
struct orig_node *orig_node, struct orig_node *orig_node,
struct ethhdr *ethhdr, struct ethhdr *ethhdr,
struct batman_packet *batman_packet, struct batman_packet *batman_packet,
struct batman_if *if_incoming, struct hard_iface *if_incoming,
unsigned char *hna_buff, int hna_buff_len, unsigned char *hna_buff, int hna_buff_len,
char is_duplicate) char is_duplicate)
{ {
...@@ -533,7 +533,7 @@ static int window_protected(struct bat_priv *bat_priv, ...@@ -533,7 +533,7 @@ static int window_protected(struct bat_priv *bat_priv,
*/ */
static char count_real_packets(struct ethhdr *ethhdr, static char count_real_packets(struct ethhdr *ethhdr,
struct batman_packet *batman_packet, struct batman_packet *batman_packet,
struct batman_if *if_incoming) struct hard_iface *if_incoming)
{ {
struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
struct orig_node *orig_node; struct orig_node *orig_node;
...@@ -598,10 +598,10 @@ static char count_real_packets(struct ethhdr *ethhdr, ...@@ -598,10 +598,10 @@ static char count_real_packets(struct ethhdr *ethhdr,
void receive_bat_packet(struct ethhdr *ethhdr, void receive_bat_packet(struct ethhdr *ethhdr,
struct batman_packet *batman_packet, struct batman_packet *batman_packet,
unsigned char *hna_buff, int hna_buff_len, unsigned char *hna_buff, int hna_buff_len,
struct batman_if *if_incoming) struct hard_iface *if_incoming)
{ {
struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
struct batman_if *batman_if; struct hard_iface *hard_iface;
struct orig_node *orig_neigh_node, *orig_node; struct orig_node *orig_neigh_node, *orig_node;
char has_directlink_flag; char has_directlink_flag;
char is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0; char is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0;
...@@ -643,23 +643,23 @@ void receive_bat_packet(struct ethhdr *ethhdr, ...@@ -643,23 +643,23 @@ void receive_bat_packet(struct ethhdr *ethhdr,
has_directlink_flag); has_directlink_flag);
rcu_read_lock(); rcu_read_lock();
list_for_each_entry_rcu(batman_if, &hardif_list, list) { list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
if (batman_if->if_status != IF_ACTIVE) if (hard_iface->if_status != IF_ACTIVE)
continue; continue;
if (batman_if->soft_iface != if_incoming->soft_iface) if (hard_iface->soft_iface != if_incoming->soft_iface)
continue; continue;
if (compare_eth(ethhdr->h_source, if (compare_eth(ethhdr->h_source,
batman_if->net_dev->dev_addr)) hard_iface->net_dev->dev_addr))
is_my_addr = 1; is_my_addr = 1;
if (compare_eth(batman_packet->orig, if (compare_eth(batman_packet->orig,
batman_if->net_dev->dev_addr)) hard_iface->net_dev->dev_addr))
is_my_orig = 1; is_my_orig = 1;
if (compare_eth(batman_packet->prev_sender, if (compare_eth(batman_packet->prev_sender,
batman_if->net_dev->dev_addr)) hard_iface->net_dev->dev_addr))
is_my_oldorig = 1; is_my_oldorig = 1;
if (compare_eth(ethhdr->h_source, broadcast_addr)) if (compare_eth(ethhdr->h_source, broadcast_addr))
...@@ -828,7 +828,7 @@ void receive_bat_packet(struct ethhdr *ethhdr, ...@@ -828,7 +828,7 @@ void receive_bat_packet(struct ethhdr *ethhdr,
orig_node_free_ref(orig_node); orig_node_free_ref(orig_node);
} }
int recv_bat_packet(struct sk_buff *skb, struct batman_if *batman_if) int recv_bat_packet(struct sk_buff *skb, struct hard_iface *hard_iface)
{ {
struct ethhdr *ethhdr; struct ethhdr *ethhdr;
...@@ -859,7 +859,7 @@ int recv_bat_packet(struct sk_buff *skb, struct batman_if *batman_if) ...@@ -859,7 +859,7 @@ int recv_bat_packet(struct sk_buff *skb, struct batman_if *batman_if)
receive_aggr_bat_packet(ethhdr, receive_aggr_bat_packet(ethhdr,
skb->data, skb->data,
skb_headlen(skb), skb_headlen(skb),
batman_if); hard_iface);
kfree_skb(skb); kfree_skb(skb);
return NET_RX_SUCCESS; return NET_RX_SUCCESS;
...@@ -997,7 +997,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv, ...@@ -997,7 +997,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
} }
int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if) int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
{ {
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct icmp_packet_rr *icmp_packet; struct icmp_packet_rr *icmp_packet;
...@@ -1097,7 +1097,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if) ...@@ -1097,7 +1097,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if)
* refcount.*/ * refcount.*/
struct neigh_node *find_router(struct bat_priv *bat_priv, struct neigh_node *find_router(struct bat_priv *bat_priv,
struct orig_node *orig_node, struct orig_node *orig_node,
struct batman_if *recv_if) struct hard_iface *recv_if)
{ {
struct orig_node *primary_orig_node; struct orig_node *primary_orig_node;
struct orig_node *router_orig; struct orig_node *router_orig;
...@@ -1263,7 +1263,7 @@ static int check_unicast_packet(struct sk_buff *skb, int hdr_size) ...@@ -1263,7 +1263,7 @@ static int check_unicast_packet(struct sk_buff *skb, int hdr_size)
return 0; return 0;
} }
int route_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if, int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if,
int hdr_size) int hdr_size)
{ {
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
...@@ -1349,7 +1349,7 @@ int route_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if, ...@@ -1349,7 +1349,7 @@ int route_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if,
return ret; return ret;
} }
int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if) int recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
{ {
struct unicast_packet *unicast_packet; struct unicast_packet *unicast_packet;
int hdr_size = sizeof(struct unicast_packet); int hdr_size = sizeof(struct unicast_packet);
...@@ -1368,7 +1368,7 @@ int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if) ...@@ -1368,7 +1368,7 @@ int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if)
return route_unicast_packet(skb, recv_if, hdr_size); return route_unicast_packet(skb, recv_if, hdr_size);
} }
int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if) int recv_ucast_frag_packet(struct sk_buff *skb, struct hard_iface *recv_if)
{ {
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct unicast_frag_packet *unicast_packet; struct unicast_frag_packet *unicast_packet;
...@@ -1402,7 +1402,7 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if) ...@@ -1402,7 +1402,7 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if)
} }
int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if) int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
{ {
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct orig_node *orig_node = NULL; struct orig_node *orig_node = NULL;
...@@ -1487,7 +1487,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if) ...@@ -1487,7 +1487,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if)
return ret; return ret;
} }
int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if) int recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if)
{ {
struct vis_packet *vis_packet; struct vis_packet *vis_packet;
struct ethhdr *ethhdr; struct ethhdr *ethhdr;
......
...@@ -22,25 +22,25 @@ ...@@ -22,25 +22,25 @@
#ifndef _NET_BATMAN_ADV_ROUTING_H_ #ifndef _NET_BATMAN_ADV_ROUTING_H_
#define _NET_BATMAN_ADV_ROUTING_H_ #define _NET_BATMAN_ADV_ROUTING_H_
void slide_own_bcast_window(struct batman_if *batman_if); void slide_own_bcast_window(struct hard_iface *hard_iface);
void receive_bat_packet(struct ethhdr *ethhdr, void receive_bat_packet(struct ethhdr *ethhdr,
struct batman_packet *batman_packet, struct batman_packet *batman_packet,
unsigned char *hna_buff, int hna_buff_len, unsigned char *hna_buff, int hna_buff_len,
struct batman_if *if_incoming); struct hard_iface *if_incoming);
void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node, void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node,
struct neigh_node *neigh_node, unsigned char *hna_buff, struct neigh_node *neigh_node, unsigned char *hna_buff,
int hna_buff_len); int hna_buff_len);
int route_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if, int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if,
int hdr_size); int hdr_size);
int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if); int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if);
int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if); int recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if);
int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if); int recv_ucast_frag_packet(struct sk_buff *skb, struct hard_iface *recv_if);
int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if); int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if);
int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if); int recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if);
int recv_bat_packet(struct sk_buff *skb, struct batman_if *recv_if); int recv_bat_packet(struct sk_buff *skb, struct hard_iface *recv_if);
struct neigh_node *find_router(struct bat_priv *bat_priv, struct neigh_node *find_router(struct bat_priv *bat_priv,
struct orig_node *orig_node, struct orig_node *orig_node,
struct batman_if *recv_if); struct hard_iface *recv_if);
void bonding_candidate_del(struct orig_node *orig_node, void bonding_candidate_del(struct orig_node *orig_node,
struct neigh_node *neigh_node); struct neigh_node *neigh_node);
......
This diff is collapsed.
...@@ -23,17 +23,17 @@ ...@@ -23,17 +23,17 @@
#define _NET_BATMAN_ADV_SEND_H_ #define _NET_BATMAN_ADV_SEND_H_
int send_skb_packet(struct sk_buff *skb, int send_skb_packet(struct sk_buff *skb,
struct batman_if *batman_if, struct hard_iface *hard_iface,
uint8_t *dst_addr); uint8_t *dst_addr);
void schedule_own_packet(struct batman_if *batman_if); void schedule_own_packet(struct hard_iface *hard_iface);
void schedule_forward_packet(struct orig_node *orig_node, void schedule_forward_packet(struct orig_node *orig_node,
struct ethhdr *ethhdr, struct ethhdr *ethhdr,
struct batman_packet *batman_packet, struct batman_packet *batman_packet,
uint8_t directlink, int hna_buff_len, uint8_t directlink, int hna_buff_len,
struct batman_if *if_outgoing); struct hard_iface *if_outgoing);
int add_bcast_packet_to_list(struct bat_priv *bat_priv, struct sk_buff *skb); int add_bcast_packet_to_list(struct bat_priv *bat_priv, struct sk_buff *skb);
void send_outstanding_bat_packet(struct work_struct *work); void send_outstanding_bat_packet(struct work_struct *work);
void purge_outstanding_packets(struct bat_priv *bat_priv, void purge_outstanding_packets(struct bat_priv *bat_priv,
struct batman_if *batman_if); struct hard_iface *hard_iface);
#endif /* _NET_BATMAN_ADV_SEND_H_ */ #endif /* _NET_BATMAN_ADV_SEND_H_ */
...@@ -414,7 +414,7 @@ int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) ...@@ -414,7 +414,7 @@ int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
} }
void interface_rx(struct net_device *soft_iface, void interface_rx(struct net_device *soft_iface,
struct sk_buff *skb, struct batman_if *recv_if, struct sk_buff *skb, struct hard_iface *recv_if,
int hdr_size) int hdr_size)
{ {
struct bat_priv *bat_priv = netdev_priv(soft_iface); struct bat_priv *bat_priv = netdev_priv(soft_iface);
......
...@@ -27,7 +27,7 @@ int softif_neigh_seq_print_text(struct seq_file *seq, void *offset); ...@@ -27,7 +27,7 @@ int softif_neigh_seq_print_text(struct seq_file *seq, void *offset);
void softif_neigh_purge(struct bat_priv *bat_priv); void softif_neigh_purge(struct bat_priv *bat_priv);
int interface_tx(struct sk_buff *skb, struct net_device *soft_iface); int interface_tx(struct sk_buff *skb, struct net_device *soft_iface);
void interface_rx(struct net_device *soft_iface, void interface_rx(struct net_device *soft_iface,
struct sk_buff *skb, struct batman_if *recv_if, struct sk_buff *skb, struct hard_iface *recv_if,
int hdr_size); int hdr_size);
struct net_device *softif_create(char *name); struct net_device *softif_create(char *name);
void softif_destroy(struct net_device *soft_iface); void softif_destroy(struct net_device *soft_iface);
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
sizeof(struct bcast_packet)))) sizeof(struct bcast_packet))))
struct batman_if { struct hard_iface {
struct list_head list; struct list_head list;
int16_t if_num; int16_t if_num;
char if_status; char if_status;
...@@ -124,7 +124,7 @@ struct neigh_node { ...@@ -124,7 +124,7 @@ struct neigh_node {
atomic_t refcount; atomic_t refcount;
struct rcu_head rcu; struct rcu_head rcu;
struct orig_node *orig_node; struct orig_node *orig_node;
struct batman_if *if_incoming; struct hard_iface *if_incoming;
}; };
...@@ -148,7 +148,7 @@ struct bat_priv { ...@@ -148,7 +148,7 @@ struct bat_priv {
struct hlist_head softif_neigh_list; struct hlist_head softif_neigh_list;
struct softif_neigh *softif_neigh; struct softif_neigh *softif_neigh;
struct debug_log *debug_log; struct debug_log *debug_log;
struct batman_if *primary_if; struct hard_iface *primary_if;
struct kobject *mesh_obj; struct kobject *mesh_obj;
struct dentry *debug_dir; struct dentry *debug_dir;
struct hlist_head forw_bat_list; struct hlist_head forw_bat_list;
...@@ -217,7 +217,7 @@ struct forw_packet { ...@@ -217,7 +217,7 @@ struct forw_packet {
uint32_t direct_link_flags; uint32_t direct_link_flags;
uint8_t num_packets; uint8_t num_packets;
struct delayed_work delayed_work; struct delayed_work delayed_work;
struct batman_if *if_incoming; struct hard_iface *if_incoming;
}; };
/* While scanning for vis-entries of a particular vis-originator /* While scanning for vis-entries of a particular vis-originator
......
...@@ -213,7 +213,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, ...@@ -213,7 +213,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
} }
int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
struct batman_if *batman_if, uint8_t dstaddr[]) struct hard_iface *hard_iface, uint8_t dstaddr[])
{ {
struct unicast_packet tmp_uc, *unicast_packet; struct unicast_packet tmp_uc, *unicast_packet;
struct sk_buff *frag_skb; struct sk_buff *frag_skb;
...@@ -258,12 +258,12 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, ...@@ -258,12 +258,12 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
frag1->flags = UNI_FRAG_HEAD | large_tail; frag1->flags = UNI_FRAG_HEAD | large_tail;
frag2->flags = large_tail; frag2->flags = large_tail;
seqno = atomic_add_return(2, &batman_if->frag_seqno); seqno = atomic_add_return(2, &hard_iface->frag_seqno);
frag1->seqno = htons(seqno - 1); frag1->seqno = htons(seqno - 1);
frag2->seqno = htons(seqno); frag2->seqno = htons(seqno);
send_skb_packet(skb, batman_if, dstaddr); send_skb_packet(skb, hard_iface, dstaddr);
send_skb_packet(frag_skb, batman_if, dstaddr); send_skb_packet(frag_skb, hard_iface, dstaddr);
return NET_RX_SUCCESS; return NET_RX_SUCCESS;
drop_frag: drop_frag:
......
...@@ -32,7 +32,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, ...@@ -32,7 +32,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
void frag_list_free(struct list_head *head); void frag_list_free(struct list_head *head);
int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv); int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv);
int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
struct batman_if *batman_if, uint8_t dstaddr[]); struct hard_iface *hard_iface, uint8_t dstaddr[]);
static inline int frag_can_reassemble(struct sk_buff *skb, int mtu) static inline int frag_can_reassemble(struct sk_buff *skb, int mtu)
{ {
......
...@@ -730,7 +730,7 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv, ...@@ -730,7 +730,7 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
struct orig_node *orig_node; struct orig_node *orig_node;
struct vis_packet *packet; struct vis_packet *packet;
struct sk_buff *skb; struct sk_buff *skb;
struct batman_if *batman_if; struct hard_iface *hard_iface;
uint8_t dstaddr[ETH_ALEN]; uint8_t dstaddr[ETH_ALEN];
int i; int i;
...@@ -755,12 +755,12 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv, ...@@ -755,12 +755,12 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
continue; continue;
memcpy(packet->target_orig, orig_node->orig, ETH_ALEN); memcpy(packet->target_orig, orig_node->orig, ETH_ALEN);
batman_if = orig_node->router->if_incoming; hard_iface = orig_node->router->if_incoming;
memcpy(dstaddr, orig_node->router->addr, ETH_ALEN); memcpy(dstaddr, orig_node->router->addr, ETH_ALEN);
skb = skb_clone(info->skb_packet, GFP_ATOMIC); skb = skb_clone(info->skb_packet, GFP_ATOMIC);
if (skb) if (skb)
send_skb_packet(skb, batman_if, dstaddr); send_skb_packet(skb, hard_iface, dstaddr);
} }
rcu_read_unlock(); rcu_read_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment