Gerrit Renker | c40616c | 2007-12-06 12:26:38 -0200 | [diff] [blame] | 1 | /* |
Gerrit Renker | 129fa44 | 2009-01-04 21:45:33 -0800 | [diff] [blame] | 2 | * TFRC library initialisation |
Gerrit Renker | c40616c | 2007-12-06 12:26:38 -0200 | [diff] [blame] | 3 | * |
4 | * Copyright (c) 2007 The University of Aberdeen, Scotland, UK | ||||
5 | * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com> | ||||
6 | */ | ||||
Paul Gortmaker | d9b9384 | 2011-09-18 13:21:27 -0400 | [diff] [blame] | 7 | #include <linux/moduleparam.h> |
Gerrit Renker | c40616c | 2007-12-06 12:26:38 -0200 | [diff] [blame] | 8 | #include "tfrc.h" |
9 | |||||
10 | #ifdef CONFIG_IP_DCCP_TFRC_DEBUG | ||||
Gerrit Renker | 09db308 | 2014-02-13 19:02:33 -0700 | [diff] [blame] | 11 | bool tfrc_debug; |
Gerrit Renker | 157439f | 2008-08-23 13:28:27 +0200 | [diff] [blame] | 12 | module_param(tfrc_debug, bool, 0644); |
Gerrit Renker | 129fa44 | 2009-01-04 21:45:33 -0800 | [diff] [blame] | 13 | MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages"); |
Gerrit Renker | c40616c | 2007-12-06 12:26:38 -0200 | [diff] [blame] | 14 | #endif |
15 | |||||
Gerrit Renker | 129fa44 | 2009-01-04 21:45:33 -0800 | [diff] [blame] | 16 | int __init tfrc_lib_init(void) |
Gerrit Renker | c40616c | 2007-12-06 12:26:38 -0200 | [diff] [blame] | 17 | { |
Gerrit Renker | 954c2db | 2007-12-12 14:06:14 -0200 | [diff] [blame] | 18 | int rc = tfrc_li_init(); |
Gerrit Renker | c40616c | 2007-12-06 12:26:38 -0200 | [diff] [blame] | 19 | |
Gerrit Renker | df8f83f | 2007-12-12 12:24:49 -0200 | [diff] [blame] | 20 | if (rc) |
21 | goto out; | ||||
Gerrit Renker | c40616c | 2007-12-06 12:26:38 -0200 | [diff] [blame] | 22 | |
Gerrit Renker | df8f83f | 2007-12-12 12:24:49 -0200 | [diff] [blame] | 23 | rc = tfrc_tx_packet_history_init(); |
24 | if (rc) | ||||
25 | goto out_free_loss_intervals; | ||||
26 | |||||
27 | rc = tfrc_rx_packet_history_init(); | ||||
28 | if (rc) | ||||
29 | goto out_free_tx_history; | ||||
30 | return 0; | ||||
31 | |||||
32 | out_free_tx_history: | ||||
33 | tfrc_tx_packet_history_exit(); | ||||
34 | out_free_loss_intervals: | ||||
Gerrit Renker | 954c2db | 2007-12-12 14:06:14 -0200 | [diff] [blame] | 35 | tfrc_li_exit(); |
Gerrit Renker | df8f83f | 2007-12-12 12:24:49 -0200 | [diff] [blame] | 36 | out: |
Gerrit Renker | c40616c | 2007-12-06 12:26:38 -0200 | [diff] [blame] | 37 | return rc; |
38 | } | ||||
39 | |||||
Leonardo Potenza | 1b6725d | 2009-01-09 23:06:28 -0800 | [diff] [blame] | 40 | void tfrc_lib_exit(void) |
Gerrit Renker | c40616c | 2007-12-06 12:26:38 -0200 | [diff] [blame] | 41 | { |
Gerrit Renker | df8f83f | 2007-12-12 12:24:49 -0200 | [diff] [blame] | 42 | tfrc_rx_packet_history_exit(); |
43 | tfrc_tx_packet_history_exit(); | ||||
Gerrit Renker | 954c2db | 2007-12-12 14:06:14 -0200 | [diff] [blame] | 44 | tfrc_li_exit(); |
Gerrit Renker | c40616c | 2007-12-06 12:26:38 -0200 | [diff] [blame] | 45 | } |