AR8327 Etherswitch led control patch

From: Dan Nelson <dnelson_1901_at_yahoo.com>
Date: Sat, 30 Jul 2016 06:11:03 +0000 (UTC)
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

Received on Sat Jul 30 2016 - 04:14:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:07 UTC