fnic_main.c (03298552cba38f7c805ed338826dc76c405465c7) fnic_main.c (4d7007b49d523d8f954ae047118d82c130f673ce)
1/*
2 * Copyright 2008 Cisco Systems, Inc. All rights reserved.
3 * Copyright 2007 Nuova Systems, Inc. All rights reserved.
4 *
5 * This program is free software; you may redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
8 *

--- 54 unchanged lines hidden (view full) ---

63MODULE_LICENSE("GPL v2");
64MODULE_VERSION(DRV_VERSION);
65MODULE_DEVICE_TABLE(pci, fnic_id_table);
66
67unsigned int fnic_log_level;
68module_param(fnic_log_level, int, S_IRUGO|S_IWUSR);
69MODULE_PARM_DESC(fnic_log_level, "bit mask of fnic logging levels");
70
1/*
2 * Copyright 2008 Cisco Systems, Inc. All rights reserved.
3 * Copyright 2007 Nuova Systems, Inc. All rights reserved.
4 *
5 * This program is free software; you may redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
8 *

--- 54 unchanged lines hidden (view full) ---

63MODULE_LICENSE("GPL v2");
64MODULE_VERSION(DRV_VERSION);
65MODULE_DEVICE_TABLE(pci, fnic_id_table);
66
67unsigned int fnic_log_level;
68module_param(fnic_log_level, int, S_IRUGO|S_IWUSR);
69MODULE_PARM_DESC(fnic_log_level, "bit mask of fnic logging levels");
70
71unsigned int fnic_trace_max_pages = 16;
72module_param(fnic_trace_max_pages, uint, S_IRUGO|S_IWUSR);
73MODULE_PARM_DESC(fnic_trace_max_pages, "Total allocated memory pages "
74 "for fnic trace buffer");
71
72static struct libfc_function_template fnic_transport_template = {
73 .frame_send = fnic_send,
74 .lport_set_port_id = fnic_set_port_id,
75 .fcp_abort_io = fnic_empty_scsi_cleanup,
76 .fcp_cleanup = fnic_empty_scsi_cleanup,
77 .exch_mgr_reset = fnic_exch_mgr_reset
78};

--- 777 unchanged lines hidden (view full) ---

856
857static int __init fnic_init_module(void)
858{
859 size_t len;
860 int err = 0;
861
862 printk(KERN_INFO PFX "%s, ver %s\n", DRV_DESCRIPTION, DRV_VERSION);
863
75
76static struct libfc_function_template fnic_transport_template = {
77 .frame_send = fnic_send,
78 .lport_set_port_id = fnic_set_port_id,
79 .fcp_abort_io = fnic_empty_scsi_cleanup,
80 .fcp_cleanup = fnic_empty_scsi_cleanup,
81 .exch_mgr_reset = fnic_exch_mgr_reset
82};

--- 777 unchanged lines hidden (view full) ---

860
861static int __init fnic_init_module(void)
862{
863 size_t len;
864 int err = 0;
865
866 printk(KERN_INFO PFX "%s, ver %s\n", DRV_DESCRIPTION, DRV_VERSION);
867
868 /* Allocate memory for trace buffer */
869 err = fnic_trace_buf_init();
870 if (err < 0) {
871 printk(KERN_ERR PFX "Trace buffer initialization Failed "
872 "Fnic Tracing utility is disabled\n");
873 fnic_trace_free();
874 }
875
864 /* Create a cache for allocation of default size sgls */
865 len = sizeof(struct fnic_dflt_sgl_list);
866 fnic_sgl_cache[FNIC_SGL_CACHE_DFLT] = kmem_cache_create
867 ("fnic_sgl_dflt", len + FNIC_SG_DESC_ALIGN, FNIC_SG_DESC_ALIGN,
868 SLAB_HWCACHE_ALIGN,
869 NULL);
870 if (!fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]) {
871 printk(KERN_ERR PFX "failed to create fnic dflt sgl slab\n");

--- 54 unchanged lines hidden (view full) ---

926 destroy_workqueue(fnic_event_queue);
927err_create_fnic_workq:
928 kmem_cache_destroy(fnic_io_req_cache);
929err_create_fnic_ioreq_slab:
930 kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_MAX]);
931err_create_fnic_sgl_slab_max:
932 kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]);
933err_create_fnic_sgl_slab_dflt:
876 /* Create a cache for allocation of default size sgls */
877 len = sizeof(struct fnic_dflt_sgl_list);
878 fnic_sgl_cache[FNIC_SGL_CACHE_DFLT] = kmem_cache_create
879 ("fnic_sgl_dflt", len + FNIC_SG_DESC_ALIGN, FNIC_SG_DESC_ALIGN,
880 SLAB_HWCACHE_ALIGN,
881 NULL);
882 if (!fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]) {
883 printk(KERN_ERR PFX "failed to create fnic dflt sgl slab\n");

--- 54 unchanged lines hidden (view full) ---

938 destroy_workqueue(fnic_event_queue);
939err_create_fnic_workq:
940 kmem_cache_destroy(fnic_io_req_cache);
941err_create_fnic_ioreq_slab:
942 kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_MAX]);
943err_create_fnic_sgl_slab_max:
944 kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]);
945err_create_fnic_sgl_slab_dflt:
946 fnic_trace_free();
934 return err;
935}
936
937static void __exit fnic_cleanup_module(void)
938{
939 pci_unregister_driver(&fnic_driver);
940 destroy_workqueue(fnic_event_queue);
941 kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_MAX]);
942 kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]);
943 kmem_cache_destroy(fnic_io_req_cache);
944 fc_release_transport(fnic_fc_transport);
947 return err;
948}
949
950static void __exit fnic_cleanup_module(void)
951{
952 pci_unregister_driver(&fnic_driver);
953 destroy_workqueue(fnic_event_queue);
954 kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_MAX]);
955 kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]);
956 kmem_cache_destroy(fnic_io_req_cache);
957 fc_release_transport(fnic_fc_transport);
958 fnic_trace_free();
945}
946
947module_init(fnic_init_module);
948module_exit(fnic_cleanup_module);
949
959}
960
961module_init(fnic_init_module);
962module_exit(fnic_cleanup_module);
963