X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/b2330934b9ccd51a59183eb2a11fdd95183df27b..d11ed10c5314c44dc01c06954d1d73d4894cbff8:/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c index 8c55dff3b..dbdbb8ab8 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c @@ -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 @@ -40,21 +40,27 @@ * passed to all RNDIS Class driver functions, so that multiple instances of the same class * within a device can be differentiated from one another. */ -USB_ClassInfo_RNDIS_t Ethernet_RNDIS_Interface = +USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface = { - .ControlInterfaceNumber = 0, - - .DataINEndpointNumber = CDC_TX_EPNUM, - .DataINEndpointSize = CDC_TXRX_EPSIZE, - - .DataOUTEndpointNumber = CDC_RX_EPNUM, - .DataOUTEndpointSize = CDC_TXRX_EPSIZE, - - .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM, - .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE, - - .AdapterVendorDescription = "LUFA RNDIS Demo Adapter", - .AdapterMACAddress = {ADAPTER_MAC_ADDRESS}, + .Config = + { + .ControlInterfaceNumber = 0, + + .DataINEndpointNumber = CDC_TX_EPNUM, + .DataINEndpointSize = CDC_TXRX_EPSIZE, + .DataINEndpointDoubleBank = false, + + .DataOUTEndpointNumber = CDC_RX_EPNUM, + .DataOUTEndpointSize = CDC_TXRX_EPSIZE, + .DataOUTEndpointDoubleBank = false, + + .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM, + .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE, + .NotificationEndpointDoubleBank = false, + + .AdapterVendorDescription = "LUFA RNDIS Demo Adapter", + .AdapterMACAddress = {ADAPTER_MAC_ADDRESS}, + }, }; /** Main program entry point. This routine contains the overall program flow, including initial @@ -73,16 +79,16 @@ int main(void) for (;;) { - if (Ethernet_RNDIS_Interface.FrameIN.FrameInBuffer) + if (Ethernet_RNDIS_Interface.State.FrameIN.FrameInBuffer) { LEDs_SetAllLEDs(LEDMASK_USB_BUSY); - Ethernet_ProcessPacket(&Ethernet_RNDIS_Interface.FrameIN, &Ethernet_RNDIS_Interface.FrameOUT); + Ethernet_ProcessPacket(&Ethernet_RNDIS_Interface.State.FrameIN, &Ethernet_RNDIS_Interface.State.FrameOUT); LEDs_SetAllLEDs(LEDMASK_USB_READY); } TCP_TCPTask(&Ethernet_RNDIS_Interface); - USB_RNDIS_USBTask(&Ethernet_RNDIS_Interface); + RNDIS_Device_USBTask(&Ethernet_RNDIS_Interface); USB_USBTask(); } } @@ -104,28 +110,28 @@ void SetupHardware(void) } /** Event handler for the library USB Connection event. */ -void EVENT_USB_Connect(void) +void EVENT_USB_Device_Connect(void) { LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING); } /** Event handler for the library USB Disconnection event. */ -void EVENT_USB_Disconnect(void) +void EVENT_USB_Device_Disconnect(void) { LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); } /** Event handler for the library USB Configuration Changed event. */ -void EVENT_USB_ConfigurationChanged(void) +void EVENT_USB_Device_ConfigurationChanged(void) { LEDs_SetAllLEDs(LEDMASK_USB_READY); - if (!(USB_RNDIS_ConfigureEndpoints(&Ethernet_RNDIS_Interface))) + if (!(RNDIS_Device_ConfigureEndpoints(&Ethernet_RNDIS_Interface))) LEDs_SetAllLEDs(LEDMASK_USB_ERROR); } -/** Event handler for the library USB Unhandled Control Packet event. */ -void EVENT_USB_UnhandledControlPacket(void) +/** Event handler for the library USB Unhandled Control Request event. */ +void EVENT_USB_Device_UnhandledControlRequest(void) { - USB_RNDIS_ProcessControlPacket(&Ethernet_RNDIS_Interface); + RNDIS_Device_ProcessControlRequest(&Ethernet_RNDIS_Interface); }