rmnet_qmi.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef _RMNET_QMI_H
  14. #define _RMNET_QMI_H
  15. #include <linux/netdevice.h>
  16. #include <linux/skbuff.h>
  17. #define CONFIG_QTI_QMI_RMNET 1
  18. void rmnet_map_tx_qmap_cmd(struct sk_buff *qmap_skb, u8 ch, bool flush);
  19. #ifdef CONFIG_QTI_QMI_RMNET
  20. void *rmnet_get_qmi_pt(void *port);
  21. void *rmnet_get_qos_pt(struct net_device *dev);
  22. void *rmnet_get_rmnet_port(struct net_device *dev);
  23. struct net_device *rmnet_get_rmnet_dev(void *port, u8 mux_id);
  24. void rmnet_reset_qmi_pt(void *port);
  25. void rmnet_init_qmi_pt(void *port, void *qmi);
  26. void rmnet_enable_all_flows(void *port);
  27. bool rmnet_all_flows_enabled(void *port);
  28. void rmnet_set_powersave_format(void *port);
  29. void rmnet_clear_powersave_format(void *port);
  30. void rmnet_get_packets(void *port, u64 *rx, u64 *tx);
  31. int rmnet_get_powersave_notif(void *port);
  32. struct net_device *rmnet_get_real_dev(void *port);
  33. int rmnet_get_dlmarker_info(void *port);
  34. void rmnet_lock_unlock_all_flows(void *port, bool lock);
  35. void rmnet_get_disabled_flows(void *port, u8 *num_bearers, u8 *bearer_id);
  36. void rmnet_reset_enabled_flows(void *port);
  37. #else
  38. static inline void *rmnet_get_qmi_pt(void *port)
  39. {
  40. return NULL;
  41. }
  42. static inline void *rmnet_get_qos_pt(struct net_device *dev)
  43. {
  44. return NULL;
  45. }
  46. static inline void *rmnet_get_rmnet_port(struct net_device *dev)
  47. {
  48. return NULL;
  49. }
  50. static inline struct net_device *rmnet_get_rmnet_dev(void *port,
  51. u8 mux_id)
  52. {
  53. return NULL;
  54. }
  55. static inline void rmnet_reset_qmi_pt(void *port)
  56. {
  57. }
  58. static inline void rmnet_init_qmi_pt(void *port, void *qmi)
  59. {
  60. }
  61. static inline void rmnet_enable_all_flows(void *port)
  62. {
  63. }
  64. static inline bool rmnet_all_flows_enabled(void *port)
  65. {
  66. return true;
  67. }
  68. static inline void rmnet_set_port_format(void *port)
  69. {
  70. }
  71. static inline void rmnet_get_packets(void *port, u64 *rx, u64 *tx)
  72. {
  73. }
  74. static inline int rmnet_get_powersave_notif(void *port)
  75. {
  76. return 0;
  77. }
  78. static inline struct net_device *rmnet_get_real_dev(void *port)
  79. {
  80. return NULL;
  81. }
  82. static inline int rmnet_get_dlmarker_info(void *port)
  83. {
  84. return 0;
  85. }
  86. #endif /* CONFIG_QTI_QMI_RMNET */
  87. #endif /*_RMNET_QMI_H*/