gadget hid change transfer packet size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm using ptxdist. I've enabled the gadget hid driver in the kernel
(2.6.38) and it is working
great. Only problem is that the current packet size is 8 bytes. I would
like to increase the packet size to 64bytes (which is maximum 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
}
};
--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux