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