diff options
-rw-r--r-- | ChangeLog | 43 | ||||
-rw-r--r-- | ldetect.spec | 6 | ||||
-rw-r--r-- | libldetect-private.h | 2 | ||||
-rw-r--r-- | libldetect.h | 2 | ||||
-rw-r--r-- | lspcidrake.c | 11 | ||||
-rw-r--r-- | pci.c | 10 | ||||
-rw-r--r-- | pciusb.c | 7 | ||||
-rw-r--r-- | usb.c | 2 |
8 files changed, 57 insertions, 26 deletions
@@ -1,3 +1,46 @@ +2003-07-31 15:36 Pixel <pixel@mandrakesoft.com> + + * ldetect.spec, pci.c: - detect ohci1394 & ehci-hcd based on the + pci class (as done in RedHat's kudzu) + +2003-04-22 11:45 Pixel <pixel@mandrakesoft.com> + + * ldetect.spec: - Use read() instead of fread() to read from + "/proc/bus/pci/%02x/%02x.%d". Thanks a lot to Tom Cox for + finding this bug: + + The proc.c module in the kernel source clearly states + that + reading more than 64 bytes can cause problems. The pci.c + module in the ldetect library uses the buffered fread() + function. This function always reads in blocks, so when + run as root, the read always tried to read more than the + user requested amount. + + This should fix freezes when doing a full probe + +2003-04-22 11:04 Pixel <pixel@mandrakesoft.com> + + * pci.c: Use read() instead of fread() to read from + "/proc/bus/pci/%02x/%02x.%d". Thanks a lot to Tom Cox for finding + this bug: + + The proc.c module in the kernel source clearly states + that + reading more than 64 bytes can cause problems. The pci.c + module in the ldetect library uses the buffered fread() + function. This function always reads in blocks, so when + run as root, the read always tried to read more than the + user requested amount. + +2003-01-28 16:44 Thierry Vignaud <tvignaud@mandrakesoft.com> + + * Makefile: only check for latest logs + +2003-01-28 15:39 Thierry Vignaud <tvignaud@mandrakesoft.com> + + * Makefile: - sanitize ChangeLog - add log rule + 2003-01-06 15:34 Thierry Vignaud <tvignaud@mandrakesoft.com> * ldetect.spec: add pixel changes diff --git a/ldetect.spec b/ldetect.spec index 5003955..c5ac080 100644 --- a/ldetect.spec +++ b/ldetect.spec @@ -1,12 +1,13 @@ Name: ldetect Version: 0.4.9 -Release: 2mdk +Release: 3mdk Summary: Light hardware detection library Source: %name.tar.bz2 Group: System/Libraries URL: http://www.mandrakelinux.com BuildRoot: %_tmppath/%{name}-buildroot BuildRequires: usbutils => 0.11-2mdk, pciutils-devel +Conflicts: drakxtools < 9.2-0.32mdk Requires: ldetect-lst common-licenses License: GPL @@ -49,6 +50,9 @@ rm -rf $RPM_BUILD_ROOT %_libdir/* %changelog +* Tue Aug 19 2003 Thierry Vignaud <tvignaud@mandrakesoft.com> 0.4.9-3mdk +- do full-probe by default + * Thu Jul 31 2003 Pixel <pixel@mandrakesoft.com> 0.4.9-2mdk - detect ohci1394 & ehci-hcd based on the pci class (as done in RedHat's kudzu) diff --git a/libldetect-private.h b/libldetect-private.h index 68959d9..faa607f 100644 --- a/libldetect-private.h +++ b/libldetect-private.h @@ -1,4 +1,4 @@ -extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable, int no_subid); +extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable); extern void pciusb_initialize(struct pciusb_entry *e); #define MAX_DEVICES 100 diff --git a/libldetect.h b/libldetect.h index 5f31c69..f407f35 100644 --- a/libldetect.h +++ b/libldetect.h @@ -28,7 +28,7 @@ extern void pciusb_free(struct pciusb_entries *entries); /******************************************************************************/ /* pci ************************************************************************/ /******************************************************************************/ -extern struct pciusb_entries pci_probe(int probe_type); /* probe_type is boolean */ +extern struct pciusb_entries pci_probe(void); extern const char *pci_class2text(unsigned long class_); /******************************************************************************/ diff --git a/lspcidrake.c b/lspcidrake.c index 28bf2f6..e2620c2 100644 --- a/lspcidrake.c +++ b/lspcidrake.c @@ -32,11 +32,10 @@ static void printit(struct pciusb_entries entries, const char *(find_class)(unsi int main(int argc, char **argv) { char ** ptr = argv; - int full_probe = 0; while (ptr && *ptr) { if (!strcmp(*ptr, "-h") || !strcmp(*ptr, "--help")) { - printf("usage: lspcidrake [-v|-f|-u]\n" + printf("usage: lspcidrake [-v|-u]\n" "-f : full probe [aka look for pci subids & class]\n" "-p <file>: pci devices source [/proc/bus/pci/devices by default]\n" "-u <file>: usb devices source [/proc/bus/usb/devices by default]\n" @@ -44,12 +43,8 @@ int main(int argc, char **argv) { ); return 0; } - if (!strcmp(*ptr, "-v")) { + if (!strcmp(*ptr, "-v")) verboze = 1; - full_probe = 1; - } - if (!strcmp(*ptr, "-f")) - full_probe = 1; if (!strcmp(*ptr, "-u")) { proc_usb_path = *++ptr; continue; @@ -59,7 +54,7 @@ int main(int argc, char **argv) { ptr++; } - printit(pci_probe(full_probe), pci_class2text); + printit(pci_probe(), pci_class2text); printit(usb_probe(), usb_class2text); return 0; } @@ -14,7 +14,7 @@ char *proc_pci_path_default = "/proc/bus/pci/devices"; char *proc_pci_path = NULL; -extern struct pciusb_entries pci_probe(int probe_type) { +extern struct pciusb_entries pci_probe(void) { FILE *f; int devf; char buf[BUF_SIZE]; unsigned short *bufi = (unsigned short *) &buf; @@ -49,8 +49,6 @@ extern struct pciusb_entries pci_probe(int probe_type) { e->pci_bus = devbusfn >> 8; e->pci_device = (devbusfn & 0xff) >> 3; e->pci_function = (devbusfn & 0xff) & 0x07; - if (probe_type != 1) - continue; snprintf(file, sizeof(file), "/proc/bus/pci/%02x/%02x.%d", e->pci_bus, e->pci_device, e->pci_function); if ((devf = open(file, O_RDONLY)) == -1) continue; @@ -83,13 +81,9 @@ extern struct pciusb_entries pci_probe(int probe_type) { fclose(f); realloc(r.entries, sizeof(struct pciusb_entry) * r.nb); - if (pciusb_find_modules(&r, "pcitable", probe_type)) + if (pciusb_find_modules(&r, "pcitable")) return r; - /* ok, let's try again with subids */ - if (probe_type == 0) - return pci_probe(1); - /* should not happen */ exit(1); } @@ -71,7 +71,7 @@ static void fh_close(fh *f) { waitpid(f->pid, NULL, 0); } -extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable, int no_subid) { +extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable) { fh f; char buf[2048]; int line; @@ -107,11 +107,6 @@ extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciu continue; // skip since already found with sub ids if (vendor != e->vendor || device != e->device) continue; // main ids differ - if (nb == 4 && e->subvendor == 0xffff && e->subdevice == 0xffff && !no_subid) { - pciusb_free(entries); - fh_close(&f); - return 0; /* leave, let the caller call again with subids */ - } if (nb == 4 && !(subvendor == e->subvendor && subdevice == e->subdevice)) continue; // subids differ @@ -88,7 +88,7 @@ extern struct pciusb_entries usb_probe(void) { fclose(f); realloc(r.entries, sizeof(struct pciusb_entry) * r.nb); - pciusb_find_modules(&r, "usbtable", 1 /* no_subid */); + pciusb_find_modules(&r, "usbtable"); return r; } |