20 #ifndef USBHUBDEVICE_H 21 #define USBHUBDEVICE_H 23 #include "modules/system/usb/Usb.h" 24 #include "modules/system/usb/UsbConstants.h" 25 #include "modules/system/usb/UsbDevice.h" 26 #include "modules/system/usb/UsbHub.h" 27 #include "pedigree/kernel/compiler.h" 28 #include "pedigree/kernel/processor/types.h" 29 #include "pedigree/kernel/utilities/String.h" 41 str =
"USB Hub Device";
45 uintptr_t pTransaction,
bool bToggle, UsbPid pid, uintptr_t pBuffer,
49 uintptr_t pTransaction,
void (*pCallback)(uintptr_t, ssize_t) = 0,
50 uintptr_t pParam = 0);
52 UsbEndpoint endpointInfo, uintptr_t pBuffer, uint16_t nBytes,
53 void (*pCallback)(uintptr_t, ssize_t), uintptr_t pParam = 0);
55 virtual bool portReset(uint8_t nPort,
bool bErrorResponse =
false);
58 enum HubFeatureSelectors
64 enum PortFeatureSelectors
76 CPortOverCurrent = 19,
84 HubPortRequest = UsbRequestType::Class | UsbRequestRecipient::Other
87 bool setPortFeature(
size_t port, PortFeatureSelectors feature);
88 bool clearPortFeature(
size_t port, PortFeatureSelectors feature);
96 : pDescriptor(static_cast<Descriptor *>(pBuffer)),
97 nPorts(pDescriptor->nPorts),
98 hubCharacteristics(pDescriptor->hubCharacteristics)
107 uint16_t hubCharacteristics;
108 } PACKED *pDescriptor;
111 uint16_t hubCharacteristics;
virtual void addTransferToTransaction(uintptr_t pTransaction, bool bToggle, UsbPid pid, uintptr_t pBuffer, size_t nBytes)
Adds a new transfer to an existent transaction.
virtual void initialiseDriver()
Implemented by the driver class, initialises driver-specific stuff.
uint32_t getPortStatus(size_t port)
Top 32 bits hold change status.
virtual void addInterruptInHandler(UsbEndpoint endpointInfo, uintptr_t pBuffer, uint16_t nBytes, void(*pCallback)(uintptr_t, ssize_t), uintptr_t pParam=0)
Adds a new handler for an interrupt IN transaction.
virtual void getName(String &str)
virtual void doAsync(uintptr_t pTransaction, void(*pCallback)(uintptr_t, ssize_t)=0, uintptr_t pParam=0)
virtual bool portReset(uint8_t nPort, bool bErrorResponse=false)
Gets a UsbDevice from a given vendor:product pair.
virtual uintptr_t createTransaction(UsbEndpoint endpointInfo)
Creates a new transaction with the given endpoint data.