|
|
@ -102,31 +102,59 @@ uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfa
|
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
|
|
|
|
for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
uint16_t Size;
|
|
|
|
|
|
|
|
uint8_t Type;
|
|
|
|
|
|
|
|
uint8_t Token;
|
|
|
|
|
|
|
|
uint8_t EndpointAddress;
|
|
|
|
|
|
|
|
uint8_t InterruptPeriod;
|
|
|
|
|
|
|
|
bool DoubleBanked;
|
|
|
|
|
|
|
|
|
|
|
|
if (PipeNum == RNDISInterfaceInfo->Config.DataINPipeNumber)
|
|
|
|
if (PipeNum == RNDISInterfaceInfo->Config.DataINPipeNumber)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Pipe_ConfigurePipe(PipeNum, EP_TYPE_BULK, PIPE_TOKEN_IN,
|
|
|
|
Size = DataINEndpoint->EndpointSize;
|
|
|
|
DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize,
|
|
|
|
EndpointAddress = DataINEndpoint->EndpointAddress;
|
|
|
|
RNDISInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
|
|
|
|
Token = PIPE_TOKEN_IN;
|
|
|
|
|
|
|
|
Type = EP_TYPE_BULK;
|
|
|
|
|
|
|
|
DoubleBanked = RNDISInterfaceInfo->Config.DataINPipeDoubleBank;
|
|
|
|
|
|
|
|
InterruptPeriod = 0;
|
|
|
|
|
|
|
|
|
|
|
|
RNDISInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
|
|
|
|
RNDISInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (PipeNum == RNDISInterfaceInfo->Config.DataOUTPipeNumber)
|
|
|
|
else if (PipeNum == RNDISInterfaceInfo->Config.DataOUTPipeNumber)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Pipe_ConfigurePipe(PipeNum, EP_TYPE_BULK, PIPE_TOKEN_OUT,
|
|
|
|
Size = DataOUTEndpoint->EndpointSize;
|
|
|
|
DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize,
|
|
|
|
EndpointAddress = DataOUTEndpoint->EndpointAddress;
|
|
|
|
RNDISInterfaceInfo->Config.DataOUTPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
|
|
|
|
Token = PIPE_TOKEN_OUT;
|
|
|
|
|
|
|
|
Type = EP_TYPE_BULK;
|
|
|
|
|
|
|
|
DoubleBanked = RNDISInterfaceInfo->Config.DataOUTPipeDoubleBank;
|
|
|
|
|
|
|
|
InterruptPeriod = 0;
|
|
|
|
|
|
|
|
|
|
|
|
RNDISInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
|
|
|
|
RNDISInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (PipeNum == RNDISInterfaceInfo->Config.NotificationPipeNumber)
|
|
|
|
else if (PipeNum == RNDISInterfaceInfo->Config.NotificationPipeNumber)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Pipe_ConfigurePipe(PipeNum, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
|
|
|
|
Size = NotificationEndpoint->EndpointSize;
|
|
|
|
NotificationEndpoint->EndpointAddress, NotificationEndpoint->EndpointSize,
|
|
|
|
EndpointAddress = NotificationEndpoint->EndpointAddress;
|
|
|
|
RNDISInterfaceInfo->Config.NotificationPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
|
|
|
|
Token = PIPE_TOKEN_IN;
|
|
|
|
Pipe_SetInterruptPeriod(NotificationEndpoint->PollingIntervalMS);
|
|
|
|
Type = EP_TYPE_INTERRUPT;
|
|
|
|
|
|
|
|
DoubleBanked = RNDISInterfaceInfo->Config.NotificationPipeDoubleBank;
|
|
|
|
|
|
|
|
InterruptPeriod = NotificationEndpoint->PollingIntervalMS;
|
|
|
|
|
|
|
|
|
|
|
|
RNDISInterfaceInfo->State.NotificationPipeSize = NotificationEndpoint->EndpointSize;
|
|
|
|
RNDISInterfaceInfo->State.NotificationPipeSize = NotificationEndpoint->EndpointSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
|
|
|
|
|
|
|
|
DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return CDC_ENUMERROR_PipeConfigurationFailed;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (InterruptPeriod)
|
|
|
|
|
|
|
|
Pipe_SetInterruptPeriod(InterruptPeriod);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
RNDISInterfaceInfo->State.ControlInterfaceNumber = RNDISControlInterface->InterfaceNumber;
|
|
|
|
RNDISInterfaceInfo->State.ControlInterfaceNumber = RNDISControlInterface->InterfaceNumber;
|
|
|
|