/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h

http://github.com/mirrors/linux · C Header · 63 lines · 44 code · 11 blank · 8 comment · 0 complexity · ee100a4d79b7dfd6e3927aa526d82335 MD5 · raw file

  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright(c) 1999 - 2018 Intel Corporation. */
  3. #ifndef _IXGBE_FCOE_H
  4. #define _IXGBE_FCOE_H
  5. #include <scsi/fc/fc_fs.h>
  6. #include <scsi/fc/fc_fcoe.h>
  7. /* shift bits within STAT fo FCSTAT */
  8. #define IXGBE_RXDADV_FCSTAT_SHIFT 4
  9. /* ddp user buffer */
  10. #define IXGBE_BUFFCNT_MAX 256 /* 8 bits bufcnt */
  11. #define IXGBE_FCPTR_ALIGN 16
  12. #define IXGBE_FCPTR_MAX (IXGBE_BUFFCNT_MAX * sizeof(dma_addr_t))
  13. #define IXGBE_FCBUFF_4KB 0x0
  14. #define IXGBE_FCBUFF_8KB 0x1
  15. #define IXGBE_FCBUFF_16KB 0x2
  16. #define IXGBE_FCBUFF_64KB 0x3
  17. #define IXGBE_FCBUFF_MAX 65536 /* 64KB max */
  18. #define IXGBE_FCBUFF_MIN 4096 /* 4KB min */
  19. #define IXGBE_FCOE_DDP_MAX 512 /* 9 bits xid */
  20. #define IXGBE_FCOE_DDP_MAX_X550 2048 /* 11 bits xid */
  21. /* Default traffic class to use for FCoE */
  22. #define IXGBE_FCOE_DEFTC 3
  23. /* fcerr */
  24. #define IXGBE_FCERR_BADCRC 0x00100000
  25. /* FCoE DDP for target mode */
  26. #define __IXGBE_FCOE_TARGET 1
  27. struct ixgbe_fcoe_ddp {
  28. int len;
  29. u32 err;
  30. unsigned int sgc;
  31. struct scatterlist *sgl;
  32. dma_addr_t udp;
  33. u64 *udl;
  34. struct dma_pool *pool;
  35. };
  36. /* per cpu variables */
  37. struct ixgbe_fcoe_ddp_pool {
  38. struct dma_pool *pool;
  39. u64 noddp;
  40. u64 noddp_ext_buff;
  41. };
  42. struct ixgbe_fcoe {
  43. struct ixgbe_fcoe_ddp_pool __percpu *ddp_pool;
  44. atomic_t refcnt;
  45. spinlock_t lock;
  46. struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX_X550];
  47. void *extra_ddp_buffer;
  48. dma_addr_t extra_ddp_buffer_dma;
  49. unsigned long mode;
  50. u8 up;
  51. };
  52. #endif /* _IXGBE_FCOE_H */