AR8327 Etherswitch led control patch

Dan Nelson dnelson_1901 at yahoo.com
Sat Jul 30 06:14:00 UTC 2016


I got a TP-Link WDR4300 recently, flashed it to FreeBSD, and decided 
that I needed to be able to control all the LEDs on the front :)  As a 
start, attached is a patch that allows you to manage the five LEDs 
connected to the Atheros AR8327 switch chip it uses.  It extends the 
etherswitch API, allowing up to three LEDs per port to be set to on, 
off, cyclic blink, or default (flash on activity for the 8327).  I added 
an "led" subcommand to the etherswitchcfg tool for full control, and 
also added led(4) nodes for basic on/off control.  This particular 
switch seems to only notice changes to the LED registers twice per 
second, so it's no good for smooth animation, but it works just fine as 
a 5-bit progress bar or error display.


This does break ABI compatibility of the etherswitch ioctl because of 
new elements in the structure.  The code should be generic enough to 
apply easily to other etherswitch chips.

Comments and suggestions welcome.

-- 

Dan Nelson
dnelson_1901 at yahoo.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: etherswitch.diff
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20160730/9b876026/attachment-0001.ksh>


More information about the freebsd-current mailing list