New upstream version 18.02
[deb_dpdk.git] / lib / librte_eal / linuxapp / kni / ethtool / ixgbe / ixgbe_fcoe.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*******************************************************************************
3
4   Intel 10 Gigabit PCI Express Linux driver
5   Copyright(c) 1999 - 2012 Intel Corporation.
6
7   Contact Information:
8   e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
9   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
10
11 *******************************************************************************/
12
13 #ifndef _IXGBE_FCOE_H
14 #define _IXGBE_FCOE_H
15
16 #ifdef IXGBE_FCOE
17
18 #include <scsi/fc/fc_fs.h>
19 #include <scsi/fc/fc_fcoe.h>
20
21 /* shift bits within STAT fo FCSTAT */
22 #define IXGBE_RXDADV_FCSTAT_SHIFT       4
23
24 /* ddp user buffer */
25 #define IXGBE_BUFFCNT_MAX       256     /* 8 bits bufcnt */
26 #define IXGBE_FCPTR_ALIGN       16
27 #define IXGBE_FCPTR_MAX         (IXGBE_BUFFCNT_MAX * sizeof(dma_addr_t))
28 #define IXGBE_FCBUFF_4KB        0x0
29 #define IXGBE_FCBUFF_8KB        0x1
30 #define IXGBE_FCBUFF_16KB       0x2
31 #define IXGBE_FCBUFF_64KB       0x3
32 #define IXGBE_FCBUFF_MAX        65536   /* 64KB max */
33 #define IXGBE_FCBUFF_MIN        4096    /* 4KB min */
34 #define IXGBE_FCOE_DDP_MAX      512     /* 9 bits xid */
35
36 /* Default traffic class to use for FCoE */
37 #define IXGBE_FCOE_DEFTC        3
38
39 /* fcerr */
40 #define IXGBE_FCERR_BADCRC      0x00100000
41 #define IXGBE_FCERR_EOFSOF      0x00200000
42 #define IXGBE_FCERR_NOFIRST     0x00300000
43 #define IXGBE_FCERR_OOOSEQ      0x00400000
44 #define IXGBE_FCERR_NODMA       0x00500000
45 #define IXGBE_FCERR_PKTLOST     0x00600000
46
47 /* FCoE DDP for target mode */
48 #define __IXGBE_FCOE_TARGET     1
49
50 struct ixgbe_fcoe_ddp {
51         int len;
52         u32 err;
53         unsigned int sgc;
54         struct scatterlist *sgl;
55         dma_addr_t udp;
56         u64 *udl;
57         struct pci_pool *pool;
58 };
59
60 struct ixgbe_fcoe {
61         struct pci_pool **pool;
62         atomic_t refcnt;
63         spinlock_t lock;
64         struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX];
65         unsigned char *extra_ddp_buffer;
66         dma_addr_t extra_ddp_buffer_dma;
67         u64 __percpu *pcpu_noddp;
68         u64 __percpu *pcpu_noddp_ext_buff;
69         unsigned long mode;
70         u8 tc;
71         u8 up;
72         u8 up_set;
73 };
74 #endif /* IXGBE_FCOE */
75
76 #endif /* _IXGBE_FCOE_H */