diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-12 10:43:07 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-12 10:43:07 +0000 |
commit | 6a46f0025a4d44ca2c747745f542e8f475dd9b28 (patch) | |
tree | af025c5d73268a0cb615b5d61be32e1c32fa6c59 /LUFA/Drivers/USB | |
parent | 04774208b6d4131466a2b5e44af314252ab1734e (diff) | |
download | lufa-6a46f0025a4d44ca2c747745f542e8f475dd9b28.tar.gz lufa-6a46f0025a4d44ca2c747745f542e8f475dd9b28.tar.bz2 lufa-6a46f0025a4d44ca2c747745f542e8f475dd9b28.zip |
Add beginnings of a RNDIS Ethernet Host demo.
Diffstat (limited to 'LUFA/Drivers/USB')
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/RNDIS.c | 44 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Class/Host/StillImage.h | 2 |
2 files changed, 22 insertions, 24 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/RNDIS.c b/LUFA/Drivers/USB/Class/Device/RNDIS.c index 8ba46c7ac..2b7564176 100644 --- a/LUFA/Drivers/USB/Class/Device/RNDIS.c +++ b/LUFA/Drivers/USB/Class/Device/RNDIS.c @@ -259,13 +259,13 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDIS_Query_Complete_t* QUERY_Response = (RNDIS_Query_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
uint32_t Query_Oid = QUERY_Message->Oid;
- void* QueryData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) +
- QUERY_Message->InformationBufferOffset];
- void* ResponseData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Query_Complete_t)];
+ void* QueryData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) +
+ QUERY_Message->InformationBufferOffset];
+ void* ResponseData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Query_Complete_t)];
uint16_t ResponseSize;
- QUERY_Response->MessageType = REMOTE_NDIS_QUERY_CMPLT;
- QUERY_Response->MessageLength = sizeof(RNDIS_Query_Complete_t);
+ QUERY_Response->MessageType = REMOTE_NDIS_QUERY_CMPLT;
+ QUERY_Response->MessageLength = sizeof(RNDIS_Query_Complete_t);
if (RNDIS_Device_ProcessNDISQuery(RNDISInterfaceInfo, Query_Oid, QueryData, QUERY_Message->InformationBufferLength,
ResponseData, &ResponseSize))
@@ -292,28 +292,26 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDIS_Set_Complete_t* SET_Response = (RNDIS_Set_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
uint32_t SET_Oid = SET_Message->Oid;
- SET_Response->MessageType = REMOTE_NDIS_SET_CMPLT;
- SET_Response->MessageLength = sizeof(RNDIS_Set_Complete_t);
- SET_Response->RequestId = SET_Message->RequestId;
+ SET_Response->MessageType = REMOTE_NDIS_SET_CMPLT;
+ SET_Response->MessageLength = sizeof(RNDIS_Set_Complete_t);
+ SET_Response->RequestId = SET_Message->RequestId;
- void* SetData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) +
- SET_Message->InformationBufferOffset];
+ void* SetData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) +
+ SET_Message->InformationBufferOffset];
- if (RNDIS_Device_ProcessNDISSet(RNDISInterfaceInfo, SET_Oid, SetData, SET_Message->InformationBufferLength))
- SET_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
- else
- SET_Response->Status = REMOTE_NDIS_STATUS_NOT_SUPPORTED;
-
+ SET_Response->Status = RNDIS_Device_ProcessNDISSet(RNDISInterfaceInfo, SET_Oid, SetData,
+ SET_Message->InformationBufferLength) ?
+ REMOTE_NDIS_STATUS_SUCCESS : REMOTE_NDIS_STATUS_NOT_SUPPORTED;
break;
case REMOTE_NDIS_RESET_MSG:
RNDISInterfaceInfo->State.ResponseReady = true;
RNDIS_Reset_Complete_t* RESET_Response = (RNDIS_Reset_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
- RESET_Response->MessageType = REMOTE_NDIS_RESET_CMPLT;
- RESET_Response->MessageLength = sizeof(RNDIS_Reset_Complete_t);
- RESET_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
- RESET_Response->AddressingReset = 0;
+ RESET_Response->MessageType = REMOTE_NDIS_RESET_CMPLT;
+ RESET_Response->MessageLength = sizeof(RNDIS_Reset_Complete_t);
+ RESET_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
+ RESET_Response->AddressingReset = 0;
break;
case REMOTE_NDIS_KEEPALIVE_MSG:
@@ -324,10 +322,10 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDIS_KeepAlive_Complete_t* KEEPALIVE_Response =
(RNDIS_KeepAlive_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
- KEEPALIVE_Response->MessageType = REMOTE_NDIS_KEEPALIVE_CMPLT;
- KEEPALIVE_Response->MessageLength = sizeof(RNDIS_KeepAlive_Complete_t);
- KEEPALIVE_Response->RequestId = KEEPALIVE_Message->RequestId;
- KEEPALIVE_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
+ KEEPALIVE_Response->MessageType = REMOTE_NDIS_KEEPALIVE_CMPLT;
+ KEEPALIVE_Response->MessageLength = sizeof(RNDIS_KeepAlive_Complete_t);
+ KEEPALIVE_Response->RequestId = KEEPALIVE_Message->RequestId;
+ KEEPALIVE_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
break;
}
diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.h b/LUFA/Drivers/USB/Class/Host/StillImage.h index 0493470d9..19adbda8c 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImage.h +++ b/LUFA/Drivers/USB/Class/Host/StillImage.h @@ -152,7 +152,7 @@ */
uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
- /** Sends a given PIMA command to the attached device, filling out the PIMA command header automatically as required.
+ /** Sends a given PIMA command to the attached device, filling out the PIMA command header's Transaction ID automatically.
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
* \param[in] Operation PIMA operation code to issue to the device
|