rewrite comments into one, unified style
This commit is contained in:
1 parent
6260de0085
commit
467a58c9c6
163 files changed
+3560
-2556
No files matched your search
@@ -1,4 +1,5 @@
|
||||
// usb_core.c - USB descriptor/configuration parsing, interface publishing, and root-port enumeration.
|
||||
// USB core helpers. This file owns common descriptor, string, and request utilities.
|
||||
|
||||
#include "usb.h"
|
||||
|
||||
KSTATUS XhciSetConfiguration(XHCI_CONTROLLER* xhci, XHCI_DEVICE* dev,
|
||||
@@ -25,6 +26,7 @@ KSTATUS XhciSetConfiguration(XHCI_CONTROLLER* xhci, XHCI_DEVICE* dev,
|
||||
}
|
||||
|
||||
|
||||
// Returns tracked Interface By Number.
|
||||
static USB_TRACKED_INTERFACE* UsbFindTrackedInterfaceByNumber(XHCI_DEVICE* dev, uint8_t interfaceNumber) {
|
||||
if (!dev) return (USB_TRACKED_INTERFACE*)0;
|
||||
for (uint8_t i = 0; i < dev->InterfaceCount && i < USB_MAX_TRACKED_INTERFACES; i++) {
|
||||
@@ -108,15 +110,15 @@ void XhciLogConfigurationTree(XHCI_CONTROLLER* xhci, XHCI_DEVICE* dev,
|
||||
dev->SlotId, iface->bInterfaceNumber);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Alternate settings are not independent USB interfaces. Real
|
||||
* UVC cameras often expose one VideoStreaming interface with
|
||||
* many alternate settings, and publishing each alternate setting
|
||||
* as a separate PDO causes duplicate interface devices and can
|
||||
* exhaust USB_MAX_TRACKED_INTERFACES. Track only alternate
|
||||
* setting zero until a function driver explicitly selects a
|
||||
* different setting.
|
||||
*/
|
||||
|
||||
// Alternate settings are not independent USB interfaces. Real
|
||||
// UVC cameras often expose one VideoStreaming interface with
|
||||
// many alternate settings, and publishing each alternate setting
|
||||
// as a separate PDO causes duplicate interface devices and can
|
||||
// exhaust USB_MAX_TRACKED_INTERFACES. Track only alternate
|
||||
// setting zero until a function driver explicitly selects a
|
||||
// different setting.
|
||||
|
||||
tracked = (USB_TRACKED_INTERFACE*)0;
|
||||
}
|
||||
|
||||
@@ -253,6 +255,7 @@ KSTATUS XhciDiscoverAndSetConfiguration(XHCI_CONTROLLER* xhci, XHCI_DEVICE* dev,
|
||||
}
|
||||
|
||||
|
||||
// Implements the rollback Enumerated Slot operation.
|
||||
static void XhciRollbackEnumeratedSlot(XHCI_CONTROLLER* xhci, uint8_t slotId) {
|
||||
if (!xhci || slotId == 0 || slotId > XHCI_MAX_TRACKED_SLOTS)
|
||||
return;
|
||||
@@ -377,6 +380,7 @@ static KSTATUS XhciEnumeratePathEx(XHCI_CONTROLLER* xhci,
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the enumerate Port Ex operation.
|
||||
KSTATUS XhciEnumeratePortEx(XHCI_CONTROLLER* xhci, uint8_t port, uint8_t* outSlotId) {
|
||||
if (outSlotId) *outSlotId = 0;
|
||||
|
||||
@@ -426,11 +430,13 @@ KSTATUS XhciEnumerateHubPortEx(XHCI_CONTROLLER* xhci,
|
||||
return XhciEnumeratePathEx(xhci, hubPort, speed, &path, hub->Self, outSlotId);
|
||||
}
|
||||
|
||||
// Implements the enumerate Port operation.
|
||||
KSTATUS XhciEnumeratePort(XHCI_CONTROLLER* xhci, uint8_t port) {
|
||||
return XhciEnumeratePortEx(xhci, port, (uint8_t*)0);
|
||||
}
|
||||
|
||||
|
||||
// Implements the enumerate Root Ports operation.
|
||||
void XhciEnumerateRootPorts(XHCI_CONTROLLER* xhci) {
|
||||
uint32_t attempted = 0;
|
||||
uint32_t configured = 0;
|
||||
|
||||
Reference in new issue
Block a user