aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2014-08-31 20:14:48 +1000
committerDean Camera <dean@fourwalledcubicle.com>2014-08-31 20:14:48 +1000
commit0e68abcd4f0e2d015538e6fce2519c9513fb90ec (patch)
treeac8a76ecb9bd9439073430213bfdfc3cbdd3dabf /Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
parent2db71bc8a48a042d49a63b27723d9bcb27a35542 (diff)
downloadlufa-0e68abcd4f0e2d015538e6fce2519c9513fb90ec.tar.gz
lufa-0e68abcd4f0e2d015538e6fce2519c9513fb90ec.tar.bz2
lufa-0e68abcd4f0e2d015538e6fce2519c9513fb90ec.zip
Fix overflow for RNDIS class driver responses when returning the adapter query list (thanks to Peter Mc Shane).
Diffstat (limited to 'Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c')
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
index 95d93549e..bdb506117 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
+++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
@@ -36,6 +36,15 @@
#include "RNDISEthernet.h"
+/** Message buffer for RNDIS messages processed by the RNDIS device class driver. */
+static uint8_t RNDIS_Message_Buffer[192];
+
+/** Global to store the incoming frame from the host before it is processed by the device. */
+static Ethernet_Frame_Info_t FrameIN;
+
+/** Global to store the outgoing frame created in the device before it is sent to the host. */
+static Ethernet_Frame_Info_t FrameOUT;
+
/** LUFA RNDIS Class driver interface configuration and state information. This structure is
* passed to all RNDIS Class driver functions, so that multiple instances of the same class
* within a device can be differentiated from one another.
@@ -65,14 +74,11 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface =
},
.AdapterVendorDescription = "LUFA RNDIS Demo Adapter",
.AdapterMACAddress = {ADAPTER_MAC_ADDRESS},
+ .MessageBuffer = RNDIS_Message_Buffer,
+ .MessageBufferLength = sizeof(RNDIS_Message_Buffer),
},
};
-/** Global to store the incoming frame from the host before it is processed by the device. */
-static Ethernet_Frame_Info_t FrameIN;
-
-/** Global to store the outgoing frame created in the device before it is sent to the host. */
-static Ethernet_Frame_Info_t FrameOUT;
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.