OpenWrt Forum Archive

Topic: Porting D-Link TI-led tool from 2.4 kernel interface to 2.6?

The content of this topic has been archived on 11 Feb 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

the D-Link GPL sources for the D-Link DSL-562T contain a LED applet. The tool relies on /proc/led_mod/led, which appears to be patched into the 2.4 kernel provided as well.

Since the leds are pretty much useless on OpenWRT, I would like to port this over to OpenWRTs 2.6 kernel.  Before I start with this I want to make sure nobody is working on something similiar...

Regards,
  Dominik

Hi Dominik,

There is already support for the LEDs using the generic leds-gpio driver in 2.6. There is no applet as such but you can control the LEDs via the sysfs system (/sys/class/leds/xxxx).

Currently, the LEDs are active on the DG834G, DSL502T, and FritzBox boards. Whether your board is supported will depend on how similar it is to the DSL502T. If it's not the same, then you will need to find out which GPIO lines drive the LEDs and edit platform.c appropriately to add support for this board.

I have been working on getting all the LEDs driven correctly for the DG834G. So far I have the DSL LED working (see ticket #2996), and Oliver has an led-trigger to drive the WAN/PPP, WIFI and ethernet LEDs (see ticket #2776). I am currently working on ensuring the power LED is on from startup, and have a working patch that just need to be agreed with the LEDs maintainer. I also have a rough uci config for all the LEDs.

This has all taken me a bit longer than I hoped, but I'll try to clean up what I have and post it to a ticket soon. Any help would be greatly appreciated though, so if you'd like to test any of it before then, PM me and I'll send you the patches as they are.

Regards,

Nick.

The discussion might have continued from here.