xref: /openbmc/linux/drivers/usb/common/debug.c (revision b6155eaf)
191f255a2SPawel Laszczak // SPDX-License-Identifier: GPL-2.0
23e682e6fSLee Jones /*
391f255a2SPawel Laszczak  * Common USB debugging functions
491f255a2SPawel Laszczak  *
5ffeb1e9eSAlexander A. Klimov  * Copyright (C) 2010-2011 Texas Instruments Incorporated - https://www.ti.com
691f255a2SPawel Laszczak  *
791f255a2SPawel Laszczak  * Authors: Felipe Balbi <balbi@ti.com>,
891f255a2SPawel Laszczak  *	    Sebastian Andrzej Siewior <bigeasy@linutronix.de>
991f255a2SPawel Laszczak  */
1091f255a2SPawel Laszczak 
1166b13ce8SGreg Kroah-Hartman #include <linux/kernel.h>
1291f255a2SPawel Laszczak #include <linux/usb/ch9.h>
1391f255a2SPawel Laszczak 
usb_decode_get_status(__u8 bRequestType,__u16 wIndex,__u16 wLength,char * str,size_t size)1491f255a2SPawel Laszczak static void usb_decode_get_status(__u8 bRequestType, __u16 wIndex,
1591f255a2SPawel Laszczak 				  __u16 wLength, char *str, size_t size)
1691f255a2SPawel Laszczak {
1791f255a2SPawel Laszczak 	switch (bRequestType & USB_RECIP_MASK) {
1891f255a2SPawel Laszczak 	case USB_RECIP_DEVICE:
1991f255a2SPawel Laszczak 		snprintf(str, size, "Get Device Status(Length = %d)", wLength);
2091f255a2SPawel Laszczak 		break;
2191f255a2SPawel Laszczak 	case USB_RECIP_INTERFACE:
2291f255a2SPawel Laszczak 		snprintf(str, size,
2391f255a2SPawel Laszczak 			 "Get Interface Status(Intf = %d, Length = %d)",
2491f255a2SPawel Laszczak 			 wIndex, wLength);
2591f255a2SPawel Laszczak 		break;
2691f255a2SPawel Laszczak 	case USB_RECIP_ENDPOINT:
2791f255a2SPawel Laszczak 		snprintf(str, size, "Get Endpoint Status(ep%d%s)",
2891f255a2SPawel Laszczak 			 wIndex & ~USB_DIR_IN,
2991f255a2SPawel Laszczak 			 wIndex & USB_DIR_IN ? "in" : "out");
3091f255a2SPawel Laszczak 		break;
3191f255a2SPawel Laszczak 	}
3291f255a2SPawel Laszczak }
3391f255a2SPawel Laszczak 
usb_decode_device_feature(u16 wValue)34010665b4SPawel Laszczak static const char *usb_decode_device_feature(u16 wValue)
35010665b4SPawel Laszczak {
36010665b4SPawel Laszczak 	switch (wValue) {
37010665b4SPawel Laszczak 	case USB_DEVICE_SELF_POWERED:
38010665b4SPawel Laszczak 		return "Self Powered";
39010665b4SPawel Laszczak 	case USB_DEVICE_REMOTE_WAKEUP:
40010665b4SPawel Laszczak 		return "Remote Wakeup";
41010665b4SPawel Laszczak 	case USB_DEVICE_TEST_MODE:
42010665b4SPawel Laszczak 		return "Test Mode";
43010665b4SPawel Laszczak 	case USB_DEVICE_U1_ENABLE:
44010665b4SPawel Laszczak 		return "U1 Enable";
45010665b4SPawel Laszczak 	case USB_DEVICE_U2_ENABLE:
46010665b4SPawel Laszczak 		return "U2 Enable";
47010665b4SPawel Laszczak 	case USB_DEVICE_LTM_ENABLE:
48010665b4SPawel Laszczak 		return "LTM Enable";
49010665b4SPawel Laszczak 	default:
50010665b4SPawel Laszczak 		return "UNKNOWN";
51010665b4SPawel Laszczak 	}
52010665b4SPawel Laszczak }
53010665b4SPawel Laszczak 
usb_decode_test_mode(u16 wIndex)54010665b4SPawel Laszczak static const char *usb_decode_test_mode(u16 wIndex)
55010665b4SPawel Laszczak {
56010665b4SPawel Laszczak 	switch (wIndex) {
5762fb45d3SGreg Kroah-Hartman 	case USB_TEST_J:
58010665b4SPawel Laszczak 		return ": TEST_J";
5962fb45d3SGreg Kroah-Hartman 	case USB_TEST_K:
60010665b4SPawel Laszczak 		return ": TEST_K";
6162fb45d3SGreg Kroah-Hartman 	case USB_TEST_SE0_NAK:
62010665b4SPawel Laszczak 		return ": TEST_SE0_NAK";
6362fb45d3SGreg Kroah-Hartman 	case USB_TEST_PACKET:
64010665b4SPawel Laszczak 		return ": TEST_PACKET";
6562fb45d3SGreg Kroah-Hartman 	case USB_TEST_FORCE_ENABLE:
66010665b4SPawel Laszczak 		return ": TEST_FORCE_EN";
67010665b4SPawel Laszczak 	default:
68010665b4SPawel Laszczak 		return ": UNKNOWN";
69010665b4SPawel Laszczak 	}
70010665b4SPawel Laszczak }
71010665b4SPawel Laszczak 
usb_decode_set_clear_feature(__u8 bRequestType,__u8 bRequest,__u16 wValue,__u16 wIndex,char * str,size_t size)72010665b4SPawel Laszczak static void usb_decode_set_clear_feature(__u8 bRequestType,
73010665b4SPawel Laszczak 					 __u8 bRequest, __u16 wValue,
74010665b4SPawel Laszczak 					 __u16 wIndex, char *str, size_t size)
7591f255a2SPawel Laszczak {
7691f255a2SPawel Laszczak 	switch (bRequestType & USB_RECIP_MASK) {
7791f255a2SPawel Laszczak 	case USB_RECIP_DEVICE:
7891f255a2SPawel Laszczak 		snprintf(str, size, "%s Device Feature(%s%s)",
7991f255a2SPawel Laszczak 			 bRequest == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set",
80010665b4SPawel Laszczak 			 usb_decode_device_feature(wValue),
8191f255a2SPawel Laszczak 			 wValue == USB_DEVICE_TEST_MODE ?
82010665b4SPawel Laszczak 			 usb_decode_test_mode(wIndex) : "");
8391f255a2SPawel Laszczak 		break;
8491f255a2SPawel Laszczak 	case USB_RECIP_INTERFACE:
8591f255a2SPawel Laszczak 		snprintf(str, size, "%s Interface Feature(%s)",
8691f255a2SPawel Laszczak 			 bRequest == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set",
8791f255a2SPawel Laszczak 			 wValue == USB_INTRF_FUNC_SUSPEND ?
8891f255a2SPawel Laszczak 			 "Function Suspend" : "UNKNOWN");
8991f255a2SPawel Laszczak 		break;
9091f255a2SPawel Laszczak 	case USB_RECIP_ENDPOINT:
9191f255a2SPawel Laszczak 		snprintf(str, size, "%s Endpoint Feature(%s ep%d%s)",
9291f255a2SPawel Laszczak 			 bRequest == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set",
9391f255a2SPawel Laszczak 			 wValue == USB_ENDPOINT_HALT ? "Halt" : "UNKNOWN",
9491f255a2SPawel Laszczak 			 wIndex & ~USB_DIR_IN,
9591f255a2SPawel Laszczak 			 wIndex & USB_DIR_IN ? "in" : "out");
9691f255a2SPawel Laszczak 		break;
9791f255a2SPawel Laszczak 	}
9891f255a2SPawel Laszczak }
9991f255a2SPawel Laszczak 
usb_decode_set_address(__u16 wValue,char * str,size_t size)10091f255a2SPawel Laszczak static void usb_decode_set_address(__u16 wValue, char *str, size_t size)
10191f255a2SPawel Laszczak {
10291f255a2SPawel Laszczak 	snprintf(str, size, "Set Address(Addr = %02x)", wValue);
10391f255a2SPawel Laszczak }
10491f255a2SPawel Laszczak 
usb_decode_get_set_descriptor(__u8 bRequestType,__u8 bRequest,__u16 wValue,__u16 wIndex,__u16 wLength,char * str,size_t size)10591f255a2SPawel Laszczak static void usb_decode_get_set_descriptor(__u8 bRequestType, __u8 bRequest,
10691f255a2SPawel Laszczak 					  __u16 wValue, __u16 wIndex,
10791f255a2SPawel Laszczak 					  __u16 wLength, char *str, size_t size)
10891f255a2SPawel Laszczak {
109f72429fcSPawel Laszczak 	char *s;
110f72429fcSPawel Laszczak 
11191f255a2SPawel Laszczak 	switch (wValue >> 8) {
11291f255a2SPawel Laszczak 	case USB_DT_DEVICE:
11391f255a2SPawel Laszczak 		s = "Device";
11491f255a2SPawel Laszczak 		break;
11591f255a2SPawel Laszczak 	case USB_DT_CONFIG:
11691f255a2SPawel Laszczak 		s = "Configuration";
11791f255a2SPawel Laszczak 		break;
11891f255a2SPawel Laszczak 	case USB_DT_STRING:
11991f255a2SPawel Laszczak 		s = "String";
12091f255a2SPawel Laszczak 		break;
12191f255a2SPawel Laszczak 	case USB_DT_INTERFACE:
12291f255a2SPawel Laszczak 		s = "Interface";
12391f255a2SPawel Laszczak 		break;
12491f255a2SPawel Laszczak 	case USB_DT_ENDPOINT:
12591f255a2SPawel Laszczak 		s = "Endpoint";
12691f255a2SPawel Laszczak 		break;
12791f255a2SPawel Laszczak 	case USB_DT_DEVICE_QUALIFIER:
12891f255a2SPawel Laszczak 		s = "Device Qualifier";
12991f255a2SPawel Laszczak 		break;
13091f255a2SPawel Laszczak 	case USB_DT_OTHER_SPEED_CONFIG:
13191f255a2SPawel Laszczak 		s = "Other Speed Config";
13291f255a2SPawel Laszczak 		break;
13391f255a2SPawel Laszczak 	case USB_DT_INTERFACE_POWER:
13491f255a2SPawel Laszczak 		s = "Interface Power";
13591f255a2SPawel Laszczak 		break;
13691f255a2SPawel Laszczak 	case USB_DT_OTG:
13791f255a2SPawel Laszczak 		s = "OTG";
13891f255a2SPawel Laszczak 		break;
13991f255a2SPawel Laszczak 	case USB_DT_DEBUG:
14091f255a2SPawel Laszczak 		s = "Debug";
14191f255a2SPawel Laszczak 		break;
14291f255a2SPawel Laszczak 	case USB_DT_INTERFACE_ASSOCIATION:
14391f255a2SPawel Laszczak 		s = "Interface Association";
14491f255a2SPawel Laszczak 		break;
14591f255a2SPawel Laszczak 	case USB_DT_BOS:
14691f255a2SPawel Laszczak 		s = "BOS";
14791f255a2SPawel Laszczak 		break;
14891f255a2SPawel Laszczak 	case USB_DT_DEVICE_CAPABILITY:
14991f255a2SPawel Laszczak 		s = "Device Capability";
15091f255a2SPawel Laszczak 		break;
15191f255a2SPawel Laszczak 	case USB_DT_PIPE_USAGE:
15291f255a2SPawel Laszczak 		s = "Pipe Usage";
15391f255a2SPawel Laszczak 		break;
15491f255a2SPawel Laszczak 	case USB_DT_SS_ENDPOINT_COMP:
15591f255a2SPawel Laszczak 		s = "SS Endpoint Companion";
15691f255a2SPawel Laszczak 		break;
15791f255a2SPawel Laszczak 	case USB_DT_SSP_ISOC_ENDPOINT_COMP:
15891f255a2SPawel Laszczak 		s = "SSP Isochronous Endpoint Companion";
15991f255a2SPawel Laszczak 		break;
16091f255a2SPawel Laszczak 	default:
16191f255a2SPawel Laszczak 		s = "UNKNOWN";
16291f255a2SPawel Laszczak 		break;
163f72429fcSPawel Laszczak 	}
164f72429fcSPawel Laszczak 
165f72429fcSPawel Laszczak 	snprintf(str, size, "%s %s Descriptor(Index = %d, Length = %d)",
166f72429fcSPawel Laszczak 		bRequest == USB_REQ_GET_DESCRIPTOR ? "Get" : "Set",
167f72429fcSPawel Laszczak 		s, wValue & 0xff, wLength);
16891f255a2SPawel Laszczak }
16991f255a2SPawel Laszczak 
usb_decode_get_configuration(__u16 wLength,char * str,size_t size)17091f255a2SPawel Laszczak static void usb_decode_get_configuration(__u16 wLength, char *str, size_t size)
17191f255a2SPawel Laszczak {
17291f255a2SPawel Laszczak 	snprintf(str, size, "Get Configuration(Length = %d)", wLength);
17391f255a2SPawel Laszczak }
17491f255a2SPawel Laszczak 
usb_decode_set_configuration(__u8 wValue,char * str,size_t size)17591f255a2SPawel Laszczak static void usb_decode_set_configuration(__u8 wValue, char *str, size_t size)
17691f255a2SPawel Laszczak {
17791f255a2SPawel Laszczak 	snprintf(str, size, "Set Configuration(Config = %d)", wValue);
17891f255a2SPawel Laszczak }
17991f255a2SPawel Laszczak 
usb_decode_get_intf(__u16 wIndex,__u16 wLength,char * str,size_t size)18091f255a2SPawel Laszczak static void usb_decode_get_intf(__u16 wIndex, __u16 wLength, char *str,
18191f255a2SPawel Laszczak 				size_t size)
18291f255a2SPawel Laszczak {
18391f255a2SPawel Laszczak 	snprintf(str, size, "Get Interface(Intf = %d, Length = %d)",
18491f255a2SPawel Laszczak 		 wIndex, wLength);
18591f255a2SPawel Laszczak }
18691f255a2SPawel Laszczak 
usb_decode_set_intf(__u8 wValue,__u16 wIndex,char * str,size_t size)18791f255a2SPawel Laszczak static void usb_decode_set_intf(__u8 wValue, __u16 wIndex, char *str,
18891f255a2SPawel Laszczak 				size_t size)
18991f255a2SPawel Laszczak {
19091f255a2SPawel Laszczak 	snprintf(str, size, "Set Interface(Intf = %d, Alt.Setting = %d)",
19191f255a2SPawel Laszczak 		 wIndex, wValue);
19291f255a2SPawel Laszczak }
19391f255a2SPawel Laszczak 
usb_decode_synch_frame(__u16 wIndex,__u16 wLength,char * str,size_t size)19491f255a2SPawel Laszczak static void usb_decode_synch_frame(__u16 wIndex, __u16 wLength,
19591f255a2SPawel Laszczak 				   char *str, size_t size)
19691f255a2SPawel Laszczak {
19791f255a2SPawel Laszczak 	snprintf(str, size, "Synch Frame(Endpoint = %d, Length = %d)",
19891f255a2SPawel Laszczak 		 wIndex, wLength);
19991f255a2SPawel Laszczak }
20091f255a2SPawel Laszczak 
usb_decode_set_sel(__u16 wLength,char * str,size_t size)20191f255a2SPawel Laszczak static void usb_decode_set_sel(__u16 wLength, char *str, size_t size)
20291f255a2SPawel Laszczak {
20391f255a2SPawel Laszczak 	snprintf(str, size, "Set SEL(Length = %d)", wLength);
20491f255a2SPawel Laszczak }
20591f255a2SPawel Laszczak 
usb_decode_set_isoch_delay(__u8 wValue,char * str,size_t size)20691f255a2SPawel Laszczak static void usb_decode_set_isoch_delay(__u8 wValue, char *str, size_t size)
20791f255a2SPawel Laszczak {
20891f255a2SPawel Laszczak 	snprintf(str, size, "Set Isochronous Delay(Delay = %d ns)", wValue);
20991f255a2SPawel Laszczak }
21091f255a2SPawel Laszczak 
usb_decode_ctrl_generic(char * str,size_t size,__u8 bRequestType,__u8 bRequest,__u16 wValue,__u16 wIndex,__u16 wLength)211*b6155eafSThinh Nguyen static void usb_decode_ctrl_generic(char *str, size_t size, __u8 bRequestType,
212*b6155eafSThinh Nguyen 				    __u8 bRequest, __u16 wValue, __u16 wIndex,
213*b6155eafSThinh Nguyen 				    __u16 wLength)
214*b6155eafSThinh Nguyen {
215*b6155eafSThinh Nguyen 	u8 recip = bRequestType & USB_RECIP_MASK;
216*b6155eafSThinh Nguyen 	u8 type = bRequestType & USB_TYPE_MASK;
217*b6155eafSThinh Nguyen 
218*b6155eafSThinh Nguyen 	snprintf(str, size,
219*b6155eafSThinh Nguyen 		 "Type=%s Recipient=%s Dir=%s bRequest=%u wValue=%u wIndex=%u wLength=%u",
220*b6155eafSThinh Nguyen 		 (type == USB_TYPE_STANDARD)    ? "Standard" :
221*b6155eafSThinh Nguyen 		 (type == USB_TYPE_VENDOR)      ? "Vendor" :
222*b6155eafSThinh Nguyen 		 (type == USB_TYPE_CLASS)       ? "Class" : "Unknown",
223*b6155eafSThinh Nguyen 		 (recip == USB_RECIP_DEVICE)    ? "Device" :
224*b6155eafSThinh Nguyen 		 (recip == USB_RECIP_INTERFACE) ? "Interface" :
225*b6155eafSThinh Nguyen 		 (recip == USB_RECIP_ENDPOINT)  ? "Endpoint" : "Unknown",
226*b6155eafSThinh Nguyen 		 (bRequestType & USB_DIR_IN)    ? "IN" : "OUT",
227*b6155eafSThinh Nguyen 		 bRequest, wValue, wIndex, wLength);
228*b6155eafSThinh Nguyen }
229*b6155eafSThinh Nguyen 
usb_decode_ctrl_standard(char * str,size_t size,__u8 bRequestType,__u8 bRequest,__u16 wValue,__u16 wIndex,__u16 wLength)230*b6155eafSThinh Nguyen static void usb_decode_ctrl_standard(char *str, size_t size, __u8 bRequestType,
23191f255a2SPawel Laszczak 				     __u8 bRequest, __u16 wValue, __u16 wIndex,
23291f255a2SPawel Laszczak 				     __u16 wLength)
23391f255a2SPawel Laszczak {
23491f255a2SPawel Laszczak 	switch (bRequest) {
23591f255a2SPawel Laszczak 	case USB_REQ_GET_STATUS:
23691f255a2SPawel Laszczak 		usb_decode_get_status(bRequestType, wIndex, wLength, str, size);
23791f255a2SPawel Laszczak 		break;
23891f255a2SPawel Laszczak 	case USB_REQ_CLEAR_FEATURE:
23991f255a2SPawel Laszczak 	case USB_REQ_SET_FEATURE:
24091f255a2SPawel Laszczak 		usb_decode_set_clear_feature(bRequestType, bRequest, wValue,
24191f255a2SPawel Laszczak 					     wIndex, str, size);
24291f255a2SPawel Laszczak 		break;
24391f255a2SPawel Laszczak 	case USB_REQ_SET_ADDRESS:
24491f255a2SPawel Laszczak 		usb_decode_set_address(wValue, str, size);
24591f255a2SPawel Laszczak 		break;
24691f255a2SPawel Laszczak 	case USB_REQ_GET_DESCRIPTOR:
24791f255a2SPawel Laszczak 	case USB_REQ_SET_DESCRIPTOR:
24891f255a2SPawel Laszczak 		usb_decode_get_set_descriptor(bRequestType, bRequest, wValue,
24991f255a2SPawel Laszczak 					      wIndex, wLength, str, size);
25091f255a2SPawel Laszczak 		break;
25191f255a2SPawel Laszczak 	case USB_REQ_GET_CONFIGURATION:
25291f255a2SPawel Laszczak 		usb_decode_get_configuration(wLength, str, size);
25391f255a2SPawel Laszczak 		break;
25491f255a2SPawel Laszczak 	case USB_REQ_SET_CONFIGURATION:
25591f255a2SPawel Laszczak 		usb_decode_set_configuration(wValue, str, size);
25691f255a2SPawel Laszczak 		break;
25791f255a2SPawel Laszczak 	case USB_REQ_GET_INTERFACE:
25891f255a2SPawel Laszczak 		usb_decode_get_intf(wIndex, wLength, str, size);
25991f255a2SPawel Laszczak 		break;
26091f255a2SPawel Laszczak 	case USB_REQ_SET_INTERFACE:
26191f255a2SPawel Laszczak 		usb_decode_set_intf(wValue, wIndex, str, size);
26291f255a2SPawel Laszczak 		break;
26391f255a2SPawel Laszczak 	case USB_REQ_SYNCH_FRAME:
26491f255a2SPawel Laszczak 		usb_decode_synch_frame(wIndex, wLength, str, size);
26591f255a2SPawel Laszczak 		break;
26691f255a2SPawel Laszczak 	case USB_REQ_SET_SEL:
26791f255a2SPawel Laszczak 		usb_decode_set_sel(wLength, str, size);
26891f255a2SPawel Laszczak 		break;
26991f255a2SPawel Laszczak 	case USB_REQ_SET_ISOCH_DELAY:
27091f255a2SPawel Laszczak 		usb_decode_set_isoch_delay(wValue, str, size);
27191f255a2SPawel Laszczak 		break;
27291f255a2SPawel Laszczak 	default:
273*b6155eafSThinh Nguyen 		usb_decode_ctrl_generic(str, size, bRequestType, bRequest,
274*b6155eafSThinh Nguyen 					wValue, wIndex, wLength);
275*b6155eafSThinh Nguyen 		break;
276*b6155eafSThinh Nguyen 	}
277*b6155eafSThinh Nguyen }
278*b6155eafSThinh Nguyen 
279*b6155eafSThinh Nguyen /**
280*b6155eafSThinh Nguyen  * usb_decode_ctrl - Returns human readable representation of control request.
281*b6155eafSThinh Nguyen  * @str: buffer to return a human-readable representation of control request.
282*b6155eafSThinh Nguyen  *       This buffer should have about 200 bytes.
283*b6155eafSThinh Nguyen  * @size: size of str buffer.
284*b6155eafSThinh Nguyen  * @bRequestType: matches the USB bmRequestType field
285*b6155eafSThinh Nguyen  * @bRequest: matches the USB bRequest field
286*b6155eafSThinh Nguyen  * @wValue: matches the USB wValue field (CPU byte order)
287*b6155eafSThinh Nguyen  * @wIndex: matches the USB wIndex field (CPU byte order)
288*b6155eafSThinh Nguyen  * @wLength: matches the USB wLength field (CPU byte order)
289*b6155eafSThinh Nguyen  *
290*b6155eafSThinh Nguyen  * Function returns decoded, formatted and human-readable description of
291*b6155eafSThinh Nguyen  * control request packet.
292*b6155eafSThinh Nguyen  *
293*b6155eafSThinh Nguyen  * The usage scenario for this is for tracepoints, so function as a return
294*b6155eafSThinh Nguyen  * use the same value as in parameters. This approach allows to use this
295*b6155eafSThinh Nguyen  * function in TP_printk
296*b6155eafSThinh Nguyen  *
297*b6155eafSThinh Nguyen  * Important: wValue, wIndex, wLength parameters before invoking this function
298*b6155eafSThinh Nguyen  * should be processed by le16_to_cpu macro.
299*b6155eafSThinh Nguyen  */
usb_decode_ctrl(char * str,size_t size,__u8 bRequestType,__u8 bRequest,__u16 wValue,__u16 wIndex,__u16 wLength)300*b6155eafSThinh Nguyen const char *usb_decode_ctrl(char *str, size_t size, __u8 bRequestType,
301*b6155eafSThinh Nguyen 			    __u8 bRequest, __u16 wValue, __u16 wIndex,
302*b6155eafSThinh Nguyen 			    __u16 wLength)
303*b6155eafSThinh Nguyen {
304*b6155eafSThinh Nguyen 	switch (bRequestType & USB_TYPE_MASK) {
305*b6155eafSThinh Nguyen 	case USB_TYPE_STANDARD:
306*b6155eafSThinh Nguyen 		usb_decode_ctrl_standard(str, size, bRequestType, bRequest,
307*b6155eafSThinh Nguyen 					 wValue, wIndex, wLength);
308*b6155eafSThinh Nguyen 		break;
309*b6155eafSThinh Nguyen 	case USB_TYPE_VENDOR:
310*b6155eafSThinh Nguyen 	case USB_TYPE_CLASS:
311*b6155eafSThinh Nguyen 	default:
312*b6155eafSThinh Nguyen 		usb_decode_ctrl_generic(str, size, bRequestType, bRequest,
313*b6155eafSThinh Nguyen 					wValue, wIndex, wLength);
314*b6155eafSThinh Nguyen 		break;
31591f255a2SPawel Laszczak 	}
31691f255a2SPawel Laszczak 
31791f255a2SPawel Laszczak 	return str;
31891f255a2SPawel Laszczak }
31991f255a2SPawel Laszczak EXPORT_SYMBOL_GPL(usb_decode_ctrl);
320