I'm using ptxdist. I've enabled the gadget hid driver and it is working
great. Only problem is that the maximum packet size is 8 bytes. I would
like to increase the packet size to the maximum (which is 64 bytes for
hid).
I've defined a custom device and report descriptor (see below) and they are
working fine. I've also created two custom endpoints and I am able to
communicate over them.
I have two questions:
1.) To increase the packet size I still need to change the configuration
descriptor but I cant find the file/location where I can change this. Which
file contains the configuration descriptor for gadget hid?
2.) The labels used in the descriptors below (for example: .bLength), where
are they defined?
*** device descriptor (drivers/usb/gadget/hid.c):
static struct usb_device_descriptor device_desc = {
.bLength = sizeof device_desc,
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = cpu_to_le16(0x0200),
.bDeviceClass = 0x00,
.bDeviceSubClass = 0x00,
.bDeviceProtocol = 0x00,
.wMaxPacketSize = 0x40,
.idVendor = cpu_to_le16(HIDG_VENDOR_NUM),
.idProduct = cpu_to_le16(HIDG_PRODUCT_NUM),
.bcdDevice = cpu_to_le16(0x0200),
.iManufacturer = 1,
.iProduct = 2,
.iSerial = 3,
.bNumConfigurations = 0x01
};
*** report descriptor (arch/arm/mach-s3c2440/mach-mini2440.c):
static struct hidg_func_descriptor my_hid_data = {
.subclass = 0,
.protocol = 1,
.report_length = 8,
.report_desc_length = 37,
.report_desc = {
0x05, 0x8C,
0x09, 0x01,
0xa1, 0x01,
0x85, IN_DATA,
0x95, IN_DATA_SIZE,
0x75, 0x08,
0x26, 0xff, 0x00,
0x15, 0x00,
0x09, 0x01,
0x81, 0x02,
0x85, OUT_DATA,
0x95, OUT_DATA_SIZE,
0x75, 0x08,
0x26, 0xff, 0x00,
0x15, 0x00,
0x09, 0x01,
0x91, 0x02,
0xC0
}
};
ptxdist gadget hid change packet size
My descriptors are fine. The only thing I still needed to do was to set the report_length in the my_hid_data descriptor to 64. Now I'm able to transfer 64 bytes over HID!!


