/******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * * www.broadcom.com * * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of version 2 of the GNU General * * Public License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful. * * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * * TO BE LEGALLY INVALID. See the GNU General Public License for * * more details, a copy of which can be found in the file COPYING * * included with this package. * *******************************************************************/ #include <linux/interrupt.h> #include <linux/dma-direction.h> #include <scsi/scsi_transport_fc.h> #include "lpfc_hw4.h" #include "lpfc_hw.h" #include "lpfc_sli.h" #include "lpfc_sli4.h" #include "lpfc_nl.h" #include "lpfc_disc.h" #include "lpfc.h" #include "lpfc_crtn.h" /* * lpfc_get_vmid_from_hashtable - search the UUID in the hash table * @vport: The virtual port for which this call is being executed. * @hash: calculated hash value * @buf: uuid associated with the VE * Return the VMID entry associated with the UUID * Make sure to acquire the appropriate lock before invoking this routine. */ struct lpfc_vmid *lpfc_get_vmid_from_hashtable(struct lpfc_vport *vport, u32 hash, u8 *buf) { … } /* * lpfc_put_vmid_in_hashtable - put the VMID in the hash table * @vport: The virtual port for which this call is being executed. * @hash - calculated hash value * @vmp: Pointer to a VMID entry representing a VM sending I/O * * This routine will insert the newly acquired VMID entity in the hash table. * Make sure to acquire the appropriate lock before invoking this routine. */ static void lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash, struct lpfc_vmid *vmp) { … } /* * lpfc_vmid_hash_fn - create a hash value of the UUID * @vmid: uuid associated with the VE * @len: length of the VMID string * Returns the calculated hash value */ int lpfc_vmid_hash_fn(const char *vmid, int len) { … } /* * lpfc_vmid_update_entry - update the vmid entry in the hash table * @vport: The virtual port for which this call is being executed. * @iodir: io direction * @vmp: Pointer to a VMID entry representing a VM sending I/O * @tag: VMID tag */ static void lpfc_vmid_update_entry(struct lpfc_vport *vport, enum dma_data_direction iodir, struct lpfc_vmid *vmp, union lpfc_vmid_io_tag *tag) { … } static void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid) { … } /* * lpfc_vmid_get_appid - get the VMID associated with the UUID * @vport: The virtual port for which this call is being executed. * @uuid: UUID associated with the VE * @cmd: address of scsi_cmd descriptor * @iodir: io direction * @tag: VMID tag * Returns status of the function */ int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid, enum dma_data_direction iodir, union lpfc_vmid_io_tag *tag) { … } /* * lpfc_reinit_vmid - reinitializes the vmid data structure * @vport: pointer to vport data structure * * This routine reinitializes the vmid post flogi completion * * Return codes * None */ void lpfc_reinit_vmid(struct lpfc_vport *vport) { … }