Linux Audio

Check our new training course

Loading...
v3.1
 1/*
 2 * TFRC library initialisation
 3 *
 4 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK
 5 * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com>
 6 */
 
 7#include "tfrc.h"
 8
 9#ifdef CONFIG_IP_DCCP_TFRC_DEBUG
10int tfrc_debug;
11module_param(tfrc_debug, bool, 0644);
12MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages");
13#endif
14
15int __init tfrc_lib_init(void)
16{
17	int rc = tfrc_li_init();
18
19	if (rc)
20		goto out;
21
22	rc = tfrc_tx_packet_history_init();
23	if (rc)
24		goto out_free_loss_intervals;
25
26	rc = tfrc_rx_packet_history_init();
27	if (rc)
28		goto out_free_tx_history;
29	return 0;
30
31out_free_tx_history:
32	tfrc_tx_packet_history_exit();
33out_free_loss_intervals:
34	tfrc_li_exit();
35out:
36	return rc;
37}
38
39void tfrc_lib_exit(void)
40{
41	tfrc_rx_packet_history_exit();
42	tfrc_tx_packet_history_exit();
43	tfrc_li_exit();
44}
v4.6
 1/*
 2 * TFRC library initialisation
 3 *
 4 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK
 5 * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com>
 6 */
 7#include <linux/moduleparam.h>
 8#include "tfrc.h"
 9
10#ifdef CONFIG_IP_DCCP_TFRC_DEBUG
11bool tfrc_debug;
12module_param(tfrc_debug, bool, 0644);
13MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages");
14#endif
15
16int __init tfrc_lib_init(void)
17{
18	int rc = tfrc_li_init();
19
20	if (rc)
21		goto out;
22
23	rc = tfrc_tx_packet_history_init();
24	if (rc)
25		goto out_free_loss_intervals;
26
27	rc = tfrc_rx_packet_history_init();
28	if (rc)
29		goto out_free_tx_history;
30	return 0;
31
32out_free_tx_history:
33	tfrc_tx_packet_history_exit();
34out_free_loss_intervals:
35	tfrc_li_exit();
36out:
37	return rc;
38}
39
40void tfrc_lib_exit(void)
41{
42	tfrc_rx_packet_history_exit();
43	tfrc_tx_packet_history_exit();
44	tfrc_li_exit();
45}