History

usb:gadget Separated decoding functions from dwc3 driver.

Patch moves some decoding functions from driver/usb/dwc3/debug.h driver to driver/usb/gadget/debug.c file. These moved functions include: dwc3_decode_get_status dwc3_decode_set_clear_feature dwc3_decode_set_address dwc3_decode_get_set_descriptor dwc3_decode_get_configuration dwc3_decode_set_configuration dwc3_decode_get_intf dwc3_decode_set_intf dwc3_decode_synch_frame dwc3_decode_set_sel dwc3_decode_set_isoch_delay dwc3_decode_ctrl These functions are used also in inroduced cdns3 driver. All functions prefixes were changed from dwc3 to usb. Also, function's parameters has been extended according to the name of fields in standard SETUP packet. Additionally, patch adds usb_decode_ctrl function to include/linux/usb/gadget.h file.

Pawel Laszczak committed 7 years ago

Commit 3db1b631 parent e8a8b405 files · +296 −253Browse files

Showing the changes to include/linux/usb (1 of 5 files). Show all

Unified · Split

include/linux/usb/gadget.h+26−0
@@ -889,4 +889,30 @@ extern void usb_ep_autoconfig_release(struct usb_ep *); · 888 unmodified lines
889 889
890extern void usb_ep_autoconfig_reset(struct usb_gadget *);890extern void usb_ep_autoconfig_reset(struct usb_gadget *);
891 891
892/*-------------------------------------------------------------------------*/
893/**
894 * usb_decode_ctrl - Returns human readable representation of control request.
895 * @str: buffer to return a human-readable representation of control request.
896 * This buffer should have about 200 bytes.
897 * @size: size of str buffer.
898 * @bRequestType: matches the USB bmRequestType field
899 * @bRequest: matches the USB bRequest field
900 * @wValue: matches the USB wValue field (CPU byte order)
901 * @wIndex: matches the USB wIndex field (CPU byte order)
902 * @wLength: matches the USB wLength field (CPU byte order)
903 *
904 * Function returns decoded, formatted and human-readable description of
905 * control request packet.
906 *
907 * The usage scenario for this is for tracepoints, so function as a return
908 * use the same value as in parameters. This approach allows to use this
909 * function in TP_printk
910 *
911 * Important: wValue, wIndex, wLength parameters before invoking this function
912 * should be processed by le16_to_cpu macro.
913 */
914extern const char *usb_decode_ctrl(char *str, size_t size, __u8 bRequestType,
915 __u8 bRequest, __u16 wValue, __u16 wIndex,
916 __u16 wLength);
917
892#endif /* __LINUX_USB_GADGET_H */918#endif /* __LINUX_USB_GADGET_H */