+ @param Context The context of the BOT protocol, that is, USB_BOT_PROTOCOL\r
+ @param MaxLun Return pointer to the max number of LUN. (e.g. MaxLun=1 means LUN0 and\r
+ LUN1 in all.)\r
+\r
+ @retval EFI_SUCCESS Max LUN is got successfully.\r
+ @retval Others Fail to execute this request.\r
+\r
+**/\r
+EFI_STATUS\r
+UsbBotGetMaxLun (\r
+ IN VOID *Context,\r
+ OUT UINT8 *MaxLun\r
+ )\r
+{\r
+ USB_BOT_PROTOCOL *UsbBot;\r
+ EFI_USB_DEVICE_REQUEST Request;\r
+ EFI_STATUS Status;\r
+ UINT32 Result;\r
+ UINT32 Timeout;\r
+\r
+ ASSERT (Context);\r
+ \r
+ UsbBot = (USB_BOT_PROTOCOL *) Context;\r
+\r
+ //\r
+ // Issue a class specific Bulk-Only Mass Storage get max lun reqest.\r
+ // according to section 3.2 of USB Mass Storage Class Bulk-Only Transport Spec, v1.0.\r
+ //\r
+ Request.RequestType = 0xA1;\r
+ Request.Request = USB_BOT_GETLUN_REQUEST;\r
+ Request.Value = 0;\r
+ Request.Index = UsbBot->Interface.InterfaceNumber;\r
+ Request.Length = 1;\r
+ Timeout = USB_BOT_RESET_DEVICE_TIMEOUT / USB_MASS_1_MILLISECOND;\r
+\r
+ Status = UsbBot->UsbIo->UsbControlTransfer (\r
+ UsbBot->UsbIo,\r
+ &Request,\r
+ EfiUsbDataIn,\r
+ Timeout,\r
+ (VOID *) MaxLun,\r
+ 1,\r
+ &Result\r
+ );\r
+\r
+ return Status;\r
+}\r
+\r
+/**\r
+ Clean up the resource used by this BOT protocol.\r
+\r
+ @param Context The context of the BOT protocol, that is, USB_BOT_PROTOCOL.\r