Remove non-functional maintenance link check.
[pub/USBasp.git] / Projects / Webserver / Lib / uIPManagement.c
index 59045c0..eb42bf2 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
 
   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
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -46,9 +46,6 @@ static struct timer ARPTimer;
 /** MAC address of the RNDIS device, when enumerated. */
 struct uip_eth_addr MACAddress;
 
 /** MAC address of the RNDIS device, when enumerated. */
 struct uip_eth_addr MACAddress;
 
-/** Indicates if an IP configuration has been set in the device. */
-bool HaveIPConfiguration;
-
 
 /** Configures the uIP stack ready for network traffic processing. */
 void uIPManagement_Init(void)
 
 /** Configures the uIP stack ready for network traffic processing. */
 void uIPManagement_Init(void)
@@ -73,10 +70,9 @@ void uIPManagement_Init(void)
                MACAddress.addr[5] = SERVER_MAC_ADDRESS[5];
 
                #if defined(ENABLE_DHCP_SERVER)
                MACAddress.addr[5] = SERVER_MAC_ADDRESS[5];
 
                #if defined(ENABLE_DHCP_SERVER)
-               DHCPServerApp_Init();   
+               DHCPServerApp_Init();
                #endif
 
                #endif
 
-               HaveIPConfiguration = true;
                uip_ipaddr_t IPAddress, Netmask, GatewayIPAddress;
                uip_ipaddr(&IPAddress,        DEVICE_IP_ADDRESS[0], DEVICE_IP_ADDRESS[1], DEVICE_IP_ADDRESS[2], DEVICE_IP_ADDRESS[3]);
                uip_ipaddr(&Netmask,          DEVICE_NETMASK[0],    DEVICE_NETMASK[1],    DEVICE_NETMASK[2],    DEVICE_NETMASK[3]);
                uip_ipaddr_t IPAddress, Netmask, GatewayIPAddress;
                uip_ipaddr(&IPAddress,        DEVICE_IP_ADDRESS[0], DEVICE_IP_ADDRESS[1], DEVICE_IP_ADDRESS[2], DEVICE_IP_ADDRESS[3]);
                uip_ipaddr(&Netmask,          DEVICE_NETMASK[0],    DEVICE_NETMASK[1],    DEVICE_NETMASK[2],    DEVICE_NETMASK[3]);
@@ -88,10 +84,8 @@ void uIPManagement_Init(void)
        else
        {
                #if defined(ENABLE_DHCP_CLIENT)
        else
        {
                #if defined(ENABLE_DHCP_CLIENT)
-               HaveIPConfiguration = false;
-               DHCPClientApp_Init();   
+               DHCPClientApp_Init();
                #else
                #else
-               HaveIPConfiguration = true;
                uip_ipaddr_t IPAddress, Netmask, GatewayIPAddress;
                uip_ipaddr(&IPAddress,        DEVICE_IP_ADDRESS[0], DEVICE_IP_ADDRESS[1], DEVICE_IP_ADDRESS[2], DEVICE_IP_ADDRESS[3]);
                uip_ipaddr(&Netmask,          DEVICE_NETMASK[0],    DEVICE_NETMASK[1],    DEVICE_NETMASK[2],    DEVICE_NETMASK[3]);
                uip_ipaddr_t IPAddress, Netmask, GatewayIPAddress;
                uip_ipaddr(&IPAddress,        DEVICE_IP_ADDRESS[0], DEVICE_IP_ADDRESS[1], DEVICE_IP_ADDRESS[2], DEVICE_IP_ADDRESS[3]);
                uip_ipaddr(&Netmask,          DEVICE_NETMASK[0],    DEVICE_NETMASK[1],    DEVICE_NETMASK[2],    DEVICE_NETMASK[3]);
@@ -119,7 +113,7 @@ void uIPManagement_Init(void)
  */
 void uIPManagement_ManageNetwork(void)
 {
  */
 void uIPManagement_ManageNetwork(void)
 {
-       if (((USB_CurrentMode == USB_MODE_Host) && (USB_HostState == HOST_STATE_Configured)) ||
+       if (((USB_CurrentMode == USB_MODE_Host)   && (USB_HostState   == HOST_STATE_Configured)) ||
            ((USB_CurrentMode == USB_MODE_Device) && (USB_DeviceState == DEVICE_STATE_Configured)))
        {
                uIPManagement_ProcessIncomingPacket();
            ((USB_CurrentMode == USB_MODE_Device) && (USB_DeviceState == DEVICE_STATE_Configured)))
        {
                uIPManagement_ProcessIncomingPacket();
@@ -170,13 +164,13 @@ void uIPManagement_UDPCallback(void)
 /** Processes Incoming packets to the server from the connected RNDIS device, creating responses as needed. */
 static void uIPManagement_ProcessIncomingPacket(void)
 {
 /** Processes Incoming packets to the server from the connected RNDIS device, creating responses as needed. */
 static void uIPManagement_ProcessIncomingPacket(void)
 {
-       /* Determine which USB mode the system is currently initialised in */
+       /* Determine which USB mode the system is currently initialized in */
        if (USB_CurrentMode == USB_MODE_Device)
        {
                /* If no packet received, exit processing routine */
                if (!(RNDIS_Device_IsPacketReceived(&Ethernet_RNDIS_Interface_Device)))
                  return;
        if (USB_CurrentMode == USB_MODE_Device)
        {
                /* If no packet received, exit processing routine */
                if (!(RNDIS_Device_IsPacketReceived(&Ethernet_RNDIS_Interface_Device)))
                  return;
-       
+
                LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
 
                /* Read the Incoming packet straight into the UIP packet buffer */
                LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
 
                /* Read the Incoming packet straight into the UIP packet buffer */
@@ -187,13 +181,13 @@ static void uIPManagement_ProcessIncomingPacket(void)
                /* If no packet received, exit processing routine */
                if (!(RNDIS_Host_IsPacketReceived(&Ethernet_RNDIS_Interface_Host)))
                  return;
                /* If no packet received, exit processing routine */
                if (!(RNDIS_Host_IsPacketReceived(&Ethernet_RNDIS_Interface_Host)))
                  return;
-       
+
                LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
 
                /* Read the Incoming packet straight into the UIP packet buffer */
                RNDIS_Host_ReadPacket(&Ethernet_RNDIS_Interface_Host, uip_buf, &uip_len);
        }
                LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
 
                /* Read the Incoming packet straight into the UIP packet buffer */
                RNDIS_Host_ReadPacket(&Ethernet_RNDIS_Interface_Host, uip_buf, &uip_len);
        }
-       
+
        /* If the packet contains an Ethernet frame, process it */
        if (uip_len > 0)
        {
        /* If the packet contains an Ethernet frame, process it */
        if (uip_len > 0)
        {
@@ -228,7 +222,7 @@ static void uIPManagement_ProcessIncomingPacket(void)
                }
        }
 
                }
        }
 
-       LEDs_SetAllLEDs(LEDMASK_USB_READY | ((HaveIPConfiguration) ? LEDMASK_UIP_READY_CONFIG : LEDMASK_UIP_READY_NOCONFIG));
+       LEDs_SetAllLEDs(LEDMASK_USB_READY);
 }
 
 /** Manages the currently open network connections, including TCP and (if enabled) UDP. */
 }
 
 /** Manages the currently open network connections, including TCP and (if enabled) UDP. */