Commit of new class abstraction APIs for all device demos other than the MIDI demo...
[pub/lufa.git] / Demos / Device / RNDISEthernet / Lib / Ethernet.h
index b360f07..b300252 100644 (file)
@@ -39,6 +39,8 @@
        /* Includes: */\r
                #include <avr/io.h>\r
                #include <string.h>\r
+               \r
+               #include <LUFA/Drivers/USB/Class/Device/RNDIS.h>\r
 \r
                #include "EthernetProtocols.h"\r
                #include "ProtocolDecoders.h"\r
@@ -50,6 +52,9 @@
                #include "IP.h"\r
                \r
        /* Macros: */\r
+               /** Physical MAC address of the USB RNDIS network adapter */\r
+               #define ADAPTER_MAC_ADDRESS              {0x00, 0x02, 0x00, 0x02, 0x00, 0x02}           \r
+\r
                /** Physical MAC address of the virtual server on the network */\r
                #define SERVER_MAC_ADDRESS               {0x00, 0x01, 0x00, 0x01, 0x00, 0x01}           \r
 \r
                 *  \return True if the addresses match, false otherwise\r
                 */\r
                #define MAC_COMPARE(MAC1, MAC2)          (memcmp(MAC1, MAC2, sizeof(MAC_Address_t)) == 0)\r
-\r
-               /** Maximum size of an incoming or outgoing Ethernet frame in bytes */\r
-               #define ETHERNET_FRAME_SIZE_MAX          1500\r
-               \r
-               /** Minimum size of an Ethernet packet in bytes, to conform to the Ethernet V2 packet standard */\r
-               #define ETHERNET_VER2_MINSIZE            0x0600\r
                \r
                /** Return value for all sub protocol handling routines, indicating that no response packet has been generated */\r
                #define NO_RESPONSE                      0              \r
                #define NO_PROCESS                       -1\r
 \r
        /* Type Defines: */\r
-               /** Type define for an Ethernet frame buffer. */\r
-               typedef struct\r
-               {\r
-                       uint8_t       FrameData[ETHERNET_FRAME_SIZE_MAX]; /**< Ethernet frame contents */\r
-                       uint16_t      FrameLength; /**< Length in bytes of the Ethernet frame stored in the buffer */\r
-                       bool          FrameInBuffer; /**< Indicates if a frame is currently stored in the buffer */\r
-               } Ethernet_Frame_Info_t;\r
-\r
                /** Type define for an Ethernet frame header */\r
                typedef struct\r
                {\r
                } Ethernet_Frame_Header_t;\r
                \r
        /* External Variables: */\r
-               extern Ethernet_Frame_Info_t FrameIN;\r
-               extern Ethernet_Frame_Info_t FrameOUT;\r
-\r
                extern const MAC_Address_t ServerMACAddress;\r
                extern const IP_Address_t  ServerIPAddress;\r
                extern const MAC_Address_t BroadcastMACAddress;\r
                extern const IP_Address_t  ClientIPAddress;\r
                \r
        /* Function Prototypes: */\r
-               void     Ethernet_ProcessPacket(void);\r
+               void     Ethernet_ProcessPacket(Ethernet_Frame_Info_t* FrameIN, Ethernet_Frame_Info_t* FrameOUT);\r
                uint16_t Ethernet_Checksum16(void* Data, uint16_t Bytes);\r
                \r
 #endif\r