summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Laszczak <pawell@cadence.com>2019-08-26 07:19:27 -0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2019-08-29 03:52:27 -0400
commit91f255a26bce80d27b5f3dcbb0333b852b5dbe2c (patch)
tree8794a7e71ac325aa299bb3ff1167c4cd8e5bbbf3
parenta7a3a6a941cf53d49c5f40529b669304d328caf4 (diff)
usb: common: Separated decoding functions from dwc3 driver.
Patch moves some decoding functions from driver/usb/dwc3/debug.h driver to driver/usb/common/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/ch9.h file. Signed-off-by: Pawel Laszczak <pawell@cadence.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r--drivers/usb/common/Makefile1
-rw-r--r--drivers/usb/common/debug.c268
-rw-r--r--drivers/usb/dwc3/debug.h252
-rw-r--r--drivers/usb/dwc3/trace.h2
-rw-r--r--include/linux/usb/ch9.h27
5 files changed, 297 insertions, 253 deletions
diff --git a/drivers/usb/common/Makefile b/drivers/usb/common/Makefile
index 0a7c45e85481..76f3e80623db 100644
--- a/drivers/usb/common/Makefile
+++ b/drivers/usb/common/Makefile
@@ -5,6 +5,7 @@
5 5
6obj-$(CONFIG_USB_COMMON) += usb-common.o 6obj-$(CONFIG_USB_COMMON) += usb-common.o
7usb-common-y += common.o 7usb-common-y += common.o
8usb-common-$(CONFIG_TRACING) += debug.o
8usb-common-$(CONFIG_USB_LED_TRIG) += led.o 9usb-common-$(CONFIG_USB_LED_TRIG) += led.o
9 10
10obj-$(CONFIG_USB_OTG_FSM) += usb-otg-fsm.o 11obj-$(CONFIG_USB_OTG_FSM) += usb-otg-fsm.o
diff --git a/drivers/usb/common/debug.c b/drivers/usb/common/debug.c
new file mode 100644
index 000000000000..d5a469bc67a3
--- /dev/null
+++ b/drivers/usb/common/debug.c
@@ -0,0 +1,268 @@
1// SPDX-License-Identifier: GPL-2.0
2/**
3 * Common USB debugging functions
4 *
5 * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com
6 *
7 * Authors: Felipe Balbi <balbi@ti.com>,
8 * Sebastian Andrzej Siewior <bigeasy@linutronix.de>
9 */
10
11#include <linux/usb/ch9.h>
12
13static void usb_decode_get_status(__u8 bRequestType, __u16 wIndex,
14 __u16 wLength, char *str, size_t size)
15{
16 switch (bRequestType & USB_RECIP_MASK) {
17 case USB_RECIP_DEVICE:
18 snprintf(str, size, "Get Device Status(Length = %d)", wLength);
19 break;
20 case USB_RECIP_INTERFACE:
21 snprintf(str, size,
22 "Get Interface Status(Intf = %d, Length = %d)",
23 wIndex, wLength);
24 break;
25 case USB_RECIP_ENDPOINT:
26 snprintf(str, size, "Get Endpoint Status(ep%d%s)",
27 wIndex & ~USB_DIR_IN,
28 wIndex & USB_DIR_IN ? "in" : "out");
29 break;
30 }
31}
32
33static void usb_decode_set_clear_feature(__u8 bRequestType, __u8 bRequest,
34 __u16 wValue, __u16 wIndex,
35 char *str, size_t size)
36{
37 switch (bRequestType & USB_RECIP_MASK) {
38 case USB_RECIP_DEVICE:
39 snprintf(str, size, "%s Device Feature(%s%s)",
40 bRequest == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set",
41 ({char *s;
42 switch (wValue) {
43 case USB_DEVICE_SELF_POWERED:
44 s = "Self Powered";
45 break;
46 case USB_DEVICE_REMOTE_WAKEUP:
47 s = "Remote Wakeup";
48 break;
49 case USB_DEVICE_TEST_MODE:
50 s = "Test Mode";
51 break;
52 case USB_DEVICE_U1_ENABLE:
53 s = "U1 Enable";
54 break;
55 case USB_DEVICE_U2_ENABLE:
56 s = "U2 Enable";
57 break;
58 case USB_DEVICE_LTM_ENABLE:
59 s = "LTM Enable";
60 break;
61 default:
62 s = "UNKNOWN";
63 } s; }),
64 wValue == USB_DEVICE_TEST_MODE ?
65 ({ char *s;
66 switch (wIndex) {
67 case TEST_J:
68 s = ": TEST_J";
69 break;
70 case TEST_K:
71 s = ": TEST_K";
72 break;
73 case TEST_SE0_NAK:
74 s = ": TEST_SE0_NAK";
75 break;
76 case TEST_PACKET:
77 s = ": TEST_PACKET";
78 break;
79 case TEST_FORCE_EN:
80 s = ": TEST_FORCE_EN";
81 break;
82 default:
83 s = ": UNKNOWN";
84 } s; }) : "");
85 break;
86 case USB_RECIP_INTERFACE:
87 snprintf(str, size, "%s Interface Feature(%s)",
88 bRequest == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set",
89 wValue == USB_INTRF_FUNC_SUSPEND ?
90 "Function Suspend" : "UNKNOWN");
91 break;
92 case USB_RECIP_ENDPOINT:
93 snprintf(str, size, "%s Endpoint Feature(%s ep%d%s)",
94 bRequest == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set",
95 wValue == USB_ENDPOINT_HALT ? "Halt" : "UNKNOWN",
96 wIndex & ~USB_DIR_IN,
97 wIndex & USB_DIR_IN ? "in" : "out");
98 break;
99 }
100}
101
102static void usb_decode_set_address(__u16 wValue, char *str, size_t size)
103{
104 snprintf(str, size, "Set Address(Addr = %02x)", wValue);
105}
106
107static void usb_decode_get_set_descriptor(__u8 bRequestType, __u8 bRequest,
108 __u16 wValue, __u16 wIndex,
109 __u16 wLength, char *str, size_t size)
110{
111 snprintf(str, size, "%s %s Descriptor(Index = %d, Length = %d)",
112 bRequest == USB_REQ_GET_DESCRIPTOR ? "Get" : "Set",
113 ({ char *s;
114 switch (wValue >> 8) {
115 case USB_DT_DEVICE:
116 s = "Device";
117 break;
118 case USB_DT_CONFIG:
119 s = "Configuration";
120 break;
121 case USB_DT_STRING:
122 s = "String";
123 break;
124 case USB_DT_INTERFACE:
125 s = "Interface";
126 break;
127 case USB_DT_ENDPOINT:
128 s = "Endpoint";
129 break;
130 case USB_DT_DEVICE_QUALIFIER:
131 s = "Device Qualifier";
132 break;
133 case USB_DT_OTHER_SPEED_CONFIG:
134 s = "Other Speed Config";
135 break;
136 case USB_DT_INTERFACE_POWER:
137 s = "Interface Power";
138 break;
139 case USB_DT_OTG:
140 s = "OTG";
141 break;
142 case USB_DT_DEBUG:
143 s = "Debug";
144 break;
145 case USB_DT_INTERFACE_ASSOCIATION:
146 s = "Interface Association";
147 break;
148 case USB_DT_BOS:
149 s = "BOS";
150 break;
151 case USB_DT_DEVICE_CAPABILITY:
152 s = "Device Capability";
153 break;
154 case USB_DT_PIPE_USAGE:
155 s = "Pipe Usage";
156 break;
157 case USB_DT_SS_ENDPOINT_COMP:
158 s = "SS Endpoint Companion";
159 break;
160 case USB_DT_SSP_ISOC_ENDPOINT_COMP:
161 s = "SSP Isochronous Endpoint Companion";
162 break;
163 default:
164 s = "UNKNOWN";
165 break;
166 } s; }), wValue & 0xff, wLength);
167}
168
169static void usb_decode_get_configuration(__u16 wLength, char *str, size_t size)
170{
171 snprintf(str, size, "Get Configuration(Length = %d)", wLength);
172}
173
174static void usb_decode_set_configuration(__u8 wValue, char *str, size_t size)
175{
176 snprintf(str, size, "Set Configuration(Config = %d)", wValue);
177}
178
179static void usb_decode_get_intf(__u16 wIndex, __u16 wLength, char *str,
180 size_t size)
181{
182 snprintf(str, size, "Get Interface(Intf = %d, Length = %d)",
183 wIndex, wLength);
184}
185
186static void usb_decode_set_intf(__u8 wValue, __u16 wIndex, char *str,
187 size_t size)
188{
189 snprintf(str, size, "Set Interface(Intf = %d, Alt.Setting = %d)",
190 wIndex, wValue);
191}
192
193static void usb_decode_synch_frame(__u16 wIndex, __u16 wLength,
194 char *str, size_t size)
195{
196 snprintf(str, size, "Synch Frame(Endpoint = %d, Length = %d)",
197 wIndex, wLength);
198}
199
200static void usb_decode_set_sel(__u16 wLength, char *str, size_t size)
201{
202 snprintf(str, size, "Set SEL(Length = %d)", wLength);
203}
204
205static void usb_decode_set_isoch_delay(__u8 wValue, char *str, size_t size)
206{
207 snprintf(str, size, "Set Isochronous Delay(Delay = %d ns)", wValue);
208}
209
210/**
211 * usb_decode_ctrl - returns a string representation of ctrl request
212 */
213const char *usb_decode_ctrl(char *str, size_t size, __u8 bRequestType,
214 __u8 bRequest, __u16 wValue, __u16 wIndex,
215 __u16 wLength)
216{
217 switch (bRequest) {
218 case USB_REQ_GET_STATUS:
219 usb_decode_get_status(bRequestType, wIndex, wLength, str, size);
220 break;
221 case USB_REQ_CLEAR_FEATURE:
222 case USB_REQ_SET_FEATURE:
223 usb_decode_set_clear_feature(bRequestType, bRequest, wValue,
224 wIndex, str, size);
225 break;
226 case USB_REQ_SET_ADDRESS:
227 usb_decode_set_address(wValue, str, size);
228 break;
229 case USB_REQ_GET_DESCRIPTOR:
230 case USB_REQ_SET_DESCRIPTOR:
231 usb_decode_get_set_descriptor(bRequestType, bRequest, wValue,
232 wIndex, wLength, str, size);
233 break;
234 case USB_REQ_GET_CONFIGURATION:
235 usb_decode_get_configuration(wLength, str, size);
236 break;
237 case USB_REQ_SET_CONFIGURATION:
238 usb_decode_set_configuration(wValue, str, size);
239 break;
240 case USB_REQ_GET_INTERFACE:
241 usb_decode_get_intf(wIndex, wLength, str, size);
242 break;
243 case USB_REQ_SET_INTERFACE:
244 usb_decode_set_intf(wValue, wIndex, str, size);
245 break;
246 case USB_REQ_SYNCH_FRAME:
247 usb_decode_synch_frame(wIndex, wLength, str, size);
248 break;
249 case USB_REQ_SET_SEL:
250 usb_decode_set_sel(wLength, str, size);
251 break;
252 case USB_REQ_SET_ISOCH_DELAY:
253 usb_decode_set_isoch_delay(wValue, str, size);
254 break;
255 default:
256 snprintf(str, size, "%02x %02x %02x %02x %02x %02x %02x %02x",
257 bRequestType, bRequest,
258 (u8)(cpu_to_le16(wValue) & 0xff),
259 (u8)(cpu_to_le16(wValue) >> 8),
260 (u8)(cpu_to_le16(wIndex) & 0xff),
261 (u8)(cpu_to_le16(wIndex) >> 8),
262 (u8)(cpu_to_le16(wLength) & 0xff),
263 (u8)(cpu_to_le16(wLength) >> 8));
264 }
265
266 return str;
267}
268EXPORT_SYMBOL_GPL(usb_decode_ctrl);
diff --git a/drivers/usb/dwc3/debug.h b/drivers/usb/dwc3/debug.h
index 068259fdfb0c..9baabed87d61 100644
--- a/drivers/usb/dwc3/debug.h
+++ b/drivers/usb/dwc3/debug.h
@@ -246,258 +246,6 @@ static inline const char *dwc3_gadget_event_string(char *str, size_t size,
246 return str; 246 return str;
247} 247}
248 248
249static inline void dwc3_decode_get_status(__u8 t, __u16 i, __u16 l, char *str,
250 size_t size)
251{
252 switch (t & USB_RECIP_MASK) {
253 case USB_RECIP_DEVICE:
254 snprintf(str, size, "Get Device Status(Length = %d)", l);
255 break;
256 case USB_RECIP_INTERFACE:
257 snprintf(str, size, "Get Interface Status(Intf = %d, Length = %d)",
258 i, l);
259 break;
260 case USB_RECIP_ENDPOINT:
261 snprintf(str, size, "Get Endpoint Status(ep%d%s)",
262 i & ~USB_DIR_IN,
263 i & USB_DIR_IN ? "in" : "out");
264 break;
265 }
266}
267
268static inline void dwc3_decode_set_clear_feature(__u8 t, __u8 b, __u16 v,
269 __u16 i, char *str, size_t size)
270{
271 switch (t & USB_RECIP_MASK) {
272 case USB_RECIP_DEVICE:
273 snprintf(str, size, "%s Device Feature(%s%s)",
274 b == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set",
275 ({char *s;
276 switch (v) {
277 case USB_DEVICE_SELF_POWERED:
278 s = "Self Powered";
279 break;
280 case USB_DEVICE_REMOTE_WAKEUP:
281 s = "Remote Wakeup";
282 break;
283 case USB_DEVICE_TEST_MODE:
284 s = "Test Mode";
285 break;
286 case USB_DEVICE_U1_ENABLE:
287 s = "U1 Enable";
288 break;
289 case USB_DEVICE_U2_ENABLE:
290 s = "U2 Enable";
291 break;
292 case USB_DEVICE_LTM_ENABLE:
293 s = "LTM Enable";
294 break;
295 default:
296 s = "UNKNOWN";
297 } s; }),
298 v == USB_DEVICE_TEST_MODE ?
299 ({ char *s;
300 switch (i) {
301 case TEST_J:
302 s = ": TEST_J";
303 break;
304 case TEST_K:
305 s = ": TEST_K";
306 break;
307 case TEST_SE0_NAK:
308 s = ": TEST_SE0_NAK";
309 break;
310 case TEST_PACKET:
311 s = ": TEST_PACKET";
312 break;
313 case TEST_FORCE_EN:
314 s = ": TEST_FORCE_EN";
315 break;
316 default:
317 s = ": UNKNOWN";
318 } s; }) : "");
319 break;
320 case USB_RECIP_INTERFACE:
321 snprintf(str, size, "%s Interface Feature(%s)",
322 b == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set",
323 v == USB_INTRF_FUNC_SUSPEND ?
324 "Function Suspend" : "UNKNOWN");
325 break;
326 case USB_RECIP_ENDPOINT:
327 snprintf(str, size, "%s Endpoint Feature(%s ep%d%s)",
328 b == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set",
329 v == USB_ENDPOINT_HALT ? "Halt" : "UNKNOWN",
330 i & ~USB_DIR_IN,
331 i & USB_DIR_IN ? "in" : "out");
332 break;
333 }
334}
335
336static inline void dwc3_decode_set_address(__u16 v, char *str, size_t size)
337{
338 snprintf(str, size, "Set Address(Addr = %02x)", v);
339}
340
341static inline void dwc3_decode_get_set_descriptor(__u8 t, __u8 b, __u16 v,
342 __u16 i, __u16 l, char *str, size_t size)
343{
344 snprintf(str, size, "%s %s Descriptor(Index = %d, Length = %d)",
345 b == USB_REQ_GET_DESCRIPTOR ? "Get" : "Set",
346 ({ char *s;
347 switch (v >> 8) {
348 case USB_DT_DEVICE:
349 s = "Device";
350 break;
351 case USB_DT_CONFIG:
352 s = "Configuration";
353 break;
354 case USB_DT_STRING:
355 s = "String";
356 break;
357 case USB_DT_INTERFACE:
358 s = "Interface";
359 break;
360 case USB_DT_ENDPOINT:
361 s = "Endpoint";
362 break;
363 case USB_DT_DEVICE_QUALIFIER:
364 s = "Device Qualifier";
365 break;
366 case USB_DT_OTHER_SPEED_CONFIG:
367 s = "Other Speed Config";
368 break;
369 case USB_DT_INTERFACE_POWER:
370 s = "Interface Power";
371 break;
372 case USB_DT_OTG:
373 s = "OTG";
374 break;
375 case USB_DT_DEBUG:
376 s = "Debug";
377 break;
378 case USB_DT_INTERFACE_ASSOCIATION:
379 s = "Interface Association";
380 break;
381 case USB_DT_BOS:
382 s = "BOS";
383 break;
384 case USB_DT_DEVICE_CAPABILITY:
385 s = "Device Capability";
386 break;
387 case USB_DT_PIPE_USAGE:
388 s = "Pipe Usage";
389 break;
390 case USB_DT_SS_ENDPOINT_COMP:
391 s = "SS Endpoint Companion";
392 break;
393 case USB_DT_SSP_ISOC_ENDPOINT_COMP:
394 s = "SSP Isochronous Endpoint Companion";
395 break;
396 default:
397 s = "UNKNOWN";
398 break;
399 } s; }), v & 0xff, l);
400}
401
402
403static inline void dwc3_decode_get_configuration(__u16 l, char *str,
404 size_t size)
405{
406 snprintf(str, size, "Get Configuration(Length = %d)", l);
407}
408
409static inline void dwc3_decode_set_configuration(__u8 v, char *str, size_t size)
410{
411 snprintf(str, size, "Set Configuration(Config = %d)", v);
412}
413
414static inline void dwc3_decode_get_intf(__u16 i, __u16 l, char *str,
415 size_t size)
416{
417 snprintf(str, size, "Get Interface(Intf = %d, Length = %d)", i, l);
418}
419
420static inline void dwc3_decode_set_intf(__u8 v, __u16 i, char *str, size_t size)
421{
422 snprintf(str, size, "Set Interface(Intf = %d, Alt.Setting = %d)", i, v);
423}
424
425static inline void dwc3_decode_synch_frame(__u16 i, __u16 l, char *str,
426 size_t size)
427{
428 snprintf(str, size, "Synch Frame(Endpoint = %d, Length = %d)", i, l);
429}
430
431static inline void dwc3_decode_set_sel(__u16 l, char *str, size_t size)
432{
433 snprintf(str, size, "Set SEL(Length = %d)", l);
434}
435
436static inline void dwc3_decode_set_isoch_delay(__u8 v, char *str, size_t size)
437{
438 snprintf(str, size, "Set Isochronous Delay(Delay = %d ns)", v);
439}
440
441/**
442 * dwc3_decode_ctrl - returns a string represetion of ctrl request
443 */
444static inline const char *dwc3_decode_ctrl(char *str, size_t size,
445 __u8 bRequestType, __u8 bRequest, __u16 wValue, __u16 wIndex,
446 __u16 wLength)
447{
448 switch (bRequest) {
449 case USB_REQ_GET_STATUS:
450 dwc3_decode_get_status(bRequestType, wIndex, wLength, str,
451 size);
452 break;
453 case USB_REQ_CLEAR_FEATURE:
454 case USB_REQ_SET_FEATURE:
455 dwc3_decode_set_clear_feature(bRequestType, bRequest, wValue,
456 wIndex, str, size);
457 break;
458 case USB_REQ_SET_ADDRESS:
459 dwc3_decode_set_address(wValue, str, size);
460 break;
461 case USB_REQ_GET_DESCRIPTOR:
462 case USB_REQ_SET_DESCRIPTOR:
463 dwc3_decode_get_set_descriptor(bRequestType, bRequest, wValue,
464 wIndex, wLength, str, size);
465 break;
466 case USB_REQ_GET_CONFIGURATION:
467 dwc3_decode_get_configuration(wLength, str, size);
468 break;
469 case USB_REQ_SET_CONFIGURATION:
470 dwc3_decode_set_configuration(wValue, str, size);
471 break;
472 case USB_REQ_GET_INTERFACE:
473 dwc3_decode_get_intf(wIndex, wLength, str, size);
474 break;
475 case USB_REQ_SET_INTERFACE:
476 dwc3_decode_set_intf(wValue, wIndex, str, size);
477 break;
478 case USB_REQ_SYNCH_FRAME:
479 dwc3_decode_synch_frame(wIndex, wLength, str, size);
480 break;
481 case USB_REQ_SET_SEL:
482 dwc3_decode_set_sel(wLength, str, size);
483 break;
484 case USB_REQ_SET_ISOCH_DELAY:
485 dwc3_decode_set_isoch_delay(wValue, str, size);
486 break;
487 default:
488 snprintf(str, size, "%02x %02x %02x %02x %02x %02x %02x %02x",
489 bRequestType, bRequest,
490 cpu_to_le16(wValue) & 0xff,
491 cpu_to_le16(wValue) >> 8,
492 cpu_to_le16(wIndex) & 0xff,
493 cpu_to_le16(wIndex) >> 8,
494 cpu_to_le16(wLength) & 0xff,
495 cpu_to_le16(wLength) >> 8);
496 }
497
498 return str;
499}
500
501/** 249/**
502 * dwc3_ep_event_string - returns event name 250 * dwc3_ep_event_string - returns event name
503 * @event: then event code 251 * @event: then event code
diff --git a/drivers/usb/dwc3/trace.h b/drivers/usb/dwc3/trace.h
index 818a63da1a44..9edff17111f7 100644
--- a/drivers/usb/dwc3/trace.h
+++ b/drivers/usb/dwc3/trace.h
@@ -86,7 +86,7 @@ DECLARE_EVENT_CLASS(dwc3_log_ctrl,
86 __entry->wIndex = le16_to_cpu(ctrl->wIndex); 86 __entry->wIndex = le16_to_cpu(ctrl->wIndex);
87 __entry->wLength = le16_to_cpu(ctrl->wLength); 87 __entry->wLength = le16_to_cpu(ctrl->wLength);
88 ), 88 ),
89 TP_printk("%s", dwc3_decode_ctrl(__get_str(str), DWC3_MSG_MAX, 89 TP_printk("%s", usb_decode_ctrl(__get_str(str), DWC3_MSG_MAX,
90 __entry->bRequestType, 90 __entry->bRequestType,
91 __entry->bRequest, __entry->wValue, 91 __entry->bRequest, __entry->wValue,
92 __entry->wIndex, __entry->wLength) 92 __entry->wIndex, __entry->wLength)
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index da82606be605..58b83066bea4 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -70,4 +70,31 @@ extern enum usb_device_speed usb_get_maximum_speed(struct device *dev);
70 */ 70 */
71extern const char *usb_state_string(enum usb_device_state state); 71extern const char *usb_state_string(enum usb_device_state state);
72 72
73#ifdef CONFIG_TRACING
74/**
75 * usb_decode_ctrl - Returns human readable representation of control request.
76 * @str: buffer to return a human-readable representation of control request.
77 * This buffer should have about 200 bytes.
78 * @size: size of str buffer.
79 * @bRequestType: matches the USB bmRequestType field
80 * @bRequest: matches the USB bRequest field
81 * @wValue: matches the USB wValue field (CPU byte order)
82 * @wIndex: matches the USB wIndex field (CPU byte order)
83 * @wLength: matches the USB wLength field (CPU byte order)
84 *
85 * Function returns decoded, formatted and human-readable description of
86 * control request packet.
87 *
88 * The usage scenario for this is for tracepoints, so function as a return
89 * use the same value as in parameters. This approach allows to use this
90 * function in TP_printk
91 *
92 * Important: wValue, wIndex, wLength parameters before invoking this function
93 * should be processed by le16_to_cpu macro.
94 */
95extern const char *usb_decode_ctrl(char *str, size_t size, __u8 bRequestType,
96 __u8 bRequest, __u16 wValue, __u16 wIndex,
97 __u16 wLength);
98#endif
99
73#endif /* __LINUX_USB_CH9_H */ 100#endif /* __LINUX_USB_CH9_H */