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.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/usb/gadget/u_ether.h b/drivers/usb/gadget/u_ether.h
index 0ef823447f28..8abf197ab402 100644
--- a/drivers/usb/gadget/u_ether.h
+++ b/drivers/usb/gadget/u_ether.h
@@ -28,6 +28,9 @@
28#include <linux/usb/composite.h> 28#include <linux/usb/composite.h>
29#include <linux/usb/cdc.h> 29#include <linux/usb/cdc.h>
30 30
31#include "gadget_chips.h"
32
33
31/* 34/*
32 * This represents the USB side of an "ethernet" link, managed by a USB 35 * This represents the USB side of an "ethernet" link, managed by a USB
33 * function which provides control and (maybe) framing. Two functions 36 * function which provides control and (maybe) framing. Two functions
@@ -80,7 +83,28 @@ void gether_cleanup(void);
80struct net_device *gether_connect(struct gether *); 83struct net_device *gether_connect(struct gether *);
81void gether_disconnect(struct gether *); 84void gether_disconnect(struct gether *);
82 85
86/* Some controllers can't support CDC Ethernet (ECM) ... */
87static inline bool can_support_ecm(struct usb_gadget *gadget)
88{
89 if (!gadget_supports_altsettings(gadget))
90 return false;
91
92 /* SA1100 can do ECM, *without* status endpoint ... but we'll
93 * only use it in non-ECM mode for backwards compatibility
94 * (and since we currently require a status endpoint)
95 */
96 if (gadget_is_sa1100(gadget))
97 return false;
98
99 /* Everything else is *presumably* fine ... but this is a bit
100 * chancy, so be **CERTAIN** there are no hardware issues with
101 * your controller. Add it above if it can't handle CDC.
102 */
103 return true;
104}
105
83/* each configuration may bind one instance of an ethernet link */ 106/* each configuration may bind one instance of an ethernet link */
84int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); 107int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]);
108int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]);
85 109
86#endif /* __U_ETHER_H */ 110#endif /* __U_ETHER_H */