Lines Matching refs:sc_dev
150 snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->sc_dev)); in arswitch_attach_phys()
160 err = mii_attach(sc->sc_dev, &sc->miibus[phy], sc->ifp[phy], in arswitch_attach_phys()
164 DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n", in arswitch_attach_phys()
169 device_printf(sc->sc_dev, in arswitch_attach_phys()
237 arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(0), in ar8xxx_port_init()
245 arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0), in ar8xxx_port_init()
246 arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0)) & in ar8xxx_port_init()
250 arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(port), in ar8xxx_port_init()
252 arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(port), in ar8xxx_port_init()
253 arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(port)) & in ar8xxx_port_init()
265 ret = arswitch_waitreg(sc->sc_dev, in ar8xxx_atu_wait_ready()
288 device_printf(sc->sc_dev, "%s: waitreg failed\n", __func__); in ar8xxx_atu_flush()
291 arswitch_writereg(sc->sc_dev, in ar8xxx_atu_flush()
321 device_printf(sc->sc_dev, "%s: waitreg failed\n", __func__); in ar8xxx_atu_flush_port()
324 arswitch_writereg(sc->sc_dev, in ar8xxx_atu_flush_port()
353 arswitch_writereg(sc->sc_dev, in ar8xxx_atu_fetch_table()
355 arswitch_writereg(sc->sc_dev, in ar8xxx_atu_fetch_table()
357 arswitch_writereg(sc->sc_dev, in ar8xxx_atu_fetch_table()
370 val = arswitch_readreg(sc->sc_dev, AR8216_REG_ATU); in ar8xxx_atu_fetch_table()
372 arswitch_writereg(sc->sc_dev, AR8216_REG_ATU, val); in ar8xxx_atu_fetch_table()
378 ret0 = arswitch_readreg(sc->sc_dev, AR8216_REG_ATU); in ar8xxx_atu_fetch_table()
379 ret1 = arswitch_readreg(sc->sc_dev, AR8216_REG_ATU_DATA); in ar8xxx_atu_fetch_table()
380 ret2 = arswitch_readreg(sc->sc_dev, AR8216_REG_ATU_CTRL2); in ar8xxx_atu_fetch_table()
437 ret = arswitch_writereg(sc->sc_dev, in ar8xxx_atu_learn_default()
442 device_printf(sc->sc_dev, "%s: writereg failed\n", __func__); in ar8xxx_atu_learn_default()
464 ret0 = arswitch_readreg(sc->sc_dev, AR8X16_REG_SW_MAC_ADDR0); in ar8xxx_hw_get_switch_macaddr()
465 ret1 = arswitch_readreg(sc->sc_dev, AR8X16_REG_SW_MAC_ADDR1); in ar8xxx_hw_get_switch_macaddr()
502 sc->sc_dev = dev; in arswitch_attach()
509 ctx = device_get_sysctl_ctx(sc->sc_dev); in arswitch_attach()
510 tree = device_get_sysctl_tree(sc->sc_dev); in arswitch_attach()
520 device_printf(sc->sc_dev, "%s: failed to allocate ATU table\n", in arswitch_attach()
781 portstatus = arswitch_readreg(sc->sc_dev, in arswitch_miipollstat()
784 portstatus = arswitch_readreg(sc->sc_dev, in arswitch_miipollstat()
800 device_printf(sc->sc_dev, "%s: port %d: port -> UP\n", in arswitch_miipollstat()
810 device_printf(sc->sc_dev, "%s: port %d: port -> DOWN\n", in arswitch_miipollstat()
876 reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(p->es_port)); in ar8xxx_port_vlan_get()
998 err = arswitch_modifyreg(sc->sc_dev, in ar8xxx_port_vlan_setup()
1067 err = (arswitch_modifyreg(sc->sc_dev, in arswitch_setled()