From owner-freebsd-hackers@FreeBSD.ORG Mon May 9 06:30:23 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EB19106564A for ; Mon, 9 May 2011 06:30:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5C85E8FC0C for ; Mon, 9 May 2011 06:30:23 +0000 (UTC) Received: by yxl31 with SMTP id 31so2128709yxl.13 for ; Sun, 08 May 2011 23:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=fLIH5hp2/HtG4m22V7Y+rIUafiOIpKE0OoQ6gA6T51o=; b=NdequTnw8OosD4fKal1G3UmLHsuwAhOLrilvHYn6sPao/zEIcfLILAjfZFuyf2qlwE NWyvK4INd+/ZtvJs717RGsmxsGSduHRzkjNSDeVL+fBIJveP6DU6XmO2LHphc6gw3/QG hsacRW6SI9d2zkk1aho1gk0oEMHxXTotjvoeE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=QMkW+s8whCm7ll4qZR7iWl+aAJyR68kOKxZvLfDGs0h5lr+9VsnnGXkiTNoEfN+Kc0 zY+mxXJWraVxszBI0mmyANxZqeSRj+9IIXkuEQjY3V9+fRXT/gOe/Tdebe6YemMANikr ArHciZfHGSVe21oLEC/nBpyOwQ6bT68n/+Zck= MIME-Version: 1.0 Received: by 10.151.5.14 with SMTP id h14mr5350928ybi.182.1304922622665; Sun, 08 May 2011 23:30:22 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.136.8 with HTTP; Sun, 8 May 2011 23:30:22 -0700 (PDT) In-Reply-To: <20110508131643.GA23650@alchemy.franken.de> References: <34CF3ED0-52BC-4D0E-922A-FE26F624E77F@gmail.com> <20110508131643.GA23650@alchemy.franken.de> Date: Mon, 9 May 2011 14:30:22 +0800 X-Google-Sender-Auth: 88tCoBu6kFoPMUWzwnVWWpEemj4 Message-ID: From: Adrian Chadd To: Marius Strobl Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, Damjan Marion Subject: Re: Embedded switch instead of stadard PHY 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: Mon, 09 May 2011 06:30:23 -0000 On 8 May 2011 21:16, Marius Strobl wrote: [snip] > Depends on what you understand by properly. One idea I particularly > like is to handle switch ports as pseudo-interfaces hanging off of the > the MAC driver parent roughly similar to vlan(4). That way you'd have > per port link status and could configure the media. The reason I like this is because I realise that these switch PHYs tend to have quite a bit of varying but useful functionality, that isn't just "multi-port single-VLAN switch PHY." Besides there being per-port status, there can also be per-port error/packet/byte counts, VLAN setups (tagged/untagged), QoS configuration, sometimes some L2 filtering and (even more creepy) sometimes L3 filtering/routing. They can sometimes hang off the MII bus, but ISTR datasheets which show they can hang off an SPI bus too. So although they can look like PHYs complete with the register layouts, there's extended commands to implement other features as well. There may even be more than one CPU ethernet port hooked up - I think the Routerstation Pro has both CPU GigE ports wired to the switch PHY and defaults to mapping port 1 -> arge0 and Port 2,3,4,5 -> arge1. I'd really appreciate it if someone were able to sit down, take the existing work done by Luiz and others and flesh out a bare minimum set of switch PHY drivers that configure them with some sensible defaults (rather than leaving it up to the boot firmware to do it for you) and have all of the interface/configuration glue in the kernel. As I said earlier, figuring out how to expose all the functionality - including per-port error counts and such - can come later. Adrian