AR8327 Etherswitch led control patch

Dan Nelson dnelson_1901 at yahoo.com
Sat Jul 30 17:00:50 UTC 2016


The patch has also been filed as
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211462 .





----- Original Message -----
From: Dan Nelson <dnelson_1901 at yahoo.com>
To: "freebsd-current at freebsd.org" <freebsd-current at freebsd.org>
Sent: Saturday, July 30, 2016 1:11 AM
Subject: AR8327 Etherswitch led control patch

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


More information about the freebsd-current mailing list