igc_base.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. struct igc_adv_data_desc {
  21. __le64 buffer_addr; /* Address of the descriptor's data buffer */
  22. union {
  23. u32 data;
  24. struct {
  25. u32 datalen:16; /* Data buffer length */
  26. u32 rsvd:4;
  27. u32 dtyp:4; /* Descriptor type */
  28. u32 dcmd:8; /* Descriptor command */
  29. } config;
  30. } lower;
  31. union {
  32. u32 data;
  33. struct {
  34. u32 status:4; /* Descriptor status */
  35. u32 idx:4;
  36. u32 popts:6; /* Packet Options */
  37. u32 paylen:18; /* Payload length */
  38. } options;
  39. } upper;
  40. };
  41. /* Receive Descriptor - Advanced */
  42. union igc_adv_rx_desc {
  43. struct {
  44. __le64 pkt_addr; /* Packet buffer address */
  45. __le64 hdr_addr; /* Header buffer address */
  46. } read;
  47. struct {
  48. struct {
  49. union {
  50. __le32 data;
  51. struct {
  52. __le16 pkt_info; /*RSS type, Pkt type*/
  53. /* Split Header, header buffer len */
  54. __le16 hdr_info;
  55. } hs_rss;
  56. } lo_dword;
  57. union {
  58. __le32 rss; /* RSS Hash */
  59. struct {
  60. __le16 ip_id; /* IP id */
  61. __le16 csum; /* Packet Checksum */
  62. } csum_ip;
  63. } hi_dword;
  64. } lower;
  65. struct {
  66. __le32 status_error; /* ext status/error */
  67. __le16 length; /* Packet length */
  68. __le16 vlan; /* VLAN tag */
  69. } upper;
  70. } wb; /* writeback */
  71. };
  72. /* Additional Transmit Descriptor Control definitions */
  73. #define IGC_TXDCTL_QUEUE_ENABLE 0x02000000 /* Ena specific Tx Queue */
  74. /* Additional Receive Descriptor Control definitions */
  75. #define IGC_RXDCTL_QUEUE_ENABLE 0x02000000 /* Ena specific Rx Queue */
  76. /* SRRCTL bit definitions */
  77. #define IGC_SRRCTL_BSIZEPKT_SHIFT 10 /* Shift _right_ */
  78. #define IGC_SRRCTL_BSIZEHDRSIZE_SHIFT 2 /* Shift _left_ */
  79. #define IGC_SRRCTL_DESCTYPE_ADV_ONEBUF 0x02000000
  80. #endif /* _IGC_BASE_H */