Age | Commit message (Collapse) | Author |
|
This matches MutexLocker, and doesn't sound like it's a lock itself.
|
|
|
|
This function is no longer required as the freeing is done
inside of the controller class through the pool interface.
|
|
The previous version of this was pretty bad and caused a lot of
odd behevaiour to occur. We now abstract a lot of the allocation
behind a `template`d pool class that handles all of the memory
allocation.
|
|
|
|
The number of UHCI related files is starting to expand to the point
where it's best if we move this into their own subdirectory. It'll
also make it easier to manage when we decide to add some more
controller types (whenever that may be)
|
|
|
|
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
|
|
There's no need for generated files in SysFS to tell you their precise
file size when you stat() them.
I noticed when profiling "find /" that we were spending a chunk of time
generating and throwing away SysFS content just so we could tell you
exactly how large it would be. :^)
|
|
This makes for nicer handling of errors compared to checking whether a
RefPtr is null. Additionally, this will give way to return different
types of errors in the future.
|
|
I was using a raw pointer instead of a RefPtr to keep the device alive
during removal.
|
|
|
|
This makes it controller agnostic and allows us to access it from the
USB hub code.
The copyright says "Liav A." because git blame says he wrote this.
|
|
A hub can technically have up to 255 ports, given that bNbrPorts is a
u8 and the DeviceRemovable field is a VLA to support up to 255 ports.
Source: USB 2.0 Specification Section 11.23.2.1
That means this enum is not going to scale well in terms of size.
Replacing it with a raw u8 allows me to remove the two port assumption
and a cast.
|
|
Nothing was using these. These can be put back in the future if
required. This also allows removing the devices array in UHCI.
|
|
|
|
There is a different hub descriptor for USB 3.0, but this isn't
included here.
|
|
Previously it would create a contiguous AVMO manually and pass it to
MM. This uses supervisor pages that quickly run out as they never get
returned and crash the system.
Instead, use allocate_kernel_region as we're only allocating a page so
it will be contiguous and will be returned when destroyed.
A potentially better solution would be to use a pool of transfers to
avoid all the allocations. This just prevents the system from crashing
within ~5 seconds from the continuous hub polling.
|
|
The order of poll_interval and device_address was flipped.
|
|
This wasn't caught before because nothing was including this header.
|
|
|
|
|
|
|
|
This is a bug that went unnoticed for a long time, so the exposed values
in SysFS PCI device directories were incorrect because the assigned PCI
address was simply the host bridge always.
Also, the bus typing should really be two hexadecimal digits and not 4
digits.
|
|
This patch removes KResult::operator int() and deals with the fallout.
This forces a lot of code to be more explicit in its handling of errors,
greatly improving readability.
|
|
The VirtIO code handles functionality related to the VirtIO bus, so it
really should be in the Bus folder.
|
|
|
|
This removes Pipes dependency on the UHCIController by introducing a
controller base class. This will be used to implement other controllers
such as OHCI.
Additionally, there can be multiple instances of a UHCI controller.
For example, multiple UHCI instances can be required for systems with
EHCI controllers. EHCI relies on using multiple of either UHCI or OHCI
controllers to drive USB 1.x devices.
This means UHCIController can no longer be a singleton. Multiple
instances of it can now be created and passed to the device and then to
the pipe.
To handle finding and creating these instances, USBManagement has been
introduced. It has the same pattern as the other management classes
such as NetworkManagement.
|
|
Port2 logic was errantly using `portsc1` registers, meaning that
the port wouldn't be reset properly. In effect, this puts devices
connected to Port2 in an undefined state.
|
|
|
|
Instead of `Memory::Region::Access::Read | Memory::Region::AccessWrite`
you can now say `Memory::Region::Access::ReadWrite`.
|
|
|
|
This directory isn't just about virtual memory, it's about all kinds
of memory management.
|
|
|
|
We don't need an entirely separate VMObject subclass to influence the
location of the physical pages.
Instead, we simply allocate enough physically contiguous memory first,
and then pass it to the AnonymousVMObject constructor that takes a span
of physical pages.
|
|
We have a dedicated format specifier which adds the "0x" prefix, so
let's use that instead of adding it manually.
|
|
Depending on the values it might be difficult to figure out whether a
value is decimal or hexadecimal. So let's make this more obvious. Also
this allows copying and pasting those numbers into GNOME calculator and
probably also other apps which auto-detect the base.
|
|
|
|
This patch moves all the USB data from /proc/bus/usb to /sys/bus/usb.
|
|
|
|
Folders are a GUI concept. File systems have directories.
|
|
|
|
Also use it instead of CPU.h's possibly_unaligned_data interface
|
|
Instead of each PhysicalPage knowing whether it comes from the
supervisor pages or from the user pages, we can just check in both
sets when freeing a page.
It's just a handful of pointer range checks, nothing expensive.
|
|
|
|
try_*() implies that it can fail (and they all return RefPtr with
nullptr signalling failure.)
|
|
Instead of returning char const*, we can also give you a StringView.
|
|
This matches the formatting used in SysFS.
|
|
Folders are a GUI concept, file systems have directories. :^)
|
|
Give them names that sound related to SysFS.
|