bjorn3
5b45f06cf3
Extract enable_function out of handle_parsed_header
...
This is the only part that actually modifies the PCI configuration. In
the future we will want to delay enabling a PCI device until it is
actually going to be used while still reading metadata about the PCI
device before that point.
2025-02-27 20:02:29 +01:00
bjorn3
581d9eea33
Replace a whole bunch more repr(packed) with repr(C, packed)
2025-02-22 16:19:25 +01:00
Jeremy Soller
471b9ebf4f
Merge branch 'no_scan_single_function_device' into 'master'
...
Don't scan through all 8 functions of a single function PCI device
Closes #32
See merge request redox-os/drivers!232
2025-02-22 14:25:54 +00:00
bjorn3
6828b744fd
Make Mcfg repr(C, packed) rather than repr(packed)
...
repr(packed) officially still allows reordering the fields.
2025-02-22 14:05:33 +01:00
bjorn3
1cae6512fa
Don't scan through all 8 functions of a single function PCI device
2025-02-22 13:57:15 +01:00
bjorn3
898f8dc72b
pcid: Remove usage of paw
2024-12-30 11:41:34 +01:00
bjorn3
e6139319e8
pcid: Remove a couple of unused dependencies
2024-12-30 11:40:02 +01:00
bjorn3
2c042f8c98
Fix a ton of unused import warnings
2024-12-26 16:05:04 +01:00
Andrey Turkin
e5e753a426
Sync up with changes to kernel's phandle irq scheme
2024-12-18 21:16:30 +03:00
Andrey Turkin
8152de14a9
Remap PCI IRQs as instructed in FDT
2024-10-22 20:33:35 +03:00
Andrey Turkin
18b688a49c
Partial risc-v support
2024-10-17 20:07:17 +03:00
Kamil Koczurek
e49fae6533
chore: fmt.sh
2024-09-30 13:22:34 +02:00
Kamil Koczurek
d2c82add9d
Move Io/Pio/Mmio from redox_syscall to common
...
* Fix Mmio repr from transparent to packed.
* Rename Mmio::from to Mmio::new.
* Remove dead imports around affected code.
* Minor formatting.
2024-09-30 13:01:36 +02:00
Timothy Finnegan
806e8b42b7
Added an assertion to map_bar that causes the calling driver to panic rather than crash the kernel
2024-09-20 18:42:03 -07:00
Timothy Finnegan
306bb7d698
Added an assertion to map_bar that causes the calling driver to panic rather than crash the kernel
2024-09-20 18:39:25 -07:00
bjorn3
7935ed0248
Deduplicate setup_logging between all drivers
...
This will make it easier to change the way logging is done for all
drivers. This also fixes the log category for a couple of drivers as
well as makes failing to set the logger a fatal error. Only when a
logger is already set is it impossible to set another logger.
2024-07-24 22:00:40 +02:00
bjorn3
10f6c16141
Remove an incorrect assertion preventing access to PCI extended capabilities
2024-07-21 21:26:05 +02:00
bjorn3
15d2078a13
Handle daemonization of pcid in a better way
...
Currently pcid exits the main thread once it is done spawning drivers
and expects all background threads handling driver communication to stay
around. This only works as exitting the main thread on redox os
currently doesn't cause the whole process to die. This will have to be
fixed at some point for compatibility with programs that expect that
exitting the main thread kills all other threads in the process, at
which point pcid would break without the changes in this commit.
2024-07-20 15:11:34 +02:00
bjorn3
fd8dabd1bc
Use the new scheme format in most places
...
The graphics subsystem still uses the old format as orbital manually
parses the fpath result.
2024-07-11 21:14:45 +02:00
Jeremy Soller
e7781dcced
Fix compilation on aarch64
2024-06-24 11:43:17 -06:00
bjorn3
4ffed8096d
Move all drivers to /usr/lib/drivers
...
This makes them harder to accidentally run them from the shell, which
would not work. In the future this may also allow embedding the driver
config in the driver executable itself without having to look at all
non-driver executables too.
2024-06-16 17:02:14 +02:00
bjorn3
07aaf6ea94
pcid: Don't include source files in two different crates
...
This confuses rust-analyzer.
2024-06-16 15:29:09 +02:00
bjorn3
6d15fbba75
pcid: Move msi from pci to driver_interface
2024-06-16 15:23:32 +02:00
bjorn3
ba6224bc27
pcid: Move VendorSpecificCapability form pci to driver_interface
2024-06-16 15:21:51 +02:00
bjorn3
5c9bbb5c96
pcid: Move PciBar from pci to driver_interface
2024-06-16 15:20:52 +02:00
bjorn3
52d1c0fb4f
pcid: Move FullDeviceId from pci to driver_interface
2024-06-16 15:19:14 +02:00
bjorn3
16819bc693
pcid: Get rid of PciHeader
...
It is a reminant of when pci_types wasn't used yet and doesn't simplify
things a lot anymore.
2024-06-16 13:42:45 +02:00
bjorn3
a34266b029
pcid: Remove all PciEndpointHeader methods
2024-06-16 13:33:55 +02:00
bjorn3
6c2fdae08c
pcid: Remove all tests of PciHeader
2024-06-16 13:32:11 +02:00
bjorn3
de4d79e69e
pcid: Inline PciEndpointHeader::bars
2024-06-16 13:23:27 +02:00
bjorn3
160acff5a8
pcid: Move the code in PciHeader::display to other places
2024-06-16 13:20:16 +02:00
bjorn3
1179d01e76
pcid: Add pretty string for the NVME device type
2024-06-16 13:12:52 +02:00
bjorn3
ae2240ef0f
pcid: Remove some PciHeader methods
2024-06-16 13:12:29 +02:00
bjorn3
56000cbd9c
pcid: Remove subsystem id from PciEndpointHeader
2024-06-16 13:03:58 +02:00
bjorn3
b6a75d0a16
virtio: Support the modern transport on x86
2024-06-15 21:59:10 +02:00
bjorn3
2144eaa62c
Rustfmt pcid
2024-06-15 21:38:43 +02:00
bjorn3
23ac696491
pcid: Add PciFunctionHandle::map_bar method
...
This will enable the pcid driver interface to safely map the MSI-X table
in the future without having to worry about a BAR being mapped twice.
2024-06-15 15:47:48 +02:00
bjorn3
a3b957c2e5
pcid: Fetch config in PciFunctionHandle::connect_default()
2024-06-15 15:16:09 +02:00
bjorn3
fdb9ea816b
pcid: Rename PcidServerHandle to PciFunctionHandle
2024-06-15 15:05:59 +02:00
bjorn3
3299a070f2
pcid: Also return bar size from physmap_mem and use it in two more drivers
2024-06-15 14:01:06 +02:00
bjorn3
4bd978da7a
pcid: Use pci_types for parsing capabilties
2024-06-15 13:45:57 +02:00
bjorn3
2ab2fe7b5e
Update to pci_types 0.10.0
2024-06-15 13:41:51 +02:00
bjorn3
386a63df42
pcid: Replace get_capabilities with get_vendor_capabilities
...
While this stops returning raw MSI/MSI-X capabilities from
get_capabilities, the same info can be obtained using
fetch_all_features and feature_info.
2024-06-14 11:12:06 +02:00
bjorn3
d2084e58cb
pcid: Remove PciFunc
2024-06-13 15:06:49 +02:00
bjorn3
d3dc2e0f80
pcid: Remove all PciFunc methods
2024-06-13 14:52:02 +02:00
bjorn3
f6a709ee5a
pcid: Simplify PciFunc::read_range
...
This also avoids UB caused by creating a slice of uninitialized u8.
2024-06-11 21:05:25 +02:00
bjorn3
8e02a87474
pcid: Reduce visibility of MsiCapability and MsixCapability methods
2024-06-11 16:57:58 +02:00
bjorn3
4f583b1cfb
Store decoded MSI info instead of full capability in PciFeatureInfo
2024-06-11 16:48:43 +02:00
bjorn3
df66633111
pcid: Store decoded MsixInfo instead of full capability in PciFeatureInfo
2024-06-10 21:00:07 +02:00
bjorn3
7c112c34dd
pcid: Remove some unused methods on MsixCapability
2024-06-10 19:44:12 +02:00