Commit | Line | Data |
---|---|---|
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 | */ | |
c40616c5 GR |
7 | #include "tfrc.h" |
8 | ||
9 | #ifdef CONFIG_IP_DCCP_TFRC_DEBUG | |
10 | int tfrc_debug; | |
157439fa | 11 | module_param(tfrc_debug, bool, 0644); |
129fa447 | 12 | MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages"); |
c40616c5 GR |
13 | #endif |
14 | ||
129fa447 | 15 | int __init tfrc_lib_init(void) |
c40616c5 | 16 | { |
954c2db8 | 17 | int rc = tfrc_li_init(); |
c40616c5 | 18 | |
df8f83fd GR |
19 | if (rc) |
20 | goto out; | |
21 | ||
22 | rc = tfrc_tx_packet_history_init(); | |
23 | if (rc) | |
24 | goto out_free_loss_intervals; | |
c40616c5 | 25 | |
df8f83fd GR |
26 | rc = tfrc_rx_packet_history_init(); |
27 | if (rc) | |
28 | goto out_free_tx_history; | |
29 | return 0; | |
30 | ||
31 | out_free_tx_history: | |
32 | tfrc_tx_packet_history_exit(); | |
33 | out_free_loss_intervals: | |
954c2db8 | 34 | tfrc_li_exit(); |
df8f83fd | 35 | out: |
c40616c5 GR |
36 | return rc; |
37 | } | |
38 | ||
129fa447 | 39 | void __exit tfrc_lib_exit(void) |
c40616c5 | 40 | { |
df8f83fd GR |
41 | tfrc_rx_packet_history_exit(); |
42 | tfrc_tx_packet_history_exit(); | |
954c2db8 | 43 | tfrc_li_exit(); |
c40616c5 | 44 | } |