From owner-freebsd-embedded@FreeBSD.ORG Thu Dec 8 12:52:40 2011 Return-Path: Delivered-To: embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FDD5106564A for ; Thu, 8 Dec 2011 12:52:40 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id E35A38FC18 for ; Thu, 8 Dec 2011 12:52:39 +0000 (UTC) Received: from terran.dlink.ua (unknown [192.168.10.90]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id 1630BC4934; Thu, 8 Dec 2011 14:36:17 +0200 (EET) Date: Thu, 8 Dec 2011 14:36:30 +0200 From: Aleksandr Rybalko To: Stefan Bethke Message-Id: <20111208143630.8bfa62c9.ray@dlink.ua> In-Reply-To: <2B013790-6DB4-4E1A-857C-5EC39F4F71C9@lassitu.de> References: <20111110014904.0e8caf2c.ray@ddteam.net> <2B013790-6DB4-4E1A-857C-5EC39F4F71C9@lassitu.de> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: embedded@freebsd.org Subject: Re: Ethernet switch framework X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2011 12:52:40 -0000 On Mon, 5 Dec 2011 00:16:45 +0100 Stefan Bethke wrote: >> Hi Alexsandr, >> >> I'v now created a driver for my RTL8366RB, and I can load and unload >> it, and have it initialize the switch. >> >> I've tried to understand how the pieces fit together in your switch >> framework, and how I would integrate my driver with it. Any chance >> you could give me quick run through how the userland device, the >> switch bus and the individual switch drivers are talking to each >> other? Hi Stefan, sorry for delay, need at least two more clones of myself :) no problem, but currently switch framework very broken :) But let me explain how it must works. sys/dev/switch: switch.c - core logic switch_if.m - newbus methods to call from core to drv switchb_if.m - newbus methods to call from drv to core switch_ioctl.h - driver IOCTL, exported to userland for switchctl switch_${busglue}.c - glue to attach to different buses (mii, obio, iicbus, spi), currently works (somehow) mii and obio. ${family}_switch.c - switch driver ${family}_switchreg.h - switch registers definitions ${family}_switchvar.h - per driver structures sbin/switchctl - still dumb tool for switch manipulation most useful thing of it - get/set reg :) Ohh, need write many manuals for it, but still busy with servers @job. Anyway, questions/comments are welcomed! >> >> >> Thanks, >> Stefan >> >> -- >> Stefan Bethke Fon +49 151 14070811 >> >> >> WBW -- Alexandr Rybalko aka Alex RAY