Colleen Przybyla wrote:
Hello,

I have googled this problem and I haven't been able to find any headway.
Any help would be greatly appreciated.


I am modifying the GadgetFS usb.c example code to function as a
simulated USB mouse while running on a PXA255 board (2.4.19-adsx7).  I

You might have some gadgetfs issues on 2.4 kernels -- more so I think than the pxa2xx_udc driver itself. You didn't mention versions; are you using a 2004 version of the udc code? That's the "latest".


am monitoring all USB transactions from Windows Host PC to the PXA board
using USB Monitor.  I am able to properly initialize the device, config,
interface, hid, and endpoint descriptors.  The PXA board is able to
recognize when the host is requesting that it send the HID Report
Descriptor, yet it does not send any of the information.  (The setup
packet that is being sent in response to this request is the same as
that of a Logitech mouse, so I know it is receiving the request
correctly.)  The segment of code that deals with this is included below.

Are you able to return strings from your user level code? If you can do that, then the other Control-IN requests should work OK. (Control-OUT is untested though, and at least on 2.6 the locking on those paths needs updating.)


I'd appreciate any direction anyone could offer regarding this problem
so that I might continue with writing 'mouse movement' to the endpoint!


I have incorporated the following into the usb.c example code:


(the initial description)

static struct hid_descriptor
hid_desc = {
        .bLength = 9,
        .bDescriptorType = USB_DT_CS_DEVICE,
        .bcdHID = 0x0110,
        .bCountryCode = 0,
        .bNumDescriptors = 1,

... cut'n'paste error goes here ... ;)


        hid_desc.desc->bDescriptorType = 0x22;       
        hid_desc.desc->wDescriptorLength = 0x34;

This looks odd too, given the above.



};

const char ReportDescriptor1[] = {
        0x05, 0x01, //Usage Page (Generic Desktop)
        0x09, 0x02, //Usage (Mouse)
        0xA1, 0x01, //Collection (Application)
        0x09, 0x01, //Usage (Pointer)
        0xA1, 0x00, //Collection (Physical)
        0x05, 0x09, //Usage Page (Buttons)
        0x19, 0x01, //Usage Minimum (1)
        0x29, 0x03, //Usage Maximum (3)
        0x15, 0x00, //Logical Minimum (0)
        0x25, 0x01, //Logical Maximum (1)
        0x95, 0x03, //Report Count (3)
        0x75, 0x01, //Report Size (1)
        0x81, 0x02, //Input (Data, Variable, Absolute)
        0x95, 0x01, //Report Count (1)
        0x75, 0x05, //Report Size (5)
        0x81, 0x01, //Input (Constant)
        0x05, 0x01, //Usage Page (Generic Desktop)
        0x09, 0x30, //Usage (X)
        0x09, 0x31, //Usage (Y)
        0x15, 0x81, //Logical Minimum (-127)
        0x25, 0x7F, //Logical Maximum (127)
        0x75, 0x08, //Report Size (8)
        0x95, 0x02, //Report Count (2)
        0x81, 0x06, //Input (Data, Variable, Relative)
        0xC0,       //End Collection
        0xC0        // End Collection
};

const unsigned int ReportDescSize = sizeof(ReportDescriptor1);

(in the handle_control function):
        case USB_REQ_GET_REPORT:

Do you know that it in fact gets to this point?



                switch (setup->wValue >> 8) {
                case USB_DT_REPORT:
                        for(i=0; i<=ReportDescSize; i++)
                        {
                                buf[i] = ReportDescriptor1[i];
                        }
                        status = write(fd, buf, setup->wLength);

Should be passing min(setup->wLength, ReportDescSize) ...



if (status<0) {
if (errno == EIDRM)
fprintf (stderr, "GET_REPORT
timeout\n");
else
perror ("write GET_REPORT data");
}
else if (status != tmp) {
fprintf (stderr, "short GET_REPORT write,
%d\n", status);
}
break;
}
return;



Thank you, Colleen




------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to