Lines Matching +full:c +full:- +full:22
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2013 Luiz Otavio O Souza.
5 * Copyright (c) 2011-2012 Stefan Bethke.
6 * Copyright (c) 2012 Adrian Chadd.
7 * Copyright (C) 2008 Patrick Horn.
8 * Copyright (C) 2008, 2010 Martin Mares.
64 ip17x_writephy(sc->sc_dev, IP175D_RESET_PHY, IP175D_RESET_REG, 0x175d); in ip175d_reset()
68 ip17x_updatephy(sc->sc_dev, 21, 22, 0x3, 0x0); in ip175d_reset()
71 ip17x_writephy(sc->sc_dev, 22, 3, 0x8100); in ip175d_reset()
96 v = &sc->vlan[i]; in ip175d_hw_setup()
97 if ((v->vlanid & ETHERSWITCH_VID_VALID) == 0 || in ip175d_hw_setup()
98 sc->vlan_mode == 0) { in ip175d_hw_setup()
100 ip17x_writephy(sc->sc_dev, 22, 14 + i, i + 1); in ip175d_hw_setup()
106 ports[i] = v->ports; in ip175d_hw_setup()
109 ip17x_writephy(sc->sc_dev, 22, 14 + i, in ip175d_hw_setup()
110 v->vlanid & ETHERSWITCH_VID_MASK); in ip175d_hw_setup()
115 if (sc->addtag & (1 << j)) in ip175d_hw_setup()
117 if (sc->striptag & (1 << j)) in ip175d_hw_setup()
124 ip17x_writephy(sc->sc_dev, 23, i, in ip175d_hw_setup()
126 ip17x_writephy(sc->sc_dev, 23, i + 8, in ip175d_hw_setup()
128 ip17x_writephy(sc->sc_dev, 23, i + 16, in ip175d_hw_setup()
133 ip17x_writephy(sc->sc_dev, 22, 10, vlan_mask); in ip175d_hw_setup()
136 for (i = 0; i < sc->numports; i++) in ip175d_hw_setup()
137 ip17x_writephy(sc->sc_dev, 22, 4 + i, sc->pvid[i]); in ip175d_hw_setup()
152 * VLAN classification rules: tag-based VLANs, in ip175d_set_vlan_mode()
156 ip17x_updatephy(sc->sc_dev, 22, 0, 0x3fff, 0x003f); in ip175d_set_vlan_mode()
157 sc->vlan_mode = mode; in ip175d_set_vlan_mode()
160 sc->vlan_mode = mode; in ip175d_set_vlan_mode()
167 ip17x_updatephy(sc->sc_dev, 22, 0, 0xbfff, 0x8000); in ip175d_set_vlan_mode()
168 sc->vlan_mode = 0; in ip175d_set_vlan_mode()
172 if (sc->vlan_mode != 0) { in ip175d_set_vlan_mode()
178 ip17x_updatephy(sc->sc_dev, 22, 1, 0x0fff, 0x0c3f); in ip175d_set_vlan_mode()
181 ip17x_updatephy(sc->sc_dev, 22, 2, 0x0fff, 0x0000); in ip175d_set_vlan_mode()
183 ip17x_updatephy(sc->sc_dev, 22, 1, 0x0fff, 0x043f); in ip175d_set_vlan_mode()
184 ip17x_updatephy(sc->sc_dev, 22, 2, 0x0fff, 0x0020); in ip175d_set_vlan_mode()
188 ip17x_reset_vlans(sc, sc->vlan_mode); in ip175d_set_vlan_mode()
203 return (sc->vlan_mode); in ip175d_get_vlan_mode()
210 sc->hal.ip17x_reset = ip175d_reset; in ip175d_attach()
211 sc->hal.ip17x_hw_setup = ip175d_hw_setup; in ip175d_attach()
212 sc->hal.ip17x_get_vlan_mode = ip175d_get_vlan_mode; in ip175d_attach()
213 sc->hal.ip17x_set_vlan_mode = ip175d_set_vlan_mode; in ip175d_attach()
216 sc->cpuport = IP175X_CPU_PORT; in ip175d_attach()
217 sc->numports = IP175X_NUM_PORTS; in ip175d_attach()
218 sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q; in ip175d_attach()
220 device_printf(sc->sc_dev, "type: IP175D\n"); in ip175d_attach()