ladybird/Kernel/Devices/HID
Liav A bfffe88de5 Kernel/HID: Untie the PS2 protocol, i8042 hardware and generic devices
For a very long time, the kernel had only support for basic PS/2 devices
such as the PS2 AT keyboard and regular PS2 mouse (with a scroll wheel).

To adapt to this, we had very simple abstractions in place, essentially,
the PS2 devices were registered as IRQ handlers (IRQ 1 and 12), and when
an interrupt was triggered, we simply had to tell the I8042Controller to
fetch a byte for us, then send it back to the appropriate device for
further processing and queueing of either a key event, or a mouse packet
so userspace can do something meaningful about it.

When we added the VMWare mouse integration feature it was easily adapted
to this paradigm, requiring small changes across the handling code for
these devices.

This patch is a major cleanup for any future advancements in the HID
subsystem.
It ensures we do things in a much more sane manner:
- We stop using LockRefPtrs. Currently, after the initialization of the
  i8042 controller, we never have to change RefPtrs in that class, as we
  simply don't support PS2 hotplugging currently.
  Also, we remove the unnecessary getters for keyboard and mouse devices
  which also returned a LockRefPtr.
- There's a clear separation between PS2 devices and the actual device
  nodes that normally exist in /dev. PS2 devices are not polled, because
  when the user uses these devices, they will trigger an IRQ which when
  is handled, could produce either a MousePacket or KeyEvent, depending
  on the device state.
  The separation is crucial for buses that are polled, for example - USB
  is a polled bus and will not generate an IRQ for HID devices.
- There's a clear separation in roles of each structure. The PS2 devices
  which are attached to a I8042Controller object are managing the device
  state, while the generic MouseDevice and KeyboardDevice manage all
  related tasks of a CharacterDevice, as well as interpreting scan code
  events and mouse relative/absolute coordinates.
2023-04-09 18:11:37 +02:00
..
Controller.h Kernel: Introduce a new super class called HIDController 2023-04-09 18:11:37 +02:00
Device.h Kernel/HID: Untie the PS2 protocol, i8042 hardware and generic devices 2023-04-09 18:11:37 +02:00
KeyboardDevice.cpp Kernel/HID: Untie the PS2 protocol, i8042 hardware and generic devices 2023-04-09 18:11:37 +02:00
KeyboardDevice.h Kernel/HID: Untie the PS2 protocol, i8042 hardware and generic devices 2023-04-09 18:11:37 +02:00
Management.cpp Kernel: Introduce a new super class called HIDController 2023-04-09 18:11:37 +02:00
Management.h Kernel: Introduce a new super class called HIDController 2023-04-09 18:11:37 +02:00
MouseDevice.cpp Kernel/HID: Untie the PS2 protocol, i8042 hardware and generic devices 2023-04-09 18:11:37 +02:00
MouseDevice.h Kernel/HID: Untie the PS2 protocol, i8042 hardware and generic devices 2023-04-09 18:11:37 +02:00
ScanCodeEvent.h Kernel/HID: Untie the PS2 protocol, i8042 hardware and generic devices 2023-04-09 18:11:37 +02:00