[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop:[5287]
From:       owes () users ! sourceforge ! net
Date:       2010-12-29 13:51:00
Message-ID: E1PXwQe-0006x5-5P () sfp-svn-6 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 5287
          http://ipcop.svn.sourceforge.net/ipcop/?rev=5287&view=rev
Author:   owes
Date:     2010-12-29 13:50:59 +0000 (Wed, 29 Dec 2010)

Log Message:
-----------
Coding style changes

Modified Paths:
--------------
    ipcop/trunk/src/installer/hardware.c

Modified: ipcop/trunk/src/installer/hardware.c
===================================================================
--- ipcop/trunk/src/installer/hardware.c	2010-12-29 13:49:48 UTC (rev 5286)
+++ ipcop/trunk/src/installer/hardware.c	2010-12-29 13:50:59 UTC (rev 5287)
@@ -608,67 +608,67 @@
             continue;
         }
 
-            type = none;
-            strcpy(vendor, "");
-            strcpy(line, "");
-            get_vendor_string(vendor, sizeof(vendor), descriptor.idVendor);
-            get_product_string(line, sizeof(line), descriptor.idVendor, \
                descriptor.idProduct);
-            snprintf(description, STRING_SIZE, "%s %s", vendor, line);
+        type = none;
+        strcpy(vendor, "");
+        strcpy(line, "");
+        get_vendor_string(vendor, sizeof(vendor), descriptor.idVendor);
+        get_product_string(line, sizeof(line), descriptor.idVendor, \
descriptor.idProduct); +        snprintf(description, STRING_SIZE, "%s %s", vendor, \
line);  
-            /* TODO: find a better way to differentiate network devices from other \
                USB devices */
-            switch (descriptor.bDeviceClass) {
-            case LIBUSB_CLASS_PER_INTERFACE:
-                type = network;
-                break;
+        /* TODO: find a better way to differentiate network devices from other USB \
devices */ +        switch (descriptor.bDeviceClass) {
+        case LIBUSB_CLASS_PER_INTERFACE:
+            type = network;
+            break;
 
-            case LIBUSB_CLASS_COMM:
-                type = network;
-                break;
+        case LIBUSB_CLASS_COMM:
+            type = network;
+            break;
 
-            case LIBUSB_CLASS_VENDOR_SPEC:
-                type = network;
-                break;
+        case LIBUSB_CLASS_VENDOR_SPEC:
+            type = network;
+            break;
+        }
+
+        if (type == none) {
+            snprintf(logline, STRING_SIZE, "  Skip %02x %04x:%04x, %s\n",
+                    descriptor.bDeviceClass, descriptor.idVendor, \
descriptor.idProduct, description); +            fprintf(flog, logline);
+            fprintf(fhwdetect, logline);
+        }
+        else {
+            char *module = NULL;
+            FILE *p;
+
+            snprintf(command, STRING_SIZE,
+                     "/bin/grep \"0x%04x   0x%04x\" /lib/modules/%s/modules.usbmap",
+                     descriptor.idVendor, descriptor.idProduct, utsbuf.release);
+
+            p = popen(command, "r");
+            if (fgets(modulemap, STRING_SIZE, p)) {
+                if ((module = strchr(modulemap, ' ')) != NULL) {
+                    *module = 0;
+                    module = modulemap;
+                }
             }
+            pclose(p);
 
-            if (type == none) {
-                snprintf(logline, STRING_SIZE, "  Skip %02x %04x:%04x, %s\n",
+            if (module != NULL) {
+                snprintf(logline, STRING_SIZE, "  Add  %02x %04x:%04x, %s\n",
                         descriptor.bDeviceClass, descriptor.idVendor, \
descriptor.idProduct, description);  fprintf(flog, logline);
                 fprintf(fhwdetect, logline);
+
+                hardwareadd(network, module, NULL, NULL, description, \
descriptor.idVendor, descriptor.idProduct);  }
             else {
-                char *module = NULL;
-                FILE *p;
-
-                snprintf(command, STRING_SIZE,
-                         "/bin/grep \"0x%04x   0x%04x\" \
                /lib/modules/%s/modules.usbmap",
-                         descriptor.idVendor, descriptor.idProduct, utsbuf.release);
-
-                p = popen(command, "r");
-                if (fgets(modulemap, STRING_SIZE, p)) {
-                    if ((module = strchr(modulemap, ' ')) != NULL) {
-                        *module = 0;
-                        module = modulemap;
-                    }
-                }
-                pclose(p);
-
-                if (module != NULL) {
-                    snprintf(logline, STRING_SIZE, "  Add  %02x %04x:%04x, %s\n",
-                            descriptor.bDeviceClass, descriptor.idVendor, \
                descriptor.idProduct, description);
-                    fprintf(flog, logline);
-                    fprintf(fhwdetect, logline);
-
-                    hardwareadd(network, module, NULL, NULL, description, \
                descriptor.idVendor, descriptor.idProduct);
-                }
-                else {
-                    /* There is little to add if there is no module */
-                    snprintf(logline, STRING_SIZE, "  Skip (no module) %02x \
                %04x:%04x\n",
-                            descriptor.bDeviceClass, descriptor.idVendor, \
                descriptor.idProduct);
-                    fprintf(flog, logline);
-                    fprintf(fhwdetect, logline);
-                }
+                /* There is little to add if there is no module */
+                snprintf(logline, STRING_SIZE, "  Skip (no module) %02x \
%04x:%04x\n", +                        descriptor.bDeviceClass, descriptor.idVendor, \
descriptor.idProduct); +                fprintf(flog, logline);
+                fprintf(fhwdetect, logline);
             }
+        }
     }
 
     numBusses++;


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic