X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f6de4db0009244baef4e961cd0cb6520e78edba0..03ee87b35abdb8b92e8b55ec040fa943f9a6786c:/LUFA/Drivers/USB/Class/Host/RNDIS.h?ds=inline diff --git a/LUFA/Drivers/USB/Class/Host/RNDIS.h b/LUFA/Drivers/USB/Class/Host/RNDIS.h index 9b14055e7..fc9b4b325 100644 --- a/LUFA/Drivers/USB/Class/Host/RNDIS.h +++ b/LUFA/Drivers/USB/Class/Host/RNDIS.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2009. + Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -120,13 +120,6 @@ #define RNDIS_COMMAND_FAILED 0xC0 /* Function Prototypes: */ - /** General management task for a given RNDIS host class interface, required for the correct operation of the interface. This should - * be called frequently in the main program loop, before the master USB management task \ref USB_USBTask(). - * - * \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state - */ - void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); - /** Host interface configuration routine, to configure a given RNDIS host interface instance using the Configuration * Descriptor read from an attached USB device. This function automatically updates the given RNDIS Host instance's * state values and configures the pipes required to communicate with the interface if it is found within the device. @@ -190,6 +183,9 @@ /** Determines if a packet is currently waiting for the host to read in and process. * + * \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the + * call will fail. + * * \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state * * \return Boolean true if a packet is waiting to be read in by the host, false otherwise @@ -200,6 +196,9 @@ /** Retrieves the next pending packet from the device, discarding the remainder of the RNDIS packet header to leave * only the packet contents for processing by the host in the nominated buffer. * + * \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the + * call will fail. + * * \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state * \param[out] Buffer Pointer to a buffer where the packer data is to be written to * \param[out] PacketLength Pointer to where the length in bytes of the read packet is to be stored @@ -209,6 +208,32 @@ uint8_t RNDIS_Host_ReadPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, void* Buffer, uint16_t* PacketLength) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3); + /** Sends the given packet to the attached RNDIS device, after adding a RNDIS packet message header. + * + * \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the + * call will fail. + * + * \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state + * \param[in] Buffer Pointer to a buffer where the packer data is to be read from + * \param[in] PacketLength Length in bytes of the packet to send + * + * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum + */ + uint8_t RNDIS_Host_SendPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, void* Buffer, uint16_t PacketLength) + ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + + /* Inline Functions: */ + /** General management task for a given RNDIS host class interface, required for the correct operation of the interface. This should + * be called frequently in the main program loop, before the master USB management task \ref USB_USBTask(). + * + * \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state + */ + static inline void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo); + static inline void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) + { + (void)RNDISInterfaceInfo; + } + /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) /* Macros: */