]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - net/dccp/ccids/lib/tfrc.c
net: add moduleparam.h for users of module_param/MODULE_PARM_DESC
[mirror_ubuntu-bionic-kernel.git] / net / dccp / ccids / lib / tfrc.c
CommitLineData
c40616c5 1/*
129fa447 2 * TFRC library initialisation
c40616c5
GR
3 *
4 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK
5 * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com>
6 */
d9b93842 7#include <linux/moduleparam.h>
c40616c5
GR
8#include "tfrc.h"
9
10#ifdef CONFIG_IP_DCCP_TFRC_DEBUG
11int tfrc_debug;
157439fa 12module_param(tfrc_debug, bool, 0644);
129fa447 13MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages");
c40616c5
GR
14#endif
15
129fa447 16int __init tfrc_lib_init(void)
c40616c5 17{
954c2db8 18 int rc = tfrc_li_init();
c40616c5 19
df8f83fd
GR
20 if (rc)
21 goto out;
22
23 rc = tfrc_tx_packet_history_init();
24 if (rc)
25 goto out_free_loss_intervals;
c40616c5 26
df8f83fd
GR
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:
954c2db8 35 tfrc_li_exit();
df8f83fd 36out:
c40616c5
GR
37 return rc;
38}
39
1b6725de 40void tfrc_lib_exit(void)
c40616c5 41{
df8f83fd
GR
42 tfrc_rx_packet_history_exit();
43 tfrc_tx_packet_history_exit();
954c2db8 44 tfrc_li_exit();
c40616c5 45}