Remove non-functional maintenance link check.
[pub/USBasp.git] / Projects / Webserver / USBHostMode.c
index 98467a1..601ebda 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2012  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
@@ -44,16 +44,22 @@ USB_ClassInfo_RNDIS_Host_t Ethernet_RNDIS_Interface_Host =
        {
                .Config =
                        {
-                               .DataINPipeNumber           = 1,
-                               .DataINPipeDoubleBank       = false,
-
-                               .DataOUTPipeNumber          = 2,
-                               .DataOUTPipeDoubleBank      = false,
-
-                               .NotificationPipeNumber     = 3,
-                               .NotificationPipeDoubleBank = false,
-
-                               .HostMaxPacketSize          = UIP_CONF_BUFFER_SIZE,
+                               .DataINPipe             =
+                                       {
+                                               .Address        = (PIPE_DIR_IN  | 1),
+                                               .Banks          = 1,
+                                       },
+                               .DataOUTPipe            =
+                                       {
+                                               .Address        = (PIPE_DIR_OUT | 2),
+                                               .Banks          = 1,
+                                       },
+                               .NotificationPipe       =
+                                       {
+                                               .Address        = (PIPE_DIR_IN  | 3),
+                                               .Banks          = 1,
+                                       },
+                               .HostMaxPacketSize      = UIP_CONF_BUFFER_SIZE,
                        },
        };
 
@@ -67,7 +73,7 @@ void USBHostMode_USBTask(void)
          return;
 
        uIPManagement_ManageNetwork();
-       
+
        RNDIS_Host_USBTask(&Ethernet_RNDIS_Interface_Host);
 }
 
@@ -120,6 +126,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
        if (RNDIS_Host_InitializeDevice(&Ethernet_RNDIS_Interface_Host) != HOST_SENDCONTROL_Successful)
        {
                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+               USB_Host_SetDeviceConfiguration(0);
                return;
        }
 
@@ -128,6 +135,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
                                        &PacketFilter, sizeof(PacketFilter)) != HOST_SENDCONTROL_Successful)
        {
                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+               USB_Host_SetDeviceConfiguration(0);
                return;
        }
 
@@ -135,6 +143,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
                                          &MACAddress, sizeof(MACAddress)) != HOST_SENDCONTROL_Successful)
        {
                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+               USB_Host_SetDeviceConfiguration(0);
                return;
        }