aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/u_ether.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/u_ether.h')
-rw-r--r--drivers/usb/gadget/u_ether.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/usb/gadget/u_ether.h b/drivers/usb/gadget/u_ether.h
index 6f4a1623d854..02522338a708 100644
--- a/drivers/usb/gadget/u_ether.h
+++ b/drivers/usb/gadget/u_ether.h
@@ -21,6 +21,7 @@
21 21
22#include "gadget_chips.h" 22#include "gadget_chips.h"
23 23
24struct eth_dev;
24 25
25/* 26/*
26 * This represents the USB side of an "ethernet" link, managed by a USB 27 * This represents the USB side of an "ethernet" link, managed by a USB
@@ -70,7 +71,7 @@ struct gether {
70 |USB_CDC_PACKET_TYPE_DIRECTED) 71 |USB_CDC_PACKET_TYPE_DIRECTED)
71 72
72/* variant of gether_setup that allows customizing network device name */ 73/* variant of gether_setup that allows customizing network device name */
73int gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN], 74struct eth_dev *gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN],
74 const char *netname); 75 const char *netname);
75 76
76/* netdev setup/teardown as directed by the gadget driver */ 77/* netdev setup/teardown as directed by the gadget driver */
@@ -86,12 +87,13 @@ int gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN],
86 * 87 *
87 * Returns negative errno, or zero on success 88 * Returns negative errno, or zero on success
88 */ 89 */
89static inline int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN]) 90static inline struct eth_dev *gether_setup(struct usb_gadget *g,
91 u8 ethaddr[ETH_ALEN])
90{ 92{
91 return gether_setup_name(g, ethaddr, "usb"); 93 return gether_setup_name(g, ethaddr, "usb");
92} 94}
93 95
94void gether_cleanup(void); 96void gether_cleanup(struct eth_dev *dev);
95 97
96/* connect/disconnect is handled by individual functions */ 98/* connect/disconnect is handled by individual functions */
97struct net_device *gether_connect(struct gether *); 99struct net_device *gether_connect(struct gether *);
@@ -111,21 +113,24 @@ static inline bool can_support_ecm(struct usb_gadget *gadget)
111} 113}
112 114
113/* each configuration may bind one instance of an ethernet link */ 115/* each configuration may bind one instance of an ethernet link */
114int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); 116int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
115int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); 117 struct eth_dev *dev);
116int ncm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); 118int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
117int eem_bind_config(struct usb_configuration *c); 119 struct eth_dev *dev);
120int ncm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
121 struct eth_dev *dev);
122int eem_bind_config(struct usb_configuration *c, struct eth_dev *dev);
118 123
119#ifdef USB_ETH_RNDIS 124#ifdef USB_ETH_RNDIS
120 125
121int rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], 126int rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
122 u32 vendorID, const char *manufacturer); 127 u32 vendorID, const char *manufacturer, struct eth_dev *dev);
123 128
124#else 129#else
125 130
126static inline int 131static inline int
127rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], 132rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
128 u32 vendorID, const char *manufacturer) 133 u32 vendorID, const char *manufacturer, struct eth_dev *dev)
129{ 134{
130 return 0; 135 return 0;
131} 136}
@@ -145,9 +150,9 @@ rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
145 * for calling @gether_cleanup() before module unload. 150 * for calling @gether_cleanup() before module unload.
146 */ 151 */
147static inline int rndis_bind_config(struct usb_configuration *c, 152static inline int rndis_bind_config(struct usb_configuration *c,
148 u8 ethaddr[ETH_ALEN]) 153 u8 ethaddr[ETH_ALEN], struct eth_dev *dev)
149{ 154{
150 return rndis_bind_config_vendor(c, ethaddr, 0, NULL); 155 return rndis_bind_config_vendor(c, ethaddr, 0, NULL, dev);
151} 156}
152 157
153 158