Loading net/batman-adv/aggregation.c +4 −4 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet, int packet_len, unsigned long send_time, bool directlink, struct batman_if *if_incoming, struct hard_iface *if_incoming, struct forw_packet *forw_packet) { struct batman_packet *batman_packet = Loading Loading @@ -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 */ static void new_aggregated_packet(unsigned char *packet_buff, int packet_len, unsigned long send_time, bool direct_link, struct batman_if *if_incoming, struct hard_iface *if_incoming, int own_packet) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); Loading Loading @@ -188,7 +188,7 @@ static void aggregate(struct forw_packet *forw_packet_aggr, void add_bat_packet_to_list(struct bat_priv *bat_priv, 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) { /** Loading Loading @@ -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 */ 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; int buff_pos = 0; Loading net/batman-adv/aggregation.h +2 −2 Original line number Diff line number Diff line Loading @@ -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, 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); 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_ */ net/batman-adv/bat_sysfs.c +22 −19 Original line number Diff line number Diff line Loading @@ -441,16 +441,16 @@ static ssize_t show_mesh_iface(struct kobject *kobj, struct attribute *attr, char *buff) { 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; if (!batman_if) if (!hard_iface) return 0; length = sprintf(buff, "%s\n", batman_if->if_status == IF_NOT_IN_USE ? "none" : batman_if->soft_iface->name); length = sprintf(buff, "%s\n", hard_iface->if_status == IF_NOT_IN_USE ? "none" : hard_iface->soft_iface->name); hardif_free_ref(batman_if); hardif_free_ref(hard_iface); return length; } Loading @@ -459,11 +459,11 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, char *buff, size_t count) { 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 ret = count; if (!batman_if) if (!hard_iface) return count; if (buff[count - 1] == '\n') Loading @@ -472,7 +472,7 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, if (strlen(buff) >= IFNAMSIZ) { pr_err("Invalid parameter for 'mesh_iface' setting received: " "interface name too long '%s'\n", buff); hardif_free_ref(batman_if); hardif_free_ref(hard_iface); return -EINVAL; } Loading @@ -481,28 +481,31 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, else status_tmp = IF_I_WANT_YOU; if ((batman_if->if_status == status_tmp) || ((batman_if->soft_iface) && (strncmp(batman_if->soft_iface->name, buff, IFNAMSIZ) == 0))) if (hard_iface->if_status == status_tmp) goto out; if ((hard_iface->soft_iface) && (strncmp(hard_iface->soft_iface->name, buff, IFNAMSIZ) == 0)) goto out; if (status_tmp == IF_NOT_IN_USE) { rtnl_lock(); hardif_disable_interface(batman_if); hardif_disable_interface(hard_iface); rtnl_unlock(); goto out; } /* 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(); hardif_disable_interface(batman_if); hardif_disable_interface(hard_iface); rtnl_unlock(); } ret = hardif_enable_interface(batman_if, buff); ret = hardif_enable_interface(hard_iface, buff); out: hardif_free_ref(batman_if); hardif_free_ref(hard_iface); return ret; } Loading @@ -510,13 +513,13 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr, char *buff) { 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; if (!batman_if) if (!hard_iface) return 0; switch (batman_if->if_status) { switch (hard_iface->if_status) { case IF_TO_BE_REMOVED: length = sprintf(buff, "disabling\n"); break; Loading @@ -535,7 +538,7 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr, break; } hardif_free_ref(batman_if); hardif_free_ref(hard_iface); return length; } Loading Loading
net/batman-adv/aggregation.c +4 −4 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet, int packet_len, unsigned long send_time, bool directlink, struct batman_if *if_incoming, struct hard_iface *if_incoming, struct forw_packet *forw_packet) { struct batman_packet *batman_packet = Loading Loading @@ -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 */ static void new_aggregated_packet(unsigned char *packet_buff, int packet_len, unsigned long send_time, bool direct_link, struct batman_if *if_incoming, struct hard_iface *if_incoming, int own_packet) { struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); Loading Loading @@ -188,7 +188,7 @@ static void aggregate(struct forw_packet *forw_packet_aggr, void add_bat_packet_to_list(struct bat_priv *bat_priv, 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) { /** Loading Loading @@ -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 */ 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; int buff_pos = 0; Loading
net/batman-adv/aggregation.h +2 −2 Original line number Diff line number Diff line Loading @@ -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, 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); 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_ */
net/batman-adv/bat_sysfs.c +22 −19 Original line number Diff line number Diff line Loading @@ -441,16 +441,16 @@ static ssize_t show_mesh_iface(struct kobject *kobj, struct attribute *attr, char *buff) { 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; if (!batman_if) if (!hard_iface) return 0; length = sprintf(buff, "%s\n", batman_if->if_status == IF_NOT_IN_USE ? "none" : batman_if->soft_iface->name); length = sprintf(buff, "%s\n", hard_iface->if_status == IF_NOT_IN_USE ? "none" : hard_iface->soft_iface->name); hardif_free_ref(batman_if); hardif_free_ref(hard_iface); return length; } Loading @@ -459,11 +459,11 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, char *buff, size_t count) { 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 ret = count; if (!batman_if) if (!hard_iface) return count; if (buff[count - 1] == '\n') Loading @@ -472,7 +472,7 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, if (strlen(buff) >= IFNAMSIZ) { pr_err("Invalid parameter for 'mesh_iface' setting received: " "interface name too long '%s'\n", buff); hardif_free_ref(batman_if); hardif_free_ref(hard_iface); return -EINVAL; } Loading @@ -481,28 +481,31 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, else status_tmp = IF_I_WANT_YOU; if ((batman_if->if_status == status_tmp) || ((batman_if->soft_iface) && (strncmp(batman_if->soft_iface->name, buff, IFNAMSIZ) == 0))) if (hard_iface->if_status == status_tmp) goto out; if ((hard_iface->soft_iface) && (strncmp(hard_iface->soft_iface->name, buff, IFNAMSIZ) == 0)) goto out; if (status_tmp == IF_NOT_IN_USE) { rtnl_lock(); hardif_disable_interface(batman_if); hardif_disable_interface(hard_iface); rtnl_unlock(); goto out; } /* 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(); hardif_disable_interface(batman_if); hardif_disable_interface(hard_iface); rtnl_unlock(); } ret = hardif_enable_interface(batman_if, buff); ret = hardif_enable_interface(hard_iface, buff); out: hardif_free_ref(batman_if); hardif_free_ref(hard_iface); return ret; } Loading @@ -510,13 +513,13 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr, char *buff) { 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; if (!batman_if) if (!hard_iface) return 0; switch (batman_if->if_status) { switch (hard_iface->if_status) { case IF_TO_BE_REMOVED: length = sprintf(buff, "disabling\n"); break; Loading @@ -535,7 +538,7 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr, break; } hardif_free_ref(batman_if); hardif_free_ref(hard_iface); return length; } Loading