]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMassStorageDxe / UsbMassBot.c
... / ...
CommitLineData
1/** @file\r
2 Implementation of the USB mass storage Bulk-Only Transport protocol,\r
3 according to USB Mass Storage Class Bulk-Only Transport, Revision 1.0.\r
4\r
5Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
6This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#include "UsbMass.h"\r
17\r
18//\r
19// Definition of USB BOT Transport Protocol\r
20//\r
21USB_MASS_TRANSPORT mUsbBotTransport = {\r
22 USB_MASS_STORE_BOT,\r
23 UsbBotInit,\r
24 UsbBotExecCommand,\r
25 UsbBotResetDevice,\r
26 UsbBotGetMaxLun,\r
27 UsbBotCleanUp\r
28};\r
29\r
30/**\r
31 Initializes USB BOT protocol.\r
32\r
33 This function initializes the USB mass storage class BOT protocol.\r
34 It will save its context which is a USB_BOT_PROTOCOL structure\r
35 in the Context if Context isn't NULL.\r
36\r
37 @param UsbIo The USB I/O Protocol instance\r
38 @param Context The buffer to save the context to\r
39\r
40 @retval EFI_SUCCESS The device is successfully initialized.\r
41 @retval EFI_UNSUPPORTED The transport protocol doesn't support the device.\r
42 @retval Other The USB BOT initialization fails.\r
43\r
44**/\r
45EFI_STATUS\r
46UsbBotInit (\r
47 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
48 OUT VOID **Context OPTIONAL\r
49 )\r
50{\r
51 USB_BOT_PROTOCOL *UsbBot;\r
52 EFI_USB_INTERFACE_DESCRIPTOR *Interface;\r
53 EFI_USB_ENDPOINT_DESCRIPTOR EndPoint;\r
54 EFI_STATUS Status;\r
55 UINT8 Index;\r
56\r
57 //\r
58 // Allocate the BOT context for USB_BOT_PROTOCOL and two endpoint descriptors.\r
59 //\r
60 UsbBot = AllocateZeroPool (sizeof (USB_BOT_PROTOCOL) + 2 * sizeof (EFI_USB_ENDPOINT_DESCRIPTOR));\r
61 ASSERT (UsbBot != NULL);\r
62\r
63 UsbBot->UsbIo = UsbIo;\r
64\r
65 //\r
66 // Get the interface descriptor and validate that it\r
67 // is a USB Mass Storage BOT interface.\r
68 //\r
69 Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &UsbBot->Interface);\r
70\r
71 if (EFI_ERROR (Status)) {\r
72 goto ON_ERROR;\r
73 }\r
74\r
75 Interface = &UsbBot->Interface;\r
76\r
77 if (Interface->InterfaceProtocol != USB_MASS_STORE_BOT) {\r
78 Status = EFI_UNSUPPORTED;\r
79 goto ON_ERROR;\r
80 }\r
81\r
82 //\r
83 // Locate and save the first bulk-in and bulk-out endpoint\r
84 //\r
85 for (Index = 0; Index < Interface->NumEndpoints; Index++) {\r
86 Status = UsbIo->UsbGetEndpointDescriptor (UsbIo, Index, &EndPoint);\r
87\r
88 if (EFI_ERROR (Status) || !USB_IS_BULK_ENDPOINT (EndPoint.Attributes)) {\r
89 continue;\r
90 }\r
91\r
92 if (USB_IS_IN_ENDPOINT (EndPoint.EndpointAddress) &&\r
93 (UsbBot->BulkInEndpoint == NULL)) {\r
94\r
95 UsbBot->BulkInEndpoint = (EFI_USB_ENDPOINT_DESCRIPTOR *) (UsbBot + 1);\r
96 CopyMem(UsbBot->BulkInEndpoint, &EndPoint, sizeof (EndPoint));\r
97 }\r
98\r
99 if (USB_IS_OUT_ENDPOINT (EndPoint.EndpointAddress) &&\r
100 (UsbBot->BulkOutEndpoint == NULL)) {\r
101\r
102 UsbBot->BulkOutEndpoint = (EFI_USB_ENDPOINT_DESCRIPTOR *) (UsbBot + 1) + 1;\r
103 CopyMem (UsbBot->BulkOutEndpoint, &EndPoint, sizeof(EndPoint));\r
104 }\r
105 }\r
106\r
107 //\r
108 // If bulk-in or bulk-out endpoint is not found, report error.\r
109 //\r
110 if ((UsbBot->BulkInEndpoint == NULL) || (UsbBot->BulkOutEndpoint == NULL)) {\r
111 Status = EFI_UNSUPPORTED;\r
112 goto ON_ERROR;\r
113 }\r
114\r
115 //\r
116 // The USB BOT protocol uses CBWTag to match the CBW and CSW.\r
117 //\r
118 UsbBot->CbwTag = 0x01;\r
119\r
120 if (Context != NULL) {\r
121 *Context = UsbBot;\r
122 } else {\r
123 FreePool (UsbBot);\r
124 }\r
125\r
126 return EFI_SUCCESS;\r
127\r
128ON_ERROR:\r
129 FreePool (UsbBot);\r
130 return Status;\r
131}\r
132\r
133/**\r
134 Send the command to the device using Bulk-Out endpoint.\r
135\r
136 This function sends the command to the device using Bulk-Out endpoint.\r
137 BOT transfer is composed of three phases: Command, Data, and Status.\r
138 This is the Command phase.\r
139\r
140 @param UsbBot The USB BOT device\r
141 @param Cmd The command to transfer to device\r
142 @param CmdLen The length of the command\r
143 @param DataDir The direction of the data\r
144 @param TransLen The expected length of the data\r
145 @param Lun The number of logic unit\r
146\r
147 @retval EFI_SUCCESS The command is sent to the device.\r
148 @retval EFI_NOT_READY The device return NAK to the transfer\r
149 @retval Others Failed to send the command to device\r
150\r
151**/\r
152EFI_STATUS\r
153UsbBotSendCommand (\r
154 IN USB_BOT_PROTOCOL *UsbBot,\r
155 IN UINT8 *Cmd,\r
156 IN UINT8 CmdLen,\r
157 IN EFI_USB_DATA_DIRECTION DataDir,\r
158 IN UINT32 TransLen,\r
159 IN UINT8 Lun\r
160 )\r
161{\r
162 USB_BOT_CBW Cbw;\r
163 EFI_STATUS Status;\r
164 UINT32 Result;\r
165 UINTN DataLen;\r
166 UINTN Timeout;\r
167\r
168 ASSERT ((CmdLen > 0) && (CmdLen <= USB_BOT_MAX_CMDLEN));\r
169\r
170 //\r
171 // Fill in the Command Block Wrapper.\r
172 //\r
173 Cbw.Signature = USB_BOT_CBW_SIGNATURE;\r
174 Cbw.Tag = UsbBot->CbwTag;\r
175 Cbw.DataLen = TransLen;\r
176 Cbw.Flag = (UINT8) ((DataDir == EfiUsbDataIn) ? BIT7 : 0);\r
177 Cbw.Lun = Lun;\r
178 Cbw.CmdLen = CmdLen;\r
179\r
180 ZeroMem (Cbw.CmdBlock, USB_BOT_MAX_CMDLEN);\r
181 CopyMem (Cbw.CmdBlock, Cmd, CmdLen);\r
182\r
183 Result = 0;\r
184 DataLen = sizeof (USB_BOT_CBW);\r
185 Timeout = USB_BOT_SEND_CBW_TIMEOUT / USB_MASS_1_MILLISECOND;\r
186\r
187 //\r
188 // Use USB I/O Protocol to send the Command Block Wrapper to the device.\r
189 //\r
190 Status = UsbBot->UsbIo->UsbBulkTransfer (\r
191 UsbBot->UsbIo,\r
192 UsbBot->BulkOutEndpoint->EndpointAddress,\r
193 &Cbw,\r
194 &DataLen,\r
195 Timeout,\r
196 &Result\r
197 );\r
198 if (EFI_ERROR (Status)) {\r
199 if (USB_IS_ERROR (Result, EFI_USB_ERR_STALL) && DataDir == EfiUsbDataOut) {\r
200 //\r
201 // Respond to Bulk-Out endpoint stall with a Reset Recovery,\r
202 // according to section 5.3.1 of USB Mass Storage Class Bulk-Only Transport Spec, v1.0.\r
203 //\r
204 UsbBotResetDevice (UsbBot, FALSE);\r
205 } else if (USB_IS_ERROR (Result, EFI_USB_ERR_NAK)) {\r
206 Status = EFI_NOT_READY;\r
207 }\r
208 }\r
209\r
210 return Status;\r
211}\r
212\r
213\r
214/**\r
215 Transfer the data between the device and host.\r
216\r
217 This function transfers the data between the device and host.\r
218 BOT transfer is composed of three phases: Command, Data, and Status.\r
219 This is the Data phase.\r
220\r
221 @param UsbBot The USB BOT device\r
222 @param DataDir The direction of the data\r
223 @param Data The buffer to hold data\r
224 @param TransLen The expected length of the data\r
225 @param Timeout The time to wait the command to complete\r
226\r
227 @retval EFI_SUCCESS The data is transferred\r
228 @retval EFI_SUCCESS No data to transfer\r
229 @retval EFI_NOT_READY The device return NAK to the transfer\r
230 @retval Others Failed to transfer data\r
231\r
232**/\r
233EFI_STATUS\r
234UsbBotDataTransfer (\r
235 IN USB_BOT_PROTOCOL *UsbBot,\r
236 IN EFI_USB_DATA_DIRECTION DataDir,\r
237 IN OUT UINT8 *Data,\r
238 IN OUT UINTN *TransLen,\r
239 IN UINT32 Timeout\r
240 )\r
241{\r
242 EFI_USB_ENDPOINT_DESCRIPTOR *Endpoint;\r
243 EFI_STATUS Status;\r
244 UINT32 Result;\r
245\r
246 //\r
247 // If no data to transfer, just return EFI_SUCCESS.\r
248 //\r
249 if ((DataDir == EfiUsbNoData) || (*TransLen == 0)) {\r
250 return EFI_SUCCESS;\r
251 }\r
252\r
253 //\r
254 // Select the endpoint then issue the transfer\r
255 //\r
256 if (DataDir == EfiUsbDataIn) {\r
257 Endpoint = UsbBot->BulkInEndpoint;\r
258 } else {\r
259 Endpoint = UsbBot->BulkOutEndpoint;\r
260 }\r
261\r
262 Result = 0;\r
263 Timeout = Timeout / USB_MASS_1_MILLISECOND;\r
264\r
265 Status = UsbBot->UsbIo->UsbBulkTransfer (\r
266 UsbBot->UsbIo,\r
267 Endpoint->EndpointAddress,\r
268 Data,\r
269 TransLen,\r
270 Timeout,\r
271 &Result\r
272 );\r
273 if (EFI_ERROR (Status)) {\r
274 if (USB_IS_ERROR (Result, EFI_USB_ERR_STALL)) {\r
275 DEBUG ((EFI_D_INFO, "UsbBotDataTransfer: (%r)\n", Status));\r
276 DEBUG ((EFI_D_INFO, "UsbBotDataTransfer: DataIn Stall\n"));\r
277 UsbClearEndpointStall (UsbBot->UsbIo, Endpoint->EndpointAddress);\r
278 } else if (USB_IS_ERROR (Result, EFI_USB_ERR_NAK)) {\r
279 Status = EFI_NOT_READY;\r
280 } else {\r
281 DEBUG ((EFI_D_ERROR, "UsbBotDataTransfer: (%r)\n", Status));\r
282 }\r
283 if(Status == EFI_TIMEOUT){\r
284 UsbBotResetDevice(UsbBot, FALSE);\r
285 }\r
286 }\r
287\r
288 return Status;\r
289}\r
290\r
291\r
292/**\r
293 Get the command execution status from device.\r
294\r
295 This function gets the command execution status from device.\r
296 BOT transfer is composed of three phases: Command, Data, and Status.\r
297 This is the Status phase.\r
298\r
299 This function returns the transfer status of the BOT's CSW status,\r
300 and returns the high level command execution result in Result. So\r
301 even if EFI_SUCCESS is returned, the command may still have failed.\r
302\r
303 @param UsbBot The USB BOT device.\r
304 @param TransLen The expected length of the data.\r
305 @param CmdStatus The result of the command execution.\r
306\r
307 @retval EFI_SUCCESS Command execute result is retrieved and in the Result.\r
308 @retval Other Error occurred when trying to get status.\r
309\r
310**/\r
311EFI_STATUS\r
312UsbBotGetStatus (\r
313 IN USB_BOT_PROTOCOL *UsbBot,\r
314 IN UINT32 TransLen,\r
315 OUT UINT8 *CmdStatus\r
316 )\r
317{\r
318 USB_BOT_CSW Csw;\r
319 UINTN Len;\r
320 UINT8 Endpoint;\r
321 EFI_STATUS Status;\r
322 UINT32 Result;\r
323 EFI_USB_IO_PROTOCOL *UsbIo;\r
324 UINT32 Index;\r
325 UINTN Timeout;\r
326\r
327 *CmdStatus = USB_BOT_COMMAND_ERROR;\r
328 Status = EFI_DEVICE_ERROR;\r
329 Endpoint = UsbBot->BulkInEndpoint->EndpointAddress;\r
330 UsbIo = UsbBot->UsbIo;\r
331 Timeout = USB_BOT_RECV_CSW_TIMEOUT / USB_MASS_1_MILLISECOND;\r
332\r
333 for (Index = 0; Index < USB_BOT_RECV_CSW_RETRY; Index++) {\r
334 //\r
335 // Attemp to the read Command Status Wrapper from bulk in endpoint\r
336 //\r
337 ZeroMem (&Csw, sizeof (USB_BOT_CSW));\r
338 Result = 0;\r
339 Len = sizeof (USB_BOT_CSW);\r
340 Status = UsbIo->UsbBulkTransfer (\r
341 UsbIo,\r
342 Endpoint,\r
343 &Csw,\r
344 &Len,\r
345 Timeout,\r
346 &Result\r
347 );\r
348 if (EFI_ERROR(Status)) {\r
349 if (USB_IS_ERROR (Result, EFI_USB_ERR_STALL)) {\r
350 UsbClearEndpointStall (UsbIo, Endpoint);\r
351 }\r
352 continue;\r
353 }\r
354\r
355 if (Csw.Signature != USB_BOT_CSW_SIGNATURE) {\r
356 //\r
357 // CSW is invalid, so perform reset recovery\r
358 //\r
359 Status = UsbBotResetDevice (UsbBot, FALSE);\r
360 } else if (Csw.CmdStatus == USB_BOT_COMMAND_ERROR) {\r
361 //\r
362 // Respond phase error also needs reset recovery\r
363 //\r
364 Status = UsbBotResetDevice (UsbBot, FALSE);\r
365 } else {\r
366 *CmdStatus = Csw.CmdStatus;\r
367 break;\r
368 }\r
369 }\r
370 //\r
371 //The tag is increased even if there is an error.\r
372 //\r
373 UsbBot->CbwTag++;\r
374\r
375 return Status;\r
376}\r
377\r
378\r
379/**\r
380 Call the USB Mass Storage Class BOT protocol to issue\r
381 the command/data/status circle to execute the commands.\r
382\r
383 @param Context The context of the BOT protocol, that is,\r
384 USB_BOT_PROTOCOL\r
385 @param Cmd The high level command\r
386 @param CmdLen The command length\r
387 @param DataDir The direction of the data transfer\r
388 @param Data The buffer to hold data\r
389 @param DataLen The length of the data\r
390 @param Lun The number of logic unit\r
391 @param Timeout The time to wait command\r
392 @param CmdStatus The result of high level command execution\r
393\r
394 @retval EFI_SUCCESS The command is executed successfully.\r
395 @retval Other Failed to execute command\r
396\r
397**/\r
398EFI_STATUS\r
399UsbBotExecCommand (\r
400 IN VOID *Context,\r
401 IN VOID *Cmd,\r
402 IN UINT8 CmdLen,\r
403 IN EFI_USB_DATA_DIRECTION DataDir,\r
404 IN VOID *Data,\r
405 IN UINT32 DataLen,\r
406 IN UINT8 Lun,\r
407 IN UINT32 Timeout,\r
408 OUT UINT32 *CmdStatus\r
409 )\r
410{\r
411 USB_BOT_PROTOCOL *UsbBot;\r
412 EFI_STATUS Status;\r
413 UINTN TransLen;\r
414 UINT8 Result;\r
415\r
416 *CmdStatus = USB_MASS_CMD_FAIL;\r
417 UsbBot = (USB_BOT_PROTOCOL *) Context;\r
418\r
419 //\r
420 // Send the command to the device. Return immediately if device\r
421 // rejects the command.\r
422 //\r
423 Status = UsbBotSendCommand (UsbBot, Cmd, CmdLen, DataDir, DataLen, Lun);\r
424 if (EFI_ERROR (Status)) {\r
425 DEBUG ((EFI_D_ERROR, "UsbBotExecCommand: UsbBotSendCommand (%r)\n", Status));\r
426 return Status;\r
427 }\r
428\r
429 //\r
430 // Transfer the data. Don't return immediately even data transfer\r
431 // failed. The host should attempt to receive the CSW no matter\r
432 // whether it succeeds or fails.\r
433 //\r
434 TransLen = (UINTN) DataLen;\r
435 UsbBotDataTransfer (UsbBot, DataDir, Data, &TransLen, Timeout);\r
436\r
437 //\r
438 // Get the status, if that succeeds, interpret the result\r
439 //\r
440 Status = UsbBotGetStatus (UsbBot, DataLen, &Result);\r
441 if (EFI_ERROR (Status)) {\r
442 DEBUG ((EFI_D_ERROR, "UsbBotExecCommand: UsbBotGetStatus (%r)\n", Status));\r
443 return Status;\r
444 }\r
445\r
446 if (Result == 0) {\r
447 *CmdStatus = USB_MASS_CMD_SUCCESS;\r
448 }\r
449\r
450 return EFI_SUCCESS;\r
451}\r
452\r
453\r
454/**\r
455 Reset the USB mass storage device by BOT protocol.\r
456\r
457 @param Context The context of the BOT protocol, that is,\r
458 USB_BOT_PROTOCOL.\r
459 @param ExtendedVerification If FALSE, just issue Bulk-Only Mass Storage Reset request.\r
460 If TRUE, additionally reset parent hub port.\r
461\r
462 @retval EFI_SUCCESS The device is reset.\r
463 @retval Others Failed to reset the device..\r
464\r
465**/\r
466EFI_STATUS\r
467UsbBotResetDevice (\r
468 IN VOID *Context,\r
469 IN BOOLEAN ExtendedVerification\r
470 )\r
471{\r
472 USB_BOT_PROTOCOL *UsbBot;\r
473 EFI_USB_DEVICE_REQUEST Request;\r
474 EFI_STATUS Status;\r
475 UINT32 Result;\r
476 UINT32 Timeout;\r
477\r
478 UsbBot = (USB_BOT_PROTOCOL *) Context;\r
479\r
480 if (ExtendedVerification) {\r
481 //\r
482 // If we need to do strictly reset, reset its parent hub port\r
483 //\r
484 Status = UsbBot->UsbIo->UsbPortReset (UsbBot->UsbIo);\r
485 if (EFI_ERROR (Status)) {\r
486 return EFI_DEVICE_ERROR;\r
487 }\r
488 }\r
489\r
490 //\r
491 // Issue a class specific Bulk-Only Mass Storage Reset request,\r
492 // according to section 3.1 of USB Mass Storage Class Bulk-Only Transport Spec, v1.0.\r
493 //\r
494 Request.RequestType = 0x21;\r
495 Request.Request = USB_BOT_RESET_REQUEST;\r
496 Request.Value = 0;\r
497 Request.Index = UsbBot->Interface.InterfaceNumber;\r
498 Request.Length = 0;\r
499 Timeout = USB_BOT_RESET_DEVICE_TIMEOUT / USB_MASS_1_MILLISECOND;\r
500\r
501 Status = UsbBot->UsbIo->UsbControlTransfer (\r
502 UsbBot->UsbIo,\r
503 &Request,\r
504 EfiUsbNoData,\r
505 Timeout,\r
506 NULL,\r
507 0,\r
508 &Result\r
509 );\r
510\r
511 if (EFI_ERROR (Status)) {\r
512 return EFI_DEVICE_ERROR;\r
513 }\r
514\r
515 //\r
516 // The device shall NAK the host's request until the reset is\r
517 // complete. We can use this to sync the device and host. For\r
518 // now just stall 100ms to wait for the device.\r
519 //\r
520 gBS->Stall (USB_BOT_RESET_DEVICE_STALL);\r
521\r
522 //\r
523 // Clear the Bulk-In and Bulk-Out stall condition.\r
524 //\r
525 UsbClearEndpointStall (UsbBot->UsbIo, UsbBot->BulkInEndpoint->EndpointAddress);\r
526 UsbClearEndpointStall (UsbBot->UsbIo, UsbBot->BulkOutEndpoint->EndpointAddress);\r
527\r
528 return Status;\r
529}\r
530\r
531\r
532/**\r
533 Get the max LUN (Logical Unit Number) of USB mass storage device.\r
534\r
535 @param Context The context of the BOT protocol, that is, USB_BOT_PROTOCOL\r
536 @param MaxLun Return pointer to the max number of LUN. (e.g. MaxLun=1 means LUN0 and\r
537 LUN1 in all.)\r
538\r
539 @retval EFI_SUCCESS Max LUN is got successfully.\r
540 @retval Others Fail to execute this request.\r
541\r
542**/\r
543EFI_STATUS\r
544UsbBotGetMaxLun (\r
545 IN VOID *Context,\r
546 OUT UINT8 *MaxLun\r
547 )\r
548{\r
549 USB_BOT_PROTOCOL *UsbBot;\r
550 EFI_USB_DEVICE_REQUEST Request;\r
551 EFI_STATUS Status;\r
552 UINT32 Result;\r
553 UINT32 Timeout;\r
554\r
555 if (Context == NULL || MaxLun == NULL) {\r
556 return EFI_INVALID_PARAMETER;\r
557 }\r
558\r
559 UsbBot = (USB_BOT_PROTOCOL *) Context;\r
560\r
561 //\r
562 // Issue a class specific Bulk-Only Mass Storage get max lun reqest.\r
563 // according to section 3.2 of USB Mass Storage Class Bulk-Only Transport Spec, v1.0.\r
564 //\r
565 Request.RequestType = 0xA1;\r
566 Request.Request = USB_BOT_GETLUN_REQUEST;\r
567 Request.Value = 0;\r
568 Request.Index = UsbBot->Interface.InterfaceNumber;\r
569 Request.Length = 1;\r
570 Timeout = USB_BOT_RESET_DEVICE_TIMEOUT / USB_MASS_1_MILLISECOND;\r
571\r
572 Status = UsbBot->UsbIo->UsbControlTransfer (\r
573 UsbBot->UsbIo,\r
574 &Request,\r
575 EfiUsbDataIn,\r
576 Timeout,\r
577 (VOID *) MaxLun,\r
578 1,\r
579 &Result\r
580 );\r
581 if (EFI_ERROR (Status) || *MaxLun > USB_BOT_MAX_LUN) {\r
582 //\r
583 // If the Get LUN request returns an error or the MaxLun is larger than\r
584 // the maximum LUN value (0x0f) supported by the USB Mass Storage Class\r
585 // Bulk-Only Transport Spec, then set MaxLun to 0.\r
586 //\r
587 // This improves compatibility with USB FLASH drives that have a single LUN\r
588 // and either do not return a max LUN value or return an invalid maximum LUN\r
589 // value.\r
590 //\r
591 *MaxLun = 0;\r
592 }\r
593\r
594 return EFI_SUCCESS;\r
595}\r
596\r
597/**\r
598 Clean up the resource used by this BOT protocol.\r
599\r
600 @param Context The context of the BOT protocol, that is, USB_BOT_PROTOCOL.\r
601\r
602 @retval EFI_SUCCESS The resource is cleaned up.\r
603\r
604**/\r
605EFI_STATUS\r
606UsbBotCleanUp (\r
607 IN VOID *Context\r
608 )\r
609{\r
610 FreePool (Context);\r
611 return EFI_SUCCESS;\r
612}\r
613\r