From owner-freebsd-mips@FreeBSD.ORG Tue Jul 1 17:20:49 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36358D14; Tue, 1 Jul 2014 17:20:49 +0000 (UTC) Received: from mail-qa0-x229.google.com (mail-qa0-x229.google.com [IPv6:2607:f8b0:400d:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCC252934; Tue, 1 Jul 2014 17:20:48 +0000 (UTC) Received: by mail-qa0-f41.google.com with SMTP id cm18so7988567qab.14 for ; Tue, 01 Jul 2014 10:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=2sX0afjjrgqm1YeFApaMS6pfiFjnjB2C8uS0RKDZRT8=; b=fxuMUSCrLScHeOtSRykIPO9dgkjqjKQfK88T1ttfLg+K60woz7SAxvDVktro+o0BLK QN+PsDiUIllzFX0dZ1Ps0xGRTUQ33W7ExmGrh4HgVFwTg5ZNF2E7jtK+9AtgGUFchlon Pr+3Git7SBSclbVnRQu0X6mjS+/RoD6bIqDhAPE2zMtMJvuWKiJNRDuhaJFcm/xS0TKe 0bPuTYL9s5i92Gh06GPWE78VnP6fdkv3pOmXI+jS4ECc+h4CixZdHqkzPzJF6osENNwx JH4lqdXnDYtwLMuJXUn77H8PcFkmgB5a3jIo4j4aYZxonis/BEdLwRHo+DQZCnvAUTP/ 6jJQ== MIME-Version: 1.0 X-Received: by 10.140.34.195 with SMTP id l61mr70934926qgl.87.1404235248061; Tue, 01 Jul 2014 10:20:48 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.202.193 with HTTP; Tue, 1 Jul 2014 10:20:47 -0700 (PDT) In-Reply-To: <201407011433.s61EXmO7010598@svn.freebsd.org> References: <201407011433.s61EXmO7010598@svn.freebsd.org> Date: Tue, 1 Jul 2014 10:20:47 -0700 X-Google-Sender-Auth: rqiYKgw9TZs7Limr1YpKVatb23c Message-ID: Subject: Re: svn commit: r268093 - head/sys/dev/etherswitch/rtl8366 From: Adrian Chadd To: Luiz Otavio O Souza , "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 17:20:49 -0000 Woo, thanks! -a On 1 July 2014 07:33, Luiz Otavio O Souza wrote: > Author: loos > Date: Tue Jul 1 14:33:48 2014 > New Revision: 268093 > URL: http://svnweb.freebsd.org/changeset/base/268093 > > Log: > Add the CPU port flag to the CPU port on rtl8366 (port 5). > > Do not allow any media change on the switch CPU port. > > Tested on TP-Link WR1043ND. > > Modified: > head/sys/dev/etherswitch/rtl8366/rtl8366rb.c > head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h > > Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c > ============================================================================== > --- head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Tue Jul 1 14:12:59 2014 (r268092) > +++ head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Tue Jul 1 14:33:48 2014 (r268093) > @@ -570,6 +570,7 @@ rtl_getport(device_t dev, etherswitch_po > return (err); > } else { > /* fill in fixed values for CPU port */ > + p->es_flags |= ETHERSWITCH_PORT_CPU; > ifmr->ifm_count = 0; > smi_read(dev, RTL8366RB_PLSR_BASE + (RTL8366RB_NUM_PHYS)/2, &v, RTL_WAITOK); > v = v >> (8 * ((RTL8366RB_NUM_PHYS) % 2)); > @@ -606,6 +607,8 @@ rtl_setport(device_t dev, etherswitch_po > RTL8366RB_PVCR_VAL(p->es_port, vlangroup), RTL_WAITOK); > if (err) > return (err); > + if (p->es_port == RTL8366RB_CPU_PORT) > + return (0); > mii = device_get_softc(sc->miibus[p->es_port]); > ifm = &mii->mii_media; > err = ifmedia_ioctl(sc->ifp[p->es_port], &p->es_ifr, ifm, SIOCSIFMEDIA); > > Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h > ============================================================================== > --- head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h Tue Jul 1 14:12:59 2014 (r268092) > +++ head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h Tue Jul 1 14:33:48 2014 (r268093) > @@ -168,9 +168,10 @@ > (RTL8366RB_PACR | (1 << (((phy) & 0x1f) + 9)) | (((page) & 0xf) << 5) | ((reg) & 0x1f)) > > /* general characteristics of the chip */ > -#define RTL8366RB_NUM_PORTS 6 > -#define RTL8366RB_NUM_PHYS (RTL8366RB_NUM_PORTS-1) > -#define RTL8366RB_NUM_VLANS 16 > -#define RTL8366RB_NUM_PHY_REG 32 > +#define RTL8366RB_CPU_PORT 5 > +#define RTL8366RB_NUM_PORTS 6 > +#define RTL8366RB_NUM_PHYS (RTL8366RB_NUM_PORTS-1) > +#define RTL8366RB_NUM_VLANS 16 > +#define RTL8366RB_NUM_PHY_REG 32 > > #endif >