blob: f5ac22349817d8ee548bc521ddf64f76d17e3e45 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Sebastian Siewior3aab70a2014-05-05 15:08:10 -05002/*
3 * (C) Copyright 2008 - 2009
4 * Windriver, <www.windriver.com>
5 * Tom Rix <Tom.Rix@windriver.com>
6 *
7 * Copyright 2011 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
8 *
9 * Copyright 2014 Linaro, Ltd.
10 * Rob Herring <robh@kernel.org>
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050011 */
Simon Glass09140112020-05-10 11:40:03 -060012#include <command.h>
Steve Rae593cbd92014-08-26 11:47:29 -070013#include <config.h>
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050014#include <common.h>
Simon Glass7b51b572019-08-01 09:46:52 -060015#include <env.h>
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050016#include <errno.h>
Maxime Ripard3c8f98f2015-10-15 14:34:13 +020017#include <fastboot.h>
Simon Glassf7ae49f2020-05-10 11:40:05 -060018#include <log.h>
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050019#include <malloc.h>
20#include <linux/usb/ch9.h>
21#include <linux/usb/gadget.h>
22#include <linux/usb/composite.h>
23#include <linux/compiler.h>
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050024#include <g_dnl.h>
25
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050026#define FASTBOOT_INTERFACE_CLASS 0xff
27#define FASTBOOT_INTERFACE_SUB_CLASS 0x42
28#define FASTBOOT_INTERFACE_PROTOCOL 0x03
29
30#define RX_ENDPOINT_MAXIMUM_PACKET_SIZE_2_0 (0x0200)
31#define RX_ENDPOINT_MAXIMUM_PACKET_SIZE_1_1 (0x0040)
32#define TX_ENDPOINT_MAXIMUM_PACKET_SIZE (0x0040)
33
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050034#define EP_BUFFER_SIZE 4096
Roger Quadrosac484c52016-04-19 10:16:59 +030035/*
36 * EP_BUFFER_SIZE must always be an integral multiple of maxpacket size
37 * (64 or 512 or 1024), else we break on certain controllers like DWC3
38 * that expect bulk OUT requests to be divisible by maxpacket size.
39 */
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050040
41struct f_fastboot {
42 struct usb_function usb_function;
43
Steve Rae593cbd92014-08-26 11:47:29 -070044 /* IN/OUT EP's and corresponding requests */
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050045 struct usb_ep *in_ep, *out_ep;
46 struct usb_request *in_req, *out_req;
47};
48
Li Jun8043cf82021-01-25 21:43:51 +080049static char fb_ext_prop_name[] = "DeviceInterfaceGUID";
50static char fb_ext_prop_data[] = "{4866319A-F4D6-4374-93B9-DC2DEB361BA9}";
51
52static struct usb_os_desc_ext_prop fb_ext_prop = {
53 .type = 1, /* NUL-terminated Unicode String (REG_SZ) */
54 .name = fb_ext_prop_name,
55 .data = fb_ext_prop_data,
56};
57
58/* 16 bytes of "Compatible ID" and "Subcompatible ID" */
59static char fb_cid[16] = {'W', 'I', 'N', 'U', 'S', 'B'};
60static struct usb_os_desc fb_os_desc = {
61 .ext_compat_id = fb_cid,
62};
63
64static struct usb_os_desc_table fb_os_desc_table = {
65 .os_desc = &fb_os_desc,
66};
67
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050068static inline struct f_fastboot *func_to_fastboot(struct usb_function *f)
69{
70 return container_of(f, struct f_fastboot, usb_function);
71}
72
73static struct f_fastboot *fastboot_func;
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050074
75static struct usb_endpoint_descriptor fs_ep_in = {
76 .bLength = USB_DT_ENDPOINT_SIZE,
77 .bDescriptorType = USB_DT_ENDPOINT,
78 .bEndpointAddress = USB_DIR_IN,
79 .bmAttributes = USB_ENDPOINT_XFER_BULK,
Roger Quadros718156a2016-04-12 15:51:48 +030080 .wMaxPacketSize = cpu_to_le16(64),
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050081};
82
83static struct usb_endpoint_descriptor fs_ep_out = {
84 .bLength = USB_DT_ENDPOINT_SIZE,
85 .bDescriptorType = USB_DT_ENDPOINT,
86 .bEndpointAddress = USB_DIR_OUT,
87 .bmAttributes = USB_ENDPOINT_XFER_BULK,
Roger Quadros718156a2016-04-12 15:51:48 +030088 .wMaxPacketSize = cpu_to_le16(64),
89};
90
91static struct usb_endpoint_descriptor hs_ep_in = {
92 .bLength = USB_DT_ENDPOINT_SIZE,
93 .bDescriptorType = USB_DT_ENDPOINT,
94 .bEndpointAddress = USB_DIR_IN,
95 .bmAttributes = USB_ENDPOINT_XFER_BULK,
96 .wMaxPacketSize = cpu_to_le16(512),
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050097};
98
99static struct usb_endpoint_descriptor hs_ep_out = {
100 .bLength = USB_DT_ENDPOINT_SIZE,
101 .bDescriptorType = USB_DT_ENDPOINT,
102 .bEndpointAddress = USB_DIR_OUT,
103 .bmAttributes = USB_ENDPOINT_XFER_BULK,
Roger Quadros718156a2016-04-12 15:51:48 +0300104 .wMaxPacketSize = cpu_to_le16(512),
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500105};
106
107static struct usb_interface_descriptor interface_desc = {
108 .bLength = USB_DT_INTERFACE_SIZE,
109 .bDescriptorType = USB_DT_INTERFACE,
110 .bInterfaceNumber = 0x00,
111 .bAlternateSetting = 0x00,
112 .bNumEndpoints = 0x02,
113 .bInterfaceClass = FASTBOOT_INTERFACE_CLASS,
114 .bInterfaceSubClass = FASTBOOT_INTERFACE_SUB_CLASS,
115 .bInterfaceProtocol = FASTBOOT_INTERFACE_PROTOCOL,
116};
117
Roger Quadros718156a2016-04-12 15:51:48 +0300118static struct usb_descriptor_header *fb_fs_function[] = {
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500119 (struct usb_descriptor_header *)&interface_desc,
120 (struct usb_descriptor_header *)&fs_ep_in,
Roger Quadros718156a2016-04-12 15:51:48 +0300121 (struct usb_descriptor_header *)&fs_ep_out,
122};
123
124static struct usb_descriptor_header *fb_hs_function[] = {
125 (struct usb_descriptor_header *)&interface_desc,
126 (struct usb_descriptor_header *)&hs_ep_in,
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500127 (struct usb_descriptor_header *)&hs_ep_out,
128 NULL,
129};
130
Roger Quadros8b704a02016-04-13 11:30:00 +0300131static struct usb_endpoint_descriptor *
132fb_ep_desc(struct usb_gadget *g, struct usb_endpoint_descriptor *fs,
133 struct usb_endpoint_descriptor *hs)
134{
135 if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH)
136 return hs;
137 return fs;
138}
139
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500140/*
141 * static strings, in UTF-8
142 */
143static const char fastboot_name[] = "Android Fastboot";
144
145static struct usb_string fastboot_string_defs[] = {
146 [0].s = fastboot_name,
147 { } /* end of list */
148};
149
150static struct usb_gadget_strings stringtab_fastboot = {
151 .language = 0x0409, /* en-us */
152 .strings = fastboot_string_defs,
153};
154
155static struct usb_gadget_strings *fastboot_strings[] = {
156 &stringtab_fastboot,
157 NULL,
158};
159
160static void rx_handler_command(struct usb_ep *ep, struct usb_request *req);
161
162static void fastboot_complete(struct usb_ep *ep, struct usb_request *req)
163{
164 int status = req->status;
165 if (!status)
166 return;
167 printf("status: %d ep '%s' trans: %d\n", status, ep->name, req->actual);
168}
169
170static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
171{
172 int id;
173 struct usb_gadget *gadget = c->cdev->gadget;
174 struct f_fastboot *f_fb = func_to_fastboot(f);
Dileep Katta537cd072015-02-13 14:33:43 +0800175 const char *s;
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500176
177 /* DYNAMIC interface numbers assignments */
178 id = usb_interface_id(c, f);
179 if (id < 0)
180 return id;
181 interface_desc.bInterfaceNumber = id;
182
Li Jun8043cf82021-01-25 21:43:51 +0800183 /* Enable OS and Extended Properties Feature Descriptor */
184 c->cdev->use_os_string = 1;
185 f->os_desc_table = &fb_os_desc_table;
186 f->os_desc_n = 1;
187 f->os_desc_table->if_id = id;
188 INIT_LIST_HEAD(&fb_os_desc.ext_prop);
189 fb_ext_prop.name_len = strlen(fb_ext_prop.name) * 2 + 2;
190 fb_os_desc.ext_prop_len = 10 + fb_ext_prop.name_len;
191 fb_os_desc.ext_prop_count = 1;
192 fb_ext_prop.data_len = strlen(fb_ext_prop.data) * 2 + 2;
193 fb_os_desc.ext_prop_len += fb_ext_prop.data_len + 4;
194 list_add_tail(&fb_ext_prop.entry, &fb_os_desc.ext_prop);
195
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500196 id = usb_string_id(c->cdev);
197 if (id < 0)
198 return id;
199 fastboot_string_defs[0].id = id;
200 interface_desc.iInterface = id;
201
202 f_fb->in_ep = usb_ep_autoconfig(gadget, &fs_ep_in);
203 if (!f_fb->in_ep)
204 return -ENODEV;
205 f_fb->in_ep->driver_data = c->cdev;
206
207 f_fb->out_ep = usb_ep_autoconfig(gadget, &fs_ep_out);
208 if (!f_fb->out_ep)
209 return -ENODEV;
210 f_fb->out_ep->driver_data = c->cdev;
211
Roger Quadros718156a2016-04-12 15:51:48 +0300212 f->descriptors = fb_fs_function;
213
214 if (gadget_is_dualspeed(gadget)) {
215 /* Assume endpoint addresses are the same for both speeds */
216 hs_ep_in.bEndpointAddress = fs_ep_in.bEndpointAddress;
217 hs_ep_out.bEndpointAddress = fs_ep_out.bEndpointAddress;
218 /* copy HS descriptors */
219 f->hs_descriptors = fb_hs_function;
220 }
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500221
Simon Glass00caae62017-08-03 12:22:12 -0600222 s = env_get("serial#");
Dileep Katta537cd072015-02-13 14:33:43 +0800223 if (s)
224 g_dnl_set_serialnumber((char *)s);
225
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500226 return 0;
227}
228
229static void fastboot_unbind(struct usb_configuration *c, struct usb_function *f)
230{
Li Jun8043cf82021-01-25 21:43:51 +0800231 f->os_desc_table = NULL;
232 list_del(&fb_os_desc.ext_prop);
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500233 memset(fastboot_func, 0, sizeof(*fastboot_func));
234}
235
236static void fastboot_disable(struct usb_function *f)
237{
238 struct f_fastboot *f_fb = func_to_fastboot(f);
239
240 usb_ep_disable(f_fb->out_ep);
241 usb_ep_disable(f_fb->in_ep);
242
243 if (f_fb->out_req) {
244 free(f_fb->out_req->buf);
245 usb_ep_free_request(f_fb->out_ep, f_fb->out_req);
246 f_fb->out_req = NULL;
247 }
248 if (f_fb->in_req) {
249 free(f_fb->in_req->buf);
250 usb_ep_free_request(f_fb->in_ep, f_fb->in_req);
251 f_fb->in_req = NULL;
252 }
253}
254
255static struct usb_request *fastboot_start_ep(struct usb_ep *ep)
256{
257 struct usb_request *req;
258
259 req = usb_ep_alloc_request(ep, 0);
260 if (!req)
261 return NULL;
262
263 req->length = EP_BUFFER_SIZE;
264 req->buf = memalign(CONFIG_SYS_CACHELINE_SIZE, EP_BUFFER_SIZE);
265 if (!req->buf) {
266 usb_ep_free_request(ep, req);
267 return NULL;
268 }
269
270 memset(req->buf, 0, req->length);
271 return req;
272}
273
274static int fastboot_set_alt(struct usb_function *f,
275 unsigned interface, unsigned alt)
276{
277 int ret;
278 struct usb_composite_dev *cdev = f->config->cdev;
279 struct usb_gadget *gadget = cdev->gadget;
280 struct f_fastboot *f_fb = func_to_fastboot(f);
Roger Quadros8b704a02016-04-13 11:30:00 +0300281 const struct usb_endpoint_descriptor *d;
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500282
283 debug("%s: func: %s intf: %d alt: %d\n",
284 __func__, f->name, interface, alt);
285
Roger Quadros8b704a02016-04-13 11:30:00 +0300286 d = fb_ep_desc(gadget, &fs_ep_out, &hs_ep_out);
287 ret = usb_ep_enable(f_fb->out_ep, d);
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500288 if (ret) {
289 puts("failed to enable out ep\n");
290 return ret;
291 }
292
293 f_fb->out_req = fastboot_start_ep(f_fb->out_ep);
294 if (!f_fb->out_req) {
295 puts("failed to alloc out req\n");
296 ret = -EINVAL;
297 goto err;
298 }
299 f_fb->out_req->complete = rx_handler_command;
300
Roger Quadros8b704a02016-04-13 11:30:00 +0300301 d = fb_ep_desc(gadget, &fs_ep_in, &hs_ep_in);
302 ret = usb_ep_enable(f_fb->in_ep, d);
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500303 if (ret) {
304 puts("failed to enable in ep\n");
305 goto err;
306 }
307
308 f_fb->in_req = fastboot_start_ep(f_fb->in_ep);
309 if (!f_fb->in_req) {
310 puts("failed alloc req in\n");
311 ret = -EINVAL;
312 goto err;
313 }
314 f_fb->in_req->complete = fastboot_complete;
315
316 ret = usb_ep_queue(f_fb->out_ep, f_fb->out_req, 0);
317 if (ret)
318 goto err;
319
320 return 0;
321err:
322 fastboot_disable(f);
323 return ret;
324}
325
326static int fastboot_add(struct usb_configuration *c)
327{
328 struct f_fastboot *f_fb = fastboot_func;
329 int status;
330
331 debug("%s: cdev: 0x%p\n", __func__, c->cdev);
332
333 if (!f_fb) {
334 f_fb = memalign(CONFIG_SYS_CACHELINE_SIZE, sizeof(*f_fb));
335 if (!f_fb)
336 return -ENOMEM;
337
338 fastboot_func = f_fb;
339 memset(f_fb, 0, sizeof(*f_fb));
340 }
341
342 f_fb->usb_function.name = "f_fastboot";
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500343 f_fb->usb_function.bind = fastboot_bind;
344 f_fb->usb_function.unbind = fastboot_unbind;
345 f_fb->usb_function.set_alt = fastboot_set_alt;
346 f_fb->usb_function.disable = fastboot_disable;
347 f_fb->usb_function.strings = fastboot_strings;
348
349 status = usb_add_function(c, &f_fb->usb_function);
350 if (status) {
351 free(f_fb);
Andy Shevchenko6ffc8e22020-12-03 17:32:05 +0200352 fastboot_func = NULL;
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500353 }
354
355 return status;
356}
357DECLARE_GADGET_BIND_CALLBACK(usb_dnl_fastboot, fastboot_add);
358
Steve Rae593cbd92014-08-26 11:47:29 -0700359static int fastboot_tx_write(const char *buffer, unsigned int buffer_size)
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500360{
361 struct usb_request *in_req = fastboot_func->in_req;
362 int ret;
363
364 memcpy(in_req->buf, buffer, buffer_size);
365 in_req->length = buffer_size;
Paul Kocialkowskibc9071c2015-07-04 16:46:16 +0200366
367 usb_ep_dequeue(fastboot_func->in_ep, in_req);
368
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500369 ret = usb_ep_queue(fastboot_func->in_ep, in_req, 0);
370 if (ret)
371 printf("Error %d on queue\n", ret);
372 return 0;
373}
374
375static int fastboot_tx_write_str(const char *buffer)
376{
377 return fastboot_tx_write(buffer, strlen(buffer));
378}
379
380static void compl_do_reset(struct usb_ep *ep, struct usb_request *req)
381{
382 do_reset(NULL, 0, 0, NULL);
383}
384
Roger Quadrosac484c52016-04-19 10:16:59 +0300385static unsigned int rx_bytes_expected(struct usb_ep *ep)
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500386{
Alex Kiernan65c96752018-05-29 15:30:55 +0000387 int rx_remain = fastboot_data_remaining();
Roger Quadrosac484c52016-04-19 10:16:59 +0300388 unsigned int rem;
389 unsigned int maxpacket = ep->maxpacket;
390
391 if (rx_remain <= 0)
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500392 return 0;
Roger Quadrosac484c52016-04-19 10:16:59 +0300393 else if (rx_remain > EP_BUFFER_SIZE)
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500394 return EP_BUFFER_SIZE;
Roger Quadrosac484c52016-04-19 10:16:59 +0300395
396 /*
397 * Some controllers e.g. DWC3 don't like OUT transfers to be
398 * not ending in maxpacket boundary. So just make them happy by
399 * always requesting for integral multiple of maxpackets.
400 * This shouldn't bother controllers that don't care about it.
401 */
402 rem = rx_remain % maxpacket;
403 if (rem > 0)
Dileep Katta9e4b5102015-02-17 02:02:36 +0530404 rx_remain = rx_remain + (maxpacket - rem);
Roger Quadrosac484c52016-04-19 10:16:59 +0300405
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500406 return rx_remain;
407}
408
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500409static void rx_handler_dl_image(struct usb_ep *ep, struct usb_request *req)
410{
Alex Kiernan65c96752018-05-29 15:30:55 +0000411 char response[FASTBOOT_RESPONSE_LEN] = {0};
412 unsigned int transfer_size = fastboot_data_remaining();
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500413 const unsigned char *buffer = req->buf;
414 unsigned int buffer_size = req->actual;
415
416 if (req->status != 0) {
417 printf("Bad status: %d\n", req->status);
418 return;
419 }
420
421 if (buffer_size < transfer_size)
422 transfer_size = buffer_size;
423
Alex Kiernan65c96752018-05-29 15:30:55 +0000424 fastboot_data_download(buffer, transfer_size, response);
425 if (response[0]) {
426 fastboot_tx_write_str(response);
427 } else if (!fastboot_data_remaining()) {
428 fastboot_data_complete(response);
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500429
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500430 /*
Alex Kiernan65c96752018-05-29 15:30:55 +0000431 * Reset global transfer variable
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500432 */
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500433 req->complete = rx_handler_command;
434 req->length = EP_BUFFER_SIZE;
435
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500436 fastboot_tx_write_str(response);
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500437 } else {
Roger Quadrosac484c52016-04-19 10:16:59 +0300438 req->length = rx_bytes_expected(ep);
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500439 }
440
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500441 req->actual = 0;
442 usb_ep_queue(ep, req, 0);
443}
444
Rob Herring267abc62014-12-10 14:43:04 -0600445static void do_exit_on_complete(struct usb_ep *ep, struct usb_request *req)
446{
447 g_dnl_trigger_detach();
448}
449
Alex Kiernan65c96752018-05-29 15:30:55 +0000450static void do_bootm_on_complete(struct usb_ep *ep, struct usb_request *req)
Rob Herring267abc62014-12-10 14:43:04 -0600451{
Alex Kiernan65c96752018-05-29 15:30:55 +0000452 fastboot_boot();
453 do_exit_on_complete(ep, req);
Rob Herring267abc62014-12-10 14:43:04 -0600454}
455
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500456static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
457{
458 char *cmdbuf = req->buf;
Alex Kiernan65c96752018-05-29 15:30:55 +0000459 char response[FASTBOOT_RESPONSE_LEN] = {0};
460 int cmd = -1;
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500461
Paul Kocialkowski94b385f2015-07-04 16:46:15 +0200462 if (req->status != 0 || req->length == 0)
463 return;
464
Alex Kiernan65c96752018-05-29 15:30:55 +0000465 if (req->actual < req->length) {
466 cmdbuf[req->actual] = '\0';
467 cmd = fastboot_handle_command(cmdbuf, response);
468 } else {
469 pr_err("buffer overflow");
470 fastboot_fail("buffer overflow", response);
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500471 }
472
Alex Kiernan65c96752018-05-29 15:30:55 +0000473 if (!strncmp("DATA", response, 4)) {
474 req->complete = rx_handler_dl_image;
475 req->length = rx_bytes_expected(ep);
476 }
477
Alex Kiernan65c96752018-05-29 15:30:55 +0000478 if (!strncmp("OKAY", response, 4)) {
479 switch (cmd) {
480 case FASTBOOT_COMMAND_BOOT:
481 fastboot_func->in_req->complete = do_bootm_on_complete;
482 break;
483
484 case FASTBOOT_COMMAND_CONTINUE:
485 fastboot_func->in_req->complete = do_exit_on_complete;
486 break;
487
488 case FASTBOOT_COMMAND_REBOOT:
489 case FASTBOOT_COMMAND_REBOOT_BOOTLOADER:
Roman Kovalivskyi2b2a7712020-07-28 23:35:33 +0300490 case FASTBOOT_COMMAND_REBOOT_FASTBOOTD:
491 case FASTBOOT_COMMAND_REBOOT_RECOVERY:
Alex Kiernan65c96752018-05-29 15:30:55 +0000492 fastboot_func->in_req->complete = compl_do_reset;
493 break;
Eric Nelsone2140582014-10-01 14:30:56 -0700494 }
Steve Rae593cbd92014-08-26 11:47:29 -0700495 }
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500496
yurii.pidhornyi64af06c2020-08-20 18:41:18 +0300497 fastboot_tx_write_str(response);
498
Paul Kocialkowski94b385f2015-07-04 16:46:15 +0200499 *cmdbuf = '\0';
500 req->actual = 0;
501 usb_ep_queue(ep, req, 0);
Sebastian Siewior3aab70a2014-05-05 15:08:10 -0500502}