On Fri, Feb 16, 2018 at 8:54 AM, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote: > On Fri, Feb 16, 2018 at 01:00:06AM +0200, Ran Shalit wrote: >> Hello, >> >> I am trying to understand article on reverse engineering usb driver, >> published in >> http://www.linuxjournal.com/node/7353/print (2004) > > That article was written a _long_ time ago :( > >> I have difficulties understanding the input to the function usb_control_msg() >> especially the 0x12, 0xc8 numbers. >> I could not find them in the article, then tried even in the delcom >> datasheet, but did not find it there too. >> These numbers refer to __u8 request, __u8 requesttype , value, and >> index, but I could not understand how they are figured it out in the >> article. >> >> usb_control_msg(led->udev, >> usb_sndctrlpipe(led->udev, 0), >> 0x12, <<------- ? >> 0xc8, <<------ ? >> (0x02 * 0x100) + 0x0a, <------ ? >> (0x00 * 0x100) + color, <------ ? >> buffer, >> 8, >> 2 * HZ); > > I thought I got them from the data sheet for the device, but that was > over a decade ago, so I really don't remember, sorry. > My question can be more of a general question. I am trying to understand how I should set these arguments (in general) with another device for example. I did not find any complete example/documentation which gives more details as to how to set these arguments: request - USB message request value requesttype - USB message request type value value - USB message value index - USB message index value Thanks for the comments, Ran > greg k-h -- 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