I'm writing a USB Device Driver for simple communication with an FPGA (UART/USB) and I intend to end this available for use in the Linux community.
Introduction to the problem: I wrote my code and it compiles fine. However, when I send my data packet to the device, it does not respond. I using one UART/USB converter device for testing the driver because it has an LED that indicates when the driver sent a package to the UART device. And so, my driver sends the packet to the device (which does not receive this packet sent) where my driver returns success usb_submit_urb
function.
Where should be the possible problem:
1. Following the book Linux Device Driver V3 cite you must use the function buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, & URB->transfer_dma);
. However, I can not compile my code using it. I think the fact that I do not use this feature something is incomplete and thus being unable to successfully receive my device the packet sent.
2. I tried to use the buf = kmalloc (int_count, GFP_KERNEL);
and the code compile regular, however the converter does not show any sign that received the packet.
3. I also tried to use the usb_alloc_coherent function, however the whole system lock and caps lock blinking constantly.
NOTE 1: In addition to USB/UART converter cited above, I have also made use Arduinos to verify receipt of the package, but no success.
Note 2: Excuse my English. This text was translated all.