The following commit has been merged in the merge/master branch: commit 4df395ccec21b42b7acc7bfb21f5d56f7b6cf9eb Merge: 6da58e686fec14e87b3d235af493d29b4dff1d3d 17a6a8c33c602fd9b495f5878895449e62361b6f Author: Antonio Quartulli antonio@meshcoding.com Date: Tue Oct 8 08:23:50 2013 +0200
Merge remote-tracking branch 'pkg/next' into merge/master
Conflicts: Documentation/accounting/gateway_common.c Documentation/accounting/gateway_common.h Documentation/accounting/hard-interface.c Documentation/accounting/main.c Documentation/accounting/network-coding.c Documentation/accounting/network-coding.h Documentation/accounting/translation-table.c Documentation/accounting/types.h
diff --combined net/batman-adv/gateway_common.c index 07fd877,b211b0f..b211b0f --- a/net/batman-adv/gateway_common.c +++ b/net/batman-adv/gateway_common.c @@@ -34,9 -34,10 +34,10 @@@ static bool batadv_parse_gw_bandwidth(struct net_device *net_dev, char *buff, uint32_t *down, uint32_t *up) { - int ret, bw_unit_type = BATADV_BW_UNIT_KBIT; + enum batadv_bandwidth_units bw_unit_type = BATADV_BW_UNIT_KBIT; char *slash_ptr, *tmp_ptr; long ldown, lup; + int ret;
slash_ptr = strchr(buff, '/'); if (slash_ptr) @@@ -223,15 -224,12 +224,12 @@@ static void batadv_gw_tvlv_ogm_handler_ /** * batadv_gw_init - initialise the gateway handling internals * @bat_priv: the bat priv with all the soft interface information - * - * Return 0 on success or negative error number in case of failure. */ - int batadv_gw_init(struct batadv_priv *bat_priv) + void batadv_gw_init(struct batadv_priv *bat_priv) { batadv_tvlv_handler_register(bat_priv, batadv_gw_tvlv_ogm_handler_v1, NULL, BATADV_TVLV_GW, 1, BATADV_TVLV_HANDLER_OGM_CIFNOTFND); - return 0; }
/** diff --combined net/batman-adv/gateway_common.h index f18e8b7,56384a4..56384a4 --- a/net/batman-adv/gateway_common.h +++ b/net/batman-adv/gateway_common.h @@@ -31,7 -31,7 +31,7 @@@ enum batadv_gw_modes * @BATADV_BW_UNIT_KBIT: unit type kbit * @BATADV_BW_UNIT_MBIT: unit type mbit */ - enum batadv_bandwidth_types { + enum batadv_bandwidth_units { BATADV_BW_UNIT_KBIT, BATADV_BW_UNIT_MBIT, }; @@@ -43,7 -43,7 +43,7 @@@ ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff, size_t count); void batadv_gw_tvlv_container_update(struct batadv_priv *bat_priv); - int batadv_gw_init(struct batadv_priv *bat_priv); + void batadv_gw_init(struct batadv_priv *bat_priv); void batadv_gw_free(struct batadv_priv *bat_priv);
#endif /* _NET_BATMAN_ADV_GATEWAY_COMMON_H_ */ diff --combined net/batman-adv/main.c index 5c5e64b,c51a5e5..c51a5e5 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c @@@ -66,6 -66,7 +66,7 @@@ static int __init batadv_init(void batadv_recv_handler_init();
batadv_iv_init(); + batadv_nc_init();
batadv_event_workqueue = create_singlethread_workqueue("bat_events");
@@@ -141,13 -142,11 +142,11 @@@ int batadv_mesh_init(struct net_device if (ret < 0) goto err;
- ret = batadv_nc_init(bat_priv); + ret = batadv_nc_mesh_init(bat_priv); if (ret < 0) goto err;
- ret = batadv_gw_init(bat_priv); - if (ret < 0) - goto err; + batadv_gw_init(bat_priv);
atomic_set(&bat_priv->gw.reselect, 0); atomic_set(&bat_priv->mesh_state, BATADV_MESH_ACTIVE); @@@ -168,7 -167,7 +167,7 @@@ void batadv_mesh_free(struct net_devic batadv_purge_outstanding_packets(bat_priv, NULL);
batadv_gw_node_purge(bat_priv); - batadv_nc_free(bat_priv); + batadv_nc_mesh_free(bat_priv); batadv_dat_free(bat_priv); batadv_bla_free(bat_priv);
@@@ -1014,10 -1013,10 +1013,10 @@@ void batadv_tvlv_ogm_receive(struct bat * payload * @bat_priv: the bat priv with all the soft interface information * @optr: ogm tvlv handler callback function. This function receives the orig - * node, flags and the tvlv content as argument to process. - * uptr: unicast tvlv handler callback function. This function receives the - * source & destination of the unicast packet as well as the tvlv content - * to process. + * node, flags and the tvlv content as argument to process. + * @uptr: unicast tvlv handler callback function. This function receives the + * source & destination of the unicast packet as well as the tvlv content + * to process. * @type: tvlv handler type to be registered * @version: tvlv handler version to be registered * @flags: flags to enable or disable TVLV API behavior diff --combined net/batman-adv/network-coding.c index 173a96e,351e199..351e199 --- a/net/batman-adv/network-coding.c +++ b/net/batman-adv/network-coding.c @@@ -35,6 -35,20 +35,20 @@@ static int batadv_nc_recv_coded_packet( struct batadv_hard_iface *recv_if);
/** + * batadv_nc_init - one-time initialization for network coding + */ + int __init batadv_nc_init(void) + { + int ret; + + /* Register our packet type */ + ret = batadv_recv_handler_register(BATADV_CODED, + batadv_nc_recv_coded_packet); + + return ret; + } + + /** * batadv_nc_start_timer - initialise the nc periodic worker * @bat_priv: the bat priv with all the soft interface information */ @@@ -98,10 -112,10 +112,10 @@@ static void batadv_nc_tvlv_ogm_handler_ }
/** - * batadv_nc_init - initialise coding hash table and start house keeping + * batadv_nc_mesh_init - initialise coding hash table and start house keeping * @bat_priv: the bat priv with all the soft interface information */ - int batadv_nc_init(struct batadv_priv *bat_priv) + int batadv_nc_mesh_init(struct batadv_priv *bat_priv) { bat_priv->nc.timestamp_fwd_flush = jiffies; bat_priv->nc.timestamp_sniffed_purge = jiffies; @@@ -123,11 -137,6 +137,6 @@@ batadv_hash_set_lock_class(bat_priv->nc.coding_hash, &batadv_nc_decoding_hash_lock_class_key);
- /* Register our packet type */ - if (batadv_recv_handler_register(BATADV_CODED, - batadv_nc_recv_coded_packet) < 0) - goto err; - INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker); batadv_nc_start_timer(bat_priv);
@@@ -1784,12 -1793,11 +1793,11 @@@ free_nc_packet }
/** - * batadv_nc_free - clean up network coding memory + * batadv_nc_mesh_free - clean up network coding memory * @bat_priv: the bat priv with all the soft interface information */ - void batadv_nc_free(struct batadv_priv *bat_priv) + void batadv_nc_mesh_free(struct batadv_priv *bat_priv) { - batadv_recv_handler_unregister(BATADV_CODED); batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_NC, 1); batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_NC, 1); cancel_delayed_work_sync(&bat_priv->nc.work); diff --combined net/batman-adv/network-coding.h index 8a97b40,d4fd315..d4fd315 --- a/net/batman-adv/network-coding.h +++ b/net/batman-adv/network-coding.h @@@ -23,8 -23,9 +23,9 @@@ #ifdef CONFIG_BATMAN_ADV_NC
void batadv_nc_status_update(struct net_device *net_dev); - int batadv_nc_init(struct batadv_priv *bat_priv); - void batadv_nc_free(struct batadv_priv *bat_priv); + int batadv_nc_init(void); + int batadv_nc_mesh_init(struct batadv_priv *bat_priv); + void batadv_nc_mesh_free(struct batadv_priv *bat_priv); void batadv_nc_update_nc_node(struct batadv_priv *bat_priv, struct batadv_orig_node *orig_node, struct batadv_orig_node *orig_neigh_node, @@@ -49,15 -50,19 +50,19 @@@ int batadv_nc_init_debugfs(struct batad
static inline void batadv_nc_status_update(struct net_device *net_dev) { - return; }
- static inline int batadv_nc_init(struct batadv_priv *bat_priv) + static inline int batadv_nc_init(void) + { + return 0; + } + + static inline int batadv_nc_mesh_init(struct batadv_priv *bat_priv) { return 0; }
- static inline void batadv_nc_free(struct batadv_priv *bat_priv) + static inline void batadv_nc_mesh_free(struct batadv_priv *bat_priv) { return; } diff --combined net/batman-adv/translation-table.c index 1198aea,d1840dd..d1840dd --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@@ -2729,7 -2729,7 +2729,7 @@@ out }
/** - * batadv_dat_status_update - process incoming tt reply + * batadv_handle_tt_response - process incoming tt reply * @bat_priv: the bat priv with all the soft interface information * @tt_data: tt data containing the tt request information * @resp_src: mac address of tt reply sender diff --combined net/batman-adv/types.h index f323822,04b6b0b..04b6b0b --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h @@@ -246,8 -246,8 +246,8 @@@ struct batadv_orig_node * @BATADV_ORIG_CAPA_HAS_NC: orig node has network coding enabled */ enum batadv_orig_capabilities { - BATADV_ORIG_CAPA_HAS_DAT = BIT(1), - BATADV_ORIG_CAPA_HAS_NC = BIT(2), + BATADV_ORIG_CAPA_HAS_DAT = BIT(0), + BATADV_ORIG_CAPA_HAS_NC = BIT(1), };
/**