/* * This file is part of the Chelsio FCoE driver for Linux. * * Copyright (c) 2008-2012 Chelsio Communications, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include <linux/kernel.h> #include <linux/string.h> #include <linux/delay.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/mm.h> #include <linux/jiffies.h> #include <scsi/fc/fc_fs.h> #include "csio_init.h" static void csio_vport_set_state(struct csio_lnode *ln); /* * csio_reg_rnode - Register a remote port with FC transport. * @rn: Rnode representing remote port. * * Call fc_remote_port_add() to register this remote port with FC transport. * If remote port is Initiator OR Target OR both, change the role appropriately. * */ void csio_reg_rnode(struct csio_rnode *rn) { … } /* * csio_unreg_rnode - Unregister a remote port with FC transport. * @rn: Rnode representing remote port. * * Call fc_remote_port_delete() to unregister this remote port with FC * transport. * */ void csio_unreg_rnode(struct csio_rnode *rn) { … } /* * csio_lnode_async_event - Async events from local port. * @ln: lnode representing local port. * * Async events from local node that FC transport/SCSI ML * should be made aware of (Eg: RSCN). */ void csio_lnode_async_event(struct csio_lnode *ln, enum csio_ln_fc_evt fc_evt) { … } /* * csio_fchost_attr_init - Initialize FC transport attributes * @ln: Lnode. * */ void csio_fchost_attr_init(struct csio_lnode *ln) { … } /* * csio_get_host_port_id - sysfs entries for nport_id is * populated/cached from this function */ static void csio_get_host_port_id(struct Scsi_Host *shost) { … } /* * csio_get_port_type - Return FC local port type. * @shost: scsi host. * */ static void csio_get_host_port_type(struct Scsi_Host *shost) { … } /* * csio_get_port_state - Return FC local port state. * @shost: scsi host. * */ static void csio_get_host_port_state(struct Scsi_Host *shost) { … } /* * csio_get_host_speed - Return link speed to FC transport. * @shost: scsi host. * */ static void csio_get_host_speed(struct Scsi_Host *shost) { … } /* * csio_get_host_fabric_name - Return fabric name * @shost: scsi host. * */ static void csio_get_host_fabric_name(struct Scsi_Host *shost) { … } /* * csio_get_host_speed - Return FC transport statistics. * @ln: Lnode. * */ static struct fc_host_statistics * csio_get_stats(struct Scsi_Host *shost) { … } /* * csio_set_rport_loss_tmo - Set the rport dev loss timeout * @rport: fc rport. * @timeout: new value for dev loss tmo. * * If timeout is non zero set the dev_loss_tmo to timeout, else set * dev_loss_tmo to one. */ static void csio_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) { … } static void csio_vport_set_state(struct csio_lnode *ln) { … } static int csio_fcoe_alloc_vnp(struct csio_hw *hw, struct csio_lnode *ln) { … } static int csio_fcoe_free_vnp(struct csio_hw *hw, struct csio_lnode *ln) { … } static int csio_vport_create(struct fc_vport *fc_vport, bool disable) { … } static int csio_vport_delete(struct fc_vport *fc_vport) { … } static int csio_vport_disable(struct fc_vport *fc_vport, bool disable) { … } static void csio_dev_loss_tmo_callbk(struct fc_rport *rport) { … } /* FC transport functions template - Physical port */ struct fc_function_template csio_fc_transport_funcs = …; /* FC transport functions template - Virtual port */ struct fc_function_template csio_fc_transport_vport_funcs = …;