]> git.ipfire.org Git - people/arne_f/kernel.git/blame - net/dccp/ccids/lib/tfrc.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[people/arne_f/kernel.git] / net / dccp / ccids / lib / tfrc.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
c40616c5 2/*
129fa447 3 * TFRC library initialisation
c40616c5
GR
4 *
5 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK
6 * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com>
7 */
d9b93842 8#include <linux/moduleparam.h>
c40616c5
GR
9#include "tfrc.h"
10
11#ifdef CONFIG_IP_DCCP_TFRC_DEBUG
09db3080 12bool tfrc_debug;
157439fa 13module_param(tfrc_debug, bool, 0644);
129fa447 14MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages");
c40616c5
GR
15#endif
16
129fa447 17int __init tfrc_lib_init(void)
c40616c5 18{
954c2db8 19 int rc = tfrc_li_init();
c40616c5 20
df8f83fd
GR
21 if (rc)
22 goto out;
23
24 rc = tfrc_tx_packet_history_init();
25 if (rc)
26 goto out_free_loss_intervals;
c40616c5 27
df8f83fd
GR
28 rc = tfrc_rx_packet_history_init();
29 if (rc)
30 goto out_free_tx_history;
31 return 0;
32
33out_free_tx_history:
34 tfrc_tx_packet_history_exit();
35out_free_loss_intervals:
954c2db8 36 tfrc_li_exit();
df8f83fd 37out:
c40616c5
GR
38 return rc;
39}
40
1b6725de 41void tfrc_lib_exit(void)
c40616c5 42{
df8f83fd
GR
43 tfrc_rx_packet_history_exit();
44 tfrc_tx_packet_history_exit();
954c2db8 45 tfrc_li_exit();
c40616c5 46}