igc_base.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (c) 2018 Intel Corporation */
  3. #ifndef _IGC_BASE_H
  4. #define _IGC_BASE_H
  5. /* forward declaration */
  6. void igc_rx_fifo_flush_base(struct igc_hw *hw);
  7. /* Transmit Descriptor - Advanced */
  8. union igc_adv_tx_desc {
  9. struct {
  10. __le64 buffer_addr; /* Address of descriptor's data buf */
  11. __le32 cmd_type_len;
  12. __le32 olinfo_status;
  13. } read;
  14. struct {
  15. __le64 rsvd; /* Reserved */
  16. __le32 nxtseq_seed;
  17. __le32 status;
  18. } wb;
  19. };
  20. /* Adv Transmit Descriptor Config Masks */
  21. #define IGC_ADVTXD_MAC_TSTAMP 0x00080000 /* IEEE1588 Timestamp packet */
  22. #define IGC_ADVTXD_DTYP_CTXT 0x00200000 /* Advanced Context Descriptor */
  23. #define IGC_ADVTXD_DTYP_DATA 0x00300000 /* Advanced Data Descriptor */
  24. #define IGC_ADVTXD_DCMD_EOP 0x01000000 /* End of Packet */
  25. #define IGC_ADVTXD_DCMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) */
  26. #define IGC_ADVTXD_DCMD_RS 0x08000000 /* Report Status */
  27. #define IGC_ADVTXD_DCMD_DEXT 0x20000000 /* Descriptor extension (1=Adv) */
  28. #define IGC_ADVTXD_DCMD_VLE 0x40000000 /* VLAN pkt enable */
  29. #define IGC_ADVTXD_DCMD_TSE 0x80000000 /* TCP Seg enable */
  30. #define IGC_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */
  31. #define IGC_RAR_ENTRIES 16
  32. struct igc_adv_data_desc {
  33. __le64 buffer_addr; /* Address of the descriptor's data buffer */
  34. union {
  35. u32 data;
  36. struct {
  37. u32 datalen:16; /* Data buffer length */
  38. u32 rsvd:4;
  39. u32 dtyp:4; /* Descriptor type */
  40. u32 dcmd:8; /* Descriptor command */
  41. } config;
  42. } lower;
  43. union {
  44. u32 data;
  45. struct {
  46. u32 status:4; /* Descriptor status */
  47. u32 idx:4;
  48. u32 popts:6; /* Packet Options */
  49. u32 paylen:18; /* Payload length */
  50. } options;
  51. } upper;
  52. };
  53. /* Receive Descriptor - Advanced */
  54. union igc_adv_rx_desc {
  55. struct {
  56. __le64 pkt_addr; /* Packet buffer address */
  57. __le64 hdr_addr; /* Header buffer address */
  58. } read;
  59. struct {
  60. struct {
  61. union {
  62. __le32 data;
  63. struct {
  64. __le16 pkt_info; /*RSS type, Pkt type*/
  65. /* Split Header, header buffer len */
  66. __le16 hdr_info;
  67. } hs_rss;
  68. } lo_dword;
  69. union {
  70. __le32 rss; /* RSS Hash */
  71. struct {
  72. __le16 ip_id; /* IP id */
  73. __le16 csum; /* Packet Checksum */
  74. } csum_ip;
  75. } hi_dword;
  76. } lower;
  77. struct {
  78. __le32 status_error; /* ext status/error */
  79. __le16 length; /* Packet length */
  80. __le16 vlan; /* VLAN tag */
  81. } upper;
  82. } wb; /* writeback */
  83. };
  84. /* Adv Transmit Descriptor Config Masks */
  85. #define IGC_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */
  86. /* Additional Transmit Descriptor Control definitions */
  87. #define IGC_TXDCTL_QUEUE_ENABLE 0x02000000 /* Ena specific Tx Queue */
  88. /* Additional Receive Descriptor Control definitions */
  89. #define IGC_RXDCTL_QUEUE_ENABLE 0x02000000 /* Ena specific Rx Queue */
  90. /* SRRCTL bit definitions */
  91. #define IGC_SRRCTL_BSIZEPKT_SHIFT 10 /* Shift _right_ */
  92. #define IGC_SRRCTL_BSIZEHDRSIZE_SHIFT 2 /* Shift _left_ */
  93. #define IGC_SRRCTL_DESCTYPE_ADV_ONEBUF 0x02000000
  94. #endif /* _IGC_BASE_H */