ixgbe_fcoe.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*******************************************************************************
  2. Intel 10 Gigabit PCI Express Linux driver
  3. Copyright(c) 1999 - 2011 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. e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  18. Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  19. *******************************************************************************/
  20. #ifndef _IXGBE_FCOE_H
  21. #define _IXGBE_FCOE_H
  22. #include <scsi/fc/fc_fs.h>
  23. #include <scsi/fc/fc_fcoe.h>
  24. /* shift bits within STAT fo FCSTAT */
  25. #define IXGBE_RXDADV_FCSTAT_SHIFT 4
  26. /* ddp user buffer */
  27. #define IXGBE_BUFFCNT_MAX 256 /* 8 bits bufcnt */
  28. #define IXGBE_FCPTR_ALIGN 16
  29. #define IXGBE_FCPTR_MAX (IXGBE_BUFFCNT_MAX * sizeof(dma_addr_t))
  30. #define IXGBE_FCBUFF_4KB 0x0
  31. #define IXGBE_FCBUFF_8KB 0x1
  32. #define IXGBE_FCBUFF_16KB 0x2
  33. #define IXGBE_FCBUFF_64KB 0x3
  34. #define IXGBE_FCBUFF_MAX 65536 /* 64KB max */
  35. #define IXGBE_FCBUFF_MIN 4096 /* 4KB min */
  36. #define IXGBE_FCOE_DDP_MAX 512 /* 9 bits xid */
  37. /* Default traffic class to use for FCoE */
  38. #define IXGBE_FCOE_DEFTC 3
  39. /* fcerr */
  40. #define IXGBE_FCERR_BADCRC 0x00100000
  41. /* FCoE DDP for target mode */
  42. #define __IXGBE_FCOE_TARGET 1
  43. struct ixgbe_fcoe_ddp {
  44. int len;
  45. u32 err;
  46. unsigned int sgc;
  47. struct scatterlist *sgl;
  48. dma_addr_t udp;
  49. u64 *udl;
  50. };
  51. struct ixgbe_fcoe {
  52. #ifdef CONFIG_IXGBE_DCB
  53. u8 tc;
  54. u8 up;
  55. #endif
  56. unsigned long mode;
  57. atomic_t refcnt;
  58. spinlock_t lock;
  59. struct pci_pool *pool;
  60. struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX];
  61. unsigned char *extra_ddp_buffer;
  62. dma_addr_t extra_ddp_buffer_dma;
  63. };
  64. #endif /* _IXGBE_FCOE_H */