{
memset(&RNDISInterfaceInfo->State, 0x00, sizeof(RNDISInterfaceInfo->State));
- for (uint8_t EndpointNum = 1; EndpointNum < ENDPOINT_TOTAL_ENDPOINTS; EndpointNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Direction;
- bool DoubleBanked;
-
- if (EndpointNum == RNDISInterfaceInfo->Config.DataINEndpointNumber)
- {
- Size = RNDISInterfaceInfo->Config.DataINEndpointSize;
- Direction = ENDPOINT_DIR_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = RNDISInterfaceInfo->Config.DataINEndpointDoubleBank;
- }
- else if (EndpointNum == RNDISInterfaceInfo->Config.DataOUTEndpointNumber)
- {
- Size = RNDISInterfaceInfo->Config.DataOUTEndpointSize;
- Direction = ENDPOINT_DIR_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = RNDISInterfaceInfo->Config.DataOUTEndpointDoubleBank;
- }
- else if (EndpointNum == RNDISInterfaceInfo->Config.NotificationEndpointNumber)
- {
- Size = RNDISInterfaceInfo->Config.NotificationEndpointSize;
- Direction = ENDPOINT_DIR_IN;
- Type = EP_TYPE_INTERRUPT;
- DoubleBanked = RNDISInterfaceInfo->Config.NotificationEndpointDoubleBank;
- }
- else
- {
- continue;
- }
-
- if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
- DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
- {
- return false;
- }
- }
+ RNDISInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_BULK;
+ RNDISInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_BULK;
+ RNDISInterfaceInfo->Config.NotificationEndpoint.Type = EP_TYPE_INTERRUPT;
+
+ if (!(Endpoint_ConfigureEndpointTable(&RNDISInterfaceInfo->Config.DataINEndpoint, 1)))
+ return false;
+
+ if (!(Endpoint_ConfigureEndpointTable(&RNDISInterfaceInfo->Config.DataOUTEndpoint, 1)))
+ return false;
+
+ if (!(Endpoint_ConfigureEndpointTable(&RNDISInterfaceInfo->Config.NotificationEndpoint, 1)))
+ return false;
return true;
}
if (USB_DeviceState != DEVICE_STATE_Configured)
return;
- Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.NotificationEndpointNumber);
+ Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.NotificationEndpoint.Address);
if (Endpoint_IsINReady() && RNDISInterfaceInfo->State.ResponseReady)
{
return false;
}
- Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpointNumber);
+ Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpoint.Address);
return Endpoint_IsOUTReceived();
}
return ENDPOINT_RWSTREAM_DeviceDisconnected;
}
- Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpointNumber);
+ Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpoint.Address);
*PacketLength = 0;
return ENDPOINT_RWSTREAM_DeviceDisconnected;
}
- Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataINEndpoint.Address);
if ((ErrorCode = Endpoint_WaitUntilReady()) != ENDPOINT_READYWAIT_NoError)
return ErrorCode;