mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 12:11:42 +00:00
[USBPORT] Type-safe function signature (PVOID -> PUSBPORT_xxx).
This commit is contained in:
parent
a913501626
commit
73bfc3c897
5 changed files with 89 additions and 84 deletions
|
@ -1524,7 +1524,7 @@ USBPORT_RestoreDevice(IN PDEVICE_OBJECT FdoDevice,
|
|||
PUSBPORT_DEVICE_EXTENSION FdoExtension;
|
||||
PLIST_ENTRY iHandleList;
|
||||
PUSBPORT_ENDPOINT Endpoint;
|
||||
ULONG EndpointRequirements[2] = {0};
|
||||
USBPORT_ENDPOINT_REQUIREMENTS EndpointRequirements = {0};
|
||||
USB_DEFAULT_PIPE_SETUP_PACKET SetupPacket;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
USBD_STATUS USBDStatus;
|
||||
|
@ -1707,7 +1707,7 @@ USBPORT_RestoreDevice(IN PDEVICE_OBJECT FdoDevice,
|
|||
|
||||
Packet->QueryEndpointRequirements(FdoExtension->MiniPortExt,
|
||||
&Endpoint->EndpointProperties,
|
||||
EndpointRequirements);
|
||||
&EndpointRequirements);
|
||||
|
||||
KeReleaseSpinLock(&FdoExtension->MiniportSpinLock,
|
||||
OldIrql);
|
||||
|
|
|
@ -620,7 +620,7 @@ USBPORT_OpenPipe(IN PDEVICE_OBJECT FdoDevice,
|
|||
UCHAR Direction;
|
||||
UCHAR Interval;
|
||||
UCHAR Period;
|
||||
ULONG TransferParams[2] = {0};
|
||||
USBPORT_ENDPOINT_REQUIREMENTS EndpointRequirements = {0};
|
||||
PUSBPORT_COMMON_BUFFER_HEADER HeaderBuffer;
|
||||
MPSTATUS MpStatus;
|
||||
USBD_STATUS USBDStatus;
|
||||
|
@ -832,27 +832,27 @@ USBPORT_OpenPipe(IN PDEVICE_OBJECT FdoDevice,
|
|||
|
||||
Packet->QueryEndpointRequirements(FdoExtension->MiniPortExt,
|
||||
&Endpoint->EndpointProperties,
|
||||
TransferParams);
|
||||
&EndpointRequirements);
|
||||
|
||||
KeReleaseSpinLock(&FdoExtension->MiniportSpinLock, OldIrql);
|
||||
|
||||
if ((EndpointProperties->TransferType == USBPORT_TRANSFER_TYPE_BULK) ||
|
||||
(EndpointProperties->TransferType == USBPORT_TRANSFER_TYPE_INTERRUPT))
|
||||
{
|
||||
EndpointProperties->MaxTransferSize = TransferParams[1];
|
||||
EndpointProperties->MaxTransferSize = EndpointRequirements.MaxTransferSize;
|
||||
}
|
||||
|
||||
if (TransferParams[0])
|
||||
if (EndpointRequirements.HeaderBufferSize)
|
||||
{
|
||||
HeaderBuffer = USBPORT_AllocateCommonBuffer(FdoDevice,
|
||||
TransferParams[0]);
|
||||
EndpointRequirements.HeaderBufferSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
HeaderBuffer = NULL;
|
||||
}
|
||||
|
||||
if (HeaderBuffer || (TransferParams[0] == 0))
|
||||
if (HeaderBuffer || (EndpointRequirements.HeaderBufferSize == 0))
|
||||
{
|
||||
Endpoint->HeaderBuffer = HeaderBuffer;
|
||||
|
||||
|
@ -969,7 +969,7 @@ USBPORT_ReopenPipe(IN PDEVICE_OBJECT FdoDevice,
|
|||
{
|
||||
PUSBPORT_DEVICE_EXTENSION FdoExtension;
|
||||
PUSBPORT_COMMON_BUFFER_HEADER HeaderBuffer;
|
||||
ULONG EndpointRequirements[2] = {0};
|
||||
USBPORT_ENDPOINT_REQUIREMENTS EndpointRequirements = {0};
|
||||
PUSBPORT_REGISTRATION_PACKET Packet;
|
||||
KIRQL MiniportOldIrql;
|
||||
NTSTATUS Status;
|
||||
|
@ -1013,21 +1013,21 @@ USBPORT_ReopenPipe(IN PDEVICE_OBJECT FdoDevice,
|
|||
|
||||
Packet->QueryEndpointRequirements(FdoExtension->MiniPortExt,
|
||||
&Endpoint->EndpointProperties,
|
||||
EndpointRequirements);
|
||||
&EndpointRequirements);
|
||||
|
||||
KeReleaseSpinLock(&FdoExtension->MiniportSpinLock, MiniportOldIrql);
|
||||
|
||||
if (EndpointRequirements[0])
|
||||
if (EndpointRequirements.HeaderBufferSize)
|
||||
{
|
||||
HeaderBuffer = USBPORT_AllocateCommonBuffer(FdoDevice,
|
||||
EndpointRequirements[0]);
|
||||
EndpointRequirements.HeaderBufferSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
HeaderBuffer = NULL;
|
||||
}
|
||||
|
||||
if (HeaderBuffer || EndpointRequirements[0] == 0)
|
||||
if (HeaderBuffer || EndpointRequirements.HeaderBufferSize == 0)
|
||||
{
|
||||
Endpoint->HeaderBuffer = HeaderBuffer;
|
||||
Status = STATUS_SUCCESS;
|
||||
|
|
|
@ -170,7 +170,7 @@ USBPORT_RootHubClassCommand(IN PDEVICE_OBJECT FdoDevice,
|
|||
case USB_REQUEST_CLEAR_FEATURE:
|
||||
Feature = SetupPacket->wValue.W;
|
||||
|
||||
if ((SetupPacket->bmRequestType.Recipient) != USBPORT_RECIPIENT_ROOT_PORT)
|
||||
if ((SetupPacket->bmRequestType.Recipient) != USBPORT_RECIPIENT_PORT)
|
||||
{
|
||||
if (Feature == FEATURE_C_HUB_LOCAL_POWER)
|
||||
{
|
||||
|
@ -242,7 +242,7 @@ USBPORT_RootHubClassCommand(IN PDEVICE_OBJECT FdoDevice,
|
|||
break;
|
||||
|
||||
case USB_REQUEST_SET_FEATURE:
|
||||
if (SetupPacket->bmRequestType.Recipient != USBPORT_RECIPIENT_ROOT_PORT)
|
||||
if (SetupPacket->bmRequestType.Recipient != USBPORT_RECIPIENT_PORT)
|
||||
{
|
||||
return RHStatus;
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
#define USBD_TRANSFER_DIRECTION 0x00000001
|
||||
#endif
|
||||
|
||||
#define USBPORT_RECIPIENT_ROOT_HUB BMREQUEST_TO_DEVICE
|
||||
#define USBPORT_RECIPIENT_ROOT_PORT BMREQUEST_TO_OTHER
|
||||
#define USBPORT_RECIPIENT_HUB BMREQUEST_TO_DEVICE
|
||||
#define USBPORT_RECIPIENT_PORT BMREQUEST_TO_OTHER
|
||||
|
||||
#define INVALIDATE_ENDPOINT_ONLY 0
|
||||
#define INVALIDATE_ENDPOINT_WORKER_THREAD 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue