]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
Merge tag 'asoc-v5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[mirror_ubuntu-hirsute-kernel.git] / drivers / net / ethernet / qualcomm / rmnet / rmnet_config.h
CommitLineData
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 15struct 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 24struct 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;
d939b6d3 31 struct net_device *rmnet_dev;
ceed73a2
SAK
32};
33
34extern struct rtnl_link_ops rmnet_link_ops;
35
192c4b5d
SAK
36struct rmnet_vnd_stats {
37 u64 rx_pkts;
38 u64 rx_bytes;
39 u64 tx_pkts;
40 u64 tx_bytes;
41 u32 tx_drops;
42};
43
44struct rmnet_pcpu_stats {
45 struct rmnet_vnd_stats stats;
46 struct u64_stats_sync syncp;
47};
48
bbde32d3
SAK
49struct rmnet_priv_stats {
50 u64 csum_ok;
51 u64 csum_valid_unset;
52 u64 csum_validation_failed;
53 u64 csum_err_bad_buffer;
54 u64 csum_err_invalid_ip_version;
55 u64 csum_err_invalid_transport;
56 u64 csum_fragmented_pkt;
57 u64 csum_skipped;
58 u64 csum_sw;
59};
60
ceed73a2 61struct rmnet_priv {
ceed73a2 62 u8 mux_id;
b752eff5 63 struct net_device *real_dev;
192c4b5d 64 struct rmnet_pcpu_stats __percpu *pcpu_stats;
ca32fb03 65 struct gro_cells gro_cells;
bbde32d3 66 struct rmnet_priv_stats stats;
ceed73a2
SAK
67};
68
102210f7 69struct rmnet_port *rmnet_get_port_rcu(struct net_device *real_dev);
3352e6c4 70struct rmnet_endpoint *rmnet_get_endpoint(struct rmnet_port *port, u8 mux_id);
60d58f97
SAK
71int rmnet_add_bridge(struct net_device *rmnet_dev,
72 struct net_device *slave_dev,
73 struct netlink_ext_ack *extack);
74int rmnet_del_bridge(struct net_device *rmnet_dev,
75 struct net_device *slave_dev);
ceed73a2 76#endif /* _RMNET_CONFIG_H_ */