Age | Commit message (Collapse) | Author |
|
Remove the old probe method. The PCIOCGETBAR ioctl has been in FreeBSD
since 8.0 release, if not earlier. Remove the old way of doing it.
This is done using unifdef -DPCIOCGETBAR and cleaning up whitespace.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
Format freebsd_pci_methods a bit, adding some whitespace and assigning
NULL to methods not implemented. This makes it easier to see the names
of various methods, as well as which methods are not implemented.
Idea from src/linux_sysfs.c
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
Add a has_kernel_driver function to the FreeBSD libpciaccess functions.
This uses the PCIOCATTACHED ioctl to check if a driver is attached to a
specific PCI device.
Idea taken from the FreeBSD system utility pciconf.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
Remove unused variable, it's written to, but never used.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
Make the FreeBSD libpciaccess routines work on FreeBSD. The FreeBSD
sparc64 architecture needs special treatment, similar to the
PCI_MAGIC_IO_RANGE code. However, PCI_MAGIC_IO_RANGE has been gone for
some time. Give this a chance to work on sparc64 anyway.
This code has been in the FreeBSD ports tree for some time.
|
|
Update FreeBSD legacy I/O routines for new architectures. When we're
not on amd64 or i386, and PCI_MAGIC_IO_RANGE is not defined, use IOCTLs
to handle reads and writes through /dev/io.
This is accomplished by opening /dev/io and using IOCTLs from
dev/io/iodev.h, an interface that exists on most FreeBSD architectures.
This change has been in the FreeBSD ports tree for quite some time.
|
|
Fix the type used in write functions to match the size of the write.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
Autoconf has a check that pci_io.pi_sel.pc_domain exists. This is only
used on FreeBSD. pc_domain was added to pci_io.pi_sel on FreeBSD many
many releases ago, and exists on all current FreeBSD releases.
Remove the check, and the corresponding HAVE_PCI_IO_PC_DOMAIN, and
update the code to take into account that #ifdef HAVE_PCI_IO_PC_DOMAIN
is now always true.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
Try to make freebsd_pci.c conform to a more uniform style.
This change is whitespace only, no functional change intended.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
Some drivers, such as QXL, rely on this method and do not check for errors
when it is unavailable. FreeBSD's legacy method can enumerate any d/b/s/f
just fine, so it should be adequate for the !legacy API, as far as I can
tell.
With this change, QXL doesn't crash on startup on FreeBSD.
Signed-off-by: Conrad Meyer <cem@FreeBSD.org>
|
|
The former has a series of defines which in some cases are crusial to be
set before including any system headers.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
In some cases the header may not exist, leading to compilation issues.
Add the ifdef HAVE_CONFIG_H, as it is those in other parts of the
project.
[Emil Velikov: Split out from a larger commit, rework commit message]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
The offsets on the resourceX files are relative to BAR base - don't add
the base address ourselves.
Reviewed-by: Adam Jackson <ajax@redhat.com>
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=63583
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Well, almost all of them. zlib doesn't support "e" in the mode string
in gzopen() though it will silently accept and ignore it, and Solaris appears
not to support "e" in the mode string at all.
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
git diff -w & git diff -b show no diffs from this change
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
-Don't frob the BARs while they are enabled
-Find proper pci bios address / length
-Use the new PCIOCGETBAR ioctl if it exists
rather than frob the BARs ourself
-Write must also be a power of two
|
|
Support for FreeBSD based systems which support pci domains was broken
in the commit to support kFreeBSD. Include config.h so that things are
happy again.
|
|
We need to initialize the FreeBSD backend on GNU/kFreeBSD and detect
whether pci_io.pi_sel.pc_domain member exists.
X.Org bug#17882 <http://bugs.freedesktop.org/show_bug.cgi?id=17882>
|
|
|
|
|
|
This gets us the same resource numbering as on Linux.
|
|
|
|
|
|
|
|
|
|
|
|
Added new functions pci_device_map_range and pci_device_unmap_range to
handle mapping of PCI device BARs. These new interfaces allow the
possiblity of MTRRs on platforms that support them.
These additional APIs necessitated changing some internal interfaces. The
code for FreeBSD and Solaris has been updated but has not been compiled or
tested.
Old interfaces are marked deprecated and will eventually be removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This could stand a lot more testing -- all it has received is visual inspection
of scanpci output on one machine, with some differing results from XFree86
scanpci output.
|
|
With this, we can hook up the IRQ line information. It would probably be nice
to have an unpriveleged mode, but for now, write access is required.
|
|
With this, scanpci gives partially-sane results.
|
|
|