Re: Attaching MEGAWIN USB Bridge with USB generic driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi again!

I customized the libusb 0.1 sample program from Greg (LED device) to mirror the
behaviour explained above. Also I use usbmon to log the traffic.

First to say, the device can be found by product and vendor id using libusb. But
all following control messages return -1 (EPERM), which shall indicate that the
urb->reject was set.

Here is the routine which sends the urb to set a device-specific timeout:
(usb_handle is global)

// Sends data out
static bool SendData(char *Buffer, int nSize, int *ReadResultSize, int TimeOut){
	
	int retval = usb_control_msg(usb_handle,
                    0x00000040,				// request type
                    0x00000004,				// request
                    0x00005001,				// value
                    0x00000000,				// index
                    Buffer,					// bytes
                    nSize,					// size
                    TimeOut);				// timeout
	fprintf(stderr, "usb_control_msg returned with: %d\n", retval);
	return (retval>=0);	
}

It is called in the main:

char buffer[] = {0x91, 0x01, 0x00, 0x01, 0x93};
int byte_count = 0;
[...] // libusb inits and searching for device by VID and PID
SendData(buffer, 5, &byte_count, 5000);

Any hints why the usb_control_msg fails and why urb->reject is set, respectively?

Thanks!

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux