![]() ![]() Even worse news is that (unless I am missing something) because your only endpoint seems to be the interrupt IN endpoint, it would seem that you can only receive interrupts from the device and are not able to send anything to the device. This call is synchronous, and may not be used in an interrupt context. ![]() In addition to a number of USB-standard descriptors, some devices also use class-specific or vendor-specific descriptors. Unfortunately, from what I can gather, it seems like there are no functions available to automatically construct interrupt urbs so you will need to create a urb struct as described in section 13.3.2.1 of. Device (USBDTDEVICE) and configuration descriptors (USBDTCONFIG) are part of the device structure. For example, instead of usb_sndctrlpipe you will need usb_rcvintpipe(struct usb_device *dev, unsigned int endpoint) to generate the pipe (since it is an IN endpoint as listed in your lsusb) and use a different function instead of usb_control_msg. This changes the functions that you need to call to communicate. When I try to compile CONFIGUSBETH as a module, kernel compilation succeeds, but the resulting. Looking at your lsusb, it seems that your endpoint is not actually a control endpoint, but an interrupt endpoint. However, I believe you have a bigger problem. I would recommend defining a constant at the beginning with the hex value of your endpoint and passing that to your calls. You seem to be passing the device pointer appropriately, however your pass in the value 0 for your control endpoint, which as you mention, is not the address of your endpoint. The definition of this function is as follows: unsigned int usb_sndctrlpipe(struct usb_device *dev, unsigned int I have a feeling it has to do with your usb_sndctrlpipe call. Here is a screengrab of one of the control URBs sent to the device The bDescriptorType member of the usb_endpoint_descriptor class contains '5' for the single endpoint exposed by the device ( bEndpointAddress is 129 - or 0x81 in hex) If you can shed some light on this at all, it would be greatly appreciated. I am completely new to Linux kernel programming so I'm likely doing something silly. */įor some reason, it returns -32 instead of sending the data to the device. However, the interesting part is the wn_set_color() function: /* Create the data buffer to be sent to the device. The Documentation/usb/error-codes.txt file describes the errors that this function can return: -EPIPE The pipe type specified in the URB doesn't match the endpoint's actual type. However, I keep getting errors when attempting to write to the device: $ echo "1" >/dev/wn0 2 Answers Sorted by: 4 usbcontrolmsg () eventually calls down to usbsubmiturb (). I have managed to get the driver to load and unload without problems and also create the device ( /dev/wn0, /dev/wn1, etc.). The module provides an extremely basic driver for a USB light (the device consists of three colored LEDs). I am currently in the process of writing a Linux kernel module in C. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |