From b0f621dd6a5f05639017d33b3f2c74d1a9665226 Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 22 Feb 2007 13:59:24 +0000 Subject: [PATCH] more dumps --- usb-driver.c | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/usb-driver.c b/usb-driver.c index cf17890..d613865 100644 --- a/usb-driver.c +++ b/usb-driver.c @@ -139,6 +139,24 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) { } break; + case EVENT_REGISTER: + fprintf(stderr,"EVENT_REGISTER\n"); + { + struct event *e = (struct event*)(wdheader->data); + int i; + + fprintf(stderr,"handle: %lu, action: %lu, status: %lu, eventid: %lu, cardtype: %lu, kplug: %lu, options: %lu, dev: %lx:%lx, unique: %lu, ver: %lu, nummatch: %lu\n", e->handle, e->dwAction, e->dwStatus, e->dwEventId, e->dwCardType, e->hKernelPlugIn, e->dwOptions, e->u.Usb.deviceId.dwVendorId, e->u.Usb.deviceId.dwProductId, e->u.Usb.dwUniqueID, e->dwEventVer, e->dwNumMatchTables); + for (i = 0; i < e->dwNumMatchTables; i++) + fprintf(stderr,"match: dev: %x:%x, class: %x, subclass: %x, intclass: %x, intsubclass: %x, intproto: %x\n", e->matchTables[i].VendorId, e->matchTables[i].ProductId, e->matchTables[i].bDeviceClass, e->matchTables[i].bDeviceSubClass, e->matchTables[i].bInterfaceClass, e->matchTables[i].bInterfaceSubClass, e->matchTables[i].bInterfaceProtocol); + + ret = (*ioctl_func) (fd, request, wdioctl); + + fprintf(stderr,"handle: %lu, action: %lu, status: %lu, eventid: %lu, cardtype: %lu, kplug: %lu, options: %lu, dev: %lx:%lx, unique: %lu, ver: %lu, nummatch: %lu\n", e->handle, e->dwAction, e->dwStatus, e->dwEventId, e->dwCardType, e->hKernelPlugIn, e->dwOptions, e->u.Usb.deviceId.dwVendorId, e->u.Usb.deviceId.dwProductId, e->u.Usb.dwUniqueID, e->dwEventVer, e->dwNumMatchTables); + for (i = 0; i < e->dwNumMatchTables; i++) + fprintf(stderr,"match: dev: %x:%x, class: %x, subclass: %x, intclass: %x, intsubclass: %x, intproto: %x\n", e->matchTables[i].VendorId, e->matchTables[i].ProductId, e->matchTables[i].bDeviceClass, e->matchTables[i].bDeviceSubClass, e->matchTables[i].bInterfaceClass, e->matchTables[i].bInterfaceSubClass, e->matchTables[i].bInterfaceProtocol); + } + break; + case TRANSFER: fprintf(stderr,"TRANSFER\n"); ret = (*ioctl_func) (fd, request, wdioctl); @@ -151,7 +169,19 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) { case INT_WAIT: fprintf(stderr,"INT_WAIT\n"); - ret = (*ioctl_func) (fd, request, wdioctl); + { + struct interrupt *it = (struct interrupt*)(wdheader->data); + + fprintf(stderr," Handle: %lu, Options: %lx, ncmds: %lu\n", it->hInterrupt, it->dwOptions, it->dwCmds); + + hexdump(wdheader->data, wdheader->size); + ret = (*ioctl_func) (fd, request, wdioctl); + //ret = 0; + //it->dwCounter++; + fprintf(stderr,"\n\n"); + hexdump(wdheader->data, wdheader->size); + fprintf(stderr,"\n"); + } break; case CARD_UNREGISTER: @@ -164,11 +194,6 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) { ret = (*ioctl_func) (fd, request, wdioctl); break; - case EVENT_REGISTER: - fprintf(stderr,"EVENT_REGISTER\n"); - ret = (*ioctl_func) (fd, request, wdioctl); - break; - default: ret = (*ioctl_func) (fd, request, wdioctl); } -- 2.39.5