Lines Matching refs:sc_dev
177 snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->sc_dev)); in arswitch_attach_phys()
181 device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); in arswitch_attach_phys()
193 err = mii_attach(sc->sc_dev, &sc->miibus[phy], sc->ifp[phy], in arswitch_attach_phys()
197 DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n", in arswitch_attach_phys()
202 device_printf(sc->sc_dev, in arswitch_attach_phys()
270 arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(0), in ar8xxx_port_init()
278 arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0), in ar8xxx_port_init()
279 arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0)) & in ar8xxx_port_init()
283 arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(port), in ar8xxx_port_init()
285 arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(port), in ar8xxx_port_init()
286 arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(port)) & in ar8xxx_port_init()
298 ret = arswitch_waitreg(sc->sc_dev, in ar8xxx_atu_wait_ready()
321 device_printf(sc->sc_dev, "%s: waitreg failed\n", __func__); in ar8xxx_atu_flush()
324 arswitch_writereg(sc->sc_dev, in ar8xxx_atu_flush()
354 device_printf(sc->sc_dev, "%s: waitreg failed\n", __func__); in ar8xxx_atu_flush_port()
357 arswitch_writereg(sc->sc_dev, in ar8xxx_atu_flush_port()
386 arswitch_writereg(sc->sc_dev, in ar8xxx_atu_fetch_table()
388 arswitch_writereg(sc->sc_dev, in ar8xxx_atu_fetch_table()
390 arswitch_writereg(sc->sc_dev, in ar8xxx_atu_fetch_table()
403 val = arswitch_readreg(sc->sc_dev, AR8216_REG_ATU); in ar8xxx_atu_fetch_table()
405 arswitch_writereg(sc->sc_dev, AR8216_REG_ATU, val); in ar8xxx_atu_fetch_table()
411 ret0 = arswitch_readreg(sc->sc_dev, AR8216_REG_ATU); in ar8xxx_atu_fetch_table()
412 ret1 = arswitch_readreg(sc->sc_dev, AR8216_REG_ATU_DATA); in ar8xxx_atu_fetch_table()
413 ret2 = arswitch_readreg(sc->sc_dev, AR8216_REG_ATU_CTRL2); in ar8xxx_atu_fetch_table()
470 ret = arswitch_writereg(sc->sc_dev, in ar8xxx_atu_learn_default()
475 device_printf(sc->sc_dev, "%s: writereg failed\n", __func__); in ar8xxx_atu_learn_default()
497 ret0 = arswitch_readreg(sc->sc_dev, AR8X16_REG_SW_MAC_ADDR0); in ar8xxx_hw_get_switch_macaddr()
498 ret1 = arswitch_readreg(sc->sc_dev, AR8X16_REG_SW_MAC_ADDR1); in ar8xxx_hw_get_switch_macaddr()
535 sc->sc_dev = dev; in arswitch_attach()
542 ctx = device_get_sysctl_ctx(sc->sc_dev); in arswitch_attach()
543 tree = device_get_sysctl_tree(sc->sc_dev); in arswitch_attach()
553 device_printf(sc->sc_dev, "%s: failed to allocate ATU table\n", in arswitch_attach()
822 portstatus = arswitch_readreg(sc->sc_dev, in arswitch_miipollstat()
825 portstatus = arswitch_readreg(sc->sc_dev, in arswitch_miipollstat()
841 device_printf(sc->sc_dev, "%s: port %d: port -> UP\n", in arswitch_miipollstat()
851 device_printf(sc->sc_dev, "%s: port %d: port -> DOWN\n", in arswitch_miipollstat()
917 reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(p->es_port)); in ar8xxx_port_vlan_get()
1039 err = arswitch_modifyreg(sc->sc_dev, in ar8xxx_port_vlan_setup()
1108 err = (arswitch_modifyreg(sc->sc_dev, in arswitch_setled()