usb_control msg sends extra '0x00' bytes
Hello,
I am developing a Linux USB driver for a Video capture device. By initializing this device I have to set some settings. To do that I call the usb_control_msg function. This function seems to work correctly but when I look at the USB packets with the USB sniffer of wireshark the data that is send is not my data but only '0x00'. When I set the 'size' parameter of that function to 17, my first data byte is showing up in the sniffed packets. When I set it to 18, my first two bytes, and so on. I also tried to set the 'data' parameter to &mydata+16. &mydata+1 results in 16 '0x00' bytes followed by the second byte of my data buffer. Also tried to alloc my data buffer with the kmalloc(x, GFP_KERNEL) call in stead of just initialize on the stack, but that doesn't make any difference. No matter what I try, I cant get the 16 '0x00' bytes out of the URB packet. My code is: Code:
int rc, i; 40 03 0b 00 00 00 1d 00 // header 00 00 00 00 00 00 00 00 // where data should be 00 00 00 00 00 00 00 00 // where data should be 0b 4a c0 01 01 0c 40 ff // my data 06 00 00 00 00 // my data The first row are metadatabytes / header / requesttype The second row should be my data but there (and on the third row) are the 16 '0x00' bytes. On the fourth row my data buffer is shown... The question is: What are those 16 bytes and how can I get rid of them? Can anyone help me with this? |
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
Continue here: http://www.linuxquestions.org/questi...es-4175446585/ |
All times are GMT -5. The time now is 04:51 AM. |