X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/blobdiff_plain/2c2119ebab64d22a917a658c82946913c52ff7e4..53f639f29205155c5090ca1965cd8b095c2ab9d4:/usb-driver.c diff --git a/usb-driver.c b/usb-driver.c index cf17890..89269b6 100644 --- a/usb-driver.c +++ b/usb-driver.c @@ -88,7 +88,7 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) { { struct interrupt *it = (struct interrupt*)(wdheader->data); - fprintf(stderr," Handle: %lu, Options: %lx, ncmds: %lu\n", it->hInterrupt, it->dwOptions, it->dwCmds); + fprintf(stderr,"Handle: %lu, Options: %lx, ncmds: %lu, enableok: %lu, count: %lu, lost: %lu, stopped: %lu\n", it->hInterrupt, it->dwOptions, it->dwCmds, it->fEnableOk, it->dwCounter, it->dwLost, it->fStopped); it->fEnableOk = 1; //ret = (*ioctl_func) (fd, request, wdioctl); @@ -101,15 +101,11 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *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); + fprintf(stderr,"Handle: %lu, Options: %lx, ncmds: %lu, enableok: %lu, count: %lu, lost: %lu, stopped: %lu\n", it->hInterrupt, it->dwOptions, it->dwCmds, it->fEnableOk, it->dwCounter, it->dwLost, it->fStopped); //it->dwCounter = 0; //it->fStopped = 1; ret = (*ioctl_func) (fd, request, wdioctl); - fprintf(stderr,"\n\n"); - hexdump(wdheader->data, wdheader->size); - fprintf(stderr,"\n"); + fprintf(stderr,"Handle: %lu, Options: %lx, ncmds: %lu, enableok: %lu, count: %lu, lost: %lu, stopped: %lu\n", it->hInterrupt, it->dwOptions, it->dwCmds, it->fEnableOk, it->dwCounter, it->dwLost, it->fStopped); } break; @@ -139,6 +135,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 +165,14 @@ 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, enableok: %lu, count: %lu, lost: %lu, stopped: %lu\n", it->hInterrupt, it->dwOptions, it->dwCmds, it->fEnableOk, it->dwCounter, it->dwLost, it->fStopped); + + ret = (*ioctl_func) (fd, request, wdioctl); + fprintf(stderr,"Handle: %lu, Options: %lx, ncmds: %lu, enableok: %lu, count: %lu, lost: %lu, stopped: %lu\n", it->hInterrupt, it->dwOptions, it->dwCmds, it->fEnableOk, it->dwCounter, it->dwLost, it->fStopped); + } break; case CARD_UNREGISTER: @@ -164,11 +185,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); }