From owner-freebsd-current@freebsd.org Sat Jul 30 17:00:49 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9BB2BA79D3 for ; Sat, 30 Jul 2016 17:00:49 +0000 (UTC) (envelope-from dnelson_1901@yahoo.com) Received: from nm33.bullet.mail.gq1.yahoo.com (nm33.bullet.mail.gq1.yahoo.com [98.136.217.16]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD8121164 for ; Sat, 30 Jul 2016 17:00:49 +0000 (UTC) (envelope-from dnelson_1901@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1469898043; bh=gOSdPAm0JmKyhgpZURAczL8FixIkjYJUrqjn4ePXlrk=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=ciGBNIBs95FTF8y8P4jYR5qKzNSnMnJ+M/9sxwq75uMsY/nMsPhio5lNoLucBqkzC14e/oTK9tpQLR//5VcpAMPPi0BpMEuCOGsEOFWiMTGCykNpA9d7d9ahkzX+FdF4a6z1T1fbevUxtzo75EVzPn9RHk+xzoqnLpOpobKZuIL3wCGWnQTFGAt0UZV9ZGbzoUmMTUHrpwaNiBfcCn3nkYx2nwUYt0n/riCscfQ6JG76W0/L9PmIKoAO7wRFt0L+CIWi6tR+O7XThrDaCjz4eZifE2cgRDOnCYlFDSIU5ahrCHPCMPd0yz9gklwPlnn8ASZCdRRo7uLqTSPDqKDqxg== Received: from [127.0.0.1] by nm33.bullet.mail.gq1.yahoo.com with NNFMP; 30 Jul 2016 17:00:43 -0000 Received: from [216.39.60.183] by nm33.bullet.mail.gq1.yahoo.com with NNFMP; 30 Jul 2016 16:57:44 -0000 Received: from [98.137.12.214] by tm19.bullet.mail.gq1.yahoo.com with NNFMP; 30 Jul 2016 16:57:44 -0000 Received: from [127.0.0.1] by omp1022.mail.gq1.yahoo.com with NNFMP; 30 Jul 2016 16:57:44 -0000 X-Yahoo-Newman-Property: ymail-4 X-Yahoo-Newman-Id: 303973.65347.bm@omp1022.mail.gq1.yahoo.com X-YMail-OSG: jdnxWWcVM1lMZhfCLw4J.TqHHsuhUatbMEJzOsiXoppYX802FbxRIxkr4CSADfB Z3Vu27Z6vGVX3TgsoQEkrokBQP9U_V.zu0O9IeGscbXcNAY7eZXv8buF0KSEVB2iKZGOZqjmvrYK oAOOT4ZYnQpy3VbPgPZ0_KlZcJ0CQKHgRkE.4Y5FhtfpO.o.A2SO1QdebW2Fg2EkoYSA4zO_8BKd 5TDyyFZd_RCV8P4vJN616Wk2m1PKUoqXQoG5yHoocxO3hskslmCRPUB223UWSCXHCojy96Y0YAv7 d8.GFOLkr67_j_GkIl5Toe78vclbCXpMNaKtFMuID_FI_Ph4a0UAvRgfUr3N9J9n.rzSy83r3Rw9 ymLRkEa6SleyunDip5LOX7XfXNay7AlrcSAIOAyf8XBN8gxr3eHr2g.zLhzyJ0XHqkoqwD.VcsIs C7opV1Hq88HyXyFZhkySFsAZ7wgYqK5a.MFyfCJrkzl7RLAI3fvO.JjcMGSsW3QFfMcN4BkDDlgk WRrViCazu.yVvVw9azI7vyo8GmLzmznp9GDw6wkMWXbStEQ-- Received: from jws10745.mail.gq1.yahoo.com by sendmailws131.mail.gq1.yahoo.com; Sat, 30 Jul 2016 16:57:43 +0000; 1469897863.948 Date: Sat, 30 Jul 2016 16:57:43 +0000 (UTC) From: Dan Nelson Reply-To: Dan Nelson To: "freebsd-current@freebsd.org" Message-ID: <1332109611.8713594.1469897863672.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <315070490.8622006.1469859063414.JavaMail.yahoo@mail.yahoo.com> References: <315070490.8622006.1469859063414.JavaMail.yahoo.ref@mail.yahoo.com> <315070490.8622006.1469859063414.JavaMail.yahoo@mail.yahoo.com> Subject: Re: AR8327 Etherswitch led control patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 30 Jul 2016 18:56:44 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2016 17:00:50 -0000 The patch has also been filed as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211462 . ----- Original Message ----- From: Dan Nelson To: "freebsd-current@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@yahoo.com