Loading include/linux/usb/audio.h +7 −7 Original line number Original line Diff line number Diff line Loading @@ -27,13 +27,13 @@ /* 4.3.2 Class-Specific AC Interface Descriptor */ /* 4.3.2 Class-Specific AC Interface Descriptor */ struct usb_ac_header_descriptor { struct usb_ac_header_descriptor { __u8 bLength; // 8+n __u8 bLength; /* 8+n */ __u8 bDescriptorType; // USB_DT_CS_INTERFACE __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ __u8 bDescriptorSubtype; // USB_MS_HEADER __u8 bDescriptorSubtype; /* USB_MS_HEADER */ __le16 bcdADC; // 0x0100 __le16 bcdADC; /* 0x0100 */ __le16 wTotalLength; // includes Unit and Terminal desc. __le16 wTotalLength; /* includes Unit and Terminal desc. */ __u8 bInCollection; // n __u8 bInCollection; /* n */ __u8 baInterfaceNr[]; // [n] __u8 baInterfaceNr[]; /* [n] */ } __attribute__ ((packed)); } __attribute__ ((packed)); #define USB_DT_AC_HEADER_SIZE(n) (8+(n)) #define USB_DT_AC_HEADER_SIZE(n) (8+(n)) Loading include/linux/usb/gadget.h +55 −68 Original line number Original line Diff line number Diff line Loading @@ -70,9 +70,10 @@ struct usb_ep; * * * Bulk endpoints can use any size buffers, and can also be used for interrupt * Bulk endpoints can use any size buffers, and can also be used for interrupt * transfers. interrupt-only endpoints can be much less functional. * transfers. interrupt-only endpoints can be much less functional. * * NOTE: this is analagous to 'struct urb' on the host side, except that * it's thinner and promotes more pre-allocation. */ */ // NOTE this is analagous to 'struct urb' on the host side, // except that it's thinner and promotes more pre-allocation. struct usb_request { struct usb_request { void *buf; void *buf; Loading Loading @@ -168,8 +169,8 @@ struct usb_ep { * * * returns zero, or a negative error code. * returns zero, or a negative error code. */ */ static inline int static inline int usb_ep_enable(struct usb_ep *ep, usb_ep_enable (struct usb_ep *ep, const struct usb_endpoint_descriptor *desc) const struct usb_endpoint_descriptor *desc) { { return ep->ops->enable(ep, desc); return ep->ops->enable(ep, desc); } } Loading @@ -186,8 +187,7 @@ usb_ep_enable (struct usb_ep *ep, const struct usb_endpoint_descriptor *desc) * * * returns zero, or a negative error code. * returns zero, or a negative error code. */ */ static inline int static inline int usb_ep_disable(struct usb_ep *ep) usb_ep_disable (struct usb_ep *ep) { { return ep->ops->disable(ep); return ep->ops->disable(ep); } } Loading @@ -206,8 +206,8 @@ usb_ep_disable (struct usb_ep *ep) * * * Returns the request, or null if one could not be allocated. * Returns the request, or null if one could not be allocated. */ */ static inline struct usb_request * static inline struct usb_request *usb_ep_alloc_request(struct usb_ep *ep, usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags) gfp_t gfp_flags) { { return ep->ops->alloc_request(ep, gfp_flags); return ep->ops->alloc_request(ep, gfp_flags); } } Loading @@ -221,8 +221,8 @@ usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags) * Caller guarantees the request is not queued, and that it will * Caller guarantees the request is not queued, and that it will * no longer be requeued (or otherwise used). * no longer be requeued (or otherwise used). */ */ static inline void static inline void usb_ep_free_request(struct usb_ep *ep, usb_ep_free_request (struct usb_ep *ep, struct usb_request *req) struct usb_request *req) { { ep->ops->free_request(ep, req); ep->ops->free_request(ep, req); } } Loading Loading @@ -281,8 +281,8 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req) * report errors; errors will also be * report errors; errors will also be * reported when the usb peripheral is disconnected. * reported when the usb peripheral is disconnected. */ */ static inline int static inline int usb_ep_queue(struct usb_ep *ep, usb_ep_queue (struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) struct usb_request *req, gfp_t gfp_flags) { { return ep->ops->queue(ep, req, gfp_flags); return ep->ops->queue(ep, req, gfp_flags); } } Loading Loading @@ -327,8 +327,7 @@ static inline int usb_ep_dequeue (struct usb_ep *ep, struct usb_request *req) * transfer requests are still queued, or if the controller hardware * transfer requests are still queued, or if the controller hardware * (usually a FIFO) still holds bytes that the host hasn't collected. * (usually a FIFO) still holds bytes that the host hasn't collected. */ */ static inline int static inline int usb_ep_set_halt(struct usb_ep *ep) usb_ep_set_halt (struct usb_ep *ep) { { return ep->ops->set_halt(ep, 1); return ep->ops->set_halt(ep, 1); } } Loading @@ -346,8 +345,7 @@ usb_ep_set_halt (struct usb_ep *ep) * Note that some hardware can't support this request (like pxa2xx_udc), * Note that some hardware can't support this request (like pxa2xx_udc), * and accordingly can't correctly implement interface altsettings. * and accordingly can't correctly implement interface altsettings. */ */ static inline int static inline int usb_ep_clear_halt(struct usb_ep *ep) usb_ep_clear_halt (struct usb_ep *ep) { { return ep->ops->set_halt(ep, 0); return ep->ops->set_halt(ep, 0); } } Loading @@ -367,8 +365,7 @@ usb_ep_clear_halt (struct usb_ep *ep) * errno if the endpoint doesn't use a FIFO or doesn't support such * errno if the endpoint doesn't use a FIFO or doesn't support such * precise handling. * precise handling. */ */ static inline int static inline int usb_ep_fifo_status(struct usb_ep *ep) usb_ep_fifo_status (struct usb_ep *ep) { { if (ep->ops->fifo_status) if (ep->ops->fifo_status) return ep->ops->fifo_status(ep); return ep->ops->fifo_status(ep); Loading @@ -385,8 +382,7 @@ usb_ep_fifo_status (struct usb_ep *ep) * must never be used except when endpoint is not being used for any * must never be used except when endpoint is not being used for any * protocol translation. * protocol translation. */ */ static inline void static inline void usb_ep_fifo_flush(struct usb_ep *ep) usb_ep_fifo_flush (struct usb_ep *ep) { { if (ep->ops->fifo_flush) if (ep->ops->fifo_flush) ep->ops->fifo_flush(ep); ep->ops->fifo_flush(ep); Loading Loading @@ -511,7 +507,6 @@ static inline int gadget_is_otg(struct usb_gadget *g) #endif #endif } } /** /** * usb_gadget_frame_number - returns the current frame number * usb_gadget_frame_number - returns the current frame number * @gadget: controller that reports the frame number * @gadget: controller that reports the frame number Loading Loading @@ -553,8 +548,7 @@ static inline int usb_gadget_wakeup (struct usb_gadget *gadget) * * * returns zero on success, else negative errno. * returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_set_selfpowered(struct usb_gadget *gadget) usb_gadget_set_selfpowered (struct usb_gadget *gadget) { { if (!gadget->ops->set_selfpowered) if (!gadget->ops->set_selfpowered) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -571,8 +565,7 @@ usb_gadget_set_selfpowered (struct usb_gadget *gadget) * * * returns zero on success, else negative errno. * returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_clear_selfpowered(struct usb_gadget *gadget) usb_gadget_clear_selfpowered (struct usb_gadget *gadget) { { if (!gadget->ops->set_selfpowered) if (!gadget->ops->set_selfpowered) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -591,8 +584,7 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget) * * * Returns zero on success, else negative errno. * Returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_vbus_connect(struct usb_gadget *gadget) usb_gadget_vbus_connect(struct usb_gadget *gadget) { { if (!gadget->ops->vbus_session) if (!gadget->ops->vbus_session) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -611,8 +603,7 @@ usb_gadget_vbus_connect(struct usb_gadget *gadget) * * * Returns zero on success, else negative errno. * Returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) { { if (!gadget->ops->vbus_draw) if (!gadget->ops->vbus_draw) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -629,8 +620,7 @@ usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) * * * Returns zero on success, else negative errno. * Returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_vbus_disconnect(struct usb_gadget *gadget) usb_gadget_vbus_disconnect(struct usb_gadget *gadget) { { if (!gadget->ops->vbus_session) if (!gadget->ops->vbus_session) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -648,8 +638,7 @@ usb_gadget_vbus_disconnect(struct usb_gadget *gadget) * * * Returns zero on success, else negative errno. * Returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_connect(struct usb_gadget *gadget) usb_gadget_connect (struct usb_gadget *gadget) { { if (!gadget->ops->pullup) if (!gadget->ops->pullup) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -671,8 +660,7 @@ usb_gadget_connect (struct usb_gadget *gadget) * * * Returns zero on success, else negative errno. * Returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_disconnect(struct usb_gadget *gadget) usb_gadget_disconnect (struct usb_gadget *gadget) { { if (!gadget->ops->pullup) if (!gadget->ops->pullup) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -680,7 +668,6 @@ usb_gadget_disconnect (struct usb_gadget *gadget) } } /*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/ /** /** Loading Loading @@ -764,7 +751,7 @@ struct usb_gadget_driver { void (*suspend)(struct usb_gadget *); void (*suspend)(struct usb_gadget *); void (*resume)(struct usb_gadget *); void (*resume)(struct usb_gadget *); // FIXME support safe rmmod /* FIXME support safe rmmod */ struct device_driver driver; struct device_driver driver; }; }; Loading include/linux/usb/gadgetfs.h +12 −10 Original line number Original line Diff line number Diff line Loading @@ -36,7 +36,7 @@ enum usb_gadgetfs_event_type { GADGETFS_DISCONNECT, GADGETFS_DISCONNECT, GADGETFS_SETUP, GADGETFS_SETUP, GADGETFS_SUSPEND, GADGETFS_SUSPEND, // and likely more ! /* and likely more ! */ }; }; /* NOTE: this structure must stay the same size and layout on /* NOTE: this structure must stay the same size and layout on Loading @@ -44,15 +44,17 @@ enum usb_gadgetfs_event_type { */ */ struct usb_gadgetfs_event { struct usb_gadgetfs_event { union { union { // NOP, DISCONNECT, SUSPEND: nothing /* NOP, DISCONNECT, SUSPEND: nothing // ... some hardware can't report disconnection * ... some hardware can't report disconnection */ // CONNECT: just the speed /* CONNECT: just the speed */ enum usb_device_speed speed; enum usb_device_speed speed; // SETUP: packet; DATA phase i/o precedes next event /* SETUP: packet; DATA phase i/o precedes next event // (setup.bmRequestType & USB_DIR_IN) flags direction *(setup.bmRequestType & USB_DIR_IN) flags direction // ... includes SET_CONFIGURATION, SET_INTERFACE * ... includes SET_CONFIGURATION, SET_INTERFACE */ struct usb_ctrlrequest setup; struct usb_ctrlrequest setup; } u; } u; enum usb_gadgetfs_event_type type; enum usb_gadgetfs_event_type type; Loading include/linux/usb/iowarrior.h +17 −8 Original line number Original line Diff line number Diff line Loading @@ -14,14 +14,23 @@ this information. this information. */ */ struct iowarrior_info { struct iowarrior_info { __u32 vendor; /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */ /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */ __u32 product; /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_XXXXX) */ __u32 vendor; __u8 serial[9]; /* the serial number of our chip (if a serial-number is not available this is empty string) */ /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_X) */ __u32 revision; /* revision number of the chip */ __u32 product; __u32 speed; /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */ /* the serial number of our chip (if a serial-number is not available __u32 power; /* power consumption of the device in mA */ * this is empty string) */ __u32 if_num; /* the number of the endpoint */ __u8 serial[9]; __u32 report_size; /* size of the data-packets on this interface */ /* revision number of the chip */ __u32 revision; /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */ __u32 speed; /* power consumption of the device in mA */ __u32 power; /* the number of the endpoint */ __u32 if_num; /* size of the data-packets on this interface */ __u32 report_size; }; }; /* /* Loading include/linux/usb/midi.h +13 −13 Original line number Original line Diff line number Diff line Loading @@ -47,9 +47,9 @@ struct usb_ms_header_descriptor { /* 6.1.2.2 MIDI IN Jack Descriptor */ /* 6.1.2.2 MIDI IN Jack Descriptor */ struct usb_midi_in_jack_descriptor { struct usb_midi_in_jack_descriptor { __u8 bLength; __u8 bLength; __u8 bDescriptorType; // USB_DT_CS_INTERFACE __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ __u8 bDescriptorSubtype; // USB_MS_MIDI_IN_JACK __u8 bDescriptorSubtype; /* USB_MS_MIDI_IN_JACK */ __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */ __u8 bJackID; __u8 bJackID; __u8 iJack; __u8 iJack; } __attribute__ ((packed)); } __attribute__ ((packed)); Loading @@ -64,12 +64,12 @@ struct usb_midi_source_pin { /* 6.1.2.3 MIDI OUT Jack Descriptor */ /* 6.1.2.3 MIDI OUT Jack Descriptor */ struct usb_midi_out_jack_descriptor { struct usb_midi_out_jack_descriptor { __u8 bLength; __u8 bLength; __u8 bDescriptorType; // USB_DT_CS_INTERFACE __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ __u8 bDescriptorSubtype; // USB_MS_MIDI_OUT_JACK __u8 bDescriptorSubtype; /* USB_MS_MIDI_OUT_JACK */ __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */ __u8 bJackID; __u8 bJackID; __u8 bNrInputPins; // p __u8 bNrInputPins; /* p */ struct usb_midi_source_pin pins[]; // [p] struct usb_midi_source_pin pins[]; /* [p] */ /*__u8 iJack; -- ommitted due to variable-sized pins[] */ /*__u8 iJack; -- ommitted due to variable-sized pins[] */ } __attribute__ ((packed)); } __attribute__ ((packed)); Loading @@ -90,11 +90,11 @@ struct usb_midi_out_jack_descriptor_##p { \ /* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */ /* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */ struct usb_ms_endpoint_descriptor { struct usb_ms_endpoint_descriptor { __u8 bLength; // 4+n __u8 bLength; /* 4+n */ __u8 bDescriptorType; // USB_DT_CS_ENDPOINT __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ __u8 bDescriptorSubtype; // USB_MS_GENERAL __u8 bDescriptorSubtype; /* USB_MS_GENERAL */ __u8 bNumEmbMIDIJack; // n __u8 bNumEmbMIDIJack; /* n */ __u8 baAssocJackID[]; // [n] __u8 baAssocJackID[]; /* [n] */ } __attribute__ ((packed)); } __attribute__ ((packed)); #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n)) #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n)) Loading Loading
include/linux/usb/audio.h +7 −7 Original line number Original line Diff line number Diff line Loading @@ -27,13 +27,13 @@ /* 4.3.2 Class-Specific AC Interface Descriptor */ /* 4.3.2 Class-Specific AC Interface Descriptor */ struct usb_ac_header_descriptor { struct usb_ac_header_descriptor { __u8 bLength; // 8+n __u8 bLength; /* 8+n */ __u8 bDescriptorType; // USB_DT_CS_INTERFACE __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ __u8 bDescriptorSubtype; // USB_MS_HEADER __u8 bDescriptorSubtype; /* USB_MS_HEADER */ __le16 bcdADC; // 0x0100 __le16 bcdADC; /* 0x0100 */ __le16 wTotalLength; // includes Unit and Terminal desc. __le16 wTotalLength; /* includes Unit and Terminal desc. */ __u8 bInCollection; // n __u8 bInCollection; /* n */ __u8 baInterfaceNr[]; // [n] __u8 baInterfaceNr[]; /* [n] */ } __attribute__ ((packed)); } __attribute__ ((packed)); #define USB_DT_AC_HEADER_SIZE(n) (8+(n)) #define USB_DT_AC_HEADER_SIZE(n) (8+(n)) Loading
include/linux/usb/gadget.h +55 −68 Original line number Original line Diff line number Diff line Loading @@ -70,9 +70,10 @@ struct usb_ep; * * * Bulk endpoints can use any size buffers, and can also be used for interrupt * Bulk endpoints can use any size buffers, and can also be used for interrupt * transfers. interrupt-only endpoints can be much less functional. * transfers. interrupt-only endpoints can be much less functional. * * NOTE: this is analagous to 'struct urb' on the host side, except that * it's thinner and promotes more pre-allocation. */ */ // NOTE this is analagous to 'struct urb' on the host side, // except that it's thinner and promotes more pre-allocation. struct usb_request { struct usb_request { void *buf; void *buf; Loading Loading @@ -168,8 +169,8 @@ struct usb_ep { * * * returns zero, or a negative error code. * returns zero, or a negative error code. */ */ static inline int static inline int usb_ep_enable(struct usb_ep *ep, usb_ep_enable (struct usb_ep *ep, const struct usb_endpoint_descriptor *desc) const struct usb_endpoint_descriptor *desc) { { return ep->ops->enable(ep, desc); return ep->ops->enable(ep, desc); } } Loading @@ -186,8 +187,7 @@ usb_ep_enable (struct usb_ep *ep, const struct usb_endpoint_descriptor *desc) * * * returns zero, or a negative error code. * returns zero, or a negative error code. */ */ static inline int static inline int usb_ep_disable(struct usb_ep *ep) usb_ep_disable (struct usb_ep *ep) { { return ep->ops->disable(ep); return ep->ops->disable(ep); } } Loading @@ -206,8 +206,8 @@ usb_ep_disable (struct usb_ep *ep) * * * Returns the request, or null if one could not be allocated. * Returns the request, or null if one could not be allocated. */ */ static inline struct usb_request * static inline struct usb_request *usb_ep_alloc_request(struct usb_ep *ep, usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags) gfp_t gfp_flags) { { return ep->ops->alloc_request(ep, gfp_flags); return ep->ops->alloc_request(ep, gfp_flags); } } Loading @@ -221,8 +221,8 @@ usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags) * Caller guarantees the request is not queued, and that it will * Caller guarantees the request is not queued, and that it will * no longer be requeued (or otherwise used). * no longer be requeued (or otherwise used). */ */ static inline void static inline void usb_ep_free_request(struct usb_ep *ep, usb_ep_free_request (struct usb_ep *ep, struct usb_request *req) struct usb_request *req) { { ep->ops->free_request(ep, req); ep->ops->free_request(ep, req); } } Loading Loading @@ -281,8 +281,8 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req) * report errors; errors will also be * report errors; errors will also be * reported when the usb peripheral is disconnected. * reported when the usb peripheral is disconnected. */ */ static inline int static inline int usb_ep_queue(struct usb_ep *ep, usb_ep_queue (struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) struct usb_request *req, gfp_t gfp_flags) { { return ep->ops->queue(ep, req, gfp_flags); return ep->ops->queue(ep, req, gfp_flags); } } Loading Loading @@ -327,8 +327,7 @@ static inline int usb_ep_dequeue (struct usb_ep *ep, struct usb_request *req) * transfer requests are still queued, or if the controller hardware * transfer requests are still queued, or if the controller hardware * (usually a FIFO) still holds bytes that the host hasn't collected. * (usually a FIFO) still holds bytes that the host hasn't collected. */ */ static inline int static inline int usb_ep_set_halt(struct usb_ep *ep) usb_ep_set_halt (struct usb_ep *ep) { { return ep->ops->set_halt(ep, 1); return ep->ops->set_halt(ep, 1); } } Loading @@ -346,8 +345,7 @@ usb_ep_set_halt (struct usb_ep *ep) * Note that some hardware can't support this request (like pxa2xx_udc), * Note that some hardware can't support this request (like pxa2xx_udc), * and accordingly can't correctly implement interface altsettings. * and accordingly can't correctly implement interface altsettings. */ */ static inline int static inline int usb_ep_clear_halt(struct usb_ep *ep) usb_ep_clear_halt (struct usb_ep *ep) { { return ep->ops->set_halt(ep, 0); return ep->ops->set_halt(ep, 0); } } Loading @@ -367,8 +365,7 @@ usb_ep_clear_halt (struct usb_ep *ep) * errno if the endpoint doesn't use a FIFO or doesn't support such * errno if the endpoint doesn't use a FIFO or doesn't support such * precise handling. * precise handling. */ */ static inline int static inline int usb_ep_fifo_status(struct usb_ep *ep) usb_ep_fifo_status (struct usb_ep *ep) { { if (ep->ops->fifo_status) if (ep->ops->fifo_status) return ep->ops->fifo_status(ep); return ep->ops->fifo_status(ep); Loading @@ -385,8 +382,7 @@ usb_ep_fifo_status (struct usb_ep *ep) * must never be used except when endpoint is not being used for any * must never be used except when endpoint is not being used for any * protocol translation. * protocol translation. */ */ static inline void static inline void usb_ep_fifo_flush(struct usb_ep *ep) usb_ep_fifo_flush (struct usb_ep *ep) { { if (ep->ops->fifo_flush) if (ep->ops->fifo_flush) ep->ops->fifo_flush(ep); ep->ops->fifo_flush(ep); Loading Loading @@ -511,7 +507,6 @@ static inline int gadget_is_otg(struct usb_gadget *g) #endif #endif } } /** /** * usb_gadget_frame_number - returns the current frame number * usb_gadget_frame_number - returns the current frame number * @gadget: controller that reports the frame number * @gadget: controller that reports the frame number Loading Loading @@ -553,8 +548,7 @@ static inline int usb_gadget_wakeup (struct usb_gadget *gadget) * * * returns zero on success, else negative errno. * returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_set_selfpowered(struct usb_gadget *gadget) usb_gadget_set_selfpowered (struct usb_gadget *gadget) { { if (!gadget->ops->set_selfpowered) if (!gadget->ops->set_selfpowered) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -571,8 +565,7 @@ usb_gadget_set_selfpowered (struct usb_gadget *gadget) * * * returns zero on success, else negative errno. * returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_clear_selfpowered(struct usb_gadget *gadget) usb_gadget_clear_selfpowered (struct usb_gadget *gadget) { { if (!gadget->ops->set_selfpowered) if (!gadget->ops->set_selfpowered) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -591,8 +584,7 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget) * * * Returns zero on success, else negative errno. * Returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_vbus_connect(struct usb_gadget *gadget) usb_gadget_vbus_connect(struct usb_gadget *gadget) { { if (!gadget->ops->vbus_session) if (!gadget->ops->vbus_session) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -611,8 +603,7 @@ usb_gadget_vbus_connect(struct usb_gadget *gadget) * * * Returns zero on success, else negative errno. * Returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) { { if (!gadget->ops->vbus_draw) if (!gadget->ops->vbus_draw) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -629,8 +620,7 @@ usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) * * * Returns zero on success, else negative errno. * Returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_vbus_disconnect(struct usb_gadget *gadget) usb_gadget_vbus_disconnect(struct usb_gadget *gadget) { { if (!gadget->ops->vbus_session) if (!gadget->ops->vbus_session) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -648,8 +638,7 @@ usb_gadget_vbus_disconnect(struct usb_gadget *gadget) * * * Returns zero on success, else negative errno. * Returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_connect(struct usb_gadget *gadget) usb_gadget_connect (struct usb_gadget *gadget) { { if (!gadget->ops->pullup) if (!gadget->ops->pullup) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -671,8 +660,7 @@ usb_gadget_connect (struct usb_gadget *gadget) * * * Returns zero on success, else negative errno. * Returns zero on success, else negative errno. */ */ static inline int static inline int usb_gadget_disconnect(struct usb_gadget *gadget) usb_gadget_disconnect (struct usb_gadget *gadget) { { if (!gadget->ops->pullup) if (!gadget->ops->pullup) return -EOPNOTSUPP; return -EOPNOTSUPP; Loading @@ -680,7 +668,6 @@ usb_gadget_disconnect (struct usb_gadget *gadget) } } /*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/ /** /** Loading Loading @@ -764,7 +751,7 @@ struct usb_gadget_driver { void (*suspend)(struct usb_gadget *); void (*suspend)(struct usb_gadget *); void (*resume)(struct usb_gadget *); void (*resume)(struct usb_gadget *); // FIXME support safe rmmod /* FIXME support safe rmmod */ struct device_driver driver; struct device_driver driver; }; }; Loading
include/linux/usb/gadgetfs.h +12 −10 Original line number Original line Diff line number Diff line Loading @@ -36,7 +36,7 @@ enum usb_gadgetfs_event_type { GADGETFS_DISCONNECT, GADGETFS_DISCONNECT, GADGETFS_SETUP, GADGETFS_SETUP, GADGETFS_SUSPEND, GADGETFS_SUSPEND, // and likely more ! /* and likely more ! */ }; }; /* NOTE: this structure must stay the same size and layout on /* NOTE: this structure must stay the same size and layout on Loading @@ -44,15 +44,17 @@ enum usb_gadgetfs_event_type { */ */ struct usb_gadgetfs_event { struct usb_gadgetfs_event { union { union { // NOP, DISCONNECT, SUSPEND: nothing /* NOP, DISCONNECT, SUSPEND: nothing // ... some hardware can't report disconnection * ... some hardware can't report disconnection */ // CONNECT: just the speed /* CONNECT: just the speed */ enum usb_device_speed speed; enum usb_device_speed speed; // SETUP: packet; DATA phase i/o precedes next event /* SETUP: packet; DATA phase i/o precedes next event // (setup.bmRequestType & USB_DIR_IN) flags direction *(setup.bmRequestType & USB_DIR_IN) flags direction // ... includes SET_CONFIGURATION, SET_INTERFACE * ... includes SET_CONFIGURATION, SET_INTERFACE */ struct usb_ctrlrequest setup; struct usb_ctrlrequest setup; } u; } u; enum usb_gadgetfs_event_type type; enum usb_gadgetfs_event_type type; Loading
include/linux/usb/iowarrior.h +17 −8 Original line number Original line Diff line number Diff line Loading @@ -14,14 +14,23 @@ this information. this information. */ */ struct iowarrior_info { struct iowarrior_info { __u32 vendor; /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */ /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */ __u32 product; /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_XXXXX) */ __u32 vendor; __u8 serial[9]; /* the serial number of our chip (if a serial-number is not available this is empty string) */ /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_X) */ __u32 revision; /* revision number of the chip */ __u32 product; __u32 speed; /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */ /* the serial number of our chip (if a serial-number is not available __u32 power; /* power consumption of the device in mA */ * this is empty string) */ __u32 if_num; /* the number of the endpoint */ __u8 serial[9]; __u32 report_size; /* size of the data-packets on this interface */ /* revision number of the chip */ __u32 revision; /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */ __u32 speed; /* power consumption of the device in mA */ __u32 power; /* the number of the endpoint */ __u32 if_num; /* size of the data-packets on this interface */ __u32 report_size; }; }; /* /* Loading
include/linux/usb/midi.h +13 −13 Original line number Original line Diff line number Diff line Loading @@ -47,9 +47,9 @@ struct usb_ms_header_descriptor { /* 6.1.2.2 MIDI IN Jack Descriptor */ /* 6.1.2.2 MIDI IN Jack Descriptor */ struct usb_midi_in_jack_descriptor { struct usb_midi_in_jack_descriptor { __u8 bLength; __u8 bLength; __u8 bDescriptorType; // USB_DT_CS_INTERFACE __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ __u8 bDescriptorSubtype; // USB_MS_MIDI_IN_JACK __u8 bDescriptorSubtype; /* USB_MS_MIDI_IN_JACK */ __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */ __u8 bJackID; __u8 bJackID; __u8 iJack; __u8 iJack; } __attribute__ ((packed)); } __attribute__ ((packed)); Loading @@ -64,12 +64,12 @@ struct usb_midi_source_pin { /* 6.1.2.3 MIDI OUT Jack Descriptor */ /* 6.1.2.3 MIDI OUT Jack Descriptor */ struct usb_midi_out_jack_descriptor { struct usb_midi_out_jack_descriptor { __u8 bLength; __u8 bLength; __u8 bDescriptorType; // USB_DT_CS_INTERFACE __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ __u8 bDescriptorSubtype; // USB_MS_MIDI_OUT_JACK __u8 bDescriptorSubtype; /* USB_MS_MIDI_OUT_JACK */ __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */ __u8 bJackID; __u8 bJackID; __u8 bNrInputPins; // p __u8 bNrInputPins; /* p */ struct usb_midi_source_pin pins[]; // [p] struct usb_midi_source_pin pins[]; /* [p] */ /*__u8 iJack; -- ommitted due to variable-sized pins[] */ /*__u8 iJack; -- ommitted due to variable-sized pins[] */ } __attribute__ ((packed)); } __attribute__ ((packed)); Loading @@ -90,11 +90,11 @@ struct usb_midi_out_jack_descriptor_##p { \ /* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */ /* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */ struct usb_ms_endpoint_descriptor { struct usb_ms_endpoint_descriptor { __u8 bLength; // 4+n __u8 bLength; /* 4+n */ __u8 bDescriptorType; // USB_DT_CS_ENDPOINT __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ __u8 bDescriptorSubtype; // USB_MS_GENERAL __u8 bDescriptorSubtype; /* USB_MS_GENERAL */ __u8 bNumEmbMIDIJack; // n __u8 bNumEmbMIDIJack; /* n */ __u8 baAssocJackID[]; // [n] __u8 baAssocJackID[]; /* [n] */ } __attribute__ ((packed)); } __attribute__ ((packed)); #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n)) #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n)) Loading