Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright 2008 Cisco Systems, Inc.  All rights reserved.
0004  * Copyright 2007 Nuova Systems, Inc.  All rights reserved.
0005  */
0006 #ifndef _FNIC_IO_H_
0007 #define _FNIC_IO_H_
0008 
0009 #include <scsi/fc/fc_fcp.h>
0010 
0011 #define FNIC_DFLT_SG_DESC_CNT  32
0012 #define FNIC_MAX_SG_DESC_CNT        256     /* Maximum descriptors per sgl */
0013 #define FNIC_SG_DESC_ALIGN          16      /* Descriptor address alignment */
0014 
0015 struct host_sg_desc {
0016     __le64 addr;
0017     __le32 len;
0018     u32 _resvd;
0019 };
0020 
0021 struct fnic_dflt_sgl_list {
0022     struct host_sg_desc sg_desc[FNIC_DFLT_SG_DESC_CNT];
0023 };
0024 
0025 struct fnic_sgl_list {
0026     struct host_sg_desc sg_desc[FNIC_MAX_SG_DESC_CNT];
0027 };
0028 
0029 enum fnic_sgl_list_type {
0030     FNIC_SGL_CACHE_DFLT = 0,  /* cache with default size sgl */
0031     FNIC_SGL_CACHE_MAX,       /* cache with max size sgl */
0032     FNIC_SGL_NUM_CACHES       /* number of sgl caches */
0033 };
0034 
0035 enum fnic_ioreq_state {
0036     FNIC_IOREQ_NOT_INITED = 0,
0037     FNIC_IOREQ_CMD_PENDING,
0038     FNIC_IOREQ_ABTS_PENDING,
0039     FNIC_IOREQ_ABTS_COMPLETE,
0040     FNIC_IOREQ_CMD_COMPLETE,
0041 };
0042 
0043 struct fnic_io_req {
0044     struct host_sg_desc *sgl_list; /* sgl list */
0045     void *sgl_list_alloc; /* sgl list address used for free */
0046     dma_addr_t sense_buf_pa; /* dma address for sense buffer*/
0047     dma_addr_t sgl_list_pa; /* dma address for sgl list */
0048     u16 sgl_cnt;
0049     u8 sgl_type; /* device DMA descriptor list type */
0050     u8 io_completed:1; /* set to 1 when fw completes IO */
0051     u32 port_id; /* remote port DID */
0052     unsigned long start_time; /* in jiffies */
0053     struct completion *abts_done; /* completion for abts */
0054     struct completion *dr_done; /* completion for device reset */
0055 };
0056 
0057 enum fnic_port_speeds {
0058     DCEM_PORTSPEED_NONE = 0,
0059     DCEM_PORTSPEED_1G    = 1000,
0060     DCEM_PORTSPEED_10G   = 10000,
0061     DCEM_PORTSPEED_20G   = 20000,
0062     DCEM_PORTSPEED_25G   = 25000,
0063     DCEM_PORTSPEED_40G   = 40000,
0064     DCEM_PORTSPEED_4x10G = 41000,
0065     DCEM_PORTSPEED_100G  = 100000,
0066 };
0067 #endif /* _FNIC_IO_H_ */