Jeremy Soller
6ff633863e
Allow usbhidd to run on multiple interfaces
2024-11-04 16:15:53 -07:00
Andrey Turkin
09b5033fbd
Wholesale cargo fmt to get CI back to green
2024-10-17 20:07:05 +03: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
39f43a51a1
Added some documentation to the XHCI daemon, clarified the scheme interface with a refactor
2024-09-10 00:43:42 +00:00
Jeremy Soller
897866d948
xhcid: switch back to polling and leave TODO
2024-09-06 20:09:04 -06:00
Jeremy Soller
b29d2c7c9e
xhcid: switch back to interrupts
2024-09-04 15:00:35 -06: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
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
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
0d926fb3f7
xhcid: Sleep for 2ms on every poll loop
...
This significantly reduces cpu usage. On my laptop before this change a
single core would be fully loaded while running at 3-4GHz. With this
change it would only be loaded for about 50% while running at 1-2GHz.
This improves battery lifetime while also preventing the fan from
spinning up to a distracting level.
This shouldn't noticably affect latency given that most keyboards and
mice don't support polling at 500Hz anyway.
2024-06-16 12:04:05 +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
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
Jeremy Soller
fd973a1d7d
xhcid: allow configuring multiple interfaces
2024-04-17 09:24:28 -06:00
Jeremy Soller
9ec71c6ba4
xhcid/usbhidd: build out USB HUB driver
2024-04-17 08:51:02 -06:00
Jeremy Soller
68d838650a
Init usbhubd
2024-04-16 21:44:37 -06:00
Jeremy Soller
f3dc1e0c7e
xhcid: add hub descriptor and do not return error if driver not found
2024-04-16 21:26:47 -06:00
Jeremy Soller
c0a4448c0b
xhcid/usbhidd: remove extra set idle code, just use device request
2024-04-16 21:26:14 -06:00
Jeremy Soller
42f612bfda
xhcid/usbhidd: WIP spawning drivers on all interfaces
2024-04-16 13:07:17 -06:00
Jeremy Soller
13ebe960dd
xhcid: always use polling
2024-04-16 11:13:50 -06:00
Jeremy Soller
9069c64b87
xhcid: fixes for setting config and interface when CIC is false
2024-04-16 11:09:57 -06:00
Jeremy Soller
18eab7c0dc
xhcid: always set CIE to match CIC
2024-04-16 11:09:38 -06:00
Jeremy Soller
667a8e42f9
xhcid: fix set_interface request type
2024-04-16 11:09:26 -06:00
Jeremy Soller
a2c024c03e
Add HID protocol and idle configuration to USB stack
2024-04-16 10:20:25 -06:00
Jeremy Soller
ec4f2f594c
xhcid: document arguments to trb.normal
2024-04-16 09:47:34 -06:00
Jeremy Soller
29b1c1aa0d
xhcid: fix isoch and interrupt endpoint types being swapped
2024-04-16 09:13:44 -06:00
Jeremy Soller
c85baf220e
xhcid: add number to trb completion codes
2024-04-16 08:56:16 -06:00
Jeremy Soller
61e2ee224a
xhcid: improve endpoint parsing
2024-04-16 08:10:32 -06:00
Jeremy Soller
806be9bdc6
xhcid: associate stalls on setup stage with transfers
2024-04-15 15:02:05 -06:00
Jeremy Soller
64fcd0a323
xhcid: ensure max packet size is set correctly before reading descriptors
2024-04-15 12:54:05 -06:00
Jeremy Soller
12bc7273bf
xhcid: add more debugging
2024-04-12 11:25:15 -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
Jeremy Soller
2c672a0568
More fixes for 32-bit x86
2024-02-16 20:58:54 -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
354c351b19
Unify device info printing between drivers
2024-01-23 13:01:40 +01:00
bjorn3
77b97bb2ed
Introduce PciBar::physmap_mem helper
2024-01-23 12:02:40 +01:00
bjorn3
ad23ad5d93
Introduce irq_handle helper for legacy interrupts
2024-01-22 19:35:18 +01:00
bjorn3
bd6716efe4
Make legacy_interrupt_line an Option
...
Drivers don't need to know the exact legacy_interrupt_pin in use.
Just if legacy interrupts are enabled and if so which
legacy_interrupt_line is used.
2024-01-22 19:35:06 +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
dc13752d74
Force usage of pcid_interface
2024-01-20 19:42:06 +01:00