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
dc33cba4c0
Fix typo
2024-06-11 21:05:09 +02:00
bjorn3
df66633111
pcid: Store decoded MsixInfo instead of full capability in PciFeatureInfo
2024-06-10 21:00:07 +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
4lDO2
4c35e88997
Use latest event queue interface everywhere.
2024-03-31 14:30:04 +02:00
Jeremy Soller
ff7015a55a
virtio-core: fix compilation on i686
2024-03-19 16:19:47 -06:00
Jacob Lorentzon
ff956fd3bb
Switch to libredox where applicable (fixed)
2024-03-18 22:09:25 +00:00
Jeremy Soller
98078650f8
Revert "Switch to libredox where applicable."
...
This reverts commit 2e7dbf1cc1 .
2024-03-18 15:00:52 -06:00
4lDO2
2e7dbf1cc1
Switch to libredox where applicable.
2024-03-18 19:23:05 +01:00
bjorn3
9bb1222933
Fix UB lint in virtio-core
...
error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused
--> virtio-core/src/probe.rs:126:21
|
86 | let capability = unsafe { &*(capability.data.as_ptr() as *const PciCapability) };
| --------------------------------------------------- backing allocation comes from here
...
126 | (&*(capability as *const PciCapability as *const PciCapabilityNotify))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: casting from `transport_pci::PciCapability` (13 bytes) to `transport_pci::PciCapabilityNotify` (17 bytes)
= note: `#[deny(invalid_reference_casting)]` on by default
2024-03-06 21:06:26 +01:00
Jeremy Soller
2c672a0568
More fixes for 32-bit x86
2024-02-16 20:58:54 -07:00
Jeremy Soller
2a4e292e1d
virtio-core: mark CommonCfg as packed
2024-02-16 20:52:55 -07:00
Enver Balalic
7439262994
ihdad, rtl8139d, rtl8168d, virtio-core, xhcid: Fix aarch64 build
2024-02-10 19:03:36 +01:00
bjorn3
67d3015e2e
Add helper for allocating a single MSI/MSI-X interrupt vector
...
It doesn't actually configure the device to emit it though, but does
make this easier to do.
2024-01-25 14:43:44 +01:00
bjorn3
9b809312c2
Ignore MSI-X PBA in all drivers
...
It isn't used in any driver and even on Linux no driver seems to use it
at all. The only times it seems to be useful are if you were to mask an
interrupt and want to check if the interrupt fired without unmasking or
if you want to make the device itself trigger an interrupt.
2024-01-24 14:28:40 +01:00
bjorn3
f43aa8574c
Simplify MSI-X table pointer computation
2024-01-24 14:28:40 +01:00
bjorn3
7dbf22331b
Share msix config validation code
2024-01-24 14:28:40 +01:00
bjorn3
77b97bb2ed
Introduce PciBar::physmap_mem helper
2024-01-23 12:02:40 +01:00
bjorn3
a5d0c7c354
Use pci_types for reading BARs
...
This simplifies a lot of code and adds support for 64bit BARs.
2024-01-22 15:54:18 +01:00
bjorn3
5192816de7
Introduce expect_port and expect_mem helpers
2024-01-21 21:12:24 +01:00
bjorn3
d0e90f5ded
Remove fetch_header from pcid_interface
...
Most things are already stored in SubdriverArguments and the couple of
things that aren't may change over time and thus should be read again
each time they are accessed, while fetch_header would receive a fixed
copy from pcid.
2024-01-21 19:35:39 +01:00
bjorn3
1890293e86
Introduce a FullDeviceId type and pass it in pcid_interface
2024-01-21 15:18:56 +01:00
bjorn3
fbcf01b413
Add a couple of FIXME
2024-01-18 19:03:10 +01:00
bjorn3
b06f0534aa
Remove interrupt status register probing
...
It isn't used when MSI-X is used and we always use MSI-X interrupts.
2024-01-18 18:45:32 +01:00
bjorn3
fcc55507ea
Move the notify_multiplier field into a separate PciCapabilityNotify type
...
It only exists for VIRTIO_PCI_CAP_NOTIFY_CFG and could conflict with
fields of other capability types.
2024-01-18 18:07:05 +01:00
bjorn3
380a416258
Reorganize virtio headers and add a couple of new fields
...
Also add a decent amount of comments from the virtio spec.
2024-01-18 17:17:39 +01:00
bjorn3
bd8b218174
Don't return Result from spawn_irq_thread
...
It never returns an error.
2024-01-18 15:29:06 +01:00
4lDO2
ea73da92bf
Replace all physalloc usages with Dma.
2023-12-12 12:03:03 +01:00
4lDO2
0d99333c3f
Remove PhysBox.
2023-12-12 12:03:03 +01:00
Jeremy Soller
82fe14960f
Fix build on x86
2023-11-08 09:54:27 -07:00
Enver Balalic
ad9295715f
virtio-core: move things around so aarch64 builds
2023-10-19 15:01:01 +00:00
Jeremy Soller
9d7e19cc0d
Merge branch 'core' into 'master'
...
virtio-core: add support for legacy transport
See merge request redox-os/drivers!112
2023-08-23 12:26:44 +00:00
Anhad Singh
6a5e9d2613
virtio-core: add support for legacy transport
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-08-23 15:03:46 +10:00
Jeremy Soller
ac9e4abcd0
virtio-core: Fix compilation on non-x86_64
2023-08-21 09:21:35 -06:00
Anhad Singh
820b8370ae
virtio-gpu: remove the +1 workaround
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-25 16:34:25 +10:00
Anhad Singh
a153c8bc1c
inputd: correctly pass on resize events
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-20 19:20:56 +10:00
Anhad Singh
e457f03935
virtio-gpu: handling GPU resets
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-20 17:34:59 +10:00
4lDO2
e4374ac60d
Switch to common::dma::Dma in virtio-*.
2023-07-18 13:47:15 +02:00
4lDO2
c63c266400
Remove physmap in virtio.
2023-07-18 11:01:16 +02:00
Anhad Singh
5c4e7b36fa
make getty work
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-07 16:51:46 +10:00
Anhad Singh
2f2720263f
drivers: add inputd
...
Take out the input coalescing from `vesad` into `inputd`.
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-05 11:12:53 +10:00
Anhad Singh
7cc2f4eff7
virtio-gpu: start working on the scheme
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-03 17:12:59 +10:00
Anhad Singh
4bbda21f0b
drivers: start building virtio-gpu
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-06-29 16:37:59 +10:00
Anhad Singh
a720cf6f44
virtio-core::probe: make sure the addr is aligned
...
sys_physmap() requires the address to be page aligned. This fixes the
panic inside the `virtio-gpu` driver.
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-06-29 16:36:02 +10:00
Anhad Singh
c898e2e01f
virtio-core: make send async
...
This allows for us to do cool stuff such as
`join!(queue.send(read_command), queue.send(write_command),
queue.send(read_command_2))`
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-06-29 14:21:34 +10:00
Anhad Singh
92fd7fc553
virtio-core::ChainBuilder: automagically add the NEXT flag
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-06-28 15:06:23 +10:00
Anhad Singh
97e77e21b6
virtio-net: scheme :^)
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-06-28 12:58:51 +10:00
Anhad Singh
6968a548d9
virtiod: rename to virtio-blkd
...
* Rename to `virtio-blkd`
* Start working on `virtio-netd`
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-06-27 10:26:04 +10:00
Anhad Singh
eee780fa0f
virtiod: split into virtio-core and virtiod
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-06-27 09:51:16 +10:00