blob: 01418ae8cb849eca4c75fa3e5937afc008a5d50e [file] [log] [blame]
Robert Love8866a5d2009-11-03 11:45:58 -08001/*
2 * Copyright(c) 2009 Intel Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16 *
17 * Maintained at www.Open-FCoE.org
18 */
19
20#include <linux/kernel.h>
21#include <linux/types.h>
22#include <linux/scatterlist.h>
23#include <linux/crc32.h>
24
25#include <scsi/libfc.h>
26
27#include "fc_libfc.h"
28
29MODULE_AUTHOR("Open-FCoE.org");
30MODULE_DESCRIPTION("libfc");
31MODULE_LICENSE("GPL v2");
32
33unsigned int fc_debug_logging;
34module_param_named(debug_logging, fc_debug_logging, int, S_IRUGO|S_IWUSR);
35MODULE_PARM_DESC(debug_logging, "a bit mask of logging levels");
Robert Love93e6d5a2009-11-03 11:46:03 -080036
37/**
38 * libfc_init() - Initialize libfc.ko
39 */
40static int __init libfc_init(void)
41{
42 int rc = 0;
43
44 rc = fc_setup_fcp();
45 if (rc)
46 return rc;
47
48 rc = fc_setup_exch_mgr();
49 if (rc)
50 goto destroy_pkt_cache;
51
52 rc = fc_setup_rport();
53 if (rc)
54 goto destroy_em;
55
56 return rc;
57destroy_em:
58 fc_destroy_exch_mgr();
59destroy_pkt_cache:
60 fc_destroy_fcp();
61 return rc;
62}
63module_init(libfc_init);
64
65/**
66 * libfc_exit() - Tear down libfc.ko
67 */
68static void __exit libfc_exit(void)
69{
70 fc_destroy_fcp();
71 fc_destroy_exch_mgr();
72 fc_destroy_rport();
73}
74module_exit(libfc_exit);