Skip to content

Commit

Permalink
Kernel: Remove the AllMiceDevice class
Browse files Browse the repository at this point in the history
This device was a short-lived solution to allow userspace (WindowServer)
to easily support hotplugging mouse devices with presumably very small
modifications on userspace side.

Now that we have a proper mechanism to propagate hotplug events from the
DeviceMapper program to any program that needs to get such events, we no
longer need this device, so let's remove it.
  • Loading branch information
supercomputer7 authored and nico committed Jul 6, 2024
1 parent 60e9f24 commit e897265
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 116 deletions.
4 changes: 0 additions & 4 deletions Kernel/API/MajorNumberAllocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ enum class CharacterDeviceFamily : unsigned {
Console = 5,
Mouse = 10,
FUSE = 11,
AllMice = 12,
GPURender = 28,
VirtualConsole = 35,
Keyboard = 85,
Expand All @@ -42,7 +41,6 @@ static constexpr CharacterDeviceFamily s_character_device_numbers[] = {
CharacterDeviceFamily::Console,
CharacterDeviceFamily::Mouse,
CharacterDeviceFamily::FUSE,
CharacterDeviceFamily::AllMice,
CharacterDeviceFamily::GPURender,
CharacterDeviceFamily::VirtualConsole,
CharacterDeviceFamily::Keyboard,
Expand Down Expand Up @@ -85,8 +83,6 @@ ALWAYS_INLINE StringView character_device_family_to_string_view(CharacterDeviceF
return "mouse"sv;
case CharacterDeviceFamily::FUSE:
return "fuse"sv;
case CharacterDeviceFamily::AllMice:
return "all-mice"sv;
case CharacterDeviceFamily::GPURender:
return "gpu-render"sv;
case CharacterDeviceFamily::VirtualConsole:
Expand Down
1 change: 0 additions & 1 deletion Kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ set(KERNEL_SOURCES
Devices/FUSEDevice.cpp
Devices/PCISerialDevice.cpp
Devices/SerialDevice.cpp
Devices/HID/AllMiceDevice.cpp
Devices/HID/KeyboardDevice.cpp
Devices/HID/Management.cpp
Devices/HID/MouseDevice.cpp
Expand Down
58 changes: 0 additions & 58 deletions Kernel/Devices/HID/AllMiceDevice.cpp

This file was deleted.

40 changes: 0 additions & 40 deletions Kernel/Devices/HID/AllMiceDevice.h

This file was deleted.

6 changes: 0 additions & 6 deletions Kernel/Devices/HID/Management.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ static constexpr Keyboard::CharacterMapData DEFAULT_CHARACTER_MAP =
};
// clang-format on

void HIDManagement::enqueue_mouse_packet(Badge<MouseDevice>, MousePacket packet)
{
m_all_mice_device->enqueue_mouse_packet(packet);
}

void HIDManagement::set_client(KeyboardClient* client)
{
SpinlockLocker locker(m_client_lock);
Expand All @@ -108,7 +103,6 @@ UNMAP_AFTER_INIT HIDManagement::KeymapData::KeymapData()
}

UNMAP_AFTER_INIT HIDManagement::HIDManagement()
: m_all_mice_device(AllMiceDevice::must_create())
{
}

Expand Down
6 changes: 0 additions & 6 deletions Kernel/Devices/HID/Management.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <AK/Types.h>
#include <Kernel/API/KeyCode.h>
#include <Kernel/Bus/SerialIO/Controller.h>
#include <Kernel/Devices/HID/AllMiceDevice.h>
#include <Kernel/Devices/HID/Device.h>
#include <Kernel/Locking/Spinlock.h>
#include <Kernel/Locking/SpinlockProtected.h>
Expand All @@ -33,7 +32,6 @@ class KeyboardClient;
class HIDManagement {
friend class KeyboardDevice;
friend class MouseDevice;
friend class AllMiceDevice;

public:
HIDManagement();
Expand All @@ -58,8 +56,6 @@ class HIDManagement {
void attach_standalone_hid_device(HIDDevice&);
void detach_standalone_hid_device(HIDDevice&);

void enqueue_mouse_packet(Badge<MouseDevice>, MousePacket);

private:
size_t generate_minor_device_number_for_mouse();
size_t generate_minor_device_number_for_keyboard();
Expand All @@ -69,8 +65,6 @@ class HIDManagement {
size_t m_keyboard_minor_number { 0 };
KeyboardClient* m_client { nullptr };

NonnullRefPtr<AllMiceDevice> m_all_mice_device;

SpinlockProtected<IntrusiveList<&SerialIOController::m_list_node>, LockRank::None> m_hid_serial_io_controllers;
// NOTE: This list is used for standalone devices, like USB HID devices
// (which are not attached via a SerialIO controller in the sense that
Expand Down
1 change: 0 additions & 1 deletion Kernel/Devices/HID/MouseDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ MouseDevice::MouseDevice()
void MouseDevice::handle_mouse_packet_input_event(MousePacket packet)
{
m_entropy_source.add_random_event(packet);
HIDManagement::the().enqueue_mouse_packet({}, packet);
{
SpinlockLocker lock(m_queue_lock);
m_queue.enqueue(packet);
Expand Down

0 comments on commit e897265

Please sign in to comment.