diff options
-rw-r--r-- | generate_pciclass.pl | 4 | ||||
-rwxr-xr-x | generate_usbclass.pl | 4 | ||||
-rw-r--r-- | libldetect.h | 6 | ||||
-rw-r--r-- | lspcidrake.c | 12 | ||||
-rw-r--r-- | pci.c | 12 | ||||
-rw-r--r-- | pciusb.c | 4 | ||||
-rw-r--r-- | usb.c | 12 |
7 files changed, 27 insertions, 27 deletions
diff --git a/generate_pciclass.pl b/generate_pciclass.pl index 2e31701..15731d6 100644 --- a/generate_pciclass.pl +++ b/generate_pciclass.pl @@ -15,10 +15,10 @@ print ' static int nb_classes = sizeof(classes) / sizeof(*classes); -extern const char *pci_class2text(unsigned long class_) { +extern const char *pci_class2text(unsigned long class_id) { int i; for (i = 0; i < nb_classes; i++) - if (classes[i].id == class_) return classes[i].name; + if (classes[i].id == class_id) return classes[i].name; return pci_class2text(0); } diff --git a/generate_usbclass.pl b/generate_usbclass.pl index 8adf6f9..4aadddc 100755 --- a/generate_usbclass.pl +++ b/generate_usbclass.pl @@ -68,9 +68,9 @@ struct class_text { const char *prot_text; }; -extern struct class_text usb_class2text(unsigned long class_) { +extern struct class_text usb_class2text(unsigned long class_id) { const char *p[3] = { NULL, NULL, NULL }; - int a_class[3] = { (class_ >> 16) & 0xff, (class_ >> 8) & 0xff, class_ & 0xff }; + int a_class[3] = { (class_id >> 16) & 0xff, (class_id >> 8) & 0xff, class_id & 0xff }; if (a_class[0] != 0xff) lookup(p, a_class, 0, nb_classes, classes); { struct class_text r = { p[0], p[1], p[2] }; diff --git a/libldetect.h b/libldetect.h index c70bf5a..c954da0 100644 --- a/libldetect.h +++ b/libldetect.h @@ -10,7 +10,7 @@ struct pciusb_entry { unsigned short subvendor; /* 0xffff if not probe_type'd or no subid */ unsigned short subdevice; /* 0xffff if not probe_type'd or no subid */ - unsigned long class_; /* 0 if not probe_type'd */ + unsigned long class_id; /* 0 if not probe_type'd */ unsigned short pci_bus; /* pci bus id 8 bits wide */ unsigned short pci_device; /* pci device id 5 bits wide */ @@ -32,7 +32,7 @@ extern void pciusb_free(struct pciusb_entries *entries); /* pci ************************************************************************/ /******************************************************************************/ extern struct pciusb_entries pci_probe(void); -extern const char *pci_class2text(unsigned long class_); +extern const char *pci_class2text(unsigned long class_id); extern char *proc_pci_path; /******************************************************************************/ @@ -46,7 +46,7 @@ struct usb_class_text { const char *usb_prot_text; }; -extern struct usb_class_text usb_class2text(unsigned long class_); +extern struct usb_class_text usb_class2text(unsigned long class_id); extern char *proc_usb_path; diff --git a/lspcidrake.c b/lspcidrake.c index 4b9b2cc..a24bcf3 100644 --- a/lspcidrake.c +++ b/lspcidrake.c @@ -13,8 +13,8 @@ static void printit(struct pciusb_entries entries, void print_class(unsigned lon if (e->text) printf(e->text); else printf("unknown (%04x/%04x/%04x/%04x)", e->vendor, e->device, e->subvendor, e->subdevice); - if (e->class_) { - print_class(e->class_); + if (e->class_id) { + print_class(e->class_id); } if (verboze && e->text) { printf(" (vendor:%04x device:%04x", e->vendor, e->device); @@ -27,14 +27,14 @@ static void printit(struct pciusb_entries entries, void print_class(unsigned lon pciusb_free(&entries); } -static void print_pci_class(unsigned long class_) { - const char *s = pci_class2text(class_); +static void print_pci_class(unsigned long class_id) { + const char *s = pci_class2text(class_id); if (strcmp(s, "NOT_DEFINED") != 0) printf(" [%s]", s); } -static void print_usb_class(unsigned long class_) { - struct usb_class_text s = usb_class2text(class_); +static void print_usb_class(unsigned long class_id) { + struct usb_class_text s = usb_class2text(class_id); if (s.usb_class_text) { printf(" ["); printf("%s", s.usb_class_text); @@ -81,7 +81,7 @@ extern struct pciusb_entries pci_probe(void) { continue; } read(devf, &buf, 0x30); /* these files're 256 bytes but we only need first 48 bytes*/ - e->class_ = dev->device_class; + e->class_id = dev->device_class; /* we divide by 2 because we address the array as a word array since we read a word */ e->subvendor = bufi[PCI_SUBSYSTEM_VENDOR_ID/2]; // == (u16)!(buf[PCI_SUBSYSTEM_VENDOR_ID] | (buf[PCI_SUBSYSTEM_VENDOR_ID+1] << 8)) e->subdevice = bufi[PCI_SUBSYSTEM_ID/2]; @@ -95,7 +95,7 @@ extern struct pciusb_entries pci_probe(void) { /* special rules below must be in sync with gi/mdk-stage1/probing.c */ - if (e->class_ == PCI_CLASS_SERIAL_USB) { + if (e->class_id == PCI_CLASS_SERIAL_USB) { /* taken from kudzu's pci.c */ char *module = class_prog == 0 ? "usb-uhci" : @@ -103,13 +103,13 @@ extern struct pciusb_entries pci_probe(void) { class_prog == 0x20 ? "ehci-hcd" : NULL; if (module) e->module = strdup(module); - } else if (e->class_ == PCI_CLASS_SERIAL_FIREWIRE) { + } else if (e->class_id == PCI_CLASS_SERIAL_FIREWIRE) { /* taken from kudzu's pci.c */ if (class_prog == 0x10) e->module = strdup("ohci1394"); - } else if (e->class_ == PCI_CLASS_BRIDGE_CARDBUS) { + } else if (e->class_id == PCI_CLASS_BRIDGE_CARDBUS) { e->module = strdup("yenta_socket"); - } else if (e->class_ == (PCI_CLASS_BRIDGE_HOST << 8)) { /* AGP */ + } else if (e->class_id == (PCI_CLASS_BRIDGE_HOST << 8)) { /* AGP */ if (e->vendor == 0x10b9) e->module = strdup("ali-agp"); else if (e->vendor == 0x1002) @@ -125,7 +125,7 @@ extern struct pciusb_entries pci_probe(void) { || e->subvendor == 0x1186 && e->subdevice == 0x1300 || e->subvendor == 0x13d1 && e->subdevice == 0xab06) e->module = strdup("8139too"); - } else if (e->vendor == 0x10de && e->class_ == PCI_CLASS_STORAGE_IDE) { + } else if (e->vendor == 0x10de && e->class_id == PCI_CLASS_STORAGE_IDE) { e->module = strdup("sata_nv"); } else if (e->vendor == 0x10b5 && (e->device == 0x9030 || e->device == 0x9050) && e->subvendor == 0x1369) { e->module = strdup("snd-vx222"); @@ -51,7 +51,7 @@ extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciu e->module = strndup(p,q-p-1); } /* special case for buggy 0x0 usb entry */ - if (descr_lookup == LOAD && 2 < strlen(q+2) && vendor != 0 && device != 0 && e->class_ != 0x90000d) { /* Hub class */ + if (descr_lookup == LOAD && 2 < strlen(q+2) && vendor != 0 && device != 0 && e->class_id != 0x90000d) { /* Hub class */ ifree(e->text); /* usb.c set it so that we display something when usbtable doesn't refer that hw*/ e->text = strndup(q+2, strlen(q)-4); } @@ -70,7 +70,7 @@ extern void pciusb_initialize(struct pciusb_entry *e) { e->device = 0xffff; e->subvendor = 0xffff; e->subdevice = 0xffff; - e->class_ = 0; + e->class_id = 0; e->pci_bus = 0xffff; e->pci_device = 0xffff; e->pci_function = 0xffff; @@ -56,18 +56,18 @@ extern struct pciusb_entries usb_probe(void) { } else fprintf(stderr, "%s %d: unknown ``P'' line\n", proc_usb_path, line); break; } - case 'I': if (e->class_ == 0) { + case 'I': if (e->class_id == 0) { char driver[50]; - int class_, sub, prot = 0; - if (sscanf(buf, "I:%*1c If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_, &sub, &prot, driver) == 4) { - e->class_ = (class_ * 0x100 + sub) * 0x100 + prot; + int class_id, sub, prot = 0; + if (sscanf(buf, "I:%*1c If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_id, &sub, &prot, driver) == 4) { + e->class_id = (class_id * 0x100 + sub) * 0x100 + prot; if (strncmp(driver, "(none)", 6)) e->module = strdup(driver); /* see linux/sound/usb/usbaudio.c::usb_audio_ids */ - if (e->class_ == (0x1*0x100+ 0x01)) /* USB_AUDIO_CLASS*0x100 + USB_SUBCLASS_AUDIO_CONTROL*/ + if (e->class_id == (0x1*0x100+ 0x01)) /* USB_AUDIO_CLASS*0x100 + USB_SUBCLASS_AUDIO_CONTROL*/ e->module = strdup("snd-usb-audio"); - } else if (sscanf(buf, "I:%*1c If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=", &class_, &sub, &prot) == 3) { + } else if (sscanf(buf, "I:%*1c If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=", &class_id, &sub, &prot) == 3) { /* prevent spurious warnings for strange USB interfaces */ } else fprintf(stderr, "%s %d: unknown ``I'' line\n", proc_usb_path, line); break; |