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