diff options
| author | Warner Losh <imp@FreeBSD.org> | 2002-03-13 16:32:11 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2002-03-13 16:32:11 +0000 |
| commit | 20fe00734bc3e8fa343d6558fbcf463409e0e8d2 (patch) | |
| tree | ede133a6d47fa0954007582d38037be63f3d1eef /sys/dev/pci | |
| parent | a3ead5848fa809fb511c2e68087faa83c95d23e9 (diff) | |
Notes
Diffstat (limited to 'sys/dev/pci')
| -rw-r--r-- | sys/dev/pci/pci.c | 9 | ||||
| -rw-r--r-- | sys/dev/pci/pci_private.h | 3 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 7a758aeaa5e6..af6500beddf9 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -310,7 +310,7 @@ pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg) /* read configuration header into pcicfgregs structure */ struct pci_devinfo * -pci_read_device(device_t pcib, int b, int s, int f) +pci_read_device(device_t pcib, int b, int s, int f, size_t size) { #define REG(n, w) PCIB_READ_CONFIG(pcib, b, s, f, n, w) pcicfgregs *cfg = NULL; @@ -322,8 +322,7 @@ pci_read_device(device_t pcib, int b, int s, int f) devlist_entry = NULL; if (PCIB_READ_CONFIG(pcib, b, s, f, PCIR_DEVVENDOR, 4) != -1) { - devlist_entry = malloc(sizeof(struct pci_devinfo), - M_DEVBUF, M_WAITOK | M_ZERO); + devlist_entry = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); if (devlist_entry == NULL) return (NULL); @@ -779,8 +778,8 @@ pci_add_children(device_t dev, int busno) for (s = 0; s <= maxslots; s++) { int pcifunchigh = 0; for (f = 0; f <= pcifunchigh; f++) { - struct pci_devinfo *dinfo = - pci_read_device(pcib, busno, s, f); + struct pci_devinfo *dinfo = pci_read_device(pcib, + busno, s, f, sizeof(struct pci_devinfo)); if (dinfo != NULL) { if (dinfo->cfg.mfdev) pcifunchigh = PCI_FUNCMAX; diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h index 9c6e6f5c9cb9..cb43cef542b2 100644 --- a/sys/dev/pci/pci_private.h +++ b/sys/dev/pci/pci_private.h @@ -60,7 +60,8 @@ struct resource *pci_alloc_resource(device_t dev, device_t child, void pci_delete_resource(device_t dev, device_t child, int type, int rid); struct resource_list *pci_get_resource_list (device_t dev, device_t child); -struct pci_devinfo *pci_read_device(device_t pcib, int b, int s, int f); +struct pci_devinfo *pci_read_device(device_t pcib, int b, int s, int f, + size_t size); void pci_print_verbose(struct pci_devinfo *dinfo); int pci_freecfg(struct pci_devinfo *dinfo); |
