cvmx-helper.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2020 Marvell International Ltd.
  4. *
  5. * Helper functions for common, but complicated tasks.
  6. */
  7. #ifndef __CVMX_HELPER_H__
  8. #define __CVMX_HELPER_H__
  9. #include "cvmx-wqe.h"
  10. /* Max number of GMXX */
  11. #define CVMX_HELPER_MAX_GMX \
  12. (OCTEON_IS_MODEL(OCTEON_CN78XX) ? \
  13. 6 : \
  14. (OCTEON_IS_MODEL(OCTEON_CN68XX) ? \
  15. 5 : \
  16. (OCTEON_IS_MODEL(OCTEON_CN73XX) ? \
  17. 3 : \
  18. (OCTEON_IS_MODEL(OCTEON_CNF75XX) ? 1 : 2))))
  19. #define CVMX_HELPER_CSR_INIT0 \
  20. 0 /* Do not change as
  21. CVMX_HELPER_WRITE_CSR()
  22. assumes it */
  23. #define CVMX_HELPER_CSR_INIT_READ -1
  24. /*
  25. * CVMX_HELPER_WRITE_CSR--set a field in a CSR with a value.
  26. *
  27. * @param chcsr_init initial value of the csr (CVMX_HELPER_CSR_INIT_READ
  28. * means to use the existing csr value as the
  29. * initial value.)
  30. * @param chcsr_csr the name of the csr
  31. * @param chcsr_type the type of the csr (see the -defs.h)
  32. * @param chcsr_chip the chip for the csr/field
  33. * @param chcsr_fld the field in the csr
  34. * @param chcsr_val the value for field
  35. */
  36. #define CVMX_HELPER_WRITE_CSR(chcsr_init, chcsr_csr, chcsr_type, chcsr_chip, chcsr_fld, chcsr_val) \
  37. do { \
  38. chcsr_type csr; \
  39. if ((chcsr_init) == CVMX_HELPER_CSR_INIT_READ) \
  40. csr.u64 = cvmx_read_csr(chcsr_csr); \
  41. else \
  42. csr.u64 = (chcsr_init); \
  43. csr.chcsr_chip.chcsr_fld = (chcsr_val); \
  44. cvmx_write_csr((chcsr_csr), csr.u64); \
  45. } while (0)
  46. /*
  47. * CVMX_HELPER_WRITE_CSR0--set a field in a CSR with the initial value of 0
  48. */
  49. #define CVMX_HELPER_WRITE_CSR0(chcsr_csr, chcsr_type, chcsr_chip, chcsr_fld, chcsr_val) \
  50. CVMX_HELPER_WRITE_CSR(CVMX_HELPER_CSR_INIT0, chcsr_csr, chcsr_type, chcsr_chip, chcsr_fld, \
  51. chcsr_val)
  52. /*
  53. * CVMX_HELPER_WRITE_CSR1--set a field in a CSR with the initial value of
  54. * the CSR's current value.
  55. */
  56. #define CVMX_HELPER_WRITE_CSR1(chcsr_csr, chcsr_type, chcsr_chip, chcsr_fld, chcsr_val) \
  57. CVMX_HELPER_WRITE_CSR(CVMX_HELPER_CSR_INIT_READ, chcsr_csr, chcsr_type, chcsr_chip, \
  58. chcsr_fld, chcsr_val)
  59. /* These flags are passed to __cvmx_helper_packet_hardware_enable */
  60. typedef enum {
  61. CVMX_HELPER_INTERFACE_MODE_DISABLED,
  62. CVMX_HELPER_INTERFACE_MODE_RGMII,
  63. CVMX_HELPER_INTERFACE_MODE_GMII,
  64. CVMX_HELPER_INTERFACE_MODE_SPI,
  65. CVMX_HELPER_INTERFACE_MODE_PCIE,
  66. CVMX_HELPER_INTERFACE_MODE_XAUI,
  67. CVMX_HELPER_INTERFACE_MODE_SGMII,
  68. CVMX_HELPER_INTERFACE_MODE_PICMG,
  69. CVMX_HELPER_INTERFACE_MODE_NPI,
  70. CVMX_HELPER_INTERFACE_MODE_LOOP,
  71. CVMX_HELPER_INTERFACE_MODE_SRIO,
  72. CVMX_HELPER_INTERFACE_MODE_ILK,
  73. CVMX_HELPER_INTERFACE_MODE_RXAUI,
  74. CVMX_HELPER_INTERFACE_MODE_QSGMII,
  75. CVMX_HELPER_INTERFACE_MODE_AGL,
  76. CVMX_HELPER_INTERFACE_MODE_XLAUI,
  77. CVMX_HELPER_INTERFACE_MODE_XFI,
  78. CVMX_HELPER_INTERFACE_MODE_10G_KR,
  79. CVMX_HELPER_INTERFACE_MODE_40G_KR4,
  80. CVMX_HELPER_INTERFACE_MODE_MIXED,
  81. } cvmx_helper_interface_mode_t;
  82. typedef union cvmx_helper_link_info {
  83. u64 u64;
  84. struct {
  85. u64 reserved_20_63 : 43;
  86. u64 init_success : 1;
  87. u64 link_up : 1;
  88. u64 full_duplex : 1;
  89. u64 speed : 18;
  90. } s;
  91. } cvmx_helper_link_info_t;
  92. /**
  93. * Sets the back pressure configuration in internal data structure.
  94. * @param backpressure_dis disable/enable backpressure
  95. */
  96. void cvmx_rgmii_set_back_pressure(u64 backpressure_dis);
  97. #include "cvmx-helper-fpa.h"
  98. #include "cvmx-helper-agl.h"
  99. #include "cvmx-helper-errata.h"
  100. #include "cvmx-helper-ilk.h"
  101. #include "cvmx-helper-loop.h"
  102. #include "cvmx-helper-npi.h"
  103. #include "cvmx-helper-rgmii.h"
  104. #include "cvmx-helper-sgmii.h"
  105. #include "cvmx-helper-spi.h"
  106. #include "cvmx-helper-srio.h"
  107. #include "cvmx-helper-util.h"
  108. #include "cvmx-helper-xaui.h"
  109. #include "cvmx-fpa3.h"
  110. enum cvmx_pko_padding {
  111. CVMX_PKO_PADDING_NONE = 0,
  112. CVMX_PKO_PADDING_60 = 1,
  113. };
  114. /**
  115. * This function enables the IPD and also enables the packet interfaces.
  116. * The packet interfaces (RGMII and SPI) must be enabled after the
  117. * IPD. This should be called by the user program after any additional
  118. * IPD configuration changes are made if CVMX_HELPER_ENABLE_IPD
  119. * is not set in the executive-config.h file.
  120. *
  121. * Return: 0 on success
  122. * -1 on failure
  123. */
  124. int cvmx_helper_ipd_and_packet_input_enable_node(int node);
  125. int cvmx_helper_ipd_and_packet_input_enable(void);
  126. /**
  127. * Initialize and allocate memory for the SSO.
  128. *
  129. * @param wqe_entries The maximum number of work queue entries to be
  130. * supported.
  131. *
  132. * Return: Zero on success, non-zero on failure.
  133. */
  134. int cvmx_helper_initialize_sso(int wqe_entries);
  135. /**
  136. * Initialize and allocate memory for the SSO on a specific node.
  137. *
  138. * @param node Node SSO to initialize
  139. * @param wqe_entries The maximum number of work queue entries to be
  140. * supported.
  141. *
  142. * Return: Zero on success, non-zero on failure.
  143. */
  144. int cvmx_helper_initialize_sso_node(unsigned int node, int wqe_entries);
  145. /**
  146. * Undo the effect of cvmx_helper_initialize_sso().
  147. *
  148. * Return: Zero on success, non-zero on failure.
  149. */
  150. int cvmx_helper_uninitialize_sso(void);
  151. /**
  152. * Undo the effect of cvmx_helper_initialize_sso_node().
  153. *
  154. * @param node Node SSO to initialize
  155. *
  156. * Return: Zero on success, non-zero on failure.
  157. */
  158. int cvmx_helper_uninitialize_sso_node(unsigned int node);
  159. /**
  160. * Initialize the PIP, IPD, and PKO hardware to support
  161. * simple priority based queues for the ethernet ports. Each
  162. * port is configured with a number of priority queues based
  163. * on CVMX_PKO_QUEUES_PER_PORT_* where each queue is lower
  164. * priority than the previous.
  165. *
  166. * Return: Zero on success, non-zero on failure
  167. */
  168. int cvmx_helper_initialize_packet_io_global(void);
  169. /**
  170. * Initialize the PIP, IPD, and PKO hardware to support
  171. * simple priority based queues for the ethernet ports. Each
  172. * port is configured with a number of priority queues based
  173. * on CVMX_PKO_QUEUES_PER_PORT_* where each queue is lower
  174. * priority than the previous.
  175. *
  176. * @param node Node on which to initialize packet io hardware
  177. *
  178. * Return: Zero on success, non-zero on failure
  179. */
  180. int cvmx_helper_initialize_packet_io_node(unsigned int node);
  181. /**
  182. * Does core local initialization for packet io
  183. *
  184. * Return: Zero on success, non-zero on failure
  185. */
  186. int cvmx_helper_initialize_packet_io_local(void);
  187. /**
  188. * Undo the initialization performed in
  189. * cvmx_helper_initialize_packet_io_global(). After calling this routine and the
  190. * local version on each core, packet IO for Octeon will be disabled and placed
  191. * in the initial reset state. It will then be safe to call the initialize
  192. * later on. Note that this routine does not empty the FPA pools. It frees all
  193. * buffers used by the packet IO hardware to the FPA so a function emptying the
  194. * FPA after shutdown should find all packet buffers in the FPA.
  195. *
  196. * Return: Zero on success, negative on failure.
  197. */
  198. int cvmx_helper_shutdown_packet_io_global(void);
  199. /**
  200. * Helper function for 78xx global packet IO shutdown
  201. */
  202. int cvmx_helper_shutdown_packet_io_global_cn78xx(int node);
  203. /**
  204. * Does core local shutdown of packet io
  205. *
  206. * Return: Zero on success, non-zero on failure
  207. */
  208. int cvmx_helper_shutdown_packet_io_local(void);
  209. /**
  210. * Returns the number of ports on the given interface.
  211. * The interface must be initialized before the port count
  212. * can be returned.
  213. *
  214. * @param interface Which interface to return port count for.
  215. *
  216. * Return: Port count for interface
  217. * -1 for uninitialized interface
  218. */
  219. int cvmx_helper_ports_on_interface(int interface);
  220. /**
  221. * Return the number of interfaces the chip has. Each interface
  222. * may have multiple ports. Most chips support two interfaces,
  223. * but the CNX0XX and CNX1XX are exceptions. These only support
  224. * one interface.
  225. *
  226. * Return: Number of interfaces on chip
  227. */
  228. int cvmx_helper_get_number_of_interfaces(void);
  229. /**
  230. * Get the operating mode of an interface. Depending on the Octeon
  231. * chip and configuration, this function returns an enumeration
  232. * of the type of packet I/O supported by an interface.
  233. *
  234. * @param xiface Interface to probe
  235. *
  236. * Return: Mode of the interface. Unknown or unsupported interfaces return
  237. * DISABLED.
  238. */
  239. cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int xiface);
  240. /**
  241. * Auto configure an IPD/PKO port link state and speed. This
  242. * function basically does the equivalent of:
  243. * cvmx_helper_link_set(ipd_port, cvmx_helper_link_get(ipd_port));
  244. *
  245. * @param ipd_port IPD/PKO port to auto configure
  246. *
  247. * Return: Link state after configure
  248. */
  249. cvmx_helper_link_info_t cvmx_helper_link_autoconf(int ipd_port);
  250. /**
  251. * Return the link state of an IPD/PKO port as returned by
  252. * auto negotiation. The result of this function may not match
  253. * Octeon's link config if auto negotiation has changed since
  254. * the last call to cvmx_helper_link_set().
  255. *
  256. * @param ipd_port IPD/PKO port to query
  257. *
  258. * Return: Link state
  259. */
  260. cvmx_helper_link_info_t cvmx_helper_link_get(int ipd_port);
  261. /**
  262. * Configure an IPD/PKO port for the specified link state. This
  263. * function does not influence auto negotiation at the PHY level.
  264. * The passed link state must always match the link state returned
  265. * by cvmx_helper_link_get(). It is normally best to use
  266. * cvmx_helper_link_autoconf() instead.
  267. *
  268. * @param ipd_port IPD/PKO port to configure
  269. * @param link_info The new link state
  270. *
  271. * Return: Zero on success, negative on failure
  272. */
  273. int cvmx_helper_link_set(int ipd_port, cvmx_helper_link_info_t link_info);
  274. /**
  275. * This function probes an interface to determine the actual number of
  276. * hardware ports connected to it. It does some setup the ports but
  277. * doesn't enable them. The main goal here is to set the global
  278. * interface_port_count[interface] correctly. Final hardware setup of
  279. * the ports will be performed later.
  280. *
  281. * @param xiface Interface to probe
  282. *
  283. * Return: Zero on success, negative on failure
  284. */
  285. int cvmx_helper_interface_probe(int xiface);
  286. /**
  287. * Determine the actual number of hardware ports connected to an
  288. * interface. It doesn't setup the ports or enable them.
  289. *
  290. * @param xiface Interface to enumerate
  291. *
  292. * Return: Zero on success, negative on failure
  293. */
  294. int cvmx_helper_interface_enumerate(int xiface);
  295. /**
  296. * Configure a port for internal and/or external loopback. Internal loopback
  297. * causes packets sent by the port to be received by Octeon. External loopback
  298. * causes packets received from the wire to sent out again.
  299. *
  300. * @param ipd_port IPD/PKO port to loopback.
  301. * @param enable_internal
  302. * Non zero if you want internal loopback
  303. * @param enable_external
  304. * Non zero if you want external loopback
  305. *
  306. * Return: Zero on success, negative on failure.
  307. */
  308. int cvmx_helper_configure_loopback(int ipd_port, int enable_internal, int enable_external);
  309. /**
  310. * Returns the number of ports on the given interface.
  311. *
  312. * @param interface Which interface to return port count for.
  313. *
  314. * Return: Port count for interface
  315. * -1 for uninitialized interface
  316. */
  317. int __cvmx_helper_early_ports_on_interface(int interface);
  318. void cvmx_helper_setup_simulator_io_buffer_counts(int node, int num_packet_buffers,
  319. int pko_buffers);
  320. void cvmx_helper_set_wqe_no_ptr_mode(bool mode);
  321. void cvmx_helper_set_pkt_wqe_le_mode(bool mode);
  322. int cvmx_helper_shutdown_fpa_pools(int node);
  323. /**
  324. * Convert Ethernet QoS/PCP value to system-level priority
  325. *
  326. * In OCTEON, highest priority is 0, in Ethernet 802.1p PCP field
  327. * the highest priority is 7, lowest is 1. Here is the full conversion
  328. * table between QoS (PCP) and OCTEON priority values, per IEEE 802.1Q-2005:
  329. *
  330. * PCP Priority Acronym Traffic Types
  331. * 1 7 (lowest) BK Background
  332. * 0 6 BE Best Effort
  333. * 2 5 EE Excellent Effort
  334. * 3 4 CA Critical Applications
  335. * 4 3 VI Video, < 100 ms latency and jitter
  336. * 5 2 VO Voice, < 10 ms latency and jitter
  337. * 6 1 IC Internetwork Control
  338. * 7 0 (highest) NC Network Control
  339. */
  340. static inline u8 cvmx_helper_qos2prio(u8 qos)
  341. {
  342. static const unsigned int pcp_map = 6 << (4 * 0) | 7 << (4 * 1) | 5 << (4 * 2) |
  343. 4 << (4 * 3) | 3 << (4 * 4) | 2 << (4 * 5) |
  344. 1 << (4 * 6) | 0 << (4 * 7);
  345. return (pcp_map >> ((qos & 0x7) << 2)) & 0x7;
  346. }
  347. /**
  348. * Convert system-level priority to Ethernet QoS/PCP value
  349. *
  350. * Calculate the reverse of cvmx_helper_qos2prio() per IEEE 802.1Q-2005.
  351. */
  352. static inline u8 cvmx_helper_prio2qos(u8 prio)
  353. {
  354. static const unsigned int prio_map = 7 << (4 * 0) | 6 << (4 * 1) | 5 << (4 * 2) |
  355. 4 << (4 * 3) | 3 << (4 * 4) | 2 << (4 * 5) |
  356. 0 << (4 * 6) | 1 << (4 * 7);
  357. return (prio_map >> ((prio & 0x7) << 2)) & 0x7;
  358. }
  359. /**
  360. * @INTERNAL
  361. * Get the number of ipd_ports on an interface.
  362. *
  363. * @param xiface
  364. *
  365. * Return: the number of ipd_ports on the interface and -1 for error.
  366. */
  367. int __cvmx_helper_get_num_ipd_ports(int xiface);
  368. enum cvmx_pko_padding __cvmx_helper_get_pko_padding(int xiface);
  369. /**
  370. * @INTERNAL
  371. *
  372. * @param xiface
  373. * @param num_ipd_ports is the number of ipd_ports on the interface
  374. * @param has_fcs indicates if PKO does FCS for the ports on this
  375. * @param pad The padding that PKO should apply.
  376. * interface.
  377. *
  378. * Return: 0 for success and -1 for failure
  379. */
  380. int __cvmx_helper_init_interface(int xiface, int num_ipd_ports, int has_fcs,
  381. enum cvmx_pko_padding pad);
  382. void __cvmx_helper_shutdown_interfaces(void);
  383. /*
  384. * @INTERNAL
  385. * Enable packet input/output from the hardware. This function is
  386. * called after all internal setup is complete and IPD is enabled.
  387. * After this function completes, packets will be accepted from the
  388. * hardware ports. PKO should still be disabled to make sure packets
  389. * aren't sent out partially setup hardware.
  390. *
  391. * Return: Zero on success, negative on failure
  392. */
  393. int __cvmx_helper_packet_hardware_enable(int xiface);
  394. /*
  395. * @INTERNAL
  396. *
  397. * Return: 0 for success and -1 for failure
  398. */
  399. int __cvmx_helper_set_link_info(int xiface, int index, cvmx_helper_link_info_t link_info);
  400. /**
  401. * @INTERNAL
  402. *
  403. * @param xiface
  404. * @param port
  405. *
  406. * Return: valid link_info on success or -1 on failure
  407. */
  408. cvmx_helper_link_info_t __cvmx_helper_get_link_info(int xiface, int port);
  409. /**
  410. * @INTERNAL
  411. *
  412. * @param xiface
  413. *
  414. * Return: 0 if PKO does not do FCS and 1 otherwise.
  415. */
  416. int __cvmx_helper_get_has_fcs(int xiface);
  417. void *cvmx_helper_mem_alloc(int node, u64 alloc_size, u64 align);
  418. void cvmx_helper_mem_free(void *buffer, u64 size);
  419. #define CVMX_QOS_NUM 8 /* Number of QoS priority classes */
  420. typedef enum {
  421. CVMX_QOS_PROTO_NONE, /* Disable QOS */
  422. CVMX_QOS_PROTO_PAUSE, /* IEEE 802.3 PAUSE */
  423. CVMX_QOS_PROTO_PFC /* IEEE 802.1Qbb-2011 PFC/CBFC */
  424. } cvmx_qos_proto_t;
  425. typedef enum {
  426. CVMX_QOS_PKT_MODE_HWONLY, /* PAUSE packets processed in Hardware only. */
  427. CVMX_QOS_PKT_MODE_SWONLY, /* PAUSE packets processed in Software only. */
  428. CVMX_QOS_PKT_MODE_HWSW, /* PAUSE packets processed in both HW and SW. */
  429. CVMX_QOS_PKT_MODE_DROP /* Ignore PAUSE packets. */
  430. } cvmx_qos_pkt_mode_t;
  431. typedef enum {
  432. CVMX_QOS_POOL_PER_PORT, /* Pool per Physical Port */
  433. CVMX_QOS_POOL_PER_CLASS /* Pool per Priority Class */
  434. } cvmx_qos_pool_mode_t;
  435. typedef struct cvmx_qos_config {
  436. cvmx_qos_proto_t qos_proto; /* QoS protocol.*/
  437. cvmx_qos_pkt_mode_t pkt_mode; /* PAUSE processing mode.*/
  438. cvmx_qos_pool_mode_t pool_mode; /* FPA Pool mode.*/
  439. int pktbuf_size; /* Packet buffer size */
  440. int aura_size; /* Number of buffers */
  441. int drop_thresh[CVMX_QOS_NUM]; /* DROP threashold in % */
  442. int red_thresh[CVMX_QOS_NUM]; /* RED threashold in % */
  443. int bp_thresh[CVMX_QOS_NUM]; /* BP threashold in % */
  444. int groups[CVMX_QOS_NUM]; /* Base SSO group for QOS group set. */
  445. int group_prio[CVMX_QOS_NUM]; /* SSO group priorities.*/
  446. int pko_pfc_en; /* Enable PKO PFC layout. */
  447. int vlan_num; /* VLAN number: 0 = 1st or 1 = 2nd. */
  448. int p_time; /* PAUSE packets send time (in number of 512 bit-times).*/
  449. int p_interval; /* PAUSE packet send interval (in number of 512 bit-times).*/
  450. /* Internal parameters (should not be used by application developer): */
  451. cvmx_fpa3_pool_t gpools[CVMX_QOS_NUM]; /* Pool to use.*/
  452. cvmx_fpa3_gaura_t gauras[CVMX_QOS_NUM]; /* Global auras -- one per priority class. */
  453. int bpids[CVMX_QOS_NUM]; /* PKI BPID.*/
  454. int qpg_base; /* QPG Table base index.*/
  455. } cvmx_qos_config_t;
  456. /**
  457. * Initialize QoS configuraiton with the SDK defaults.
  458. *
  459. * @param qos_cfg User QOS configuration parameters.
  460. * Return: Zero on success, negative number otherwise.
  461. */
  462. int cvmx_helper_qos_config_init(cvmx_qos_proto_t qos_proto, cvmx_qos_config_t *qos_cfg);
  463. /**
  464. * Update the user static processor configuration.
  465. * It should be done before any initialization of the DP units is performed.
  466. *
  467. * @param xipdport Global IPD port
  468. * @param qos_cfg User QOS configuration parameters.
  469. * Return: Zero on success, negative number otherwise.
  470. */
  471. int cvmx_helper_qos_port_config_update(int xipdport, cvmx_qos_config_t *qos_cfg);
  472. /**
  473. * Configure the Data Path components for QOS function.
  474. * This function is called after the global processor initialization is
  475. * performed.
  476. *
  477. * @param xipdport Global IPD port
  478. * @param qos_cfg User QOS configuration parameters.
  479. * Return: Zero on success, negative number otherwise.
  480. */
  481. int cvmx_helper_qos_port_setup(int xipdport, cvmx_qos_config_t *qos_cfg);
  482. /**
  483. * Configure the SSO for QOS function.
  484. * This function is called after the global processor initialization is
  485. * performed.
  486. *
  487. * @param node OCTEON3 node number.
  488. * @param qos_cfg User QOS configuration parameters.
  489. * Return: Zero on success, negative number otherwise.
  490. */
  491. int cvmx_helper_qos_sso_setup(int node, cvmx_qos_config_t *qos_cfg);
  492. /**
  493. * Return PKI_CHAN_E channel name based on the provided index.
  494. * @param chan Channel index.
  495. * @param namebuf Name buffer (output).
  496. * @param buflen Name maximum length.
  497. * Return: Length of name (in bytes) on success, negative number otherwise.
  498. */
  499. int cvmx_helper_get_chan_e_name(int chan, char *namebuf, int buflen);
  500. #ifdef CVMX_DUMP_DIAGNOSTICS
  501. void cvmx_helper_dump_for_diagnostics(int node);
  502. #endif
  503. #endif /* __CVMX_HELPER_H__ */