Commit | Line | Data |
---|---|---|
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 | 12 | bool tfrc_debug; |
157439fa | 13 | module_param(tfrc_debug, bool, 0644); |
129fa447 | 14 | MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages"); |
c40616c5 GR |
15 | #endif |
16 | ||
129fa447 | 17 | int __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 | ||
33 | out_free_tx_history: | |
34 | tfrc_tx_packet_history_exit(); | |
35 | out_free_loss_intervals: | |
954c2db8 | 36 | tfrc_li_exit(); |
df8f83fd | 37 | out: |
c40616c5 GR |
38 | return rc; |
39 | } | |
40 | ||
1b6725de | 41 | void 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 | } |