igc_defines.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (c) 2018 Intel Corporation */
  3. #ifndef _IGC_DEFINES_H_
  4. #define _IGC_DEFINES_H_
  5. #define IGC_CTRL_EXT_DRV_LOAD 0x10000000 /* Drv loaded bit for FW */
  6. /* PCI Bus Info */
  7. #define PCIE_DEVICE_CONTROL2 0x28
  8. #define PCIE_DEVICE_CONTROL2_16ms 0x0005
  9. /* Receive Address
  10. * Number of high/low register pairs in the RAR. The RAR (Receive Address
  11. * Registers) holds the directed and multicast addresses that we monitor.
  12. * Technically, we have 16 spots. However, we reserve one of these spots
  13. * (RAR[15]) for our directed address used by controllers with
  14. * manageability enabled, allowing us room for 15 multicast addresses.
  15. */
  16. #define IGC_RAH_AV 0x80000000 /* Receive descriptor valid */
  17. #define IGC_RAH_POOL_1 0x00040000
  18. /* Error Codes */
  19. #define IGC_SUCCESS 0
  20. #define IGC_ERR_NVM 1
  21. #define IGC_ERR_PHY 2
  22. #define IGC_ERR_CONFIG 3
  23. #define IGC_ERR_PARAM 4
  24. #define IGC_ERR_MAC_INIT 5
  25. #define IGC_ERR_RESET 9
  26. /* PBA constants */
  27. #define IGC_PBA_34K 0x0022
  28. /* Device Status */
  29. #define IGC_STATUS_FD 0x00000001 /* Full duplex.0=half,1=full */
  30. #define IGC_STATUS_LU 0x00000002 /* Link up.0=no,1=link */
  31. #define IGC_STATUS_FUNC_MASK 0x0000000C /* PCI Function Mask */
  32. #define IGC_STATUS_FUNC_SHIFT 2
  33. #define IGC_STATUS_FUNC_1 0x00000004 /* Function 1 */
  34. #define IGC_STATUS_TXOFF 0x00000010 /* transmission paused */
  35. #define IGC_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */
  36. #define IGC_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */
  37. /* Interrupt Cause Read */
  38. #define IGC_ICR_TXDW BIT(0) /* Transmit desc written back */
  39. #define IGC_ICR_TXQE BIT(1) /* Transmit Queue empty */
  40. #define IGC_ICR_LSC BIT(2) /* Link Status Change */
  41. #define IGC_ICR_RXSEQ BIT(3) /* Rx sequence error */
  42. #define IGC_ICR_RXDMT0 BIT(4) /* Rx desc min. threshold (0) */
  43. #define IGC_ICR_RXO BIT(6) /* Rx overrun */
  44. #define IGC_ICR_RXT0 BIT(7) /* Rx timer intr (ring 0) */
  45. #define IGC_ICR_DRSTA BIT(30) /* Device Reset Asserted */
  46. /* If this bit asserted, the driver should claim the interrupt */
  47. #define IGC_ICR_INT_ASSERTED BIT(31)
  48. #define IGC_ICS_RXT0 IGC_ICR_RXT0 /* Rx timer intr */
  49. #define IMS_ENABLE_MASK ( \
  50. IGC_IMS_RXT0 | \
  51. IGC_IMS_TXDW | \
  52. IGC_IMS_RXDMT0 | \
  53. IGC_IMS_RXSEQ | \
  54. IGC_IMS_LSC)
  55. /* Interrupt Mask Set */
  56. #define IGC_IMS_TXDW IGC_ICR_TXDW /* Tx desc written back */
  57. #define IGC_IMS_RXSEQ IGC_ICR_RXSEQ /* Rx sequence error */
  58. #define IGC_IMS_LSC IGC_ICR_LSC /* Link Status Change */
  59. #define IGC_IMS_DOUTSYNC IGC_ICR_DOUTSYNC /* NIC DMA out of sync */
  60. #define IGC_IMS_DRSTA IGC_ICR_DRSTA /* Device Reset Asserted */
  61. #define IGC_IMS_RXT0 IGC_ICR_RXT0 /* Rx timer intr */
  62. #define IGC_IMS_RXDMT0 IGC_ICR_RXDMT0 /* Rx desc min. threshold */
  63. #define IGC_QVECTOR_MASK 0x7FFC /* Q-vector mask */
  64. #define IGC_ITR_VAL_MASK 0x04 /* ITR value mask */
  65. #define IGC_ICR_DOUTSYNC 0x10000000 /* NIC DMA out of sync */
  66. #define IGC_EITR_CNT_IGNR 0x80000000 /* Don't reset counters on write */
  67. #define IGC_IVAR_VALID 0x80
  68. #define IGC_GPIE_NSICR 0x00000001
  69. #define IGC_GPIE_MSIX_MODE 0x00000010
  70. #define IGC_GPIE_EIAME 0x40000000
  71. #define IGC_GPIE_PBA 0x80000000
  72. /* Transmit Control */
  73. #define IGC_TCTL_EN 0x00000002 /* enable Tx */
  74. #define IGC_TCTL_PSP 0x00000008 /* pad short packets */
  75. #define IGC_TCTL_CT 0x00000ff0 /* collision threshold */
  76. #define IGC_TCTL_COLD 0x003ff000 /* collision distance */
  77. #define IGC_TCTL_RTLC 0x01000000 /* Re-transmit on late collision */
  78. #define IGC_TCTL_MULR 0x10000000 /* Multiple request support */
  79. #define IGC_CT_SHIFT 4
  80. #define IGC_COLLISION_THRESHOLD 15
  81. /* Management Control */
  82. #define IGC_MANC_RCV_TCO_EN 0x00020000 /* Receive TCO Packets Enabled */
  83. /* Receive Control */
  84. #define IGC_RCTL_RST 0x00000001 /* Software reset */
  85. #define IGC_RCTL_EN 0x00000002 /* enable */
  86. #define IGC_RCTL_SBP 0x00000004 /* store bad packet */
  87. #define IGC_RCTL_UPE 0x00000008 /* unicast promisc enable */
  88. #define IGC_RCTL_MPE 0x00000010 /* multicast promisc enable */
  89. #define IGC_RCTL_LPE 0x00000020 /* long packet enable */
  90. #define IGC_RCTL_LBM_MAC 0x00000040 /* MAC loopback mode */
  91. #define IGC_RCTL_LBM_TCVR 0x000000C0 /* tcvr loopback mode */
  92. #define IGC_RCTL_RDMTS_HALF 0x00000000 /* Rx desc min thresh size */
  93. #define IGC_RCTL_BAM 0x00008000 /* broadcast enable */
  94. /* Header split receive */
  95. #define IGC_RFCTL_IPV6_EX_DIS 0x00010000
  96. #define IGC_RFCTL_LEF 0x00040000
  97. #define IGC_RCTL_SZ_256 0x00030000 /* Rx buffer size 256 */
  98. #define IGC_RCTL_MO_SHIFT 12 /* multicast offset shift */
  99. #define IGC_RCTL_CFIEN 0x00080000 /* canonical form enable */
  100. #define IGC_RCTL_DPF 0x00400000 /* discard pause frames */
  101. #define IGC_RCTL_PMCF 0x00800000 /* pass MAC control frames */
  102. #define IGC_RCTL_SECRC 0x04000000 /* Strip Ethernet CRC */
  103. #define IGC_N0_QUEUE -1
  104. #endif /* _IGC_DEFINES_H_ */