Hi Marek
I've not looked into the details yet, just a quick glans. However maybe we should discuss this point:
@@ -249,6 +249,8 @@ static void rebuild_batman_packet(struct batman_if *batman_if)
void schedule_own_packet(struct batman_if *batman_if) {
- /* FIXME: each batman_if will be attached to a softif */
- struct bat_priv *bat_priv = netdev_priv(soft_device); unsigned long send_time; struct batman_packet *batman_packet; int vis_server = atomic_read(&vis_mode);
@@ -289,7 +291,9 @@ void schedule_own_packet(struct batman_if *batman_if) slide_own_bcast_window(batman_if); send_time = own_send_time(); add_bat_packet_to_list(batman_if->packet_buff,
batman_if->packet_len, batman_if, 1, send_time);
batman_if->packet_len,
batman_if, 1, send_time,
&bat_priv->aggregation_enabled);
}
struct bat_priv { struct net_device_stats stats;
- atomic_t aggregation_enabled;
- atomic_t bonding_enabled;
- struct kobject *mesh_obj;
};
With time i expect that bat_priv will gain many more members as global variables are replaced with variables per mesh. Rather than passing to functions a member, pass the pointer and let the function dereference it. I think it will make the APIs neater in the long run.
Andrew