tfrc.c 847 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * TFRC library initialisation
  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/moduleparam.h>
  8. #include "tfrc.h"
  9. #ifdef CONFIG_IP_DCCP_TFRC_DEBUG
  10. bool tfrc_debug;
  11. module_param(tfrc_debug, bool, 0644);
  12. MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages");
  13. #endif
  14. int __init tfrc_lib_init(void)
  15. {
  16. int rc = tfrc_li_init();
  17. if (rc)
  18. goto out;
  19. rc = tfrc_tx_packet_history_init();
  20. if (rc)
  21. goto out_free_loss_intervals;
  22. rc = tfrc_rx_packet_history_init();
  23. if (rc)
  24. goto out_free_tx_history;
  25. return 0;
  26. out_free_tx_history:
  27. tfrc_tx_packet_history_exit();
  28. out_free_loss_intervals:
  29. tfrc_li_exit();
  30. out:
  31. return rc;
  32. }
  33. void tfrc_lib_exit(void)
  34. {
  35. tfrc_rx_packet_history_exit();
  36. tfrc_tx_packet_history_exit();
  37. tfrc_li_exit();
  38. }