Commit Graph

8 Commits

Author SHA1 Message Date
Liav A.
96e1391c23 Kernel/Devices: Remove the DeviceManagement singleton
This change has many improvements:
- We don't use `LockRefPtr` to hold instances of many base devices as
  with the DeviceManagement class. Instead, we have a saner pattern of
  holding them in a `NonnullRefPtr<T> const`, in a small-text footprint
  class definition in the `Device.cpp` file.
- The awkwardness of using `::the()` each time we need to get references
  to mostly-static objects (like the Event queue) in runtime is now gone
  in the migration to using the `Device` class.
- Acquiring a device feel more obvious because we use now the Device
  class for this method. The method name is improved as well.
2024-10-05 12:26:48 +02:00
Sönke Holz
54709af2f5 Kernel/USBMS: Perform a Reset Recovery when CSW transport fails twice
This requires storing a const reference to the interface, as the
Bulk-Only Mass Storage Reset request takes the interface number as an
argument.
2024-09-25 14:41:23 -04:00
Sönke Holz
2099647cc0 Kernel/USBMS: Make send_scsi_command a member function 2024-09-25 14:41:23 -04:00
Sönke Holz
7173a02728 Kernel/USBMS: Move device initialization to BulkSCSIInterface 2024-09-25 14:41:23 -04:00
Sönke Holz
c5f4469b32 Kernel/USBMS: Move StorageDevice functions into a separate class
This will allow us to make send_scsi_command a member function. This is
necessary because we need to execute some SCSI commands
(with send_scsi_command) to get all arguments necessary for the
StorageDevice constructor.

This change should will likely also be necessary to support USB mass
storage devices with multiple LUNs.
2024-09-25 14:41:23 -04:00
Hendiadyoin1
f5d2671718 Kernel/USBMS: Query and use the Block Limits VPD page
This allows us to properly limit our block requests to the device's
capabilities, and choose more optimal block counts for I/O operations.
In theory, as Qemu  only advertises a block limit above our current
internal block size limit of u16::max and does not advertise any optimal
transfer lengths.
2024-08-20 22:06:51 -04:00
Hendiadyoin1
e3567969d4 Kernel/USBMS: Add and use a send_scsi_command helper
This makes sending commands less repetitive
2024-08-20 22:06:51 -04:00
Hendiadyoin1
29292bbdbf Kernel/USB: Add a crude USB MassStorage driver :^) 2023-09-29 16:14:47 -06:00