linux/drivers/scsi/lpfc/lpfc_nvme.h

/*******************************************************************
 * This file is part of the Emulex Linux Device Driver for         *
 * Fibre Channel Host Bus Adapters.                                *
 * Copyright (C) 2017-2022 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/nvme.h>
#include <linux/nvme-fc-driver.h>
#include <linux/nvme-fc.h>

#define LPFC_NVME_DEFAULT_SEGS

#define LPFC_NVME_ERSP_LEN

#define LPFC_NVME_WAIT_TMO
#define LPFC_NVME_EXPEDITE_XRICNT
#define LPFC_NVME_FB_SHIFT
#define LPFC_NVME_MAX_FB

#define lpfc_ndlp_get_nrport(ndlp)

struct lpfc_nvme_qhandle {};

/* Declare nvme-based local and remote port definitions. */
struct lpfc_nvme_lport {};

struct lpfc_nvme_rport {};

struct lpfc_nvme_fcpreq_priv {};

/*
 * set NVME LS request timeouts to 30s. It is larger than the 2*R_A_TOV
 * set by the spec, which appears to have issues with some devices.
 */
#define LPFC_NVME_LS_TIMEOUT


#define LPFC_NVMET_DEFAULT_SEGS
#define LPFC_NVMET_RQE_MIN_POST
#define LPFC_NVMET_RQE_DEF_POST
#define LPFC_NVMET_RQE_DEF_COUNT
#define LPFC_NVMET_SUCCESS_LEN

#define LPFC_NVMET_MRQ_AUTO
#define LPFC_NVMET_MRQ_MAX

#define LPFC_NVMET_WAIT_TMO

/* Used for NVME Target */
#define LPFC_NVMET_INV_HOST_ACTIVE

struct lpfc_nvmet_tgtport {};

struct lpfc_nvmet_ctx_info {};

/* This retrieves the context info associated with the specified cpu / mrq */
#define lpfc_get_ctx_list(phba, cpu, mrq)

/* Values for state field of struct lpfc_async_xchg_ctx */
#define LPFC_NVME_STE_LS_RCV
#define LPFC_NVME_STE_LS_ABORT
#define LPFC_NVME_STE_LS_RSP
#define LPFC_NVME_STE_RCV
#define LPFC_NVME_STE_DATA
#define LPFC_NVME_STE_ABORT
#define LPFC_NVME_STE_DONE
#define LPFC_NVME_STE_FREE

/* Values for flag field of struct lpfc_async_xchg_ctx */
#define LPFC_NVME_IO_INP
#define LPFC_NVME_ABORT_OP
#define LPFC_NVME_XBUSY
#define LPFC_NVME_CTX_RLS
#define LPFC_NVME_ABTS_RCV
#define LPFC_NVME_CTX_REUSE_WQ
#define LPFC_NVME_DEFER_WQFULL
#define LPFC_NVME_TNOTIFY

struct lpfc_async_xchg_ctx {};


/* routines found in lpfc_nvme.c */
int __lpfc_nvme_ls_req(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
		struct nvmefc_ls_req *pnvme_lsreq,
		void (*gen_req_cmp)(struct lpfc_hba *phba,
				struct lpfc_iocbq *cmdwqe,
				struct lpfc_iocbq *rspwqe));
void __lpfc_nvme_ls_req_cmp(struct lpfc_hba *phba,  struct lpfc_vport *vport,
		struct lpfc_iocbq *cmdwqe, struct lpfc_wcqe_complete *wcqe);
int __lpfc_nvme_ls_abort(struct lpfc_vport *vport,
		struct lpfc_nodelist *ndlp, struct nvmefc_ls_req *pnvme_lsreq);

/* routines found in lpfc_nvmet.c */
int lpfc_nvme_unsol_ls_issue_abort(struct lpfc_hba *phba,
			struct lpfc_async_xchg_ctx *ctxp, uint32_t sid,
			uint16_t xri);
int __lpfc_nvme_xmt_ls_rsp(struct lpfc_async_xchg_ctx *axchg,
			struct nvmefc_ls_rsp *ls_rsp,
			void (*xmt_ls_rsp_cmp)(struct lpfc_hba *phba,
				struct lpfc_iocbq *cmdwqe,
				struct lpfc_iocbq *rspwqe));
void __lpfc_nvme_xmt_ls_rsp_cmp(struct lpfc_hba *phba,
		struct lpfc_iocbq *cmdwqe, struct lpfc_iocbq *rspwqe);