Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright(c) 1999 - 2018 Intel Corporation. */
0003 
0004 #ifndef _IXGBE_FCOE_H
0005 #define _IXGBE_FCOE_H
0006 
0007 #include <scsi/fc/fc_fs.h>
0008 #include <scsi/fc/fc_fcoe.h>
0009 
0010 /* shift bits within STAT fo FCSTAT */
0011 #define IXGBE_RXDADV_FCSTAT_SHIFT   4
0012 
0013 /* ddp user buffer */
0014 #define IXGBE_BUFFCNT_MAX   256 /* 8 bits bufcnt */
0015 #define IXGBE_FCPTR_ALIGN   16
0016 #define IXGBE_FCPTR_MAX (IXGBE_BUFFCNT_MAX * sizeof(dma_addr_t))
0017 #define IXGBE_FCBUFF_4KB    0x0
0018 #define IXGBE_FCBUFF_8KB    0x1
0019 #define IXGBE_FCBUFF_16KB   0x2
0020 #define IXGBE_FCBUFF_64KB   0x3
0021 #define IXGBE_FCBUFF_MAX    65536   /* 64KB max */
0022 #define IXGBE_FCBUFF_MIN    4096    /* 4KB min */
0023 #define IXGBE_FCOE_DDP_MAX  512 /* 9 bits xid */
0024 #define IXGBE_FCOE_DDP_MAX_X550 2048    /* 11 bits xid */
0025 
0026 /* Default traffic class to use for FCoE */
0027 #define IXGBE_FCOE_DEFTC    3
0028 
0029 /* fcerr */
0030 #define IXGBE_FCERR_BADCRC       0x00100000
0031 
0032 /* FCoE DDP for target mode */
0033 #define __IXGBE_FCOE_TARGET 1
0034 
0035 struct ixgbe_fcoe_ddp {
0036     int len;
0037     u32 err;
0038     unsigned int sgc;
0039     struct scatterlist *sgl;
0040     dma_addr_t udp;
0041     u64 *udl;
0042     struct dma_pool *pool;
0043 };
0044 
0045 /* per cpu variables */
0046 struct ixgbe_fcoe_ddp_pool {
0047     struct dma_pool *pool;
0048     u64 noddp;
0049     u64 noddp_ext_buff;
0050 };
0051 
0052 struct ixgbe_fcoe {
0053     struct ixgbe_fcoe_ddp_pool __percpu *ddp_pool;
0054     atomic_t refcnt;
0055     spinlock_t lock;
0056     struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX_X550];
0057     void *extra_ddp_buffer;
0058     dma_addr_t extra_ddp_buffer_dma;
0059     unsigned long mode;
0060     u8 up;
0061 };
0062 
0063 #endif /* _IXGBE_FCOE_H */