fce_hal.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright(C) 2021 Alibaba Communications Inc.
  4. * Author: David Li <liyong.li@alibaba-inc.com>
  5. */
  6. #ifndef _FCE_HAL_H_
  7. #define _FCE_HAL_H_
  8. #ifdef __cplusplus
  9. extern "C"{
  10. #endif
  11. #include <sys/socket.h>
  12. #include <linux/netlink.h>
  13. #include "fce_cfg.h"
  14. enum FCE_EVENT {
  15. FCE_EVENT_COMPLETE = 0,
  16. FCE_EVENT_PAUSE,
  17. FCE_EVENT_BUSERR,
  18. FCE_EVENT_TIMEOUT,
  19. FCE_EVENT_UNDEFMSG,
  20. FCE_EVENT_SOCKERR,
  21. FCE_EVENT_OTHER
  22. };
  23. typedef void *csi_fce_handle_t;
  24. typedef void *csi_fce_sock_handle_t;
  25. int csi_fce_open(csi_fce_handle_t *fce_handle, char *name);
  26. int csi_fce_close(csi_fce_handle_t fce_handle);
  27. int csi_fce_query_result_cnt(csi_fce_handle_t fce_handle, unsigned int *cnt);
  28. int csi_fce_set_result_cnt(csi_fce_handle_t fce_handle, unsigned int *cnt);
  29. int csi_fce_set_attr(csi_fce_handle_t fce_handle, struct fce_cfg *cfg);
  30. int csi_fce_get_attr(csi_fce_handle_t fce_handle, struct fce_cfg *cfg);
  31. int csi_fce_do_compare(csi_fce_handle_t fce_handle, struct target_vector *target_vect);
  32. int csi_fce_get_result(csi_fce_handle_t fce_handle, struct top_result *top_buf);
  33. int csi_fce_suspend(csi_fce_handle_t fce_handle);
  34. int csi_fce_resume(csi_fce_handle_t fce_handle);
  35. unsigned long csi_fce_create_featurelib(csi_fce_handle_t fce_handle, unsigned int size);
  36. int csi_fce_release_featurelib(csi_fce_handle_t fce_handle, unsigned long offset);
  37. int csi_fce_config_init(struct fce_cfg *cfg);
  38. int csi_fce_check_result(struct top_result *res1, struct top_result *res2);
  39. int csi_fce_init_sock(csi_fce_sock_handle_t *sock_handle, unsigned long timeout_ms);
  40. int csi_fce_release_sock(csi_fce_sock_handle_t sock_handle);
  41. enum FCE_EVENT csi_fce_waitevent(csi_fce_sock_handle_t sock_handle);
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif // #ifndef _FCE_HAL_H_