Lines Matching refs:Status

218                                 ? Status::FUNCTIONS_APPLIED  in getCurrentUsbFunctions()
219 : Status::FUNCTIONS_NOT_APPLIED); in getCurrentUsbFunctions()
227 V1_0::Status UsbGadget::tearDownGadget() { in tearDownGadget()
233 if (!WriteStringToFile("0", DEVICE_CLASS_PATH)) return Status::ERROR; in tearDownGadget()
235 if (!WriteStringToFile("0", DEVICE_SUB_CLASS_PATH)) return Status::ERROR; in tearDownGadget()
237 if (!WriteStringToFile("0", DEVICE_PROTOCOL_PATH)) return Status::ERROR; in tearDownGadget()
239 if (!WriteStringToFile("0", DESC_USE_PATH)) return Status::ERROR; in tearDownGadget()
241 if (unlinkFunctions(CONFIG_PATH)) return Status::ERROR; in tearDownGadget()
258 return Status::SUCCESS; in tearDownGadget()
274 static V1_0::Status setVidPid(const char *vid, const char *pid) { in setVidPid()
275 if (!WriteStringToFile(vid, VENDOR_ID_PATH)) return Status::ERROR; in setVidPid()
277 if (!WriteStringToFile(pid, PRODUCT_ID_PATH)) return Status::ERROR; in setVidPid()
279 return Status::SUCCESS; in setVidPid()
305 static V1_0::Status validateAndSetVidPid(uint64_t functions) { in validateAndSetVidPid()
306 V1_0::Status ret = Status::SUCCESS; in validateAndSetVidPid()
416 ret = Status::CONFIGURATION_NOT_SUPPORTED; in validateAndSetVidPid()
421 V1_0::Status UsbGadget::setupFunctions( in setupFunctions()
429 return Status::ERROR; in setupFunctions()
439 if (!WriteStringToFile("1", DESC_USE_PATH)) return Status::ERROR; in setupFunctions()
442 return Status::ERROR; in setupFunctions()
444 if (linkFunction("ffs.mtp", i++)) return Status::ERROR; in setupFunctions()
453 if (!WriteStringToFile("1", DESC_USE_PATH)) return Status::ERROR; in setupFunctions()
456 return Status::ERROR; in setupFunctions()
459 if (linkFunction("ffs.ptp", i++)) return Status::ERROR; in setupFunctions()
469 if (linkFunction("midi.gs5", i++)) return Status::ERROR; in setupFunctions()
474 if (linkFunction("accessory.gs2", i++)) return Status::ERROR; in setupFunctions()
479 if (linkFunction("audio_source.gs3", i++)) return Status::ERROR; in setupFunctions()
484 if (linkFunction("gsi.rndis", i++)) return Status::ERROR; in setupFunctions()
493 return Status::ERROR; in setupFunctions()
495 return Status::ERROR; in setupFunctions()
497 return Status::ERROR; in setupFunctions()
506 return Status::ERROR; in setupFunctions()
508 if (linkFunction("ffs.adb", i++)) return Status::ERROR; in setupFunctions()
516 if (!WriteStringToFile(GADGET_NAME, PULLUP_PATH)) return Status::ERROR; in setupFunctions()
519 callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS); in setupFunctions()
520 return Status::SUCCESS; in setupFunctions()
526 return Status::ERROR; in setupFunctions()
532 return Status::ERROR; in setupFunctions()
535 if (addEpollFd(epollFd, inotifyFd) == -1) return Status::ERROR; in setupFunctions()
537 if (addEpollFd(epollFd, eventFd) == -1) return Status::ERROR; in setupFunctions()
560 functions, gadgetPullup ? Status::SUCCESS : Status::ERROR); in setupFunctions()
565 return Status::SUCCESS; in setupFunctions()
577 V1_0::Status status = tearDownGadget(); in setCurrentUsbFunctions()
578 if (status != Status::SUCCESS) { in setCurrentUsbFunctions()
588 callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS); in setCurrentUsbFunctions()
597 if (status != Status::SUCCESS) { in setCurrentUsbFunctions()
602 if (status != Status::SUCCESS) { in setCurrentUsbFunctions()