From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 2 12:39:28 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DBC3A16A41C for ; Sat, 2 Jul 2005 12:39:28 +0000 (GMT) (envelope-from stsp@stsp.in-berlin.de) Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6EA8543D1F for ; Sat, 2 Jul 2005 12:39:28 +0000 (GMT) (envelope-from stsp@stsp.in-berlin.de) X-Envelope-From: stsp@stsp.in-berlin.de X-Envelope-To: Received: from stud.seeling33.de (p54BE965E.dip0.t-ipconnect.de [84.190.150.94]) (authenticated bits=0) by einhorn.in-berlin.de (8.12.10/8.12.10/Debian-4) with ESMTP id j62CdP1t013520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 2 Jul 2005 14:39:25 +0200 Received: by stud.seeling33.de (Postfix, from userid 1000) id 07710F7CC; Sat, 2 Jul 2005 14:33:25 +0200 (CEST) Date: Sat, 2 Jul 2005 14:33:25 +0200 From: stsp@stsp.in-berlin.de To: freebsd-hackers@freebsd.org Message-ID: <20050702123325.GA13307@stud.seeling33.de> Mail-Followup-To: freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Spam-Score: (-1.063) BAYES_00,FORGED_RCVD_HELO,NO_REAL_NAME X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 Subject: wake on lan support for sis driver (NetSemi chip) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jul 2005 12:39:29 -0000 Hello, I have written a patch that teaches the sis driver to put the NatSemi DP83815 chip into wake on lan mode on system shutdown. A _very_ sketchy, but working, version, that still includes debugging related macro craft that won't be in the final version, can be found at http://stsp.in-berlin.de/wol/ Currently, the patch puts the card into "wake on Magic Packet" mode, and leaves it at that. There is no configurability at all. Ideally, I'd like the wake mode (None (default), Broadcast, Unicast, Magic Packet, etc) and special things like "SecureOn" passwords to be run-time configurable. The best idea I came up with is defining a set of wake on lan related ioctls, and adding commands to ifconfig that use them to hand user requests such as "put my card into wake on broadcast mode, please" down to the driver. With such a framework in place, adding wake on lan support for other cards would only require a driver to implement ioctls that match wake on lan features supported by the driver/chip, and voila, it's run-time configurable as well. This design also creates a unified user interface independent of the underlying driver, pretty much like 'ethtool' does on linux. Is there anything wrong with such a design, or does anyone have a better idea how to make the driver run-time configurable? I am not aware of any other network driver in the tree that implements wake on lan. But if there were any, I would of course adapt my patch to their behaviour. Any comments on the patch in general are also appreciated (Note that I've read style(9) by now, and I know that I need to make a few fixes here and there ;) thanks, stefan