rmnet_ll.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * RmNet Low Latency channel handlers
  13. */
  14. #ifndef __RMNET_LL_H__
  15. #define __RMNET_LL_H__
  16. #include <linux/skbuff.h>
  17. struct rmnet_ll_stats {
  18. u64 tx_queue;
  19. u64 tx_queue_err;
  20. u64 tx_complete;
  21. u64 tx_complete_err;
  22. u64 rx_queue;
  23. u64 rx_queue_err;
  24. u64 rx_status_err;
  25. u64 rx_null;
  26. u64 rx_oom;
  27. u64 rx_pkts;
  28. u64 rx_tmp_allocs;
  29. };
  30. #if IS_ENABLED(CONFIG_MHI_BUS)
  31. int rmnet_ll_send_skb(struct sk_buff *skb);
  32. struct rmnet_ll_stats *rmnet_ll_get_stats(void);
  33. int rmnet_ll_init(void);
  34. void rmnet_ll_exit(void);
  35. #else
  36. static struct rmnet_ll_stats rmnet_ll_dummy_stats;
  37. static inline int rmnet_ll_send_skb(struct sk_buff *skb)
  38. {
  39. return -EINVAL;
  40. }
  41. static inline struct rmnet_ll_stats *rmnet_ll_get_stats(void)
  42. {
  43. return &rmnet_ll_dummy_stats;
  44. }
  45. static inline int rmnet_ll_init(void)
  46. {
  47. /* Allow configuration to continue. Nothing else will happen since all
  48. * this does is register the driver with the mhi framework, and if the
  49. * channel never comes up, we don't do anything.
  50. */
  51. return 0;
  52. }
  53. static inline void rmnet_ll_exit(void)
  54. {
  55. }
  56. #endif
  57. #endif