Commit Graph

225 Commits

Author SHA1 Message Date
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
bjorn3 15c9ad1ba6 pcid: Ensure MSI and MSI-X are not enabled at the same time 2024-06-10 19:44:12 +02:00
bjorn3 588bbfe6a3 pcid: Stop returning feature enable status from fetch_all_features
For the same reason the feature_status method was removed.
2024-06-10 19:44:12 +02:00
bjorn3 e14e56349f pcid: Remove method to get the current feature status
Devices should never change the feature status behind the back of the
driver, so storing the current status after setting it is fine. Drivers
should reset all state when they start to recover from a crashed driver,
so they shouldn't need to get the current feature status at startup
either.
2024-06-10 19:44:12 +02:00
bjorn3 123eef9635 pcid: Move capability offset into the Capability enum
This makes it easier to move to using pci_types for parsing PCI
capabilities.
2024-06-10 19:44:12 +02:00
bjorn3 027d952c39 pcid: Remove parsing of unused capabilities
This will make it easier to switch to pci_types for capability parsing
in the future.
2024-06-09 20:38:46 +02:00
bjorn3 8f9bbecd0c pcid: Rustfmt main.rs 2024-06-09 20:38:46 +02:00