Loading net/batman-adv/bat_debugfs.c +14 −13 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ static struct dentry *batadv_debugfs; static int batadv_log_buff_len = BATADV_LOG_BUF_LEN; static void batadv_emit_log_char(struct debug_log *debug_log, char c) static void batadv_emit_log_char(struct batadv_debug_log *debug_log, char c) { BATADV_LOG_BUFF(debug_log->log_end) = c; debug_log->log_end++; Loading @@ -50,7 +50,8 @@ static void batadv_emit_log_char(struct debug_log *debug_log, char c) } __printf(2, 3) static int batadv_fdebug_log(struct debug_log *debug_log, const char *fmt, ...) static int batadv_fdebug_log(struct batadv_debug_log *debug_log, const char *fmt, ...) { va_list args; static char debug_log_buf[256]; Loading @@ -74,7 +75,7 @@ static int batadv_fdebug_log(struct debug_log *debug_log, const char *fmt, ...) return 0; } int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...) int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...) { va_list args; char tmp_log_buf[256]; Loading Loading @@ -105,8 +106,8 @@ static int batadv_log_release(struct inode *inode, struct file *file) static ssize_t batadv_log_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct bat_priv *bat_priv = file->private_data; struct debug_log *debug_log = bat_priv->debug_log; struct batadv_priv *bat_priv = file->private_data; struct batadv_debug_log *debug_log = bat_priv->debug_log; int error, i = 0; char c; Loading Loading @@ -158,8 +159,8 @@ static ssize_t batadv_log_read(struct file *file, char __user *buf, static unsigned int batadv_log_poll(struct file *file, poll_table *wait) { struct bat_priv *bat_priv = file->private_data; struct debug_log *debug_log = bat_priv->debug_log; struct batadv_priv *bat_priv = file->private_data; struct batadv_debug_log *debug_log = bat_priv->debug_log; poll_wait(file, &debug_log->queue_wait, wait); Loading @@ -177,7 +178,7 @@ static const struct file_operations batadv_log_fops = { .llseek = no_llseek, }; static int batadv_debug_log_setup(struct bat_priv *bat_priv) static int batadv_debug_log_setup(struct batadv_priv *bat_priv) { struct dentry *d; Loading @@ -203,19 +204,19 @@ static int batadv_debug_log_setup(struct bat_priv *bat_priv) return -ENOMEM; } static void batadv_debug_log_cleanup(struct bat_priv *bat_priv) static void batadv_debug_log_cleanup(struct batadv_priv *bat_priv) { kfree(bat_priv->debug_log); bat_priv->debug_log = NULL; } #else /* CONFIG_BATMAN_ADV_DEBUG */ static int batadv_debug_log_setup(struct bat_priv *bat_priv) static int batadv_debug_log_setup(struct batadv_priv *bat_priv) { bat_priv->debug_log = NULL; return 0; } static void batadv_debug_log_cleanup(struct bat_priv *bat_priv) static void batadv_debug_log_cleanup(struct batadv_priv *bat_priv) { return; } Loading Loading @@ -339,7 +340,7 @@ void batadv_debugfs_destroy(void) int batadv_debugfs_add_meshif(struct net_device *dev) { struct bat_priv *bat_priv = netdev_priv(dev); struct batadv_priv *bat_priv = netdev_priv(dev); struct batadv_debuginfo **bat_debug; struct dentry *file; Loading Loading @@ -382,7 +383,7 @@ int batadv_debugfs_add_meshif(struct net_device *dev) void batadv_debugfs_del_meshif(struct net_device *dev) { struct bat_priv *bat_priv = netdev_priv(dev); struct batadv_priv *bat_priv = netdev_priv(dev); batadv_debug_log_cleanup(bat_priv); Loading net/batman-adv/bat_iv_ogm.c +64 −61 Original line number Diff line number Diff line Loading @@ -28,13 +28,13 @@ #include "send.h" #include "bat_algo.h" static struct neigh_node *batadv_iv_ogm_neigh_new(struct hard_iface *hard_iface, static struct batadv_neigh_node * batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface, const uint8_t *neigh_addr, struct orig_node *orig_node, struct orig_node *orig_neigh, __be32 seqno) struct batadv_orig_node *orig_node, struct batadv_orig_node *orig_neigh, __be32 seqno) { struct neigh_node *neigh_node; struct batadv_neigh_node *neigh_node; neigh_node = batadv_neigh_node_new(hard_iface, neigh_addr, ntohl(seqno)); Loading @@ -54,7 +54,7 @@ static struct neigh_node *batadv_iv_ogm_neigh_new(struct hard_iface *hard_iface, return neigh_node; } static int batadv_iv_ogm_iface_enable(struct hard_iface *hard_iface) static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface) { struct batadv_ogm_packet *batadv_ogm_packet; uint32_t random_seqno; Loading Loading @@ -85,13 +85,13 @@ static int batadv_iv_ogm_iface_enable(struct hard_iface *hard_iface) return res; } static void batadv_iv_ogm_iface_disable(struct hard_iface *hard_iface) static void batadv_iv_ogm_iface_disable(struct batadv_hard_iface *hard_iface) { kfree(hard_iface->packet_buff); hard_iface->packet_buff = NULL; } static void batadv_iv_ogm_iface_update_mac(struct hard_iface *hard_iface) static void batadv_iv_ogm_iface_update_mac(struct batadv_hard_iface *hard_iface) { struct batadv_ogm_packet *batadv_ogm_packet; Loading @@ -102,7 +102,8 @@ static void batadv_iv_ogm_iface_update_mac(struct hard_iface *hard_iface) hard_iface->net_dev->dev_addr, ETH_ALEN); } static void batadv_iv_ogm_primary_iface_set(struct hard_iface *hard_iface) static void batadv_iv_ogm_primary_iface_set(struct batadv_hard_iface *hard_iface) { struct batadv_ogm_packet *batadv_ogm_packet; Loading @@ -113,7 +114,7 @@ static void batadv_iv_ogm_primary_iface_set(struct hard_iface *hard_iface) /* when do we schedule our own ogm to be sent */ static unsigned long batadv_iv_ogm_emit_send_time(const struct bat_priv *bat_priv) batadv_iv_ogm_emit_send_time(const struct batadv_priv *bat_priv) { unsigned int msecs; Loading @@ -130,7 +131,8 @@ static unsigned long batadv_iv_ogm_fwd_send_time(void) } /* apply hop penalty for a normal link */ static uint8_t batadv_hop_penalty(uint8_t tq, const struct bat_priv *bat_priv) static uint8_t batadv_hop_penalty(uint8_t tq, const struct batadv_priv *bat_priv) { int hop_penalty = atomic_read(&bat_priv->hop_penalty); int new_tq; Loading @@ -155,10 +157,10 @@ static int batadv_iv_ogm_aggr_packet(int buff_pos, int packet_len, } /* send a batman ogm to a given interface */ static void batadv_iv_ogm_send_to_if(struct forw_packet *forw_packet, struct hard_iface *hard_iface) static void batadv_iv_ogm_send_to_if(struct batadv_forw_packet *forw_packet, struct batadv_hard_iface *hard_iface) { struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); char *fwd_str; uint8_t packet_num; int16_t buff_pos; Loading Loading @@ -217,12 +219,12 @@ static void batadv_iv_ogm_send_to_if(struct forw_packet *forw_packet, } /* send a batman ogm packet */ static void batadv_iv_ogm_emit(struct forw_packet *forw_packet) static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet) { struct hard_iface *hard_iface; struct batadv_hard_iface *hard_iface; struct net_device *soft_iface; struct bat_priv *bat_priv; struct hard_iface *primary_if = NULL; struct batadv_priv *bat_priv; struct batadv_hard_iface *primary_if = NULL; struct batadv_ogm_packet *batadv_ogm_packet; unsigned char directlink; Loading Loading @@ -288,15 +290,15 @@ static void batadv_iv_ogm_emit(struct forw_packet *forw_packet) /* return true if new_packet can be aggregated with forw_packet */ static bool batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet, struct bat_priv *bat_priv, struct batadv_priv *bat_priv, int packet_len, unsigned long send_time, bool directlink, const struct hard_iface *if_incoming, const struct forw_packet *forw_packet) const struct batadv_hard_iface *if_incoming, const struct batadv_forw_packet *forw_packet) { struct batadv_ogm_packet *batadv_ogm_packet; int aggregated_bytes = forw_packet->packet_len + packet_len; struct hard_iface *primary_if = NULL; struct batadv_hard_iface *primary_if = NULL; bool res = false; unsigned long aggregation_end_time; Loading Loading @@ -371,11 +373,11 @@ batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet, static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff, int packet_len, unsigned long send_time, bool direct_link, struct hard_iface *if_incoming, struct batadv_hard_iface *if_incoming, int own_packet) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct forw_packet *forw_packet_aggr; struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_forw_packet *forw_packet_aggr; unsigned char *skb_buff; unsigned int skb_size; Loading Loading @@ -447,7 +449,7 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff, } /* aggregate a new packet into the existing ogm packet */ static void batadv_iv_ogm_aggregate(struct forw_packet *forw_packet_aggr, static void batadv_iv_ogm_aggregate(struct batadv_forw_packet *forw_packet_aggr, const unsigned char *packet_buff, int packet_len, bool direct_link) { Loading @@ -464,16 +466,17 @@ static void batadv_iv_ogm_aggregate(struct forw_packet *forw_packet_aggr, (1 << forw_packet_aggr->num_packets); } static void batadv_iv_ogm_queue_add(struct bat_priv *bat_priv, static void batadv_iv_ogm_queue_add(struct batadv_priv *bat_priv, unsigned char *packet_buff, int packet_len, struct hard_iface *if_incoming, struct batadv_hard_iface *if_incoming, int own_packet, unsigned long send_time) { /* _aggr -> pointer to the packet we want to aggregate with * _pos -> pointer to the position in the queue */ struct forw_packet *forw_packet_aggr = NULL, *forw_packet_pos = NULL; struct batadv_forw_packet *forw_packet_aggr = NULL; struct batadv_forw_packet *forw_packet_pos = NULL; struct hlist_node *tmp_node; struct batadv_ogm_packet *batadv_ogm_packet; bool direct_link; Loading Loading @@ -524,14 +527,14 @@ static void batadv_iv_ogm_queue_add(struct bat_priv *bat_priv, } } static void batadv_iv_ogm_forward(struct orig_node *orig_node, static void batadv_iv_ogm_forward(struct batadv_orig_node *orig_node, const struct ethhdr *ethhdr, struct batadv_ogm_packet *batadv_ogm_packet, bool is_single_hop_neigh, bool is_from_best_next_hop, struct hard_iface *if_incoming) struct batadv_hard_iface *if_incoming) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); uint8_t tt_num_changes; if (batadv_ogm_packet->header.ttl <= 1) { Loading Loading @@ -577,11 +580,11 @@ static void batadv_iv_ogm_forward(struct orig_node *orig_node, if_incoming, 0, batadv_iv_ogm_fwd_send_time()); } static void batadv_iv_ogm_schedule(struct hard_iface *hard_iface) static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface) { struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); struct batadv_ogm_packet *batadv_ogm_packet; struct hard_iface *primary_if; struct batadv_hard_iface *primary_if; int vis_server, tt_num_changes = 0; vis_server = atomic_read(&bat_priv->vis_mode); Loading Loading @@ -627,17 +630,17 @@ static void batadv_iv_ogm_schedule(struct hard_iface *hard_iface) } static void batadv_iv_ogm_orig_update(struct bat_priv *bat_priv, struct orig_node *orig_node, batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, struct batadv_orig_node *orig_node, const struct ethhdr *ethhdr, const struct batadv_ogm_packet *batadv_ogm_packet, struct hard_iface *if_incoming, struct batadv_hard_iface *if_incoming, const unsigned char *tt_buff, int is_duplicate) { struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; struct neigh_node *router = NULL; struct orig_node *orig_node_tmp; struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; struct batadv_neigh_node *router = NULL; struct batadv_orig_node *orig_node_tmp; struct hlist_node *node; uint8_t bcast_own_sum_orig, bcast_own_sum_neigh; uint8_t *neigh_addr; Loading Loading @@ -670,7 +673,7 @@ batadv_iv_ogm_orig_update(struct bat_priv *bat_priv, } if (!neigh_node) { struct orig_node *orig_tmp; struct batadv_orig_node *orig_tmp; orig_tmp = batadv_get_orig_node(bat_priv, ethhdr->h_source); if (!orig_tmp) Loading Loading @@ -775,13 +778,13 @@ batadv_iv_ogm_orig_update(struct bat_priv *bat_priv, batadv_neigh_node_free_ref(router); } static int batadv_iv_ogm_calc_tq(struct orig_node *orig_node, struct orig_node *orig_neigh_node, static int batadv_iv_ogm_calc_tq(struct batadv_orig_node *orig_node, struct batadv_orig_node *orig_neigh_node, struct batadv_ogm_packet *batadv_ogm_packet, struct hard_iface *if_incoming) struct batadv_hard_iface *if_incoming) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct neigh_node *neigh_node = NULL, *tmp_neigh_node; struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node; struct hlist_node *node; uint8_t total_count; uint8_t orig_eq_count, neigh_rq_count, neigh_rq_inv, tq_own; Loading Loading @@ -895,11 +898,11 @@ static int batadv_iv_ogm_calc_tq(struct orig_node *orig_node, static int batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, const struct batadv_ogm_packet *batadv_ogm_packet, const struct hard_iface *if_incoming) const struct batadv_hard_iface *if_incoming) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct orig_node *orig_node; struct neigh_node *tmp_neigh_node; struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_orig_node *orig_node; struct batadv_neigh_node *tmp_neigh_node; struct hlist_node *node; int is_duplicate = 0; int32_t seq_diff; Loading Loading @@ -965,13 +968,13 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, struct batadv_ogm_packet *batadv_ogm_packet, const unsigned char *tt_buff, struct hard_iface *if_incoming) struct batadv_hard_iface *if_incoming) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct hard_iface *hard_iface; struct orig_node *orig_neigh_node, *orig_node; struct neigh_node *router = NULL, *router_router = NULL; struct neigh_node *orig_neigh_router = NULL; struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_hard_iface *hard_iface; struct batadv_orig_node *orig_neigh_node, *orig_node; struct batadv_neigh_node *router = NULL, *router_router = NULL; struct batadv_neigh_node *orig_neigh_router = NULL; int has_directlink_flag; int is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0; int is_broadcast = 0, is_bidirect; Loading Loading @@ -1240,9 +1243,9 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, } static int batadv_iv_ogm_receive(struct sk_buff *skb, struct hard_iface *if_incoming) struct batadv_hard_iface *if_incoming) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_ogm_packet *batadv_ogm_packet; struct ethhdr *ethhdr; int buff_pos = 0, packet_len; Loading Loading @@ -1287,7 +1290,7 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb, return NET_RX_SUCCESS; } static struct bat_algo_ops batadv_batman_iv __read_mostly = { static struct batadv_algo_ops batadv_batman_iv __read_mostly = { .name = "BATMAN_IV", .bat_iface_enable = batadv_iv_ogm_iface_enable, .bat_iface_disable = batadv_iv_ogm_iface_disable, Loading net/batman-adv/bat_sysfs.c +24 −21 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ static struct net_device *batadv_kobj_to_netdev(struct kobject *obj) return to_net_dev(dev); } static struct bat_priv *batadv_kobj_to_batpriv(struct kobject *obj) static struct batadv_priv *batadv_kobj_to_batpriv(struct kobject *obj) { struct net_device *net_dev = batadv_kobj_to_netdev(obj); return netdev_priv(net_dev); Loading Loading @@ -67,7 +67,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ size_t count) \ { \ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ struct bat_priv *bat_priv = netdev_priv(net_dev); \ struct batadv_priv *bat_priv = netdev_priv(net_dev); \ return __batadv_store_bool_attr(buff, count, _post_func, attr, \ &bat_priv->_name, net_dev); \ } Loading @@ -76,7 +76,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ ssize_t batadv_show_##_name(struct kobject *kobj, \ struct attribute *attr, char *buff) \ { \ struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ return sprintf(buff, "%s\n", \ atomic_read(&bat_priv->_name) == 0 ? \ "disabled" : "enabled"); \ Loading @@ -98,7 +98,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ size_t count) \ { \ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ struct bat_priv *bat_priv = netdev_priv(net_dev); \ struct batadv_priv *bat_priv = netdev_priv(net_dev); \ return __batadv_store_uint_attr(buff, count, _min, _max, \ _post_func, attr, \ &bat_priv->_name, net_dev); \ Loading @@ -108,7 +108,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ ssize_t batadv_show_##_name(struct kobject *kobj, \ struct attribute *attr, char *buff) \ { \ struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ return sprintf(buff, "%i\n", atomic_read(&bat_priv->_name)); \ } \ Loading @@ -128,7 +128,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ size_t count) \ { \ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ struct hard_iface *hard_iface; \ struct batadv_hard_iface *hard_iface; \ ssize_t length; \ \ hard_iface = batadv_hardif_get_by_netdev(net_dev); \ Loading @@ -148,7 +148,7 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \ struct attribute *attr, char *buff) \ { \ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ struct hard_iface *hard_iface; \ struct batadv_hard_iface *hard_iface; \ ssize_t length; \ \ hard_iface = batadv_hardif_get_by_netdev(net_dev); \ Loading Loading @@ -281,7 +281,7 @@ __batadv_store_uint_attr(const char *buff, size_t count, static ssize_t batadv_show_vis_mode(struct kobject *kobj, struct attribute *attr, char *buff) { struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); int vis_mode = atomic_read(&bat_priv->vis_mode); const char *mode; Loading @@ -298,7 +298,7 @@ static ssize_t batadv_store_vis_mode(struct kobject *kobj, size_t count) { struct net_device *net_dev = batadv_kobj_to_netdev(kobj); struct bat_priv *bat_priv = netdev_priv(net_dev); struct batadv_priv *bat_priv = netdev_priv(net_dev); unsigned long val; int ret, vis_mode_tmp = -1; const char *old_mode, *new_mode; Loading Loading @@ -349,20 +349,20 @@ static ssize_t batadv_store_vis_mode(struct kobject *kobj, static ssize_t batadv_show_bat_algo(struct kobject *kobj, struct attribute *attr, char *buff) { struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); return sprintf(buff, "%s\n", bat_priv->bat_algo_ops->name); } static void batadv_post_gw_deselect(struct net_device *net_dev) { struct bat_priv *bat_priv = netdev_priv(net_dev); struct batadv_priv *bat_priv = netdev_priv(net_dev); batadv_gw_deselect(bat_priv); } static ssize_t batadv_show_gw_mode(struct kobject *kobj, struct attribute *attr, char *buff) { struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); int bytes_written; switch (atomic_read(&bat_priv->gw_mode)) { Loading @@ -388,7 +388,7 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj, size_t count) { struct net_device *net_dev = batadv_kobj_to_netdev(kobj); struct bat_priv *bat_priv = netdev_priv(net_dev); struct batadv_priv *bat_priv = netdev_priv(net_dev); char *curr_gw_mode_str; int gw_mode_tmp = -1; Loading Loading @@ -440,7 +440,7 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj, static ssize_t batadv_show_gw_bwidth(struct kobject *kobj, struct attribute *attr, char *buff) { struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); int down, up; int gw_bandwidth = atomic_read(&bat_priv->gw_bandwidth); Loading Loading @@ -512,7 +512,7 @@ static struct batadv_attribute *batadv_mesh_attrs[] = { int batadv_sysfs_add_meshif(struct net_device *dev) { struct kobject *batif_kobject = &dev->dev.kobj; struct bat_priv *bat_priv = netdev_priv(dev); struct batadv_priv *bat_priv = netdev_priv(dev); struct batadv_attribute **bat_attr; int err; Loading Loading @@ -549,7 +549,7 @@ int batadv_sysfs_add_meshif(struct net_device *dev) void batadv_sysfs_del_meshif(struct net_device *dev) { struct bat_priv *bat_priv = netdev_priv(dev); struct batadv_priv *bat_priv = netdev_priv(dev); struct batadv_attribute **bat_attr; for (bat_attr = batadv_mesh_attrs; *bat_attr; ++bat_attr) Loading @@ -563,10 +563,11 @@ static ssize_t batadv_show_mesh_iface(struct kobject *kobj, struct attribute *attr, char *buff) { struct net_device *net_dev = batadv_kobj_to_netdev(kobj); struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev); struct batadv_hard_iface *hard_iface; ssize_t length; const char *ifname; hard_iface = batadv_hardif_get_by_netdev(net_dev); if (!hard_iface) return 0; Loading @@ -587,10 +588,11 @@ static ssize_t batadv_store_mesh_iface(struct kobject *kobj, size_t count) { struct net_device *net_dev = batadv_kobj_to_netdev(kobj); struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev); struct batadv_hard_iface *hard_iface; int status_tmp = -1; int ret = count; hard_iface = batadv_hardif_get_by_netdev(net_dev); if (!hard_iface) return count; Loading Loading @@ -643,9 +645,10 @@ static ssize_t batadv_show_iface_status(struct kobject *kobj, struct attribute *attr, char *buff) { struct net_device *net_dev = batadv_kobj_to_netdev(kobj); struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev); struct batadv_hard_iface *hard_iface; ssize_t length; hard_iface = batadv_hardif_get_by_netdev(net_dev); if (!hard_iface) return 0; Loading Loading @@ -723,11 +726,11 @@ void batadv_sysfs_del_hardif(struct kobject **hardif_obj) *hardif_obj = NULL; } int batadv_throw_uevent(struct bat_priv *bat_priv, enum batadv_uev_type type, int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, enum batadv_uev_action action, const char *data) { int ret = -ENOMEM; struct hard_iface *primary_if = NULL; struct batadv_hard_iface *primary_if = NULL; struct kobject *bat_kobj; char *uevent_env[4] = { NULL, NULL, NULL, NULL }; Loading net/batman-adv/bat_sysfs.h +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ void batadv_sysfs_del_meshif(struct net_device *dev); int batadv_sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev); void batadv_sysfs_del_hardif(struct kobject **hardif_obj); int batadv_throw_uevent(struct bat_priv *bat_priv, enum batadv_uev_type type, int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, enum batadv_uev_action action, const char *data); #endif /* _NET_BATMAN_ADV_SYSFS_H_ */ net/batman-adv/bitarray.c +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ static void batadv_bitmap_shift_left(unsigned long *seq_bits, int32_t n) int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, int32_t seq_num_diff, int set_mark) { struct bat_priv *bat_priv = priv; struct batadv_priv *bat_priv = priv; /* sequence number is slightly older. We already got a sequence number * higher than this one, so we just mark it. Loading Loading
net/batman-adv/bat_debugfs.c +14 −13 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ static struct dentry *batadv_debugfs; static int batadv_log_buff_len = BATADV_LOG_BUF_LEN; static void batadv_emit_log_char(struct debug_log *debug_log, char c) static void batadv_emit_log_char(struct batadv_debug_log *debug_log, char c) { BATADV_LOG_BUFF(debug_log->log_end) = c; debug_log->log_end++; Loading @@ -50,7 +50,8 @@ static void batadv_emit_log_char(struct debug_log *debug_log, char c) } __printf(2, 3) static int batadv_fdebug_log(struct debug_log *debug_log, const char *fmt, ...) static int batadv_fdebug_log(struct batadv_debug_log *debug_log, const char *fmt, ...) { va_list args; static char debug_log_buf[256]; Loading @@ -74,7 +75,7 @@ static int batadv_fdebug_log(struct debug_log *debug_log, const char *fmt, ...) return 0; } int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...) int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...) { va_list args; char tmp_log_buf[256]; Loading Loading @@ -105,8 +106,8 @@ static int batadv_log_release(struct inode *inode, struct file *file) static ssize_t batadv_log_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct bat_priv *bat_priv = file->private_data; struct debug_log *debug_log = bat_priv->debug_log; struct batadv_priv *bat_priv = file->private_data; struct batadv_debug_log *debug_log = bat_priv->debug_log; int error, i = 0; char c; Loading Loading @@ -158,8 +159,8 @@ static ssize_t batadv_log_read(struct file *file, char __user *buf, static unsigned int batadv_log_poll(struct file *file, poll_table *wait) { struct bat_priv *bat_priv = file->private_data; struct debug_log *debug_log = bat_priv->debug_log; struct batadv_priv *bat_priv = file->private_data; struct batadv_debug_log *debug_log = bat_priv->debug_log; poll_wait(file, &debug_log->queue_wait, wait); Loading @@ -177,7 +178,7 @@ static const struct file_operations batadv_log_fops = { .llseek = no_llseek, }; static int batadv_debug_log_setup(struct bat_priv *bat_priv) static int batadv_debug_log_setup(struct batadv_priv *bat_priv) { struct dentry *d; Loading @@ -203,19 +204,19 @@ static int batadv_debug_log_setup(struct bat_priv *bat_priv) return -ENOMEM; } static void batadv_debug_log_cleanup(struct bat_priv *bat_priv) static void batadv_debug_log_cleanup(struct batadv_priv *bat_priv) { kfree(bat_priv->debug_log); bat_priv->debug_log = NULL; } #else /* CONFIG_BATMAN_ADV_DEBUG */ static int batadv_debug_log_setup(struct bat_priv *bat_priv) static int batadv_debug_log_setup(struct batadv_priv *bat_priv) { bat_priv->debug_log = NULL; return 0; } static void batadv_debug_log_cleanup(struct bat_priv *bat_priv) static void batadv_debug_log_cleanup(struct batadv_priv *bat_priv) { return; } Loading Loading @@ -339,7 +340,7 @@ void batadv_debugfs_destroy(void) int batadv_debugfs_add_meshif(struct net_device *dev) { struct bat_priv *bat_priv = netdev_priv(dev); struct batadv_priv *bat_priv = netdev_priv(dev); struct batadv_debuginfo **bat_debug; struct dentry *file; Loading Loading @@ -382,7 +383,7 @@ int batadv_debugfs_add_meshif(struct net_device *dev) void batadv_debugfs_del_meshif(struct net_device *dev) { struct bat_priv *bat_priv = netdev_priv(dev); struct batadv_priv *bat_priv = netdev_priv(dev); batadv_debug_log_cleanup(bat_priv); Loading
net/batman-adv/bat_iv_ogm.c +64 −61 Original line number Diff line number Diff line Loading @@ -28,13 +28,13 @@ #include "send.h" #include "bat_algo.h" static struct neigh_node *batadv_iv_ogm_neigh_new(struct hard_iface *hard_iface, static struct batadv_neigh_node * batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface, const uint8_t *neigh_addr, struct orig_node *orig_node, struct orig_node *orig_neigh, __be32 seqno) struct batadv_orig_node *orig_node, struct batadv_orig_node *orig_neigh, __be32 seqno) { struct neigh_node *neigh_node; struct batadv_neigh_node *neigh_node; neigh_node = batadv_neigh_node_new(hard_iface, neigh_addr, ntohl(seqno)); Loading @@ -54,7 +54,7 @@ static struct neigh_node *batadv_iv_ogm_neigh_new(struct hard_iface *hard_iface, return neigh_node; } static int batadv_iv_ogm_iface_enable(struct hard_iface *hard_iface) static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface) { struct batadv_ogm_packet *batadv_ogm_packet; uint32_t random_seqno; Loading Loading @@ -85,13 +85,13 @@ static int batadv_iv_ogm_iface_enable(struct hard_iface *hard_iface) return res; } static void batadv_iv_ogm_iface_disable(struct hard_iface *hard_iface) static void batadv_iv_ogm_iface_disable(struct batadv_hard_iface *hard_iface) { kfree(hard_iface->packet_buff); hard_iface->packet_buff = NULL; } static void batadv_iv_ogm_iface_update_mac(struct hard_iface *hard_iface) static void batadv_iv_ogm_iface_update_mac(struct batadv_hard_iface *hard_iface) { struct batadv_ogm_packet *batadv_ogm_packet; Loading @@ -102,7 +102,8 @@ static void batadv_iv_ogm_iface_update_mac(struct hard_iface *hard_iface) hard_iface->net_dev->dev_addr, ETH_ALEN); } static void batadv_iv_ogm_primary_iface_set(struct hard_iface *hard_iface) static void batadv_iv_ogm_primary_iface_set(struct batadv_hard_iface *hard_iface) { struct batadv_ogm_packet *batadv_ogm_packet; Loading @@ -113,7 +114,7 @@ static void batadv_iv_ogm_primary_iface_set(struct hard_iface *hard_iface) /* when do we schedule our own ogm to be sent */ static unsigned long batadv_iv_ogm_emit_send_time(const struct bat_priv *bat_priv) batadv_iv_ogm_emit_send_time(const struct batadv_priv *bat_priv) { unsigned int msecs; Loading @@ -130,7 +131,8 @@ static unsigned long batadv_iv_ogm_fwd_send_time(void) } /* apply hop penalty for a normal link */ static uint8_t batadv_hop_penalty(uint8_t tq, const struct bat_priv *bat_priv) static uint8_t batadv_hop_penalty(uint8_t tq, const struct batadv_priv *bat_priv) { int hop_penalty = atomic_read(&bat_priv->hop_penalty); int new_tq; Loading @@ -155,10 +157,10 @@ static int batadv_iv_ogm_aggr_packet(int buff_pos, int packet_len, } /* send a batman ogm to a given interface */ static void batadv_iv_ogm_send_to_if(struct forw_packet *forw_packet, struct hard_iface *hard_iface) static void batadv_iv_ogm_send_to_if(struct batadv_forw_packet *forw_packet, struct batadv_hard_iface *hard_iface) { struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); char *fwd_str; uint8_t packet_num; int16_t buff_pos; Loading Loading @@ -217,12 +219,12 @@ static void batadv_iv_ogm_send_to_if(struct forw_packet *forw_packet, } /* send a batman ogm packet */ static void batadv_iv_ogm_emit(struct forw_packet *forw_packet) static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet) { struct hard_iface *hard_iface; struct batadv_hard_iface *hard_iface; struct net_device *soft_iface; struct bat_priv *bat_priv; struct hard_iface *primary_if = NULL; struct batadv_priv *bat_priv; struct batadv_hard_iface *primary_if = NULL; struct batadv_ogm_packet *batadv_ogm_packet; unsigned char directlink; Loading Loading @@ -288,15 +290,15 @@ static void batadv_iv_ogm_emit(struct forw_packet *forw_packet) /* return true if new_packet can be aggregated with forw_packet */ static bool batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet, struct bat_priv *bat_priv, struct batadv_priv *bat_priv, int packet_len, unsigned long send_time, bool directlink, const struct hard_iface *if_incoming, const struct forw_packet *forw_packet) const struct batadv_hard_iface *if_incoming, const struct batadv_forw_packet *forw_packet) { struct batadv_ogm_packet *batadv_ogm_packet; int aggregated_bytes = forw_packet->packet_len + packet_len; struct hard_iface *primary_if = NULL; struct batadv_hard_iface *primary_if = NULL; bool res = false; unsigned long aggregation_end_time; Loading Loading @@ -371,11 +373,11 @@ batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet, static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff, int packet_len, unsigned long send_time, bool direct_link, struct hard_iface *if_incoming, struct batadv_hard_iface *if_incoming, int own_packet) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct forw_packet *forw_packet_aggr; struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_forw_packet *forw_packet_aggr; unsigned char *skb_buff; unsigned int skb_size; Loading Loading @@ -447,7 +449,7 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff, } /* aggregate a new packet into the existing ogm packet */ static void batadv_iv_ogm_aggregate(struct forw_packet *forw_packet_aggr, static void batadv_iv_ogm_aggregate(struct batadv_forw_packet *forw_packet_aggr, const unsigned char *packet_buff, int packet_len, bool direct_link) { Loading @@ -464,16 +466,17 @@ static void batadv_iv_ogm_aggregate(struct forw_packet *forw_packet_aggr, (1 << forw_packet_aggr->num_packets); } static void batadv_iv_ogm_queue_add(struct bat_priv *bat_priv, static void batadv_iv_ogm_queue_add(struct batadv_priv *bat_priv, unsigned char *packet_buff, int packet_len, struct hard_iface *if_incoming, struct batadv_hard_iface *if_incoming, int own_packet, unsigned long send_time) { /* _aggr -> pointer to the packet we want to aggregate with * _pos -> pointer to the position in the queue */ struct forw_packet *forw_packet_aggr = NULL, *forw_packet_pos = NULL; struct batadv_forw_packet *forw_packet_aggr = NULL; struct batadv_forw_packet *forw_packet_pos = NULL; struct hlist_node *tmp_node; struct batadv_ogm_packet *batadv_ogm_packet; bool direct_link; Loading Loading @@ -524,14 +527,14 @@ static void batadv_iv_ogm_queue_add(struct bat_priv *bat_priv, } } static void batadv_iv_ogm_forward(struct orig_node *orig_node, static void batadv_iv_ogm_forward(struct batadv_orig_node *orig_node, const struct ethhdr *ethhdr, struct batadv_ogm_packet *batadv_ogm_packet, bool is_single_hop_neigh, bool is_from_best_next_hop, struct hard_iface *if_incoming) struct batadv_hard_iface *if_incoming) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); uint8_t tt_num_changes; if (batadv_ogm_packet->header.ttl <= 1) { Loading Loading @@ -577,11 +580,11 @@ static void batadv_iv_ogm_forward(struct orig_node *orig_node, if_incoming, 0, batadv_iv_ogm_fwd_send_time()); } static void batadv_iv_ogm_schedule(struct hard_iface *hard_iface) static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface) { struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); struct batadv_ogm_packet *batadv_ogm_packet; struct hard_iface *primary_if; struct batadv_hard_iface *primary_if; int vis_server, tt_num_changes = 0; vis_server = atomic_read(&bat_priv->vis_mode); Loading Loading @@ -627,17 +630,17 @@ static void batadv_iv_ogm_schedule(struct hard_iface *hard_iface) } static void batadv_iv_ogm_orig_update(struct bat_priv *bat_priv, struct orig_node *orig_node, batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, struct batadv_orig_node *orig_node, const struct ethhdr *ethhdr, const struct batadv_ogm_packet *batadv_ogm_packet, struct hard_iface *if_incoming, struct batadv_hard_iface *if_incoming, const unsigned char *tt_buff, int is_duplicate) { struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; struct neigh_node *router = NULL; struct orig_node *orig_node_tmp; struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; struct batadv_neigh_node *router = NULL; struct batadv_orig_node *orig_node_tmp; struct hlist_node *node; uint8_t bcast_own_sum_orig, bcast_own_sum_neigh; uint8_t *neigh_addr; Loading Loading @@ -670,7 +673,7 @@ batadv_iv_ogm_orig_update(struct bat_priv *bat_priv, } if (!neigh_node) { struct orig_node *orig_tmp; struct batadv_orig_node *orig_tmp; orig_tmp = batadv_get_orig_node(bat_priv, ethhdr->h_source); if (!orig_tmp) Loading Loading @@ -775,13 +778,13 @@ batadv_iv_ogm_orig_update(struct bat_priv *bat_priv, batadv_neigh_node_free_ref(router); } static int batadv_iv_ogm_calc_tq(struct orig_node *orig_node, struct orig_node *orig_neigh_node, static int batadv_iv_ogm_calc_tq(struct batadv_orig_node *orig_node, struct batadv_orig_node *orig_neigh_node, struct batadv_ogm_packet *batadv_ogm_packet, struct hard_iface *if_incoming) struct batadv_hard_iface *if_incoming) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct neigh_node *neigh_node = NULL, *tmp_neigh_node; struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node; struct hlist_node *node; uint8_t total_count; uint8_t orig_eq_count, neigh_rq_count, neigh_rq_inv, tq_own; Loading Loading @@ -895,11 +898,11 @@ static int batadv_iv_ogm_calc_tq(struct orig_node *orig_node, static int batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, const struct batadv_ogm_packet *batadv_ogm_packet, const struct hard_iface *if_incoming) const struct batadv_hard_iface *if_incoming) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct orig_node *orig_node; struct neigh_node *tmp_neigh_node; struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_orig_node *orig_node; struct batadv_neigh_node *tmp_neigh_node; struct hlist_node *node; int is_duplicate = 0; int32_t seq_diff; Loading Loading @@ -965,13 +968,13 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, struct batadv_ogm_packet *batadv_ogm_packet, const unsigned char *tt_buff, struct hard_iface *if_incoming) struct batadv_hard_iface *if_incoming) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct hard_iface *hard_iface; struct orig_node *orig_neigh_node, *orig_node; struct neigh_node *router = NULL, *router_router = NULL; struct neigh_node *orig_neigh_router = NULL; struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_hard_iface *hard_iface; struct batadv_orig_node *orig_neigh_node, *orig_node; struct batadv_neigh_node *router = NULL, *router_router = NULL; struct batadv_neigh_node *orig_neigh_router = NULL; int has_directlink_flag; int is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0; int is_broadcast = 0, is_bidirect; Loading Loading @@ -1240,9 +1243,9 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, } static int batadv_iv_ogm_receive(struct sk_buff *skb, struct hard_iface *if_incoming) struct batadv_hard_iface *if_incoming) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); struct batadv_ogm_packet *batadv_ogm_packet; struct ethhdr *ethhdr; int buff_pos = 0, packet_len; Loading Loading @@ -1287,7 +1290,7 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb, return NET_RX_SUCCESS; } static struct bat_algo_ops batadv_batman_iv __read_mostly = { static struct batadv_algo_ops batadv_batman_iv __read_mostly = { .name = "BATMAN_IV", .bat_iface_enable = batadv_iv_ogm_iface_enable, .bat_iface_disable = batadv_iv_ogm_iface_disable, Loading
net/batman-adv/bat_sysfs.c +24 −21 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ static struct net_device *batadv_kobj_to_netdev(struct kobject *obj) return to_net_dev(dev); } static struct bat_priv *batadv_kobj_to_batpriv(struct kobject *obj) static struct batadv_priv *batadv_kobj_to_batpriv(struct kobject *obj) { struct net_device *net_dev = batadv_kobj_to_netdev(obj); return netdev_priv(net_dev); Loading Loading @@ -67,7 +67,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ size_t count) \ { \ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ struct bat_priv *bat_priv = netdev_priv(net_dev); \ struct batadv_priv *bat_priv = netdev_priv(net_dev); \ return __batadv_store_bool_attr(buff, count, _post_func, attr, \ &bat_priv->_name, net_dev); \ } Loading @@ -76,7 +76,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ ssize_t batadv_show_##_name(struct kobject *kobj, \ struct attribute *attr, char *buff) \ { \ struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ return sprintf(buff, "%s\n", \ atomic_read(&bat_priv->_name) == 0 ? \ "disabled" : "enabled"); \ Loading @@ -98,7 +98,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ size_t count) \ { \ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ struct bat_priv *bat_priv = netdev_priv(net_dev); \ struct batadv_priv *bat_priv = netdev_priv(net_dev); \ return __batadv_store_uint_attr(buff, count, _min, _max, \ _post_func, attr, \ &bat_priv->_name, net_dev); \ Loading @@ -108,7 +108,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ ssize_t batadv_show_##_name(struct kobject *kobj, \ struct attribute *attr, char *buff) \ { \ struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ return sprintf(buff, "%i\n", atomic_read(&bat_priv->_name)); \ } \ Loading @@ -128,7 +128,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ size_t count) \ { \ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ struct hard_iface *hard_iface; \ struct batadv_hard_iface *hard_iface; \ ssize_t length; \ \ hard_iface = batadv_hardif_get_by_netdev(net_dev); \ Loading @@ -148,7 +148,7 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \ struct attribute *attr, char *buff) \ { \ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ struct hard_iface *hard_iface; \ struct batadv_hard_iface *hard_iface; \ ssize_t length; \ \ hard_iface = batadv_hardif_get_by_netdev(net_dev); \ Loading Loading @@ -281,7 +281,7 @@ __batadv_store_uint_attr(const char *buff, size_t count, static ssize_t batadv_show_vis_mode(struct kobject *kobj, struct attribute *attr, char *buff) { struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); int vis_mode = atomic_read(&bat_priv->vis_mode); const char *mode; Loading @@ -298,7 +298,7 @@ static ssize_t batadv_store_vis_mode(struct kobject *kobj, size_t count) { struct net_device *net_dev = batadv_kobj_to_netdev(kobj); struct bat_priv *bat_priv = netdev_priv(net_dev); struct batadv_priv *bat_priv = netdev_priv(net_dev); unsigned long val; int ret, vis_mode_tmp = -1; const char *old_mode, *new_mode; Loading Loading @@ -349,20 +349,20 @@ static ssize_t batadv_store_vis_mode(struct kobject *kobj, static ssize_t batadv_show_bat_algo(struct kobject *kobj, struct attribute *attr, char *buff) { struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); return sprintf(buff, "%s\n", bat_priv->bat_algo_ops->name); } static void batadv_post_gw_deselect(struct net_device *net_dev) { struct bat_priv *bat_priv = netdev_priv(net_dev); struct batadv_priv *bat_priv = netdev_priv(net_dev); batadv_gw_deselect(bat_priv); } static ssize_t batadv_show_gw_mode(struct kobject *kobj, struct attribute *attr, char *buff) { struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); int bytes_written; switch (atomic_read(&bat_priv->gw_mode)) { Loading @@ -388,7 +388,7 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj, size_t count) { struct net_device *net_dev = batadv_kobj_to_netdev(kobj); struct bat_priv *bat_priv = netdev_priv(net_dev); struct batadv_priv *bat_priv = netdev_priv(net_dev); char *curr_gw_mode_str; int gw_mode_tmp = -1; Loading Loading @@ -440,7 +440,7 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj, static ssize_t batadv_show_gw_bwidth(struct kobject *kobj, struct attribute *attr, char *buff) { struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); int down, up; int gw_bandwidth = atomic_read(&bat_priv->gw_bandwidth); Loading Loading @@ -512,7 +512,7 @@ static struct batadv_attribute *batadv_mesh_attrs[] = { int batadv_sysfs_add_meshif(struct net_device *dev) { struct kobject *batif_kobject = &dev->dev.kobj; struct bat_priv *bat_priv = netdev_priv(dev); struct batadv_priv *bat_priv = netdev_priv(dev); struct batadv_attribute **bat_attr; int err; Loading Loading @@ -549,7 +549,7 @@ int batadv_sysfs_add_meshif(struct net_device *dev) void batadv_sysfs_del_meshif(struct net_device *dev) { struct bat_priv *bat_priv = netdev_priv(dev); struct batadv_priv *bat_priv = netdev_priv(dev); struct batadv_attribute **bat_attr; for (bat_attr = batadv_mesh_attrs; *bat_attr; ++bat_attr) Loading @@ -563,10 +563,11 @@ static ssize_t batadv_show_mesh_iface(struct kobject *kobj, struct attribute *attr, char *buff) { struct net_device *net_dev = batadv_kobj_to_netdev(kobj); struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev); struct batadv_hard_iface *hard_iface; ssize_t length; const char *ifname; hard_iface = batadv_hardif_get_by_netdev(net_dev); if (!hard_iface) return 0; Loading @@ -587,10 +588,11 @@ static ssize_t batadv_store_mesh_iface(struct kobject *kobj, size_t count) { struct net_device *net_dev = batadv_kobj_to_netdev(kobj); struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev); struct batadv_hard_iface *hard_iface; int status_tmp = -1; int ret = count; hard_iface = batadv_hardif_get_by_netdev(net_dev); if (!hard_iface) return count; Loading Loading @@ -643,9 +645,10 @@ static ssize_t batadv_show_iface_status(struct kobject *kobj, struct attribute *attr, char *buff) { struct net_device *net_dev = batadv_kobj_to_netdev(kobj); struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev); struct batadv_hard_iface *hard_iface; ssize_t length; hard_iface = batadv_hardif_get_by_netdev(net_dev); if (!hard_iface) return 0; Loading Loading @@ -723,11 +726,11 @@ void batadv_sysfs_del_hardif(struct kobject **hardif_obj) *hardif_obj = NULL; } int batadv_throw_uevent(struct bat_priv *bat_priv, enum batadv_uev_type type, int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, enum batadv_uev_action action, const char *data) { int ret = -ENOMEM; struct hard_iface *primary_if = NULL; struct batadv_hard_iface *primary_if = NULL; struct kobject *bat_kobj; char *uevent_env[4] = { NULL, NULL, NULL, NULL }; Loading
net/batman-adv/bat_sysfs.h +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ void batadv_sysfs_del_meshif(struct net_device *dev); int batadv_sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev); void batadv_sysfs_del_hardif(struct kobject **hardif_obj); int batadv_throw_uevent(struct bat_priv *bat_priv, enum batadv_uev_type type, int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, enum batadv_uev_action action, const char *data); #endif /* _NET_BATMAN_ADV_SYSFS_H_ */
net/batman-adv/bitarray.c +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ static void batadv_bitmap_shift_left(unsigned long *seq_bits, int32_t n) int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, int32_t seq_num_diff, int set_mark) { struct bat_priv *bat_priv = priv; struct batadv_priv *bat_priv = priv; /* sequence number is slightly older. We already got a sequence number * higher than this one, so we just mark it. Loading