diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-06-19 21:19:46 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-21 18:16:13 -0400 |
commit | da741b8c56d612b5dd26ffa31341911a5fea23ee (patch) | |
tree | 201018abff24086e048a7dbf96ae07e60a82433e /drivers/usb/gadget/gadget_chips.h | |
parent | 8a40819e97368f2b6e67fea103348f9fc2f68ceb (diff) |
usb ethernet gadget: split CDC Ethernet function
This is a "CDC Ethernet" (ECM) function driver, extracted from the
all-in-one Ethernet gadget driver.
This is a good example of how to implement interface altsettings.
In fact it's currently the only such example in the gadget stack,
pending addition of OBEX support.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/gadget_chips.h')
-rw-r--r-- | drivers/usb/gadget/gadget_chips.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h index ca5149ea7312..5246e8fef2b2 100644 --- a/drivers/usb/gadget/gadget_chips.h +++ b/drivers/usb/gadget/gadget_chips.h | |||
@@ -214,3 +214,26 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget) | |||
214 | return 0x21; | 214 | return 0x21; |
215 | return -ENOENT; | 215 | return -ENOENT; |
216 | } | 216 | } |
217 | |||
218 | |||
219 | /** | ||
220 | * gadget_supports_altsettings - return true if altsettings work | ||
221 | * @gadget: the gadget in question | ||
222 | */ | ||
223 | static inline bool gadget_supports_altsettings(struct usb_gadget *gadget) | ||
224 | { | ||
225 | /* PXA 21x/25x/26x has no altsettings at all */ | ||
226 | if (gadget_is_pxa(gadget)) | ||
227 | return false; | ||
228 | |||
229 | /* PXA 27x and 3xx have *broken* altsetting support */ | ||
230 | if (gadget_is_pxa27x(gadget)) | ||
231 | return false; | ||
232 | |||
233 | /* SH3 hardware just doesn't do altsettings */ | ||
234 | if (gadget_is_sh(gadget)) | ||
235 | return false; | ||
236 | |||
237 | /* Everything else is *presumably* fine ... */ | ||
238 | return true; | ||
239 | } | ||