rmnet_config.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* Copyright (c) 2013-2014, 2016-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * RMNET Data configuration engine
  5. */
  6. #include <linux/skbuff.h>
  7. #include <net/gro_cells.h>
  8. #ifndef _RMNET_CONFIG_H_
  9. #define _RMNET_CONFIG_H_
  10. #define RMNET_MAX_LOGICAL_EP 255
  11. struct rmnet_endpoint {
  12. u8 mux_id;
  13. struct net_device *egress_dev;
  14. struct hlist_node hlnode;
  15. };
  16. /* One instance of this structure is instantiated for each real_dev associated
  17. * with rmnet.
  18. */
  19. struct rmnet_port {
  20. struct net_device *dev;
  21. u32 data_format;
  22. u8 nr_rmnet_devs;
  23. u8 rmnet_mode;
  24. struct hlist_head muxed_ep[RMNET_MAX_LOGICAL_EP];
  25. struct net_device *bridge_ep;
  26. struct net_device *rmnet_dev;
  27. };
  28. extern struct rtnl_link_ops rmnet_link_ops;
  29. struct rmnet_vnd_stats {
  30. u64 rx_pkts;
  31. u64 rx_bytes;
  32. u64 tx_pkts;
  33. u64 tx_bytes;
  34. u32 tx_drops;
  35. };
  36. struct rmnet_pcpu_stats {
  37. struct rmnet_vnd_stats stats;
  38. struct u64_stats_sync syncp;
  39. };
  40. struct rmnet_priv_stats {
  41. u64 csum_ok;
  42. u64 csum_valid_unset;
  43. u64 csum_validation_failed;
  44. u64 csum_err_bad_buffer;
  45. u64 csum_err_invalid_ip_version;
  46. u64 csum_err_invalid_transport;
  47. u64 csum_fragmented_pkt;
  48. u64 csum_skipped;
  49. u64 csum_sw;
  50. };
  51. struct rmnet_priv {
  52. u8 mux_id;
  53. struct net_device *real_dev;
  54. struct rmnet_pcpu_stats __percpu *pcpu_stats;
  55. struct gro_cells gro_cells;
  56. struct rmnet_priv_stats stats;
  57. };
  58. struct rmnet_port *rmnet_get_port_rcu(struct net_device *real_dev);
  59. struct rmnet_endpoint *rmnet_get_endpoint(struct rmnet_port *port, u8 mux_id);
  60. int rmnet_add_bridge(struct net_device *rmnet_dev,
  61. struct net_device *slave_dev,
  62. struct netlink_ext_ack *extack);
  63. int rmnet_del_bridge(struct net_device *rmnet_dev,
  64. struct net_device *slave_dev);
  65. #endif /* _RMNET_CONFIG_H_ */