xref: /linux/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h (revision 83a37b3292f4aca799b355179ad6fbdd78a08e10)
1 /* Copyright (c) 2013-2014, 2016-2017 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 
18 #ifndef _RMNET_CONFIG_H_
19 #define _RMNET_CONFIG_H_
20 
21 #define RMNET_MAX_LOGICAL_EP 255
22 
23 struct rmnet_endpoint {
24 	u8 mux_id;
25 	struct net_device *egress_dev;
26 	struct hlist_node hlnode;
27 };
28 
29 /* One instance of this structure is instantiated for each real_dev associated
30  * with rmnet.
31  */
32 struct rmnet_port {
33 	struct net_device *dev;
34 	u32 ingress_data_format;
35 	u32 egress_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 
42 extern struct rtnl_link_ops rmnet_link_ops;
43 
44 struct rmnet_priv {
45 	u8 mux_id;
46 	struct net_device *real_dev;
47 };
48 
49 struct rmnet_port *rmnet_get_port(struct net_device *real_dev);
50 struct rmnet_endpoint *rmnet_get_endpoint(struct rmnet_port *port, u8 mux_id);
51 int rmnet_add_bridge(struct net_device *rmnet_dev,
52 		     struct net_device *slave_dev,
53 		     struct netlink_ext_ack *extack);
54 int rmnet_del_bridge(struct net_device *rmnet_dev,
55 		     struct net_device *slave_dev);
56 #endif /* _RMNET_CONFIG_H_ */
57