[Voyageurs] Send ConfigureEndpointCommand to device.

This commit is contained in:
Drew Galbraith 2024-02-24 09:23:58 -08:00
parent af69415d4d
commit 2cc9c89051
6 changed files with 77 additions and 3 deletions

View file

@ -11,19 +11,25 @@
#include "xhci/trb_ring.h"
#include "xhci/xhci.h"
class XhciDriver;
class DeviceSlot {
public:
DeviceSlot() = default;
DeviceSlot(const DeviceSlot&) = delete;
DeviceSlot(DeviceSlot&&) = delete;
void EnableAndInitializeDataStructures(uint8_t slot_index_,
void EnableAndInitializeDataStructures(XhciDriver* driver,
uint8_t slot_index_,
uint64_t* output_context,
volatile uint32_t* doorbell);
XhciTrb CreateAddressDeviceCommand(uint8_t root_port, uint32_t route_string,
uint16_t max_packet_size);
mmth::Semaphore IssueConfigureDeviceCommand(uint8_t config_value);
void SignalConfigureDeviceCompleted();
// Caller must keep the command in scope until it completes.
template <typename T>
void ExecuteReadControlCommand(ReadControlCommand<T>& command);
@ -35,6 +41,7 @@ class DeviceSlot {
private:
bool enabled_ = false;
XhciDriver* xhci_driver_;
uint8_t slot_index_ = 0;
volatile uint32_t* doorbell_ = nullptr;
@ -49,6 +56,10 @@ class DeviceSlot {
glcr::UniquePtr<TrbRingWriter> control_endpoint_transfer_trb_;
glcr::HashMap<uint64_t, glcr::SharedPtr<mmth::Semaphore>>
control_completion_sempahores_;
mmth::Semaphore configure_device_semaphore_;
glcr::UniquePtr<TrbRingWriter> other_endpoint_transfer_trb_;
};
template <typename T>