mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 04:34:11 +08:00
93e6d5ab99
These routines are for the libfc kernel module and should be in the libfc .c file. Moving the libfc __init routine into fc_libfc.c caused the creation of the fc_setup_fcp() and fc_destroy_fcp() routines so that scsi_pkt_cachep was not exposed outside of fc_fcp.c. Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
75 lines
1.7 KiB
C
75 lines
1.7 KiB
C
/*
|
|
* Copyright(c) 2009 Intel Corporation. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms and conditions of the GNU General Public License,
|
|
* version 2, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along with
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*
|
|
* Maintained at www.Open-FCoE.org
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/types.h>
|
|
#include <linux/scatterlist.h>
|
|
#include <linux/crc32.h>
|
|
|
|
#include <scsi/libfc.h>
|
|
|
|
#include "fc_libfc.h"
|
|
|
|
MODULE_AUTHOR("Open-FCoE.org");
|
|
MODULE_DESCRIPTION("libfc");
|
|
MODULE_LICENSE("GPL v2");
|
|
|
|
unsigned int fc_debug_logging;
|
|
module_param_named(debug_logging, fc_debug_logging, int, S_IRUGO|S_IWUSR);
|
|
MODULE_PARM_DESC(debug_logging, "a bit mask of logging levels");
|
|
|
|
/**
|
|
* libfc_init() - Initialize libfc.ko
|
|
*/
|
|
static int __init libfc_init(void)
|
|
{
|
|
int rc = 0;
|
|
|
|
rc = fc_setup_fcp();
|
|
if (rc)
|
|
return rc;
|
|
|
|
rc = fc_setup_exch_mgr();
|
|
if (rc)
|
|
goto destroy_pkt_cache;
|
|
|
|
rc = fc_setup_rport();
|
|
if (rc)
|
|
goto destroy_em;
|
|
|
|
return rc;
|
|
destroy_em:
|
|
fc_destroy_exch_mgr();
|
|
destroy_pkt_cache:
|
|
fc_destroy_fcp();
|
|
return rc;
|
|
}
|
|
module_init(libfc_init);
|
|
|
|
/**
|
|
* libfc_exit() - Tear down libfc.ko
|
|
*/
|
|
static void __exit libfc_exit(void)
|
|
{
|
|
fc_destroy_fcp();
|
|
fc_destroy_exch_mgr();
|
|
fc_destroy_rport();
|
|
}
|
|
module_exit(libfc_exit);
|