1 /*******************************************************************************
3 Intel 10 Gigabit PCI Express Linux driver
4 Copyright(c) 1999 - 2013 Intel Corporation.
6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License,
8 version 2, as published by the Free Software Foundation.
10 This program is distributed in the hope it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 You should have received a copy of the GNU General Public License along with
16 this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 The full GNU General Public License is included in this distribution in
20 the file called "COPYING".
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
27 *******************************************************************************/
32 #include <scsi/fc/fc_fs.h>
33 #include <scsi/fc/fc_fcoe.h>
35 /* shift bits within STAT fo FCSTAT */
36 #define IXGBE_RXDADV_FCSTAT_SHIFT 4
39 #define IXGBE_BUFFCNT_MAX 256 /* 8 bits bufcnt */
40 #define IXGBE_FCPTR_ALIGN 16
41 #define IXGBE_FCPTR_MAX (IXGBE_BUFFCNT_MAX * sizeof(dma_addr_t))
42 #define IXGBE_FCBUFF_4KB 0x0
43 #define IXGBE_FCBUFF_8KB 0x1
44 #define IXGBE_FCBUFF_16KB 0x2
45 #define IXGBE_FCBUFF_64KB 0x3
46 #define IXGBE_FCBUFF_MAX 65536 /* 64KB max */
47 #define IXGBE_FCBUFF_MIN 4096 /* 4KB min */
48 #define IXGBE_FCOE_DDP_MAX 512 /* 9 bits xid */
50 /* Default traffic class to use for FCoE */
51 #define IXGBE_FCOE_DEFTC 3
54 #define IXGBE_FCERR_BADCRC 0x00100000
56 /* FCoE DDP for target mode */
57 #define __IXGBE_FCOE_TARGET 1
59 struct ixgbe_fcoe_ddp {
63 struct scatterlist *sgl;
66 struct dma_pool *pool;
69 /* per cpu variables */
70 struct ixgbe_fcoe_ddp_pool {
71 struct dma_pool *pool;
77 struct ixgbe_fcoe_ddp_pool __percpu *ddp_pool;
80 struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX];
81 void *extra_ddp_buffer;
82 dma_addr_t extra_ddp_buffer_dma;
87 #endif /* _IXGBE_FCOE_H */