1 --- linux-2.6.12.2/drivers/usb/core/hub.c.bak 2005-09-19 20:29:14.000000000 +0000
2 +++ linux-2.6.12.2/drivers/usb/core/hub.c 2005-09-19 20:30:44.000000000 +0000
5 dev_info (&udev->dev, "USB disconnect, address %d\n", udev->devnum);
7 + // --- Forward-Ported Linksys Disk 1 & Disk 2 LED Control (Port done 16.Sept.05 by Philipp Kirchhofer) ---
8 + // Copy & paste from nslu2-io.c
9 + #define DISK1_OFF 0x00000008 //0b0000 0000 0000 1000
10 + #define DISK2_OFF 0x00000004 //0b0000 0000 0000 0100
13 + if (*udev->devpath == 0x31) {
14 + *IXP4XX_GPIO_GPOUTR |= DISK1_OFF;
15 + } else if (*udev->devpath == 0x32) {
16 + *IXP4XX_GPIO_GPOUTR |= DISK2_OFF;
18 + // --- End LED Control ---
20 /* Free up all the children before we remove this device */
21 for (i = 0; i < USB_MAXCHILDREN; i++) {
22 if (udev->children[i])
23 @@ -2175,6 +2188,19 @@
24 udev->bus->controller->driver->name,
27 + // --- Start LED Control ---
28 + // Copy & paste from nslu2-io.c
29 + #define DISK1_ON 0xfffffff7 //0b1111 1111 1111 0111
30 + #define DISK2_ON 0xfffffffb //0b1111 1111 1111 1011
33 + if (*udev->devpath == 0x31) {
34 + *IXP4XX_GPIO_GPOUTR &= DISK1_ON;
35 + } else if (*udev->devpath == 0x32) {
36 + *IXP4XX_GPIO_GPOUTR &= DISK2_ON;
38 + // --- End LED Control ---
40 /* Set up TT records, if needed */
43 --- linux-2.6.12.2/drivers/usb/storage/transport.c.bak 2005-09-19 20:29:25.000000000 +0000
44 +++ linux-2.6.12.2/drivers/usb/storage/transport.c 2005-09-19 20:29:55.000000000 +0000
49 +// --- Forward-Ported Linksys Disk 1 & Disk 2 LED Activity Blinking Part 1 (Port done 16.Sept.05 by Philipp Kirchhofer) ---
50 +// Copy & Paste from nslu2-io.c
51 +#define DISK1_ON 0xfffffff7 //0b1111 1111 1111 0111
52 +#define DISK2_ON 0xfffffffb //0b1111 1111 1111 1011
54 +#define DISK1_OFF 0x00000008 //0b0000 0000 0000 1000
55 +#define DISK2_OFF 0x00000004 //0b0000 0000 0000 0100
58 +#define JIFFIES_BLINKING_TIME 6
59 +#define ON_LED_INTERVAL 3
60 +unsigned long turn_on_time;
62 +static struct timer_list usb1_led_timer; /* ide led switch */
63 +static struct timer_list usb2_led_timer; /* ide led switch */
65 +// Turns on Disk 1 LED
66 +static void turn_on_led_usb1(unsigned long ptr) {
67 + *IXP4XX_GPIO_GPOUTR &= DISK1_ON; // 0xfff7
71 +// Turns on Disk 2 LED
72 +static void turn_on_led_usb2(unsigned long ptr) {
73 + *IXP4XX_GPIO_GPOUTR &= DISK2_ON; // 0xfffb
77 +// Turns on Disk 1 LED after ON_LED_INTERVAL jiffies
78 +static void usb_1_led_timer(void) {
79 + usb1_led_timer.expires = jiffies + ON_LED_INTERVAL;
80 + add_timer(&usb1_led_timer);
84 +// Turns on Disk 2 LED after ON_LED_INTERVAL jiffies
85 +static void usb_2_led_timer(void) {
86 + usb2_led_timer.expires = jiffies + ON_LED_INTERVAL;
87 + add_timer(&usb2_led_timer);
91 +// Initializes Timers
92 +unsigned long initialized_timers = 0;
93 +static void initializeTimers() {
94 + if (initialized_timers != 1) {
95 + init_timer(&usb1_led_timer);
96 + usb1_led_timer.function = turn_on_led_usb1;
97 + init_timer(&usb2_led_timer);
98 + usb2_led_timer.function = turn_on_led_usb2;
99 + initialized_timers = 1;
102 +// --- End Disk LED Activity Blinking Part 1 ---
104 /***********************************************************************
105 * Data transfer routines
108 /* are we scatter-gathering? */
110 + // --- Disk LED Activity Blinking Part 2 ---
111 + initializeTimers();
112 + if ((jiffies - turn_on_time) >= JIFFIES_BLINKING_TIME) {
113 + if (*us->pusb_dev->devpath == 0x31) {
114 + del_timer_sync(&usb1_led_timer);
115 + *IXP4XX_GPIO_GPOUTR |= DISK1_OFF;
117 + } else if (*us->pusb_dev->devpath == 0x32) {
118 + del_timer_sync(&usb2_led_timer);
119 + *IXP4XX_GPIO_GPOUTR |= DISK2_OFF;
122 + turn_on_time = jiffies;
124 + // --- End Disk LED Activity Blinking Part 2 ---
125 /* use the usb core scatter-gather primitives */
126 result = usb_stor_bulk_transfer_sglist(us, pipe,
127 (struct scatterlist *) buf, use_sg,