diff options
author | Luke <luke.wilde@live.co.uk> | 2021-08-10 02:23:57 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-14 21:22:44 +0200 |
commit | 035aef9c093d99232c23c3610b6f862c9816ee13 (patch) | |
tree | b5a7ab97d8a22fc5bfe6d0b87e0a0bcdddf06167 /Kernel/Bus | |
parent | 3b4f71e4df90d5c56aff0b135c8b672cc6da39b2 (diff) | |
download | serenity-035aef9c093d99232c23c3610b6f862c9816ee13.zip |
Kernel/USB: Add endpoint directions and make endpoint constants public
Diffstat (limited to 'Kernel/Bus')
-rw-r--r-- | Kernel/Bus/USB/USBEndpoint.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/Bus/USB/USBEndpoint.h b/Kernel/Bus/USB/USBEndpoint.h index c29aecb2ae..3ef61419ed 100644 --- a/Kernel/Bus/USB/USBEndpoint.h +++ b/Kernel/Bus/USB/USBEndpoint.h @@ -27,8 +27,11 @@ namespace Kernel::USB { // while the keyboard part would only generate data once we push a key (hence an interrupt transfer). // Each of these data sources would be a _different_ endpoint on the device that we read from. class USBEndpoint { +public: static constexpr u8 ENDPOINT_ADDRESS_NUMBER_MASK = 0x0f; static constexpr u8 ENDPOINT_ADDRESS_DIRECTION_MASK = 0x80; + static constexpr u8 ENDPOINT_ADDRESS_DIRECTION_OUT = 0x00; + static constexpr u8 ENDPOINT_ADDRESS_DIRECTION_IN = 0x80; static constexpr u8 ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_MASK = 0x03; static constexpr u8 ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_CONTROL = 0x00; @@ -39,7 +42,6 @@ class USBEndpoint { static constexpr u8 ENDPOINT_ATTRIBUTES_ISO_MODE_SYNC_TYPE = 0x0c; static constexpr u8 ENDPOINT_ATTRIBUTES_ISO_MODE_USAGE_TYPE = 0x30; -public: const USBEndpointDescriptor& descriptor() const { return m_descriptor; } bool is_control() const { return (m_descriptor.endpoint_attributes_bitmap & ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_MASK) == ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_CONTROL; } |