From 6a46f0025a4d44ca2c747745f542e8f475dd9b28 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 12 Nov 2009 10:43:07 +0000 Subject: Add beginnings of a RNDIS Ethernet Host demo. --- LUFA/Drivers/USB/Class/Device/RNDIS.c | 44 +++++++++++++++----------------- LUFA/Drivers/USB/Class/Host/StillImage.h | 2 +- LUFA/ManPages/Donating.txt | 6 ++++- LUFA/ManPages/Licence.txt | 3 ++- LUFA/ManPages/VIDAndPIDValues.txt | 2 +- 5 files changed, 30 insertions(+), 27 deletions(-) (limited to 'LUFA') 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 diff --git a/LUFA/ManPages/Donating.txt b/LUFA/ManPages/Donating.txt index 17e44c3b2..a09707820 100644 --- a/LUFA/ManPages/Donating.txt +++ b/LUFA/ManPages/Donating.txt @@ -14,7 +14,11 @@ * and supporter. Please consider donating a small amount to support this and my future Open Source projects - All * donations are greatly appreciated. * - * + * Note that commercial entities can remove the attribution portion of the LUFA licence by a one-time fee - see + * \ref Page_Licence for more details (Note: Please do NOT pay this in advance through the donation link below - + * contact author for payment details.). + * + * \image html "http://www.pledgie.com/campaigns/6927.png?skin_name=chrome" * Donate to this project via PayPal - Thanks in Advance! */ \ No newline at end of file diff --git a/LUFA/ManPages/Licence.txt b/LUFA/ManPages/Licence.txt index 36f0267f1..e10c79210 100644 --- a/LUFA/ManPages/Licence.txt +++ b/LUFA/ManPages/Licence.txt @@ -13,7 +13,8 @@ * for a one-time US$1500 payment. This provides a non-exclusive modified MIT licensed which * allows for the free use of the LUFA library, bootloaders and (where the sole copyright * is attributed to Dean Camera) demos without public disclosure within an organisation. Please - * contact the author for more information. + * contact the author for more information (Note: Please do NOT pay this in advance through the + * donation link shown on \ref Page_Donating - contact author for payment details.). * * \verbatim * Permission to use, copy, modify, and distribute this software diff --git a/LUFA/ManPages/VIDAndPIDValues.txt b/LUFA/ManPages/VIDAndPIDValues.txt index f1d66d2fb..1a101a893 100644 --- a/LUFA/ManPages/VIDAndPIDValues.txt +++ b/LUFA/ManPages/VIDAndPIDValues.txt @@ -11,7 +11,7 @@ * are used within the LUFA demos, and thus may be re-used by derivations of each demo. Free PID values may be * used by future LUFA demo projects. * - * These VID/PID values should not be used in commercial designs under any circumstances.>/b> Private projects + * These VID/PID values should not be used in commercial designs under any circumstances. Private projects * may use the following values freely, but must accept any collisions due to other LUFA derived private projects * sharing identical values. It is suggested that private projects using interfaces compatible with existing * demos share the save VID/PID value. -- cgit v1.2.3