rmnet_ctl.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * RMNET_CTL header
  6. *
  7. */
  8. #ifndef _RMNET_CTL_H_
  9. #define _RMNET_CTL_H_
  10. #include <linux/skbuff.h>
  11. enum rmnet_ctl_log_lvl {
  12. RMNET_CTL_LOG_CRIT,
  13. RMNET_CTL_LOG_ERR,
  14. RMNET_CTL_LOG_INFO,
  15. RMNET_CTL_LOG_DEBUG,
  16. };
  17. struct rmnet_ctl_client_hooks {
  18. void (*ctl_dl_client_hook)(struct sk_buff *skb);
  19. };
  20. struct rmnet_ctl_client_if {
  21. void * (*reg)(struct rmnet_ctl_client_hooks *hook);
  22. int (*dereg)(void *handle);
  23. int (*send)(void *handle, struct sk_buff *skb);
  24. void (*log)(enum rmnet_ctl_log_lvl lvl, const char *msg, int rc,
  25. const void *data, unsigned int len);
  26. };
  27. #ifdef CONFIG_RMNET_LA_PLATFORM
  28. struct rmnet_ctl_client_if *rmnet_ctl_if(void);
  29. int rmnet_ctl_get_stats(u64 *s, int n);
  30. #else
  31. static inline struct rmnet_ctl_client_if *rmnet_ctl_if(void) {return NULL;};
  32. static inline int rmnet_ctl_get_stats(u64 *s, int n) {return 0;};
  33. #endif /* CONFIG_RMNET_LA_PLATFORM */
  34. #endif /* _RMNET_CTL_H_ */