Lines Matching refs:h
189 static void CloseFunctionFs(usb_handle* h) { in CloseFunctionFs() argument
190 h->bulk_in.reset(); in CloseFunctionFs()
191 h->bulk_out.reset(); in CloseFunctionFs()
192 h->control.reset(); in CloseFunctionFs()
195 static bool InitFunctionFs(usb_handle* h) { in InitFunctionFs() argument
198 if (h->control < 0) { // might have already done this before in InitFunctionFs()
200 h->control.reset(open(kUsbFfsFastbootEp0, O_RDWR)); in InitFunctionFs()
201 if (h->control < 0) { in InitFunctionFs()
206 auto ret = write(h->control.get(), &v2_descriptor, sizeof(v2_descriptor)); in InitFunctionFs()
212 ret = write(h->control.get(), &strings, sizeof(strings)); in InitFunctionFs()
221 h->bulk_out.reset(open(kUsbFfsFastbootOut, O_RDONLY)); in InitFunctionFs()
222 if (h->bulk_out < 0) { in InitFunctionFs()
227 h->bulk_in.reset(open(kUsbFfsFastbootIn, O_WRONLY)); in InitFunctionFs()
228 if (h->bulk_in < 0) { in InitFunctionFs()
233 h->read_aiob.fd = h->bulk_out.get(); in InitFunctionFs()
234 h->write_aiob.fd = h->bulk_in.get(); in InitFunctionFs()
238 CloseFunctionFs(h); in InitFunctionFs()