zcrypt_mono.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * linux/drivers/s390/crypto/zcrypt_mono.c
  3. *
  4. * zcrypt 2.1.0
  5. *
  6. * Copyright (C) 2001, 2006 IBM Corporation
  7. * Author(s): Robert Burroughs
  8. * Eric Rossman (edrossma@us.ibm.com)
  9. *
  10. * Hotplug & misc device support: Jochen Roehrig (roehrig@de.ibm.com)
  11. * Major cleanup & driver split: Martin Schwidefsky <schwidefsky@de.ibm.com>
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation; either version 2, or (at your option)
  16. * any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, write to the Free Software
  25. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26. */
  27. #include <linux/module.h>
  28. #include <linux/init.h>
  29. #include <linux/interrupt.h>
  30. #include <linux/miscdevice.h>
  31. #include <linux/fs.h>
  32. #include <linux/proc_fs.h>
  33. #include <linux/compat.h>
  34. #include <asm/atomic.h>
  35. #include <asm/uaccess.h>
  36. #include "ap_bus.h"
  37. #include "zcrypt_api.h"
  38. #include "zcrypt_pcica.h"
  39. #include "zcrypt_pcicc.h"
  40. #include "zcrypt_pcixcc.h"
  41. #include "zcrypt_cex2a.h"
  42. /**
  43. * The module initialization code.
  44. */
  45. static int __init zcrypt_init(void)
  46. {
  47. int rc;
  48. rc = ap_module_init();
  49. if (rc)
  50. goto out;
  51. rc = zcrypt_api_init();
  52. if (rc)
  53. goto out_ap;
  54. rc = zcrypt_pcica_init();
  55. if (rc)
  56. goto out_api;
  57. rc = zcrypt_pcicc_init();
  58. if (rc)
  59. goto out_pcica;
  60. rc = zcrypt_pcixcc_init();
  61. if (rc)
  62. goto out_pcicc;
  63. rc = zcrypt_cex2a_init();
  64. if (rc)
  65. goto out_pcixcc;
  66. return 0;
  67. out_pcixcc:
  68. zcrypt_pcixcc_exit();
  69. out_pcicc:
  70. zcrypt_pcicc_exit();
  71. out_pcica:
  72. zcrypt_pcica_exit();
  73. out_api:
  74. zcrypt_api_exit();
  75. out_ap:
  76. ap_module_exit();
  77. out:
  78. return rc;
  79. }
  80. /**
  81. * The module termination code.
  82. */
  83. static void __exit zcrypt_exit(void)
  84. {
  85. zcrypt_cex2a_exit();
  86. zcrypt_pcixcc_exit();
  87. zcrypt_pcicc_exit();
  88. zcrypt_pcica_exit();
  89. zcrypt_api_exit();
  90. ap_module_exit();
  91. }
  92. module_init(zcrypt_init);
  93. module_exit(zcrypt_exit);