Lines Matching refs:swsc

1001 	sc->swsc = device_get_softc(sc->pdev);  in cpswp_attach()
1003 sc->phy = sc->swsc->port[sc->unit].phy; in cpswp_attach()
1004 sc->vlan = sc->swsc->port[sc->unit].vlan; in cpswp_attach()
1005 if (sc->swsc->dualemac && sc->vlan == -1) in cpswp_attach()
1031 if_setsendqlen(ifp, sc->swsc->tx.queue_slots); in cpswp_attach()
1075 cpsw_write_4(sc->swsc, sc->physel, in cpswp_attach()
1095 CPSW_DEBUGF(sc->swsc, ("")); in cpswp_detach()
1139 CPSW_DEBUGF(sc->swsc, ("")); in cpswp_init()
1155 CPSW_DEBUGF(sc->swsc, ("")); in cpswp_init_locked()
1163 if (!sc->swsc->rx.running && !sc->swsc->tx.running) { in cpswp_init_locked()
1165 cpsw_reset(sc->swsc); in cpswp_init_locked()
1166 cpsw_init(sc->swsc); in cpswp_init_locked()
1170 cpsw_write_4(sc->swsc, CPSW_SL_RX_PRI_MAP(sc->unit), 0x76543210); in cpswp_init_locked()
1171 cpsw_write_4(sc->swsc, CPSW_PORT_P_TX_PRI_MAP(sc->unit + 1), in cpswp_init_locked()
1173 cpsw_write_4(sc->swsc, CPSW_SL_RX_MAXLEN(sc->unit), 0x5f2); in cpswp_init_locked()
1177 reg = cpsw_read_4(sc->swsc, CPSW_SL_MACCONTROL(sc->unit)); in cpswp_init_locked()
1179 cpsw_write_4(sc->swsc, CPSW_SL_MACCONTROL(sc->unit), reg); in cpswp_init_locked()
1182 cpsw_write_4(sc->swsc, CPSW_ALE_PORTCTL(sc->unit + 1), in cpswp_init_locked()
1186 if (sc->swsc->dualemac) { in cpswp_init_locked()
1188 cpsw_write_4(sc->swsc, CPSW_PORT_P_VLAN(sc->unit + 1), in cpswp_init_locked()
1190 cpsw_ale_update_vlan_table(sc->swsc, sc->vlan, in cpswp_init_locked()
1287 CPSW_DEBUGF(sc->swsc, ("")); in cpswp_stop_locked()
1301 if (cpsw_ports_down(sc->swsc)) { in cpswp_stop_locked()
1302 cpsw_rx_teardown(sc->swsc); in cpswp_stop_locked()
1303 cpsw_tx_teardown(sc->swsc); in cpswp_stop_locked()
1307 reg = cpsw_read_4(sc->swsc, CPSW_SL_MACCONTROL(sc->unit)); in cpswp_stop_locked()
1309 cpsw_write_4(sc->swsc, CPSW_SL_MACCONTROL(sc->unit), reg); in cpswp_stop_locked()
1311 if (cpsw_ports_down(sc->swsc)) { in cpswp_stop_locked()
1313 cpsw_stats_collect(sc->swsc); in cpswp_stop_locked()
1315 cpsw_reset(sc->swsc); in cpswp_stop_locked()
1316 cpsw_init(sc->swsc); in cpswp_stop_locked()
1374 reg = cpsw_read_4(sc->swsc, CPSW_ALE_CONTROL); in cpsw_set_promisc()
1378 cpsw_write_4(sc->swsc, CPSW_ALE_CONTROL, reg); in cpsw_set_promisc()
1417 CPSW_DEBUGF(sc->swsc, in cpswp_ioctl()
1427 CPSW_DEBUGF(sc->swsc, in cpswp_ioctl()
1432 CPSW_DEBUGF(sc->swsc, ("SIOCSIFFLAGS: shutting down")); in cpswp_ioctl()
1485 if (!cpswp_miibus_ready(sc->swsc, sc->phyaccess)) { in cpswp_miibus_readreg()
1492 cpsw_write_4(sc->swsc, sc->phyaccess, cmd); in cpswp_miibus_readreg()
1494 if (!cpswp_miibus_ready(sc->swsc, sc->phyaccess)) { in cpswp_miibus_readreg()
1499 r = cpsw_read_4(sc->swsc, sc->phyaccess); in cpswp_miibus_readreg()
1514 if (!cpswp_miibus_ready(sc->swsc, sc->phyaccess)) { in cpswp_miibus_writereg()
1522 cpsw_write_4(sc->swsc, sc->phyaccess, cmd); in cpswp_miibus_writereg()
1524 if (!cpswp_miibus_ready(sc->swsc, sc->phyaccess)) { in cpswp_miibus_writereg()
1539 CPSW_DEBUGF(sc->swsc, ("")); in cpswp_miibus_statchg()
1542 mac_control = cpsw_read_4(sc->swsc, reg); in cpswp_miibus_statchg()
1561 cpsw_write_4(sc->swsc, reg, mac_control); in cpswp_miibus_statchg()
1813 sc->swsc->tx.running == 0) { in cpswp_start()
1816 CPSW_TX_LOCK(sc->swsc); in cpswp_start()
1818 cpsw_tx_dequeue(sc->swsc); in cpswp_start()
1819 CPSW_TX_UNLOCK(sc->swsc); in cpswp_start()
1848 last_old_slot = STAILQ_LAST(&sc->swsc->tx.active, cpsw_slot, next); in cpswp_tx_enqueue()
1849 while ((slot = STAILQ_FIRST(&sc->swsc->tx.avail)) != NULL) { in cpswp_tx_enqueue()
1859 m_append(slot->mbuf, padlen, sc->swsc->nullpad); in cpswp_tx_enqueue()
1862 error = bus_dmamap_load_mbuf_sg(sc->swsc->mbuf_dtag, in cpswp_tx_enqueue()
1866 (error == 0 && nsegs > sc->swsc->tx.avail_queue_len)) { in cpswp_tx_enqueue()
1867 bus_dmamap_unload(sc->swsc->mbuf_dtag, slot->dmamap); in cpswp_tx_enqueue()
1874 CPSW_DEBUGF(sc->swsc, in cpswp_tx_enqueue()
1885 bus_dmamap_unload(sc->swsc->mbuf_dtag, slot->dmamap); in cpswp_tx_enqueue()
1891 bus_dmamap_sync(sc->swsc->mbuf_dtag, slot->dmamap, in cpswp_tx_enqueue()
1894 CPSW_DEBUGF(sc->swsc, in cpswp_tx_enqueue()
1903 cpsw_cpdma_write_bd_next(sc->swsc, last, slot); in cpswp_tx_enqueue()
1912 bd.next = cpsw_cpdma_bd_paddr(sc->swsc, next); in cpswp_tx_enqueue()
1921 if (sc->swsc->dualemac) { in cpswp_tx_enqueue()
1927 cpsw_cpdma_write_bd(sc->swsc, slot, &bd); in cpswp_tx_enqueue()
1928 STAILQ_REMOVE_HEAD(&sc->swsc->tx.avail, next); in cpswp_tx_enqueue()
1929 STAILQ_INSERT_TAIL(&sc->swsc->tx.active, slot, next); in cpswp_tx_enqueue()
1930 slot = STAILQ_FIRST(&sc->swsc->tx.avail); in cpswp_tx_enqueue()
1935 bd.next = cpsw_cpdma_bd_paddr(sc->swsc, next); in cpswp_tx_enqueue()
1947 cpsw_cpdma_write_bd(sc->swsc, slot, &bd); in cpswp_tx_enqueue()
1948 STAILQ_REMOVE_HEAD(&sc->swsc->tx.avail, next); in cpswp_tx_enqueue()
1949 STAILQ_INSERT_TAIL(&sc->swsc->tx.active, slot, next); in cpswp_tx_enqueue()
1953 if (nsegs > sc->swsc->tx.longest_chain) in cpswp_tx_enqueue()
1954 sc->swsc->tx.longest_chain = nsegs; in cpswp_tx_enqueue()
1964 (cpsw_cpdma_read_bd_flags(sc->swsc, last_old_slot) & in cpswp_tx_enqueue()
1967 cpsw_cpdma_write_bd_next(sc->swsc, last_old_slot, in cpswp_tx_enqueue()
1971 cpsw_write_hdp_slot(sc->swsc, &sc->swsc->tx, first_new_slot); in cpswp_tx_enqueue()
1973 sc->swsc->tx.queue_adds += added; in cpswp_tx_enqueue()
1974 sc->swsc->tx.avail_queue_len -= added; in cpswp_tx_enqueue()
1975 sc->swsc->tx.active_queue_len += added; in cpswp_tx_enqueue()
1976 if (sc->swsc->tx.active_queue_len > sc->swsc->tx.max_active_queue_len) { in cpswp_tx_enqueue()
1977 sc->swsc->tx.max_active_queue_len = sc->swsc->tx.active_queue_len; in cpswp_tx_enqueue()
1979 CPSW_DEBUGF(sc->swsc, ("Queued %d TX packet(s)", added)); in cpswp_tx_enqueue()
2221 CPSW_DEBUGF(sc->swsc, ("")); in cpswp_ifmedia_sts()
2238 CPSW_DEBUGF(sc->swsc, ("")); in cpswp_ifmedia_upd()
2440 if (sc->swsc->dualemac) in cpswp_set_maddr()
2445 cpsw_ale_mc_entry_set(sc->swsc, portmask, sc->vlan, LLADDR(sdl)); in cpswp_set_maddr()
2456 if (sc->swsc->dualemac) { in cpswp_ale_update_addresses()
2473 cpsw_ale_write_entry(sc->swsc, 0 + 2 * sc->unit, ale_entry); in cpswp_ale_update_addresses()
2476 cpsw_write_4(sc->swsc, CPSW_PORT_P_SA_HI(sc->unit + 1), in cpswp_ale_update_addresses()
2478 cpsw_write_4(sc->swsc, CPSW_PORT_P_SA_LO(sc->unit + 1), in cpswp_ale_update_addresses()
2486 cpsw_ale_write_entry(sc->swsc, 1 + 2 * sc->unit, ale_entry); in cpswp_ale_update_addresses()
2491 cpsw_ale_remove_all_mc_entries(sc->swsc); in cpswp_ale_update_addresses()
2652 struct cpsw_softc *swsc; in cpsw_stat_uptime() local
2657 swsc = arg1; in cpsw_stat_uptime()
2658 sc = device_get_softc(swsc->port[arg2].dev); in cpsw_stat_uptime()