2018-03-22 17:08:48 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2018-04-26 15:08:09 +00:00
|
|
|
/* Copyright(c) 1999 - 2018 Intel Corporation. */
|
2009-05-13 13:10:01 +00:00
|
|
|
|
|
|
|
#ifndef _IXGBE_FCOE_H
|
|
|
|
#define _IXGBE_FCOE_H
|
|
|
|
|
2009-06-08 14:38:44 +00:00
|
|
|
#include <scsi/fc/fc_fs.h>
|
2009-05-13 13:10:01 +00:00
|
|
|
#include <scsi/fc/fc_fcoe.h>
|
|
|
|
|
|
|
|
/* shift bits within STAT fo FCSTAT */
|
|
|
|
#define IXGBE_RXDADV_FCSTAT_SHIFT 4
|
|
|
|
|
|
|
|
/* ddp user buffer */
|
|
|
|
#define IXGBE_BUFFCNT_MAX 256 /* 8 bits bufcnt */
|
|
|
|
#define IXGBE_FCPTR_ALIGN 16
|
|
|
|
#define IXGBE_FCPTR_MAX (IXGBE_BUFFCNT_MAX * sizeof(dma_addr_t))
|
|
|
|
#define IXGBE_FCBUFF_4KB 0x0
|
|
|
|
#define IXGBE_FCBUFF_8KB 0x1
|
|
|
|
#define IXGBE_FCBUFF_16KB 0x2
|
|
|
|
#define IXGBE_FCBUFF_64KB 0x3
|
|
|
|
#define IXGBE_FCBUFF_MAX 65536 /* 64KB max */
|
|
|
|
#define IXGBE_FCBUFF_MIN 4096 /* 4KB min */
|
|
|
|
#define IXGBE_FCOE_DDP_MAX 512 /* 9 bits xid */
|
2015-04-10 05:03:23 +00:00
|
|
|
#define IXGBE_FCOE_DDP_MAX_X550 2048 /* 11 bits xid */
|
2009-05-13 13:10:01 +00:00
|
|
|
|
2009-08-31 12:34:28 +00:00
|
|
|
/* Default traffic class to use for FCoE */
|
|
|
|
#define IXGBE_FCOE_DEFTC 3
|
|
|
|
|
2009-05-13 13:10:01 +00:00
|
|
|
/* fcerr */
|
|
|
|
#define IXGBE_FCERR_BADCRC 0x00100000
|
|
|
|
|
2011-02-01 07:22:16 +00:00
|
|
|
/* FCoE DDP for target mode */
|
|
|
|
#define __IXGBE_FCOE_TARGET 1
|
|
|
|
|
2009-05-13 13:10:01 +00:00
|
|
|
struct ixgbe_fcoe_ddp {
|
|
|
|
int len;
|
|
|
|
u32 err;
|
|
|
|
unsigned int sgc;
|
|
|
|
struct scatterlist *sgl;
|
|
|
|
dma_addr_t udp;
|
2009-05-13 13:11:29 +00:00
|
|
|
u64 *udl;
|
2012-05-05 05:32:32 +00:00
|
|
|
struct dma_pool *pool;
|
2009-05-13 13:10:01 +00:00
|
|
|
};
|
|
|
|
|
2012-05-05 17:14:28 +00:00
|
|
|
/* per cpu variables */
|
|
|
|
struct ixgbe_fcoe_ddp_pool {
|
|
|
|
struct dma_pool *pool;
|
|
|
|
u64 noddp;
|
|
|
|
u64 noddp_ext_buff;
|
|
|
|
};
|
|
|
|
|
2009-05-13 13:10:01 +00:00
|
|
|
struct ixgbe_fcoe {
|
2012-05-05 17:14:28 +00:00
|
|
|
struct ixgbe_fcoe_ddp_pool __percpu *ddp_pool;
|
2010-10-20 23:00:30 +00:00
|
|
|
atomic_t refcnt;
|
2009-05-13 13:10:01 +00:00
|
|
|
spinlock_t lock;
|
2015-04-10 05:03:23 +00:00
|
|
|
struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX_X550];
|
2012-05-05 05:32:47 +00:00
|
|
|
void *extra_ddp_buffer;
|
2011-02-15 09:11:31 +00:00
|
|
|
dma_addr_t extra_ddp_buffer_dma;
|
2011-05-11 05:41:46 +00:00
|
|
|
unsigned long mode;
|
|
|
|
u8 up;
|
2009-05-13 13:10:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _IXGBE_FCOE_H */
|