ip175c.c (250386) | ip175c.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 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 2013 Luiz Otavio O Souza. 3 * Copyright (c) 2011-2012 Stefan Bethke. 4 * Copyright (c) 2012 Adrian Chadd. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/dev/etherswitch/ip17x/ip175c.c 250386 2013-05-08 20:58:41Z adrian $ | 28 * $FreeBSD: head/sys/dev/etherswitch/ip17x/ip175c.c 253569 2013-07-23 13:56:38Z loos $ |
29 */ 30 31#include <sys/param.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/systm.h> --- 105 unchanged lines hidden (view full) --- 142 /* Set the VID_IDX_SEL to 0. */ 143 if (ip17x_updatephy(sc->sc_dev, 30, 9, 0x70, 0)) 144 return (-1); 145 146 /* Calculate the port masks. */ 147 memset(vlans, 0, sizeof(vlans)); 148 for (i = 0; i < IP17X_MAX_VLANS; i++) { 149 v = &sc->vlan[i]; | 29 */ 30 31#include <sys/param.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/systm.h> --- 105 unchanged lines hidden (view full) --- 142 /* Set the VID_IDX_SEL to 0. */ 143 if (ip17x_updatephy(sc->sc_dev, 30, 9, 0x70, 0)) 144 return (-1); 145 146 /* Calculate the port masks. */ 147 memset(vlans, 0, sizeof(vlans)); 148 for (i = 0; i < IP17X_MAX_VLANS; i++) { 149 v = &sc->vlan[i]; |
150 if (v->vlanid == 0) | 150 if ((v->vlanid & ETHERSWITCH_VID_VALID) == 0) |
151 continue; | 151 continue; |
152 vlans[v->vlanid] = v->ports; | 152 vlans[v->vlanid & ETHERSWITCH_VID_MASK] = v->ports; |
153 } 154 155 for (j = 0, i = 1; i <= IP17X_MAX_VLANS / 2; i++) { 156 data = vlans[j++] & 0x3f; 157 data |= (vlans[j++] & 0x3f) << 8; 158 if (ip17x_writephy(sc->sc_dev, 30, i, data)) 159 return (-1); 160 } --- 89 unchanged lines hidden --- | 153 } 154 155 for (j = 0, i = 1; i <= IP17X_MAX_VLANS / 2; i++) { 156 data = vlans[j++] & 0x3f; 157 data |= (vlans[j++] & 0x3f) << 8; 158 if (ip17x_writephy(sc->sc_dev, 30, i, data)) 159 return (-1); 160 } --- 89 unchanged lines hidden --- |