Autor Tópico: usb_buffer_alloc, kmalloc, usb_alloc_coherent error writing USB Device Driver  (Lida 3420 vezes)

Offline rodolfolabiapari

  • Usuário Ubuntu
  • *
  • Mensagens: 0
    • Ver perfil
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
Código: [Selecionar]
usb_submit_urb function.

Where should be the possible problem:
        1. Following the book Linux Device Driver V3 cite you must use the function
Código: [Selecionar]
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
Código: [Selecionar]
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.

Offline irtigor

  • Equipe Ubuntu
  • Usuário Ubuntu
  • *****
  • Mensagens: 4.344
  • Delete, delete, delete!
    • Ver perfil
Re:usb_buffer_alloc, kmalloc, usb_alloc_coherent error writing USB Device Driver
« Resposta #1 Online: 27 de Agosto de 2015, 08:29 »
Closed. Ubuntuforum-br is a discussion board for portuguese speakers.