dnglevent.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * Broadcom Event protocol definitions
  3. *
  4. * Dependencies: bcmeth.h
  5. *
  6. * Portions of this code are copyright (c) 2020 Cypress Semiconductor Corporation
  7. *
  8. * Copyright (C) 1999-2020, Broadcom Corporation
  9. *
  10. * Unless you and Broadcom execute a separate written software license
  11. * agreement governing use of this software, this software is licensed to you
  12. * under the terms of the GNU General Public License version 2 (the "GPL"),
  13. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  14. * following added to such license:
  15. *
  16. * As a special exception, the copyright holders of this software give you
  17. * permission to link this software with independent modules, and to copy and
  18. * distribute the resulting executable under terms of your choice, provided that
  19. * you also meet, for each linked independent module, the terms and conditions of
  20. * the license of that module. An independent module is a module which is not
  21. * derived from this software. The special exception does not apply to any
  22. * modifications of the software.
  23. *
  24. * Notwithstanding the above, under no circumstances may you combine this
  25. * software in any way with any other Broadcom software provided under a license
  26. * other than the GPL, without Broadcom's express prior written consent.
  27. *
  28. *
  29. * <<Broadcom-WL-IPTag/Open:>>
  30. *
  31. * $Id: dnglevent.h $
  32. *
  33. * -----------------------------------------------------------------------------
  34. *
  35. */
  36. /*
  37. * Broadcom dngl Ethernet Events protocol defines
  38. *
  39. */
  40. #ifndef _DNGLEVENT_H_
  41. #define _DNGLEVENT_H_
  42. #ifndef _TYPEDEFS_H_
  43. #include <typedefs.h>
  44. #endif // endif
  45. #include <bcmeth.h>
  46. #include <ethernet.h>
  47. /* This marks the start of a packed structure section. */
  48. #include <packed_section_start.h>
  49. #define BCM_DNGL_EVENT_MSG_VERSION 1
  50. #define DNGL_E_RSRVD_1 0x0
  51. #define DNGL_E_RSRVD_2 0x1
  52. #define DNGL_E_SOCRAM_IND 0x2
  53. typedef BWL_PRE_PACKED_STRUCT struct
  54. {
  55. uint16 version; /* Current version is 1 */
  56. uint16 reserved; /* reserved for any future extension */
  57. uint16 event_type; /* DNGL_E_SOCRAM_IND */
  58. uint16 datalen; /* Length of the event payload */
  59. } BWL_POST_PACKED_STRUCT bcm_dngl_event_msg_t;
  60. typedef BWL_PRE_PACKED_STRUCT struct bcm_dngl_event {
  61. struct ether_header eth;
  62. bcmeth_hdr_t bcm_hdr;
  63. bcm_dngl_event_msg_t dngl_event;
  64. /* data portion follows */
  65. } BWL_POST_PACKED_STRUCT bcm_dngl_event_t;
  66. typedef BWL_PRE_PACKED_STRUCT struct bcm_dngl_socramind {
  67. uint16 tag; /* data tag */
  68. uint16 length; /* data length */
  69. uint8 value[1]; /* data value with variable length specified by length */
  70. } BWL_POST_PACKED_STRUCT bcm_dngl_socramind_t;
  71. /* SOCRAM_IND type tags */
  72. typedef enum socram_ind_tag {
  73. SOCRAM_IND_ASSERT_TAG = 1,
  74. SOCRAM_IND_TAG_HEALTH_CHECK = 2
  75. } socram_ind_tag_t;
  76. /* Health check top level module tags */
  77. typedef BWL_PRE_PACKED_STRUCT struct bcm_dngl_healthcheck {
  78. uint16 top_module_tag; /* top level module tag */
  79. uint16 top_module_len; /* Type of PCIE issue indication */
  80. uint8 value[1]; /* data value with variable length specified by length */
  81. } BWL_POST_PACKED_STRUCT bcm_dngl_healthcheck_t;
  82. /* Health check top level module tags */
  83. #define HEALTH_CHECK_TOP_LEVEL_MODULE_PCIEDEV_RTE 1
  84. #define HEALTH_CHECK_PCIEDEV_VERSION_1 1
  85. #define HEALTH_CHECK_PCIEDEV_FLAG_IN_D3_SHIFT 0
  86. #define HEALTH_CHECK_PCIEDEV_FLAG_AER_SHIFT 1
  87. #define HEALTH_CHECK_PCIEDEV_FLAG_LINKDOWN_SHIFT 2
  88. #define HEALTH_CHECK_PCIEDEV_FLAG_MSI_INT_SHIFT 3
  89. #define HEALTH_CHECK_PCIEDEV_FLAG_NODS_SHIFT 4
  90. #define HEALTH_CHECK_PCIEDEV_FLAG_NO_HOST_WAKE_SHIFT 5
  91. #define HEALTH_CHECK_PCIEDEV_FLAG_IN_D3 1 << HEALTH_CHECK_PCIEDEV_FLAG_IN_D3_SHIFT
  92. #define HEALTH_CHECK_PCIEDEV_FLAG_AER 1 << HEALTH_CHECK_PCIEDEV_FLAG_AER_SHIFT
  93. #define HEALTH_CHECK_PCIEDEV_FLAG_LINKDOWN 1 << HEALTH_CHECK_PCIEDEV_FLAG_LINKDOWN_SHIFT
  94. #define HEALTH_CHECK_PCIEDEV_FLAG_MSI_INT 1 << HEALTH_CHECK_PCIEDEV_FLAG_MSI_INT_SHIFT
  95. #define HEALTH_CHECK_PCIEDEV_FLAG_NODS 1 << HEALTH_CHECK_PCIEDEV_FLAG_NODS_SHIFT
  96. #define HEALTH_CHECK_PCIEDEV_FLAG_NO_HOST_WAKE 1 << HEALTH_CHECK_PCIEDEV_FLAG_NO_HOST_WAKE_SHIFT
  97. /* PCIE Module TAGs */
  98. #define HEALTH_CHECK_PCIEDEV_INDUCED_IND 0x1
  99. #define HEALTH_CHECK_PCIEDEV_H2D_DMA_IND 0x2
  100. #define HEALTH_CHECK_PCIEDEV_D2H_DMA_IND 0x3
  101. #define HEALTH_CHECK_PCIEDEV_IOCTL_STALL_IND 0x4
  102. #define HEALTH_CHECK_PCIEDEV_D3ACK_STALL_IND 0x5
  103. #define HEALTH_CHECK_PCIEDEV_NODS_IND 0x6
  104. #define HEALTH_CHECK_PCIEDEV_LINKSPEED_FALLBACK_IND 0x7
  105. #define HEALTH_CHECK_PCIEDEV_DSACK_STALL_IND 0x8
  106. #define HC_PCIEDEV_CONFIG_REGLIST_MAX 25
  107. typedef BWL_PRE_PACKED_STRUCT struct bcm_dngl_pcie_hc {
  108. uint16 version; /* HEALTH_CHECK_PCIEDEV_VERSION_1 */
  109. uint16 reserved;
  110. uint16 pcie_err_ind_type; /* PCIE Module TAGs */
  111. uint16 pcie_flag;
  112. uint32 pcie_control_reg;
  113. uint32 pcie_config_regs[HC_PCIEDEV_CONFIG_REGLIST_MAX];
  114. } BWL_POST_PACKED_STRUCT bcm_dngl_pcie_hc_t;
  115. #ifdef HCHK_COMMON_SW_EVENT
  116. /* Enumerating top level SW entities for use by health check */
  117. typedef enum {
  118. HCHK_SW_ENTITY_UNDEFINED = 0,
  119. HCHK_SW_ENTITY_PCIE = 1,
  120. HCHK_SW_ENTITY_SDIO = 2,
  121. HCHK_SW_ENTITY_USB = 3,
  122. HCHK_SW_ENTITY_RTE = 4,
  123. HCHK_SW_ENTITY_WL_PRIMARY = 5, /* WL instance 0 */
  124. HCHK_SW_ENTITY_WL_SECONDARY = 6, /* WL instance 1 */
  125. HCHK_SW_ENTITY_MAX
  126. } hchk_sw_entity_t;
  127. #endif /* HCHK_COMMON_SW_EVENT */
  128. /* This marks the end of a packed structure section. */
  129. #include <packed_section_end.h>
  130. #endif /* _DNGLEVENT_H_ */