diff options
Diffstat (limited to 'drivers/usb/gadget/u_ether.h')
-rw-r--r-- | drivers/usb/gadget/u_ether.h | 27 |
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 | ||
24 | struct 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 */ |
73 | int gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN], | 74 | struct 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 | */ |
89 | static inline int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN]) | 90 | static 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 | ||
94 | void gether_cleanup(void); | 96 | void gether_cleanup(struct eth_dev *dev); |
95 | 97 | ||
96 | /* connect/disconnect is handled by individual functions */ | 98 | /* connect/disconnect is handled by individual functions */ |
97 | struct net_device *gether_connect(struct gether *); | 99 | struct 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 */ |
114 | int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); | 116 | int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], |
115 | int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); | 117 | struct eth_dev *dev); |
116 | int ncm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); | 118 | int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], |
117 | int eem_bind_config(struct usb_configuration *c); | 119 | struct eth_dev *dev); |
120 | int ncm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], | ||
121 | struct eth_dev *dev); | ||
122 | int 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 | ||
121 | int rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], | 126 | int 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 | ||
126 | static inline int | 131 | static inline int |
127 | rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], | 132 | rndis_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 | */ |
147 | static inline int rndis_bind_config(struct usb_configuration *c, | 152 | static 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 | ||