+ char vendor[64];
+ char device[64];
+ struct iwinfo_hardware_id *ids;
+ struct iwinfo_hardware_entry *e;
+
+ if (wext_get_hardware_id(ifname, buf))
+ {
+ ids = (struct iwinfo_hardware_id *)buf;
+ madwifi_proc_file(ifname, "dev_vendor", vendor, sizeof(vendor));
+ madwifi_proc_file(ifname, "dev_name", device, sizeof(device));
+
+ if (vendor[0] && device[0])
+ {
+ for (e = IWINFO_HARDWARE_ENTRIES; e->vendor_name; e++)
+ {
+ if (!madwifi_startswith(vendor, e->vendor_name))
+ continue;
+
+ if (!madwifi_startswith(device, e->device_name))
+ continue;
+
+ ids->vendor_id = e->vendor_id;
+ ids->device_id = e->device_id;
+ ids->subsystem_vendor_id = e->subsystem_vendor_id;
+ ids->subsystem_device_id = e->subsystem_device_id;
+
+ return 0;
+ }
+ }
+
+ return -1;
+ }
+
+ return 0;