Linux Audio

Check our new training course

Loading...
v4.17
 1/* Copyright (c) 2013-2014, 2016-2018 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
16#include <linux/skbuff.h>
 
17#include <net/gro_cells.h>
18
19#ifndef _RMNET_CONFIG_H_
20#define _RMNET_CONFIG_H_
21
22#define RMNET_MAX_LOGICAL_EP 255
23
24struct rmnet_endpoint {
25	u8 mux_id;
26	struct net_device *egress_dev;
27	struct hlist_node hlnode;
28};
29
 
 
 
 
 
 
30/* One instance of this structure is instantiated for each real_dev associated
31 * with rmnet.
32 */
33struct rmnet_port {
34	struct net_device *dev;
35	u32 data_format;
36	u8 nr_rmnet_devs;
37	u8 rmnet_mode;
38	struct hlist_head muxed_ep[RMNET_MAX_LOGICAL_EP];
39	struct net_device *bridge_ep;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40};
41
42extern struct rtnl_link_ops rmnet_link_ops;
43
44struct rmnet_vnd_stats {
45	u64 rx_pkts;
46	u64 rx_bytes;
47	u64 tx_pkts;
48	u64 tx_bytes;
49	u32 tx_drops;
50};
51
52struct rmnet_pcpu_stats {
53	struct rmnet_vnd_stats stats;
54	struct u64_stats_sync syncp;
55};
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57struct rmnet_priv {
58	u8 mux_id;
59	struct net_device *real_dev;
60	struct rmnet_pcpu_stats __percpu *pcpu_stats;
61	struct gro_cells gro_cells;
 
62};
63
64struct rmnet_port *rmnet_get_port(struct net_device *real_dev);
65struct rmnet_endpoint *rmnet_get_endpoint(struct rmnet_port *port, u8 mux_id);
66int rmnet_add_bridge(struct net_device *rmnet_dev,
67		     struct net_device *slave_dev,
68		     struct netlink_ext_ack *extack);
69int rmnet_del_bridge(struct net_device *rmnet_dev,
70		     struct net_device *slave_dev);
 
 
71#endif /* _RMNET_CONFIG_H_ */
v6.13.7
  1/* SPDX-License-Identifier: GPL-2.0-only */
  2/* Copyright (c) 2013-2014, 2016-2018, 2021 The Linux Foundation.
  3 * All rights reserved.
 
 
 
 
 
 
 
  4 *
  5 * RMNET Data configuration engine
 
  6 */
  7
  8#include <linux/skbuff.h>
  9#include <linux/time.h>
 10#include <net/gro_cells.h>
 11
 12#ifndef _RMNET_CONFIG_H_
 13#define _RMNET_CONFIG_H_
 14
 15#define RMNET_MAX_LOGICAL_EP 255
 16
 17struct rmnet_endpoint {
 18	u8 mux_id;
 19	struct net_device *egress_dev;
 20	struct hlist_node hlnode;
 21};
 22
 23struct rmnet_egress_agg_params {
 24	u32 bytes;
 25	u32 count;
 26	u64 time_nsec;
 27};
 28
 29/* One instance of this structure is instantiated for each real_dev associated
 30 * with rmnet.
 31 */
 32struct rmnet_port {
 33	struct net_device *dev;
 34	u32 data_format;
 35	u8 nr_rmnet_devs;
 36	u8 rmnet_mode;
 37	struct hlist_head muxed_ep[RMNET_MAX_LOGICAL_EP];
 38	struct net_device *bridge_ep;
 39	struct net_device *rmnet_dev;
 40
 41	/* Egress aggregation information */
 42	struct rmnet_egress_agg_params egress_agg_params;
 43	/* Protect aggregation related elements */
 44	spinlock_t agg_lock;
 45	struct sk_buff *skbagg_head;
 46	struct sk_buff *skbagg_tail;
 47	int agg_state;
 48	u8 agg_count;
 49	struct timespec64 agg_time;
 50	struct timespec64 agg_last;
 51	struct hrtimer hrtimer;
 52	struct work_struct agg_wq;
 53};
 54
 55extern struct rtnl_link_ops rmnet_link_ops;
 56
 57struct rmnet_vnd_stats {
 58	u64 rx_pkts;
 59	u64 rx_bytes;
 60	u64 tx_pkts;
 61	u64 tx_bytes;
 62	u32 tx_drops;
 63};
 64
 65struct rmnet_pcpu_stats {
 66	struct rmnet_vnd_stats stats;
 67	struct u64_stats_sync syncp;
 68};
 69
 70struct rmnet_priv_stats {
 71	u64 csum_ok;
 72	u64 csum_ip4_header_bad;
 73	u64 csum_valid_unset;
 74	u64 csum_validation_failed;
 75	u64 csum_err_bad_buffer;
 76	u64 csum_err_invalid_ip_version;
 77	u64 csum_err_invalid_transport;
 78	u64 csum_fragmented_pkt;
 79	u64 csum_skipped;
 80	u64 csum_sw;
 81	u64 csum_hw;
 82};
 83
 84struct rmnet_priv {
 85	u8 mux_id;
 86	struct net_device *real_dev;
 87	struct rmnet_pcpu_stats __percpu *pcpu_stats;
 88	struct gro_cells gro_cells;
 89	struct rmnet_priv_stats stats;
 90};
 91
 92struct rmnet_port *rmnet_get_port_rcu(struct net_device *real_dev);
 93struct rmnet_endpoint *rmnet_get_endpoint(struct rmnet_port *port, u8 mux_id);
 94int rmnet_add_bridge(struct net_device *rmnet_dev,
 95		     struct net_device *slave_dev,
 96		     struct netlink_ext_ack *extack);
 97int rmnet_del_bridge(struct net_device *rmnet_dev,
 98		     struct net_device *slave_dev);
 99struct rmnet_port*
100rmnet_get_port_rtnl(const struct net_device *real_dev);
101#endif /* _RMNET_CONFIG_H_ */