// SPDX-License-Identifier: GPL-2.0-only /* * Copyright(c) 2009 Intel Corporation. All rights reserved. * * Maintained at www.Open-FCoE.org */ /* * NPIV VN_Port helper functions for libfc */ #include <scsi/libfc.h> #include <linux/export.h> /** * libfc_vport_create() - Create a new NPIV vport instance * @vport: fc_vport structure from scsi_transport_fc * @privsize: driver private data size to allocate along with the Scsi_Host */ struct fc_lport *libfc_vport_create(struct fc_vport *vport, int privsize) { … } EXPORT_SYMBOL(…); /** * fc_vport_id_lookup() - find NPIV lport that matches a given fabric ID * @n_port: Top level N_Port which may have multiple NPIV VN_Ports * @port_id: Fabric ID to find a match for * * Returns: matching lport pointer or NULL if there is no match */ struct fc_lport *fc_vport_id_lookup(struct fc_lport *n_port, u32 port_id) { … } EXPORT_SYMBOL(…); /* * When setting the link state of vports during an lport state change, it's * necessary to hold the lp_mutex of both the N_Port and the VN_Port. * This tells the lockdep engine to treat the nested locking of the VN_Port * as a different lock class. */ enum libfc_lport_mutex_class { … }; /** * __fc_vport_setlink() - update link and status on a VN_Port * @n_port: parent N_Port * @vn_port: VN_Port to update * * Locking: must be called with both the N_Port and VN_Port lp_mutex held */ static void __fc_vport_setlink(struct fc_lport *n_port, struct fc_lport *vn_port) { … } /** * fc_vport_setlink() - update link and status on a VN_Port * @vn_port: virtual port to update */ void fc_vport_setlink(struct fc_lport *vn_port) { … } EXPORT_SYMBOL(…); /** * fc_vports_linkchange() - change the link state of all vports * @n_port: Parent N_Port that has changed state * * Locking: called with the n_port lp_mutex held */ void fc_vports_linkchange(struct fc_lport *n_port) { … }