blob: d1dfbb8de64ce0c26d0698e1868ba1b4b23e42f1 [file] [log] [blame]
Gerrit Renkerc40616c2007-12-06 12:26:38 -02001/*
2 * TFRC: main module holding the pieces of the TFRC library together
3 *
4 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK
5 * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com>
6 */
7#include <linux/module.h>
8#include <linux/moduleparam.h>
9#include "tfrc.h"
10
11#ifdef CONFIG_IP_DCCP_TFRC_DEBUG
12int tfrc_debug;
13module_param(tfrc_debug, bool, 0444);
14MODULE_PARM_DESC(tfrc_debug, "Enable debug messages");
15#endif
16
Gerrit Renkerdf8f83f2007-12-12 12:24:49 -020017extern int tfrc_tx_packet_history_init(void);
18extern void tfrc_tx_packet_history_exit(void);
19extern int tfrc_rx_packet_history_init(void);
20extern void tfrc_rx_packet_history_exit(void);
21
Gerrit Renker954c2db2007-12-12 14:06:14 -020022extern int tfrc_li_init(void);
23extern void tfrc_li_exit(void);
Gerrit Renkerc40616c2007-12-06 12:26:38 -020024
25static int __init tfrc_module_init(void)
26{
Gerrit Renker954c2db2007-12-12 14:06:14 -020027 int rc = tfrc_li_init();
Gerrit Renkerc40616c2007-12-06 12:26:38 -020028
Gerrit Renkerdf8f83f2007-12-12 12:24:49 -020029 if (rc)
30 goto out;
Gerrit Renkerc40616c2007-12-06 12:26:38 -020031
Gerrit Renkerdf8f83f2007-12-12 12:24:49 -020032 rc = tfrc_tx_packet_history_init();
33 if (rc)
34 goto out_free_loss_intervals;
35
36 rc = tfrc_rx_packet_history_init();
37 if (rc)
38 goto out_free_tx_history;
39 return 0;
40
41out_free_tx_history:
42 tfrc_tx_packet_history_exit();
43out_free_loss_intervals:
Gerrit Renker954c2db2007-12-12 14:06:14 -020044 tfrc_li_exit();
Gerrit Renkerdf8f83f2007-12-12 12:24:49 -020045out:
Gerrit Renkerc40616c2007-12-06 12:26:38 -020046 return rc;
47}
48
49static void __exit tfrc_module_exit(void)
50{
Gerrit Renkerdf8f83f2007-12-12 12:24:49 -020051 tfrc_rx_packet_history_exit();
52 tfrc_tx_packet_history_exit();
Gerrit Renker954c2db2007-12-12 14:06:14 -020053 tfrc_li_exit();
Gerrit Renkerc40616c2007-12-06 12:26:38 -020054}
55
56module_init(tfrc_module_init);
57module_exit(tfrc_module_exit);
58
59MODULE_AUTHOR("Gerrit Renker <gerrit@erg.abdn.ac.uk>, "
60 "Ian McDonald <ian.mcdonald@jandi.co.nz>, "
61 "Arnaldo Carvalho de Melo <acme@redhat.com>");
62MODULE_DESCRIPTION("DCCP TFRC library");
63MODULE_LICENSE("GPL");