Jeff Kirsher | ae06c70 | 2018-03-22 10:08:48 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 2 | /******************************************************************************* |
| 3 | |
| 4 | Intel 10 Gigabit PCI Express Linux driver |
Don Skidmore | 434c5e3 | 2013-01-08 05:02:28 +0000 | [diff] [blame] | 5 | Copyright(c) 1999 - 2013 Intel Corporation. |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 6 | |
| 7 | This program is free software; you can redistribute it and/or modify it |
| 8 | under the terms and conditions of the GNU General Public License, |
| 9 | version 2, as published by the Free Software Foundation. |
| 10 | |
| 11 | This program is distributed in the hope it will be useful, but WITHOUT |
| 12 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 14 | more details. |
| 15 | |
| 16 | You should have received a copy of the GNU General Public License along with |
| 17 | this program; if not, write to the Free Software Foundation, Inc., |
| 18 | 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 | |
| 20 | The full GNU General Public License is included in this distribution in |
| 21 | the file called "COPYING". |
| 22 | |
| 23 | Contact Information: |
Jacob Keller | b89aae7 | 2014-02-22 01:23:50 +0000 | [diff] [blame] | 24 | Linux NICS <linux.nics@intel.com> |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 25 | e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> |
| 26 | Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 27 | |
| 28 | *******************************************************************************/ |
| 29 | |
| 30 | #ifndef _IXGBE_FCOE_H |
| 31 | #define _IXGBE_FCOE_H |
| 32 | |
Yi Zou | 3d8fd38 | 2009-06-08 14:38:44 +0000 | [diff] [blame] | 33 | #include <scsi/fc/fc_fs.h> |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 34 | #include <scsi/fc/fc_fcoe.h> |
| 35 | |
| 36 | /* shift bits within STAT fo FCSTAT */ |
| 37 | #define IXGBE_RXDADV_FCSTAT_SHIFT 4 |
| 38 | |
| 39 | /* ddp user buffer */ |
| 40 | #define IXGBE_BUFFCNT_MAX 256 /* 8 bits bufcnt */ |
| 41 | #define IXGBE_FCPTR_ALIGN 16 |
| 42 | #define IXGBE_FCPTR_MAX (IXGBE_BUFFCNT_MAX * sizeof(dma_addr_t)) |
| 43 | #define IXGBE_FCBUFF_4KB 0x0 |
| 44 | #define IXGBE_FCBUFF_8KB 0x1 |
| 45 | #define IXGBE_FCBUFF_16KB 0x2 |
| 46 | #define IXGBE_FCBUFF_64KB 0x3 |
| 47 | #define IXGBE_FCBUFF_MAX 65536 /* 64KB max */ |
| 48 | #define IXGBE_FCBUFF_MIN 4096 /* 4KB min */ |
| 49 | #define IXGBE_FCOE_DDP_MAX 512 /* 9 bits xid */ |
Vasu Dev | ea41201 | 2015-04-09 22:03:23 -0700 | [diff] [blame] | 50 | #define IXGBE_FCOE_DDP_MAX_X550 2048 /* 11 bits xid */ |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 51 | |
Yi Zou | 6ee1652 | 2009-08-31 12:34:28 +0000 | [diff] [blame] | 52 | /* Default traffic class to use for FCoE */ |
| 53 | #define IXGBE_FCOE_DEFTC 3 |
| 54 | |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 55 | /* fcerr */ |
| 56 | #define IXGBE_FCERR_BADCRC 0x00100000 |
| 57 | |
Yi Zou | 68a683c | 2011-02-01 07:22:16 +0000 | [diff] [blame] | 58 | /* FCoE DDP for target mode */ |
| 59 | #define __IXGBE_FCOE_TARGET 1 |
| 60 | |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 61 | struct ixgbe_fcoe_ddp { |
| 62 | int len; |
| 63 | u32 err; |
| 64 | unsigned int sgc; |
| 65 | struct scatterlist *sgl; |
| 66 | dma_addr_t udp; |
Yi Zou | d0ed893 | 2009-05-13 13:11:29 +0000 | [diff] [blame] | 67 | u64 *udl; |
Alexander Duyck | 1bf91cd | 2012-05-05 05:32:32 +0000 | [diff] [blame] | 68 | struct dma_pool *pool; |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 69 | }; |
| 70 | |
Alexander Duyck | 5a1ee27 | 2012-05-05 17:14:28 +0000 | [diff] [blame] | 71 | /* per cpu variables */ |
| 72 | struct ixgbe_fcoe_ddp_pool { |
| 73 | struct dma_pool *pool; |
| 74 | u64 noddp; |
| 75 | u64 noddp_ext_buff; |
| 76 | }; |
| 77 | |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 78 | struct ixgbe_fcoe { |
Alexander Duyck | 5a1ee27 | 2012-05-05 17:14:28 +0000 | [diff] [blame] | 79 | struct ixgbe_fcoe_ddp_pool __percpu *ddp_pool; |
Vasu Dev | dadbe85 | 2011-05-11 05:41:46 +0000 | [diff] [blame] | 80 | atomic_t refcnt; |
| 81 | spinlock_t lock; |
Vasu Dev | ea41201 | 2015-04-09 22:03:23 -0700 | [diff] [blame] | 82 | struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX_X550]; |
Alexander Duyck | 7c8ae65 | 2012-05-05 05:32:47 +0000 | [diff] [blame] | 83 | void *extra_ddp_buffer; |
Vasu Dev | dadbe85 | 2011-05-11 05:41:46 +0000 | [diff] [blame] | 84 | dma_addr_t extra_ddp_buffer_dma; |
| 85 | unsigned long mode; |
Yi Zou | 61a0f42 | 2009-12-03 11:32:22 +0000 | [diff] [blame] | 86 | u8 up; |
Yi Zou | e92cbea | 2009-05-13 13:10:01 +0000 | [diff] [blame] | 87 | }; |
| 88 | |
| 89 | #endif /* _IXGBE_FCOE_H */ |