Linux 5.7.7
[linux/fpc-iii.git] / net / dccp / ccids / lib / tfrc.c
blobd7f265e1f50c85e8e59d0668e786f9f21d5c36c6
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * TFRC library initialisation
5 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK
6 * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com>
7 */
8 #include <linux/moduleparam.h>
9 #include "tfrc.h"
11 #ifdef CONFIG_IP_DCCP_TFRC_DEBUG
12 bool tfrc_debug;
13 module_param(tfrc_debug, bool, 0644);
14 MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages");
15 #endif
17 int __init tfrc_lib_init(void)
19 int rc = tfrc_li_init();
21 if (rc)
22 goto out;
24 rc = tfrc_tx_packet_history_init();
25 if (rc)
26 goto out_free_loss_intervals;
28 rc = tfrc_rx_packet_history_init();
29 if (rc)
30 goto out_free_tx_history;
31 return 0;
33 out_free_tx_history:
34 tfrc_tx_packet_history_exit();
35 out_free_loss_intervals:
36 tfrc_li_exit();
37 out:
38 return rc;
41 void tfrc_lib_exit(void)
43 tfrc_rx_packet_history_exit();
44 tfrc_tx_packet_history_exit();
45 tfrc_li_exit();