Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | |
| 3 | Intel 10 Gigabit PCI Express Linux driver |
Don Skidmore | 434c5e3 | 2013-01-08 05:02:28 +0000 | [diff] [blame] | 4 | Copyright(c) 1999 - 2013 Intel Corporation. |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 5 | |
| 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. |
| 9 | |
| 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 |
| 13 | more details. |
| 14 | |
| 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. |
| 18 | |
| 19 | The full GNU General Public License is included in this distribution in |
| 20 | the file called "COPYING". |
| 21 | |
| 22 | Contact Information: |
Jacob Keller | b89aae7 | 2014-02-22 01:23:50 +0000 | [diff] [blame] | 23 | Linux NICS <linux.nics@intel.com> |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 24 | e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> |
| 25 | Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 26 | |
| 27 | *******************************************************************************/ |
| 28 | |
| 29 | #ifndef _IXGBE_FCOE_H |
| 30 | #define _IXGBE_FCOE_H |
| 31 | |
Yi Zou | 3d8fd38 | 2009-06-08 14:38:44 +0000 | [diff] [blame] | 32 | #include <scsi/fc/fc_fs.h> |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 33 | #include <scsi/fc/fc_fcoe.h> |
| 34 | |
| 35 | /* shift bits within STAT fo FCSTAT */ |
| 36 | #define IXGBE_RXDADV_FCSTAT_SHIFT 4 |
| 37 | |
| 38 | /* ddp user buffer */ |
| 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 */ |
Vasu Dev | ea41201 | 2015-04-09 22:03:23 -0700 | [diff] [blame] | 49 | #define IXGBE_FCOE_DDP_MAX_X550 2048 /* 11 bits xid */ |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 50 | |
Yi Zou | 6ee1652 | 2009-08-31 12:34:28 +0000 | [diff] [blame] | 51 | /* Default traffic class to use for FCoE */ |
| 52 | #define IXGBE_FCOE_DEFTC 3 |
| 53 | |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 54 | /* fcerr */ |
| 55 | #define IXGBE_FCERR_BADCRC 0x00100000 |
| 56 | |
Yi Zou | 68a683c | 2011-02-01 07:22:16 +0000 | [diff] [blame] | 57 | /* FCoE DDP for target mode */ |
| 58 | #define __IXGBE_FCOE_TARGET 1 |
| 59 | |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 60 | struct ixgbe_fcoe_ddp { |
| 61 | int len; |
| 62 | u32 err; |
| 63 | unsigned int sgc; |
| 64 | struct scatterlist *sgl; |
| 65 | dma_addr_t udp; |
Yi Zou | d0ed893 | 2009-05-13 13:11:29 +0000 | [diff] [blame] | 66 | u64 *udl; |
Alexander Duyck | 1bf91cd | 2012-05-05 05:32:32 +0000 | [diff] [blame] | 67 | struct dma_pool *pool; |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 68 | }; |
| 69 | |
Alexander Duyck | 5a1ee27 | 2012-05-05 17:14:28 +0000 | [diff] [blame] | 70 | /* per cpu variables */ |
| 71 | struct ixgbe_fcoe_ddp_pool { |
| 72 | struct dma_pool *pool; |
| 73 | u64 noddp; |
| 74 | u64 noddp_ext_buff; |
| 75 | }; |
| 76 | |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 77 | struct ixgbe_fcoe { |
Alexander Duyck | 5a1ee27 | 2012-05-05 17:14:28 +0000 | [diff] [blame] | 78 | struct ixgbe_fcoe_ddp_pool __percpu *ddp_pool; |
Vasu Dev | dadbe85 | 2011-05-11 05:41:46 +0000 | [diff] [blame] | 79 | atomic_t refcnt; |
| 80 | spinlock_t lock; |
Vasu Dev | ea41201 | 2015-04-09 22:03:23 -0700 | [diff] [blame] | 81 | struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX_X550]; |
Alexander Duyck | 7c8ae65 | 2012-05-05 05:32:47 +0000 | [diff] [blame] | 82 | void *extra_ddp_buffer; |
Vasu Dev | dadbe85 | 2011-05-11 05:41:46 +0000 | [diff] [blame] | 83 | dma_addr_t extra_ddp_buffer_dma; |
| 84 | unsigned long mode; |
Yi Zou | 61a0f42 | 2009-12-03 11:32:22 +0000 | [diff] [blame] | 85 | u8 up; |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 86 | }; |
| 87 | |
| 88 | #endif /* _IXGBE_FCOE_H */ |