View | Details | Raw Unified | Return to bug 231264 | Differences between
and this patch

Collapse All | Expand All

(-)libusb10_io.c (-3 / +18 lines)
Lines 489-494 Link Here
489
	return (actlen);
489
	return (actlen);
490
}
490
}
491
491
492
static libusb_context *
493
libusb10_get_context_by_device_handle(libusb_device_handle *devh)
494
{
495
	libusb_context *ctx = NULL;
496
497
	if (devh != NULL)
498
		ctx = libusb_get_device(devh)->ctx;
499
	else
500
		ctx = NULL;
501
502
	return (GET_CONTEXT(ctx));
503
}
504
492
static void
505
static void
493
libusb10_do_transfer_cb(struct libusb_transfer *transfer)
506
libusb10_do_transfer_cb(struct libusb_transfer *transfer)
494
{
507
{
Lines 495-501 Link Here
495
	libusb_context *ctx;
508
	libusb_context *ctx;
496
	int *pdone;
509
	int *pdone;
497
510
498
	ctx = GET_CONTEXT(NULL);
511
	ctx = libusb10_get_context_by_device_handle(transfer->dev_handle);
499
512
500
	DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done");
513
	DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done");
501
514
Lines 585-591 Link Here
585
	libusb_context *ctx;
598
	libusb_context *ctx;
586
	int ret;
599
	int ret;
587
600
588
	ctx = GET_CONTEXT(NULL);
601
	ctx = libusb10_get_context_by_device_handle(devh);
602
589
	DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_bulk_transfer enter");
603
	DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_bulk_transfer enter");
590
604
591
	ret = libusb10_do_transfer(devh, endpoint, data, length, transferred,
605
	ret = libusb10_do_transfer(devh, endpoint, data, length, transferred,
Lines 603-609 Link Here
603
	libusb_context *ctx;
617
	libusb_context *ctx;
604
	int ret;
618
	int ret;
605
619
606
	ctx = GET_CONTEXT(NULL);
620
	ctx = libusb10_get_context_by_device_handle(devh);
621
607
	DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer enter");
622
	DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer enter");
608
623
609
	ret = libusb10_do_transfer(devh, endpoint, data, length, transferred,
624
	ret = libusb10_do_transfer(devh, endpoint, data, length, transferred,

Return to bug 231264