--- linux-2.6.12.2/drivers/usb/core/hub.c.bak	2005-09-19 20:29:14.000000000 +0000
+++ linux-2.6.12.2/drivers/usb/core/hub.c	2005-09-20 23:14:47.000000000 +0000
@@ -1026,6 +1026,40 @@
 
 	dev_info (&udev->dev, "USB disconnect, address %d\n", udev->devnum);
 
+	// --- Forward-Ported Linksys Disk 1 & Disk 2 LED Control (Port & Enhancement done by Philipp Kirchhofer - Sept. '05) ---
+	// --- Start LED Control (Disconnect Part) ---
+	#define GPIO_DISK1 	3 	// Bit 3 controls LED 'Disk 1'
+	#define GPIO_DISK2 	2 	// Bit 2 controls LED 'Disk 2'
+	#define DEVPATH_PORT1 	0x31	// udev->devpath for EHCI Port 1
+	#define DEVPATH_PORT2 	0x32	// udev->devpath for EHCI Port 2
+
+	// Only disable LED if unplugged device is directly connected to a NSLU2 USB port
+	if (udev->parent && udev->parent->devnum == 1) {
+		switch (udev->bus->busnum) {
+			/* EHCI Port 1 + 2 */
+			case 1:
+				if (*udev->devpath == DEVPATH_PORT1) {
+					// Disable LED 'Disk 1'
+					gpio_line_set(GPIO_DISK1, IXP4XX_GPIO_HIGH);
+				} else if (*udev->devpath == DEVPATH_PORT2) {
+					// Disable LED 'Disk 2'
+					gpio_line_set(GPIO_DISK2, IXP4XX_GPIO_HIGH);
+				}
+				break;
+			/* OHCI Port 1 */
+			case 2:
+				// Disable LED 'Disk 1'
+				gpio_line_set(GPIO_DISK1, IXP4XX_GPIO_HIGH);
+				break;
+			/* OHCI Port 2 */
+			case 3:
+				// Disable LED 'Disk 2'
+				gpio_line_set(GPIO_DISK2, IXP4XX_GPIO_HIGH);
+				break;
+		}
+	}
+	// --- End LED Control (Disconnect Part) ---
+
 	/* Free up all the children before we remove this device */
 	for (i = 0; i < USB_MAXCHILDREN; i++) {
 		if (udev->children[i])
@@ -2322,6 +2356,34 @@
 
 	retval = 0;
 
+	// --- Start LED Control (Connect Part) ---
+	// Only enable LED if new device is not a hub
+	if (udev->descriptor.bDeviceClass != USB_CLASS_HUB) {
+		switch (udev->bus->busnum) {
+			/* EHCI Port 1 + 2 */
+			case 1:
+				if (*udev->devpath == DEVPATH_PORT1) {
+					// Enable LED 'Disk 1'
+					gpio_line_set(GPIO_DISK1, IXP4XX_GPIO_LOW);
+				} else if (*udev->devpath == DEVPATH_PORT2) {
+					// Enable LED 'Disk 2'
+					gpio_line_set(GPIO_DISK2, IXP4XX_GPIO_LOW);
+				}
+				break;
+			/* OHCI Port 1 */
+			case 2:
+				// Enable LED 'Disk 1'
+				gpio_line_set(GPIO_DISK1, IXP4XX_GPIO_LOW);
+				break;
+			/* OHCI Port 2 */
+			case 3:
+				// Enable LED 'Disk 2'
+				gpio_line_set(GPIO_DISK2, IXP4XX_GPIO_LOW);
+				break;
+		}
+	}
+	// --- End LED Control (Connect Part) ---
+
 fail:
 	if (retval)
 		hub_port_disable(hub, port1, 0);

