diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-06-01 11:03:39 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-06-01 11:03:39 +0000 |
commit | d1e52660368d34d693131f6aff3c8fd8584162e5 (patch) | |
tree | 333916f85f9fd38a80b0785478aa596f11f166b6 /Demos/Device/RNDISEthernet/Lib/Ethernet.h | |
parent | 2440ca268ac444c1aed2441cefe9e25a767d961a (diff) | |
download | lufa-d1e52660368d34d693131f6aff3c8fd8584162e5.tar.gz lufa-d1e52660368d34d693131f6aff3c8fd8584162e5.tar.bz2 lufa-d1e52660368d34d693131f6aff3c8fd8584162e5.zip |
Commit of new class abstraction APIs for all device demos other than the MIDI demo - not documented yet.
Removed scheduler and memory allocation libraries.
Added new EVENT_USB_StartOfFrame event in the library to indicate the start of each USB frame (when generated).
Removed Tx interrupt from the USBtoSerial demo; now sends characters via polling to ensure more time for the Rx interrupt.
Diffstat (limited to 'Demos/Device/RNDISEthernet/Lib/Ethernet.h')
-rw-r--r-- | Demos/Device/RNDISEthernet/Lib/Ethernet.h | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/Demos/Device/RNDISEthernet/Lib/Ethernet.h b/Demos/Device/RNDISEthernet/Lib/Ethernet.h index b360f07ae..b3002523a 100644 --- a/Demos/Device/RNDISEthernet/Lib/Ethernet.h +++ b/Demos/Device/RNDISEthernet/Lib/Ethernet.h @@ -39,6 +39,8 @@ /* Includes: */
#include <avr/io.h>
#include <string.h>
+
+ #include <LUFA/Drivers/USB/Class/Device/RNDIS.h>
#include "EthernetProtocols.h"
#include "ProtocolDecoders.h"
@@ -50,6 +52,9 @@ #include "IP.h"
/* Macros: */
+ /** Physical MAC address of the USB RNDIS network adapter */
+ #define ADAPTER_MAC_ADDRESS {0x00, 0x02, 0x00, 0x02, 0x00, 0x02}
+
/** Physical MAC address of the virtual server on the network */
#define SERVER_MAC_ADDRESS {0x00, 0x01, 0x00, 0x01, 0x00, 0x01}
@@ -64,12 +69,6 @@ * \return True if the addresses match, false otherwise
*/
#define MAC_COMPARE(MAC1, MAC2) (memcmp(MAC1, MAC2, sizeof(MAC_Address_t)) == 0)
-
- /** Maximum size of an incoming or outgoing Ethernet frame in bytes */
- #define ETHERNET_FRAME_SIZE_MAX 1500
-
- /** Minimum size of an Ethernet packet in bytes, to conform to the Ethernet V2 packet standard */
- #define ETHERNET_VER2_MINSIZE 0x0600
/** Return value for all sub protocol handling routines, indicating that no response packet has been generated */
#define NO_RESPONSE 0
@@ -78,14 +77,6 @@ #define NO_PROCESS -1
/* Type Defines: */
- /** Type define for an Ethernet frame buffer. */
- typedef struct
- {
- uint8_t FrameData[ETHERNET_FRAME_SIZE_MAX]; /**< Ethernet frame contents */
- uint16_t FrameLength; /**< Length in bytes of the Ethernet frame stored in the buffer */
- bool FrameInBuffer; /**< Indicates if a frame is currently stored in the buffer */
- } Ethernet_Frame_Info_t;
-
/** Type define for an Ethernet frame header */
typedef struct
{
@@ -100,9 +91,6 @@ } Ethernet_Frame_Header_t;
/* External Variables: */
- extern Ethernet_Frame_Info_t FrameIN;
- extern Ethernet_Frame_Info_t FrameOUT;
-
extern const MAC_Address_t ServerMACAddress;
extern const IP_Address_t ServerIPAddress;
extern const MAC_Address_t BroadcastMACAddress;
@@ -110,7 +98,7 @@ extern const IP_Address_t ClientIPAddress;
/* Function Prototypes: */
- void Ethernet_ProcessPacket(void);
+ void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* FrameIN, Ethernet_Frame_Info_t* FrameOUT);
uint16_t Ethernet_Checksum16(void* Data, uint16_t Bytes);
#endif
|