ip175d.c (250386) | ip175d.c (253569) |
---|---|
1/*- 2 * Copyright (c) 2013 Luiz Otavio O Souza. 3 * Copyright (c) 2011-2012 Stefan Bethke. 4 * Copyright (c) 2012 Adrian Chadd. 5 * Copyright (C) 2008 Patrick Horn. 6 * Copyright (C) 2008, 2010 Martin Mares. 7 * All rights reserved. 8 * --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * | 1/*- 2 * Copyright (c) 2013 Luiz Otavio O Souza. 3 * Copyright (c) 2011-2012 Stefan Bethke. 4 * Copyright (c) 2012 Adrian Chadd. 5 * Copyright (C) 2008 Patrick Horn. 6 * Copyright (C) 2008, 2010 Martin Mares. 7 * All rights reserved. 8 * --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * |
30 * $FreeBSD: head/sys/dev/etherswitch/ip17x/ip175d.c 250386 2013-05-08 20:58:41Z adrian $ | 30 * $FreeBSD: head/sys/dev/etherswitch/ip17x/ip175d.c 253569 2013-07-23 13:56:38Z loos $ |
31 */ 32 33#include <sys/param.h> 34#include <sys/bus.h> 35#include <sys/kernel.h> 36#include <sys/lock.h> 37#include <sys/mutex.h> 38#include <sys/systm.h> --- 50 unchanged lines hidden (view full) --- 89 vlan_mask = 0; 90 for (i = 0; i < IP17X_MAX_VLANS; i++) { 91 92 ports[i] = 0; 93 addtag[i] = 0; 94 striptag[i] = 0; 95 96 v = &sc->vlan[i]; | 31 */ 32 33#include <sys/param.h> 34#include <sys/bus.h> 35#include <sys/kernel.h> 36#include <sys/lock.h> 37#include <sys/mutex.h> 38#include <sys/systm.h> --- 50 unchanged lines hidden (view full) --- 89 vlan_mask = 0; 90 for (i = 0; i < IP17X_MAX_VLANS; i++) { 91 92 ports[i] = 0; 93 addtag[i] = 0; 94 striptag[i] = 0; 95 96 v = &sc->vlan[i]; |
97 if (v->vlanid == 0 || sc->vlan_mode == 0) { | 97 if ((v->vlanid & ETHERSWITCH_VID_VALID) == 0 || 98 sc->vlan_mode == 0) { |
98 /* Vlangroup disabled. Reset the filter. */ 99 ip17x_writephy(sc->sc_dev, 22, 14 + i, i + 1); 100 ports[i] = 0x3f; 101 continue; 102 } 103 104 vlan_mask |= (1 << i); 105 ports[i] = v->ports; 106 107 /* Setup the filter, write the VLAN id. */ | 99 /* Vlangroup disabled. Reset the filter. */ 100 ip17x_writephy(sc->sc_dev, 22, 14 + i, i + 1); 101 ports[i] = 0x3f; 102 continue; 103 } 104 105 vlan_mask |= (1 << i); 106 ports[i] = v->ports; 107 108 /* Setup the filter, write the VLAN id. */ |
108 ip17x_writephy(sc->sc_dev, 22, 14 + i, v->vlanid); | 109 ip17x_writephy(sc->sc_dev, 22, 14 + i, 110 v->vlanid & ETHERSWITCH_VID_MASK); |
109 110 for (j = 0; j < MII_NPHY; j++) { 111 if ((ports[i] & (1 << j)) == 0) 112 continue; 113 if (sc->addtag & (1 << j)) 114 addtag[i] |= (1 << j); 115 if (sc->striptag & (1 << j)) 116 striptag[i] |= (1 << j); --- 103 unchanged lines hidden --- | 111 112 for (j = 0; j < MII_NPHY; j++) { 113 if ((ports[i] & (1 << j)) == 0) 114 continue; 115 if (sc->addtag & (1 << j)) 116 addtag[i] |= (1 << j); 117 if (sc->striptag & (1 << j)) 118 striptag[i] |= (1 << j); --- 103 unchanged lines hidden --- |