devices: add device id for Realtek RTL8188CU and RTL8188FTV
[project/iwinfo.git] / iwinfo_utils.c
index a342b6a19fa526d94aa90f9e24b604ce703878c1..d96cbb345e68fb9b9a4d6edcc3067b5a192afd23 100644 (file)
@@ -280,13 +280,19 @@ struct iwinfo_hardware_entry * iwinfo_hardware(struct iwinfo_hardware_id *id)
 
        while (fgets(buf, sizeof(buf) - 1, db) != NULL)
        {
+               if (buf[0] == '#')
+                       continue;
+
                memset(&e, 0, sizeof(e));
 
                if (sscanf(buf, "%hx %hx %hx %hx %hd %hd \"%63[^\"]\" \"%63[^\"]\"",
                               &e.vendor_id, &e.device_id,
                               &e.subsystem_vendor_id, &e.subsystem_device_id,
                               &e.txpower_offset, &e.frequency_offset,
-                              e.vendor_name, e.device_name) < 8)
+                              e.vendor_name, e.device_name) != 8 &&
+                       sscanf(buf, "\"%127[^\"]\" %hd %hd \"%63[^\"]\" \"%63[^\"]\"",
+                              e.compatible, &e.txpower_offset, &e.frequency_offset,
+                              e.vendor_name, e.device_name) != 5)
                        continue;
 
                if ((e.vendor_id != 0xffff) && (e.vendor_id != id->vendor_id))
@@ -303,6 +309,9 @@ struct iwinfo_hardware_entry * iwinfo_hardware(struct iwinfo_hardware_id *id)
                        (e.subsystem_device_id != id->subsystem_device_id))
                        continue;
 
+               if (strcmp(e.compatible, id->compatible))
+                       continue;
+
                rv = &e;
                break;
        }