mirror of
https://github.com/opnsense/src.git
synced 2026-03-03 13:51:30 -05:00
FreeBSD supports lazy allocation of PCI BAR, that is, when a device driver's attach method is invoked, even if the device's PCI BAR address wasn't initialized, the invocation of bus_alloc_resource_any() (the call chain: pci_alloc_resource() -> pci_alloc_multi_resource() -> pci_reserve_map() -> pci_write_bar()) would allocate a proper address for the PCI BAR and write this 'lazy allocated' address into the PCI BAR. This model works fine for native FreeBSD device drivers, but _not_ for device drivers shared with Linux (e.g. dev/mlx5/mlx5_core/mlx5_main.c and ofed/drivers/net/mlx4/main.c. Both of them use pci_request_regions(), which doesn't work properly with the PCI BAR lazy allocation, because pci_resource_type() -> _pci_get_rle() always returns NULL, so pci_request_regions() doesn't have the opportunity to invoke bus_alloc_resource_any(). We now use pci_find_bar() in pci_resource_type(), which is able to locate all available PCI BARs even if some of them will be lazy allocated. Submitted by: Dexuan Cui <decui microsoft com> Reviewed by: hps MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8071 |
||
|---|---|---|
| .. | ||
| bitops.h | ||
| cache.h | ||
| cdev.h | ||
| clocksource.h | ||
| compat.h | ||
| compiler.h | ||
| completion.h | ||
| delay.h | ||
| device.h | ||
| dma-attrs.h | ||
| dma-mapping.h | ||
| dmapool.h | ||
| err.h | ||
| errno.h | ||
| etherdevice.h | ||
| file.h | ||
| fs.h | ||
| gfp.h | ||
| hardirq.h | ||
| idr.h | ||
| if_arp.h | ||
| if_ether.h | ||
| if_vlan.h | ||
| in.h | ||
| in6.h | ||
| inetdevice.h | ||
| interrupt.h | ||
| io-mapping.h | ||
| io.h | ||
| ioctl.h | ||
| jhash.h | ||
| jiffies.h | ||
| kdev_t.h | ||
| kernel.h | ||
| kmod.h | ||
| kobject.h | ||
| kref.h | ||
| kthread.h | ||
| ktime.h | ||
| list.h | ||
| lockdep.h | ||
| log2.h | ||
| math64.h | ||
| miscdevice.h | ||
| mm.h | ||
| module.h | ||
| moduleparam.h | ||
| mutex.h | ||
| net.h | ||
| netdevice.h | ||
| notifier.h | ||
| page.h | ||
| pci.h | ||
| poll.h | ||
| printk.h | ||
| radix-tree.h | ||
| random.h | ||
| rbtree.h | ||
| rcupdate.h | ||
| rwlock.h | ||
| rwsem.h | ||
| scatterlist.h | ||
| sched.h | ||
| semaphore.h | ||
| slab.h | ||
| socket.h | ||
| spinlock.h | ||
| srcu.h | ||
| string.h | ||
| sysfs.h | ||
| time.h | ||
| timer.h | ||
| types.h | ||
| uaccess.h | ||
| usb.h | ||
| vmalloc.h | ||
| wait.h | ||
| workqueue.h | ||