aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Device/RNDIS.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-05-18 14:33:34 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-05-18 14:33:34 +0000
commit9d733d44b402ce33c3c41e45b497c2f92be393f5 (patch)
tree2ddf8b9b25e696ec4a2ab30c181f253005036be7 /LUFA/Drivers/USB/Class/Device/RNDIS.h
parent41de1d1dab863c7b769f6e492c36c115994c403d (diff)
downloadlufa-9d733d44b402ce33c3c41e45b497c2f92be393f5.tar.gz
lufa-9d733d44b402ce33c3c41e45b497c2f92be393f5.tar.bz2
lufa-9d733d44b402ce33c3c41e45b497c2f92be393f5.zip
Add new RNDIS_Host_IsPacketReceived(), RNDIS_Device_ReadPacket() and RNDIS_Device_WritePacket() functions to the Device RNDIS Class Driver.
Modify RNDIS demos to suit the simplified Ethernet_Frame_Info_t structure.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device/RNDIS.h')
-rw-r--r--LUFA/Drivers/USB/Class/Device/RNDIS.h48
1 files changed, 42 insertions, 6 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/RNDIS.h b/LUFA/Drivers/USB/Class/Device/RNDIS.h
index f53a8e01f..734ceb3fd 100644
--- a/LUFA/Drivers/USB/Class/Device/RNDIS.h
+++ b/LUFA/Drivers/USB/Class/Device/RNDIS.h
@@ -106,12 +106,6 @@
bool ResponseReady; /**< Internal flag indicating if a RNDIS message is waiting to be returned to the host. */
uint8_t CurrRNDISState; /**< Current RNDIS state of the adapter, a value from the \ref RNDIS_States_t enum. */
uint32_t CurrPacketFilter; /**< Current packet filter mode, used internally by the class driver. */
- Ethernet_Frame_Info_t FrameIN; /**< Structure holding the last received Ethernet frame from the host, for user
- * processing.
- */
- Ethernet_Frame_Info_t FrameOUT; /**< Structure holding the next Ethernet frame to send to the host, populated by the
- * user application.
- */
} State; /**< State data for the USB class interface within the device. All elements in this section
* are reset to their defaults when the interface is enumerated.
*/
@@ -146,6 +140,48 @@
*/
void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
+ /** Determines if a packet is currently waiting for the device to read in and process.
+ *
+ * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or the
+ * call will fail.
+ *
+ * \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class configuration and state.
+ *
+ * \return Boolean \c true if a packet is waiting to be read in by the host, \c false otherwise.
+ */
+ bool RNDIS_Device_IsPacketReceived(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo);
+
+ /** 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 device in the nominated buffer.
+ *
+ * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or the
+ * call will fail.
+ *
+ * \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class 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.
+ *
+ * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t RNDIS_Device_ReadPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo,
+ void* Buffer,
+ uint16_t* const PacketLength);
+
+ /** Sends the given packet to the attached RNDIS device, after adding a RNDIS packet message header.
+ *
+ * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or the
+ * call will fail.
+ *
+ * \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class 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 \ref Endpoint_Stream_RW_ErrorCodes_t enum.
+ */
+ uint8_t RNDIS_Device_SendPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo,
+ void* Buffer,
+ const uint16_t PacketLength);
+
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */