ixgbe_fcoe.h 2.5 KB

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