+ char response[FASTBOOT_RESPONSE_LEN];
+
+ strsep(&cmd, ":");
+ if (!cmd) {
+ pr_err("missing partition name");
+ fastboot_tx_write_str("FAILmissing partition name");
+ return;
+ }
+
+ /* initialize the response buffer */
+ fb_response_str = response;
+
+ fastboot_fail("no flash device defined");
+#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV
+ fb_mmc_flash_write(cmd, (void *)CONFIG_FASTBOOT_BUF_ADDR,
+ download_bytes);
+#endif
+#ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV
+ fb_nand_flash_write(cmd,
+ (void *)CONFIG_FASTBOOT_BUF_ADDR,
+ download_bytes);
+#endif
+ fastboot_tx_write_str(response);
+}
+#endif
+
+static void cb_oem(struct usb_ep *ep, struct usb_request *req)
+{
+ char *cmd = req->buf;
+#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV
+ if (strncmp("format", cmd + 4, 6) == 0) {
+ char cmdbuf[32];
+ sprintf(cmdbuf, "gpt write mmc %x $partitions",
+ CONFIG_FASTBOOT_FLASH_MMC_DEV);
+ if (run_command(cmdbuf, 0))
+ fastboot_tx_write_str("FAIL");
+ else
+ fastboot_tx_write_str("OKAY");
+ } else
+#endif
+ if (strncmp("unlock", cmd + 4, 8) == 0) {
+ fastboot_tx_write_str("FAILnot implemented");
+ }
+ else {
+ fastboot_tx_write_str("FAILunknown oem command");
+ }
+}
+
+#ifdef CONFIG_FASTBOOT_FLASH
+static void cb_erase(struct usb_ep *ep, struct usb_request *req)
+{
+ char *cmd = req->buf;
+ char response[FASTBOOT_RESPONSE_LEN];