hsr_main.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * hsr_main.c: hsr initialization code. This is moved from
  3. * hsr_prp_main.c
  4. *
  5. * Copyright (C) 2017 Texas Instruments Incorporated
  6. * Copyright 2011-2014 Autronica Fire and Security AS
  7. *
  8. * Author(s):
  9. * 2011-2014 Arvid Brodin, arvid.brodin@alten.se
  10. * Murali Karicheri <m-karicheri2@ti.com?
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License as
  14. * published by the Free Software Foundation version 2.
  15. *
  16. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  17. * kind, whether express or implied; without even the implied warranty
  18. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. */
  21. #include <linux/netdevice.h>
  22. #include "hsr_prp_main.h"
  23. #include "hsr_netlink.h"
  24. static int __init hsr_init(void)
  25. {
  26. int res;
  27. BUILD_BUG_ON(sizeof(struct hsr_tag) != HSR_PRP_HLEN);
  28. res = hsr_prp_register_notifier(HSR);
  29. if (!res)
  30. res = hsr_netlink_init();
  31. return res;
  32. }
  33. static void __exit hsr_exit(void)
  34. {
  35. hsr_prp_unregister_notifier(HSR);
  36. hsr_netlink_exit();
  37. }
  38. module_init(hsr_init);
  39. MODULE_LICENSE("GPL");