rmnet_config.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* Copyright (c) 2013-2014, 2016-2017 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 Data configuration engine
  13. *
  14. */
  15. #include <linux/skbuff.h>
  16. #include <net/gro_cells.h>
  17. #ifndef _RMNET_CONFIG_H_
  18. #define _RMNET_CONFIG_H_
  19. #define RMNET_MAX_LOGICAL_EP 255
  20. struct rmnet_endpoint {
  21. u8 mux_id;
  22. struct net_device *egress_dev;
  23. struct hlist_node hlnode;
  24. };
  25. /* One instance of this structure is instantiated for each real_dev associated
  26. * with rmnet.
  27. */
  28. struct rmnet_port {
  29. struct net_device *dev;
  30. u32 ingress_data_format;
  31. u32 egress_data_format;
  32. u8 nr_rmnet_devs;
  33. u8 rmnet_mode;
  34. struct hlist_head muxed_ep[RMNET_MAX_LOGICAL_EP];
  35. struct net_device *bridge_ep;
  36. };
  37. extern struct rtnl_link_ops rmnet_link_ops;
  38. struct rmnet_vnd_stats {
  39. u64 rx_pkts;
  40. u64 rx_bytes;
  41. u64 tx_pkts;
  42. u64 tx_bytes;
  43. u32 tx_drops;
  44. };
  45. struct rmnet_pcpu_stats {
  46. struct rmnet_vnd_stats stats;
  47. struct u64_stats_sync syncp;
  48. };
  49. struct rmnet_priv {
  50. u8 mux_id;
  51. struct net_device *real_dev;
  52. struct rmnet_pcpu_stats __percpu *pcpu_stats;
  53. struct gro_cells gro_cells;
  54. };
  55. struct rmnet_port *rmnet_get_port(struct net_device *real_dev);
  56. struct rmnet_endpoint *rmnet_get_endpoint(struct rmnet_port *port, u8 mux_id);
  57. int rmnet_add_bridge(struct net_device *rmnet_dev,
  58. struct net_device *slave_dev,
  59. struct netlink_ext_ack *extack);
  60. int rmnet_del_bridge(struct net_device *rmnet_dev,
  61. struct net_device *slave_dev);
  62. #endif /* _RMNET_CONFIG_H_ */