]> cvs.zerfleddert.de Git - usb-driver/blobdiff - usb-driver.c
add one supported and one untested cable
[usb-driver] / usb-driver.c
index ddb25708fd507ad8f64d6aa79c779b3171a58247..26ce16b4d526d3eda709a5e63ae07350ccb4aac5 100644 (file)
@@ -56,13 +56,14 @@ static int modules_read = 0;
 
 #define NO_WINDRVR 1
 
-void hexdump(unsigned char *buf, int len) {
+void hexdump(unsigned char *buf, int len, char *prefix) {
        int i;
 
+       fprintf(stderr, "%s ", prefix);
        for(i=0; i<len; i++) {
                fprintf(stderr,"%02x ", buf[i]);
                if ((i % 16) == 15)
-                       fprintf(stderr,"\n");
+                       fprintf(stderr,"\n%s ", prefix);
        }
        fprintf(stderr,"\n");
 }
@@ -142,13 +143,13 @@ static int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
                                ut->dwUniqueID, ut->dwPipeNum, ut->fRead,
                                ut->dwOptions, ut->dwBufferSize, ut->dwTimeout);
                                if (ut->dwPipeNum == 0) {
-                                       DPRINTF("-> setup packet: ");
-                                       hexdump(ut->SetupPacket, 8);
+                                       DPRINTF("-> setup packet:");
+                                       hexdump(ut->SetupPacket, 8, "");
                                }
 
                                if (!ut->fRead && ut->dwBufferSize)
                                {
-                                       hexdump(ut->pBuffer, ut->dwBufferSize);
+                                       hexdump(ut->pBuffer, ut->dwBufferSize, "->");
                                }
 #endif
 
@@ -162,8 +163,7 @@ static int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
                                DPRINTF("Transferred: %lu (%s)\n",ut->dwBytesTransferred, (ut->fRead?"read":"write"));
                                if (ut->fRead && ut->dwBytesTransferred)
                                {
-                                       DPRINTF("<- Read: ");
-                                       hexdump(ut->pBuffer, ut->dwBytesTransferred);
+                                       hexdump(ut->pBuffer, ut->dwBytesTransferred, "<-");
                                }
 #endif
                        }
Impressum, Datenschutz