cpsw 74 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = (priv)->cpsw; \ cpsw 76 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac) \ cpsw 77 drivers/net/ethernet/ti/cpsw.c (func)((cpsw)->slaves + priv->emac_port, ##arg);\ cpsw 79 drivers/net/ethernet/ti/cpsw.c for (n = cpsw->data.slaves, \ cpsw 80 drivers/net/ethernet/ti/cpsw.c slave = cpsw->slaves; \ cpsw 95 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 96 drivers/net/ethernet/ti/cpsw.c struct cpsw_ale *ale = cpsw->ale; cpsw 99 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac) { cpsw 106 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->data.slaves; i++) cpsw 107 drivers/net/ethernet/ti/cpsw.c if (cpsw->slaves[i].ndev->flags & IFF_PROMISC) cpsw 130 drivers/net/ethernet/ti/cpsw.c for (i = 0; i <= cpsw->data.slaves; i++) { cpsw 158 drivers/net/ethernet/ti/cpsw.c for (i = 0; i <= cpsw->data.slaves; i++) { cpsw 181 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 185 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac) cpsw 186 drivers/net/ethernet/ti/cpsw.c vid = cpsw->slaves[priv->emac_port].port_vlan; cpsw 191 drivers/net/ethernet/ti/cpsw.c mask = cpsw->data.dual_emac ? ALE_PORT_HOST : ALE_ALL_PORTS; cpsw 195 drivers/net/ethernet/ti/cpsw.c ret = cpsw_ale_add_mcast(cpsw->ale, addr, mask, flags, vid, 0); cpsw 197 drivers/net/ethernet/ti/cpsw.c ret = cpsw_ale_del_mcast(cpsw->ale, addr, 0, flags, vid); cpsw 310 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 313 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac) cpsw 319 drivers/net/ethernet/ti/cpsw.c cpsw_ale_set_allmulti(cpsw->ale, IFF_ALLMULTI, slave_port); cpsw 327 drivers/net/ethernet/ti/cpsw.c cpsw_ale_set_allmulti(cpsw->ale, cpsw 335 drivers/net/ethernet/ti/cpsw.c void cpsw_intr_enable(struct cpsw_common *cpsw) cpsw 337 drivers/net/ethernet/ti/cpsw.c writel_relaxed(0xFF, &cpsw->wr_regs->tx_en); cpsw 338 drivers/net/ethernet/ti/cpsw.c writel_relaxed(0xFF, &cpsw->wr_regs->rx_en); cpsw 340 drivers/net/ethernet/ti/cpsw.c cpdma_ctlr_int_ctrl(cpsw->dma, true); cpsw 344 drivers/net/ethernet/ti/cpsw.c void cpsw_intr_disable(struct cpsw_common *cpsw) cpsw 346 drivers/net/ethernet/ti/cpsw.c writel_relaxed(0, &cpsw->wr_regs->tx_en); cpsw 347 drivers/net/ethernet/ti/cpsw.c writel_relaxed(0, &cpsw->wr_regs->rx_en); cpsw 349 drivers/net/ethernet/ti/cpsw.c cpdma_ctlr_int_ctrl(cpsw->dma, false); cpsw 410 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 432 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac && cpsw 433 drivers/net/ethernet/ti/cpsw.c vid == cpsw->slaves[priv->emac_port].port_vlan) cpsw 453 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 462 drivers/net/ethernet/ti/cpsw.c txch = cpsw->txv[0].ch; cpsw 464 drivers/net/ethernet/ti/cpsw.c port = priv->emac_port + cpsw->data.dual_emac; cpsw 491 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 543 drivers/net/ethernet/ti/cpsw.c page_pool_recycle_direct(cpsw->page_pool[ch], page); cpsw 555 drivers/net/ethernet/ti/cpsw.c static struct page_pool *cpsw_create_page_pool(struct cpsw_common *cpsw, cpsw 566 drivers/net/ethernet/ti/cpsw.c pp_params.dev = cpsw->dev; cpsw 570 drivers/net/ethernet/ti/cpsw.c dev_err(cpsw->dev, "cannot create rx page pool\n"); cpsw 577 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 582 drivers/net/ethernet/ti/cpsw.c pool = cpsw->page_pool[ch]; cpsw 606 drivers/net/ethernet/ti/cpsw.c static int cpsw_create_rx_pool(struct cpsw_common *cpsw, int ch) cpsw 611 drivers/net/ethernet/ti/cpsw.c pool_size = cpdma_chan_get_rx_buf_num(cpsw->rxv[ch].ch); cpsw 612 drivers/net/ethernet/ti/cpsw.c pool = cpsw_create_page_pool(cpsw, pool_size); cpsw 616 drivers/net/ethernet/ti/cpsw.c cpsw->page_pool[ch] = pool; cpsw 621 drivers/net/ethernet/ti/cpsw.c void cpsw_destroy_xdp_rxqs(struct cpsw_common *cpsw) cpsw 626 drivers/net/ethernet/ti/cpsw.c for (ch = 0; ch < cpsw->rx_ch_num; ch++) { cpsw 627 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->data.slaves; i++) { cpsw 628 drivers/net/ethernet/ti/cpsw.c ndev = cpsw->slaves[i].ndev; cpsw 635 drivers/net/ethernet/ti/cpsw.c page_pool_destroy(cpsw->page_pool[ch]); cpsw 636 drivers/net/ethernet/ti/cpsw.c cpsw->page_pool[ch] = NULL; cpsw 640 drivers/net/ethernet/ti/cpsw.c int cpsw_create_xdp_rxqs(struct cpsw_common *cpsw) cpsw 645 drivers/net/ethernet/ti/cpsw.c for (ch = 0; ch < cpsw->rx_ch_num; ch++) { cpsw 646 drivers/net/ethernet/ti/cpsw.c ret = cpsw_create_rx_pool(cpsw, ch); cpsw 653 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->data.slaves; i++) { cpsw 654 drivers/net/ethernet/ti/cpsw.c ndev = cpsw->slaves[i].ndev; cpsw 667 drivers/net/ethernet/ti/cpsw.c cpsw_destroy_xdp_rxqs(cpsw); cpsw 677 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = ndev_to_cpsw(xmeta->ndev); cpsw 678 drivers/net/ethernet/ti/cpsw.c int pkt_size = cpsw->rx_packet_max; cpsw 688 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac && status >= 0) { cpsw 691 drivers/net/ethernet/ti/cpsw.c ndev = cpsw->slaves[--port].ndev; cpsw 695 drivers/net/ethernet/ti/cpsw.c pool = cpsw->page_pool[ch]; cpsw 698 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac && cpsw->usage_count && cpsw 764 drivers/net/ethernet/ti/cpsw.c cpts_rx_timestamp(cpsw->cpts, skb); cpsw 780 drivers/net/ethernet/ti/cpsw.c ret = cpdma_chan_submit_mapped(cpsw->rxv[ch].ch, new_page, dma, cpsw 788 drivers/net/ethernet/ti/cpsw.c void cpsw_split_res(struct cpsw_common *cpsw) cpsw 791 drivers/net/ethernet/ti/cpsw.c struct cpsw_vector *txv = cpsw->txv; cpsw 797 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->tx_ch_num; i++) { cpsw 806 drivers/net/ethernet/ti/cpsw.c if (cpsw->tx_ch_num == rlim_ch_num) { cpsw 809 drivers/net/ethernet/ti/cpsw.c ch_budget = CPSW_POLL_WEIGHT / cpsw->tx_ch_num; cpsw 813 drivers/net/ethernet/ti/cpsw.c max_rate = cpsw->speed * 1000; cpsw 826 drivers/net/ethernet/ti/cpsw.c (cpsw->tx_ch_num - rlim_ch_num); cpsw 828 drivers/net/ethernet/ti/cpsw.c (cpsw->tx_ch_num - rlim_ch_num); cpsw 833 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->tx_ch_num; i++) { cpsw 847 drivers/net/ethernet/ti/cpsw.c cpdma_chan_set_weight(cpsw->txv[i].ch, ch_weight); cpsw 852 drivers/net/ethernet/ti/cpsw.c cpdma_chan_set_weight(cpsw->txv[i].ch, 0); cpsw 863 drivers/net/ethernet/ti/cpsw.c ch_budget = budget / cpsw->rx_ch_num; cpsw 864 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->rx_ch_num; i++) { cpsw 865 drivers/net/ethernet/ti/cpsw.c cpsw->rxv[i].budget = ch_budget; cpsw 870 drivers/net/ethernet/ti/cpsw.c cpsw->rxv[0].budget += budget; cpsw 875 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = dev_id; cpsw 877 drivers/net/ethernet/ti/cpsw.c writel(0, &cpsw->wr_regs->tx_en); cpsw 878 drivers/net/ethernet/ti/cpsw.c cpdma_ctlr_eoi(cpsw->dma, CPDMA_EOI_TX); cpsw 880 drivers/net/ethernet/ti/cpsw.c if (cpsw->quirk_irq) { cpsw 881 drivers/net/ethernet/ti/cpsw.c disable_irq_nosync(cpsw->irqs_table[1]); cpsw 882 drivers/net/ethernet/ti/cpsw.c cpsw->tx_irq_disabled = true; cpsw 885 drivers/net/ethernet/ti/cpsw.c napi_schedule(&cpsw->napi_tx); cpsw 891 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = dev_id; cpsw 893 drivers/net/ethernet/ti/cpsw.c writel(0, &cpsw->wr_regs->rx_en); cpsw 894 drivers/net/ethernet/ti/cpsw.c cpdma_ctlr_eoi(cpsw->dma, CPDMA_EOI_RX); cpsw 896 drivers/net/ethernet/ti/cpsw.c if (cpsw->quirk_irq) { cpsw 897 drivers/net/ethernet/ti/cpsw.c disable_irq_nosync(cpsw->irqs_table[0]); cpsw 898 drivers/net/ethernet/ti/cpsw.c cpsw->rx_irq_disabled = true; cpsw 901 drivers/net/ethernet/ti/cpsw.c napi_schedule(&cpsw->napi_rx); cpsw 909 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = napi_to_cpsw(napi_tx); cpsw 913 drivers/net/ethernet/ti/cpsw.c ch_map = cpdma_ctrl_txchs_state(cpsw->dma); cpsw 918 drivers/net/ethernet/ti/cpsw.c txv = &cpsw->txv[ch]; cpsw 931 drivers/net/ethernet/ti/cpsw.c writel(0xff, &cpsw->wr_regs->tx_en); cpsw 939 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = napi_to_cpsw(napi_tx); cpsw 942 drivers/net/ethernet/ti/cpsw.c num_tx = cpdma_chan_process(cpsw->txv[0].ch, budget); cpsw 945 drivers/net/ethernet/ti/cpsw.c writel(0xff, &cpsw->wr_regs->tx_en); cpsw 946 drivers/net/ethernet/ti/cpsw.c if (cpsw->tx_irq_disabled) { cpsw 947 drivers/net/ethernet/ti/cpsw.c cpsw->tx_irq_disabled = false; cpsw 948 drivers/net/ethernet/ti/cpsw.c enable_irq(cpsw->irqs_table[1]); cpsw 959 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = napi_to_cpsw(napi_rx); cpsw 963 drivers/net/ethernet/ti/cpsw.c ch_map = cpdma_ctrl_rxchs_state(cpsw->dma); cpsw 968 drivers/net/ethernet/ti/cpsw.c rxv = &cpsw->rxv[ch]; cpsw 981 drivers/net/ethernet/ti/cpsw.c writel(0xff, &cpsw->wr_regs->rx_en); cpsw 989 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = napi_to_cpsw(napi_rx); cpsw 992 drivers/net/ethernet/ti/cpsw.c num_rx = cpdma_chan_process(cpsw->rxv[0].ch, budget); cpsw 995 drivers/net/ethernet/ti/cpsw.c writel(0xff, &cpsw->wr_regs->rx_en); cpsw 996 drivers/net/ethernet/ti/cpsw.c if (cpsw->rx_irq_disabled) { cpsw 997 drivers/net/ethernet/ti/cpsw.c cpsw->rx_irq_disabled = false; cpsw 998 drivers/net/ethernet/ti/cpsw.c enable_irq(cpsw->irqs_table[0]); cpsw 1026 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1030 drivers/net/ethernet/ti/cpsw.c val = readl_relaxed(&cpsw->regs->ptype); cpsw 1032 drivers/net/ethernet/ti/cpsw.c slave = &cpsw->slaves[cpsw_slave_index(cpsw, priv)]; cpsw 1042 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1046 drivers/net/ethernet/ti/cpsw.c val = readl_relaxed(&cpsw->regs->ptype); cpsw 1048 drivers/net/ethernet/ti/cpsw.c slave = &cpsw->slaves[cpsw_slave_index(cpsw, priv)]; cpsw 1053 drivers/net/ethernet/ti/cpsw.c writel_relaxed(val, &cpsw->regs->ptype); cpsw 1062 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1094 drivers/net/ethernet/ti/cpsw.c cpsw_ale_control_set(cpsw->ale, slave_port, cpsw 1107 drivers/net/ethernet/ti/cpsw.c cpsw_ale_control_set(cpsw->ale, slave_port, cpsw 1121 drivers/net/ethernet/ti/cpsw.c static int cpsw_get_common_speed(struct cpsw_common *cpsw) cpsw 1125 drivers/net/ethernet/ti/cpsw.c for (i = 0, speed = 0; i < cpsw->data.slaves; i++) cpsw 1126 drivers/net/ethernet/ti/cpsw.c if (cpsw->slaves[i].phy && cpsw->slaves[i].phy->link) cpsw 1127 drivers/net/ethernet/ti/cpsw.c speed += cpsw->slaves[i].phy->speed; cpsw 1132 drivers/net/ethernet/ti/cpsw.c static int cpsw_need_resplit(struct cpsw_common *cpsw) cpsw 1138 drivers/net/ethernet/ti/cpsw.c speed = cpsw_get_common_speed(cpsw); cpsw 1139 drivers/net/ethernet/ti/cpsw.c if (speed == cpsw->speed || !speed) cpsw 1142 drivers/net/ethernet/ti/cpsw.c cpsw->speed = speed; cpsw 1144 drivers/net/ethernet/ti/cpsw.c for (i = 0, rlim_ch_num = 0; i < cpsw->tx_ch_num; i++) { cpsw 1145 drivers/net/ethernet/ti/cpsw.c ch_rate = cpdma_chan_get_rate(cpsw->txv[i].ch); cpsw 1153 drivers/net/ethernet/ti/cpsw.c if (!rlim_ch_num || rlim_ch_num == cpsw->tx_ch_num) cpsw 1162 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1168 drivers/net/ethernet/ti/cpsw.c if (cpsw_need_resplit(cpsw)) cpsw 1169 drivers/net/ethernet/ti/cpsw.c cpsw_split_res(cpsw); cpsw 1184 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1187 drivers/net/ethernet/ti/cpsw.c if (cpsw->version == CPSW_VERSION_1) cpsw 1191 drivers/net/ethernet/ti/cpsw.c cpsw_ale_add_vlan(cpsw->ale, slave->port_vlan, port_mask, cpsw 1193 drivers/net/ethernet/ti/cpsw.c cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast, cpsw 1195 drivers/net/ethernet/ti/cpsw.c cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr, cpsw 1198 drivers/net/ethernet/ti/cpsw.c cpsw_ale_control_set(cpsw->ale, slave_port, cpsw 1206 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1215 drivers/net/ethernet/ti/cpsw.c switch (cpsw->version) { cpsw 1240 drivers/net/ethernet/ti/cpsw.c cpsw->rx_packet_max); cpsw 1247 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac) cpsw 1250 drivers/net/ethernet/ti/cpsw.c cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast, cpsw 1285 drivers/net/ethernet/ti/cpsw.c cpsw_phy_sel(cpsw->dev, slave->phy->interface, cpsw 1291 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1292 drivers/net/ethernet/ti/cpsw.c const int vlan = cpsw->data.default_vlan; cpsw 1297 drivers/net/ethernet/ti/cpsw.c reg = (cpsw->version == CPSW_VERSION_1) ? CPSW1_PORT_VLAN : cpsw 1300 drivers/net/ethernet/ti/cpsw.c writel(vlan, &cpsw->host_port_regs->port_vlan); cpsw 1302 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->data.slaves; i++) cpsw 1303 drivers/net/ethernet/ti/cpsw.c slave_write(cpsw->slaves + i, vlan, reg); cpsw 1310 drivers/net/ethernet/ti/cpsw.c cpsw_ale_add_vlan(cpsw->ale, vlan, ALE_ALL_PORTS, cpsw 1319 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1322 drivers/net/ethernet/ti/cpsw.c soft_reset("cpsw", &cpsw->regs->soft_reset); cpsw 1323 drivers/net/ethernet/ti/cpsw.c cpsw_ale_start(cpsw->ale); cpsw 1326 drivers/net/ethernet/ti/cpsw.c cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_VLAN_AWARE, cpsw 1328 drivers/net/ethernet/ti/cpsw.c control_reg = readl(&cpsw->regs->control); cpsw 1330 drivers/net/ethernet/ti/cpsw.c writel(control_reg, &cpsw->regs->control); cpsw 1331 drivers/net/ethernet/ti/cpsw.c fifo_mode = (cpsw->data.dual_emac) ? CPSW_FIFO_DUAL_MAC_MODE : cpsw 1333 drivers/net/ethernet/ti/cpsw.c writel(fifo_mode, &cpsw->host_port_regs->tx_in_ctl); cpsw 1337 drivers/net/ethernet/ti/cpsw.c &cpsw->host_port_regs->cpdma_tx_pri_map); cpsw 1338 drivers/net/ethernet/ti/cpsw.c writel_relaxed(0, &cpsw->host_port_regs->cpdma_rx_chan_map); cpsw 1340 drivers/net/ethernet/ti/cpsw.c cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, cpsw 1343 drivers/net/ethernet/ti/cpsw.c if (!cpsw->data.dual_emac) { cpsw 1344 drivers/net/ethernet/ti/cpsw.c cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr, HOST_PORT_NUM, cpsw 1346 drivers/net/ethernet/ti/cpsw.c cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast, cpsw 1353 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1361 drivers/net/ethernet/ti/cpsw.c for (ch = 0; ch < cpsw->rx_ch_num; ch++) { cpsw 1362 drivers/net/ethernet/ti/cpsw.c pool = cpsw->page_pool[ch]; cpsw 1363 drivers/net/ethernet/ti/cpsw.c ch_buf_num = cpdma_chan_get_rx_buf_num(cpsw->rxv[ch].ch); cpsw 1376 drivers/net/ethernet/ti/cpsw.c ret = cpdma_chan_idle_submit_mapped(cpsw->rxv[ch].ch, cpsw 1378 drivers/net/ethernet/ti/cpsw.c cpsw->rx_packet_max, cpsw 1396 drivers/net/ethernet/ti/cpsw.c static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_common *cpsw) cpsw 1407 drivers/net/ethernet/ti/cpsw.c cpsw_ale_control_set(cpsw->ale, slave_port, cpsw 1423 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1434 drivers/net/ethernet/ti/cpsw.c slave = &cpsw->slaves[cpsw_slave_index(cpsw, priv)]; cpsw 1483 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1492 drivers/net/ethernet/ti/cpsw.c slave = &cpsw->slaves[cpsw_slave_index(cpsw, priv)]; cpsw 1493 drivers/net/ethernet/ti/cpsw.c tx_in_ctl_rg = cpsw->version == CPSW_VERSION_1 ? cpsw 1535 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1558 drivers/net/ethernet/ti/cpsw.c slave = &cpsw->slaves[cpsw_slave_index(cpsw, priv)]; cpsw 1572 drivers/net/ethernet/ti/cpsw.c ret = pm_runtime_get_sync(cpsw->dev); cpsw 1574 drivers/net/ethernet/ti/cpsw.c pm_runtime_put_noidle(cpsw->dev); cpsw 1589 drivers/net/ethernet/ti/cpsw.c pm_runtime_put_sync(cpsw->dev); cpsw 1608 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1622 drivers/net/ethernet/ti/cpsw.c tx_prio_rg = cpsw->version == CPSW_VERSION_1 ? cpsw 1655 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1659 drivers/net/ethernet/ti/cpsw.c ret = pm_runtime_get_sync(cpsw->dev); cpsw 1661 drivers/net/ethernet/ti/cpsw.c pm_runtime_put_noidle(cpsw->dev); cpsw 1668 drivers/net/ethernet/ti/cpsw.c ret = netif_set_real_num_tx_queues(ndev, cpsw->tx_ch_num); cpsw 1674 drivers/net/ethernet/ti/cpsw.c ret = netif_set_real_num_rx_queues(ndev, cpsw->rx_ch_num); cpsw 1680 drivers/net/ethernet/ti/cpsw.c reg = cpsw->version; cpsw 1687 drivers/net/ethernet/ti/cpsw.c if (!cpsw->usage_count) cpsw 1692 drivers/net/ethernet/ti/cpsw.c if (!cpsw->data.dual_emac) cpsw 1695 drivers/net/ethernet/ti/cpsw.c cpsw_ale_add_vlan(cpsw->ale, cpsw->data.default_vlan, cpsw 1699 drivers/net/ethernet/ti/cpsw.c if (!cpsw->usage_count) { cpsw 1701 drivers/net/ethernet/ti/cpsw.c writel_relaxed(0, &cpsw->regs->ptype); cpsw 1704 drivers/net/ethernet/ti/cpsw.c writel_relaxed(0x7, &cpsw->regs->stat_port_en); cpsw 1707 drivers/net/ethernet/ti/cpsw.c writel(0x7, &cpsw->regs->flow_control); cpsw 1709 drivers/net/ethernet/ti/cpsw.c napi_enable(&cpsw->napi_rx); cpsw 1710 drivers/net/ethernet/ti/cpsw.c napi_enable(&cpsw->napi_tx); cpsw 1712 drivers/net/ethernet/ti/cpsw.c if (cpsw->tx_irq_disabled) { cpsw 1713 drivers/net/ethernet/ti/cpsw.c cpsw->tx_irq_disabled = false; cpsw 1714 drivers/net/ethernet/ti/cpsw.c enable_irq(cpsw->irqs_table[1]); cpsw 1717 drivers/net/ethernet/ti/cpsw.c if (cpsw->rx_irq_disabled) { cpsw 1718 drivers/net/ethernet/ti/cpsw.c cpsw->rx_irq_disabled = false; cpsw 1719 drivers/net/ethernet/ti/cpsw.c enable_irq(cpsw->irqs_table[0]); cpsw 1725 drivers/net/ethernet/ti/cpsw.c ret = cpsw_create_xdp_rxqs(cpsw); cpsw 1733 drivers/net/ethernet/ti/cpsw.c if (cpts_register(cpsw->cpts)) cpsw 1741 drivers/net/ethernet/ti/cpsw.c if (cpsw->coal_intvl != 0) { cpsw 1744 drivers/net/ethernet/ti/cpsw.c coal.rx_coalesce_usecs = cpsw->coal_intvl; cpsw 1748 drivers/net/ethernet/ti/cpsw.c cpdma_ctlr_start(cpsw->dma); cpsw 1749 drivers/net/ethernet/ti/cpsw.c cpsw_intr_enable(cpsw); cpsw 1750 drivers/net/ethernet/ti/cpsw.c cpsw->usage_count++; cpsw 1755 drivers/net/ethernet/ti/cpsw.c if (!cpsw->usage_count) { cpsw 1756 drivers/net/ethernet/ti/cpsw.c cpdma_ctlr_stop(cpsw->dma); cpsw 1757 drivers/net/ethernet/ti/cpsw.c cpsw_destroy_xdp_rxqs(cpsw); cpsw 1760 drivers/net/ethernet/ti/cpsw.c for_each_slave(priv, cpsw_slave_stop, cpsw); cpsw 1761 drivers/net/ethernet/ti/cpsw.c pm_runtime_put_sync(cpsw->dev); cpsw 1769 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1776 drivers/net/ethernet/ti/cpsw.c if (cpsw->usage_count <= 1) { cpsw 1777 drivers/net/ethernet/ti/cpsw.c napi_disable(&cpsw->napi_rx); cpsw 1778 drivers/net/ethernet/ti/cpsw.c napi_disable(&cpsw->napi_tx); cpsw 1779 drivers/net/ethernet/ti/cpsw.c cpts_unregister(cpsw->cpts); cpsw 1780 drivers/net/ethernet/ti/cpsw.c cpsw_intr_disable(cpsw); cpsw 1781 drivers/net/ethernet/ti/cpsw.c cpdma_ctlr_stop(cpsw->dma); cpsw 1782 drivers/net/ethernet/ti/cpsw.c cpsw_ale_stop(cpsw->ale); cpsw 1783 drivers/net/ethernet/ti/cpsw.c cpsw_destroy_xdp_rxqs(cpsw); cpsw 1785 drivers/net/ethernet/ti/cpsw.c for_each_slave(priv, cpsw_slave_stop, cpsw); cpsw 1787 drivers/net/ethernet/ti/cpsw.c if (cpsw_need_resplit(cpsw)) cpsw 1788 drivers/net/ethernet/ti/cpsw.c cpsw_split_res(cpsw); cpsw 1790 drivers/net/ethernet/ti/cpsw.c cpsw->usage_count--; cpsw 1791 drivers/net/ethernet/ti/cpsw.c pm_runtime_put_sync(cpsw->dev); cpsw 1799 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1800 drivers/net/ethernet/ti/cpsw.c struct cpts *cpts = cpsw->cpts; cpsw 1816 drivers/net/ethernet/ti/cpsw.c if (q_idx >= cpsw->tx_ch_num) cpsw 1817 drivers/net/ethernet/ti/cpsw.c q_idx = q_idx % cpsw->tx_ch_num; cpsw 1819 drivers/net/ethernet/ti/cpsw.c txch = cpsw->txv[q_idx].ch; cpsw 1823 drivers/net/ethernet/ti/cpsw.c priv->emac_port + cpsw->data.dual_emac); cpsw 1860 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1861 drivers/net/ethernet/ti/cpsw.c struct cpsw_slave *slave = &cpsw->slaves[cpsw->data.active_slave]; cpsw 1885 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1888 drivers/net/ethernet/ti/cpsw.c slave = &cpsw->slaves[cpsw_slave_index(cpsw, priv)]; cpsw 1891 drivers/net/ethernet/ti/cpsw.c switch (cpsw->version) { cpsw 1917 drivers/net/ethernet/ti/cpsw.c writel_relaxed(ETH_P_1588, &cpsw->regs->ts_ltype); cpsw 1918 drivers/net/ethernet/ti/cpsw.c writel_relaxed(ETH_P_8021Q, &cpsw->regs->vlan_ltype); cpsw 1925 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 1927 drivers/net/ethernet/ti/cpsw.c if (cpsw->version != CPSW_VERSION_1 && cpsw 1928 drivers/net/ethernet/ti/cpsw.c cpsw->version != CPSW_VERSION_2 && cpsw 1929 drivers/net/ethernet/ti/cpsw.c cpsw->version != CPSW_VERSION_3) cpsw 1973 drivers/net/ethernet/ti/cpsw.c switch (cpsw->version) { cpsw 1990 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = ndev_to_cpsw(dev); cpsw 1994 drivers/net/ethernet/ti/cpsw.c if (cpsw->version != CPSW_VERSION_1 && cpsw 1995 drivers/net/ethernet/ti/cpsw.c cpsw->version != CPSW_VERSION_2 && cpsw 1996 drivers/net/ethernet/ti/cpsw.c cpsw->version != CPSW_VERSION_3) cpsw 2020 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 2021 drivers/net/ethernet/ti/cpsw.c int slave_no = cpsw_slave_index(cpsw, priv); cpsw 2033 drivers/net/ethernet/ti/cpsw.c if (!cpsw->slaves[slave_no].phy) cpsw 2035 drivers/net/ethernet/ti/cpsw.c return phy_mii_ioctl(cpsw->slaves[slave_no].phy, req, cmd); cpsw 2041 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 2046 drivers/net/ethernet/ti/cpsw.c cpsw_intr_disable(cpsw); cpsw 2047 drivers/net/ethernet/ti/cpsw.c for (ch = 0; ch < cpsw->tx_ch_num; ch++) { cpsw 2048 drivers/net/ethernet/ti/cpsw.c cpdma_chan_stop(cpsw->txv[ch].ch); cpsw 2049 drivers/net/ethernet/ti/cpsw.c cpdma_chan_start(cpsw->txv[ch].ch); cpsw 2052 drivers/net/ethernet/ti/cpsw.c cpsw_intr_enable(cpsw); cpsw 2061 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 2069 drivers/net/ethernet/ti/cpsw.c ret = pm_runtime_get_sync(cpsw->dev); cpsw 2071 drivers/net/ethernet/ti/cpsw.c pm_runtime_put_noidle(cpsw->dev); cpsw 2075 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac) { cpsw 2076 drivers/net/ethernet/ti/cpsw.c vid = cpsw->slaves[priv->emac_port].port_vlan; cpsw 2080 drivers/net/ethernet/ti/cpsw.c cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr, HOST_PORT_NUM, cpsw 2082 drivers/net/ethernet/ti/cpsw.c cpsw_ale_add_ucast(cpsw->ale, addr->sa_data, HOST_PORT_NUM, cpsw 2089 drivers/net/ethernet/ti/cpsw.c pm_runtime_put(cpsw->dev); cpsw 2101 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 2103 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac) { cpsw 2119 drivers/net/ethernet/ti/cpsw.c ret = cpsw_ale_add_vlan(cpsw->ale, vid, port_mask, 0, port_mask, cpsw 2124 drivers/net/ethernet/ti/cpsw.c ret = cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr, cpsw 2129 drivers/net/ethernet/ti/cpsw.c ret = cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast, cpsw 2136 drivers/net/ethernet/ti/cpsw.c cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr, cpsw 2139 drivers/net/ethernet/ti/cpsw.c cpsw_ale_del_vlan(cpsw->ale, vid, 0); cpsw 2147 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 2150 drivers/net/ethernet/ti/cpsw.c if (vid == cpsw->data.default_vlan) cpsw 2153 drivers/net/ethernet/ti/cpsw.c ret = pm_runtime_get_sync(cpsw->dev); cpsw 2155 drivers/net/ethernet/ti/cpsw.c pm_runtime_put_noidle(cpsw->dev); cpsw 2159 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac) { cpsw 2166 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->data.slaves; i++) { cpsw 2167 drivers/net/ethernet/ti/cpsw.c if (vid == cpsw->slaves[i].port_vlan) { cpsw 2177 drivers/net/ethernet/ti/cpsw.c pm_runtime_put(cpsw->dev); cpsw 2185 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 2188 drivers/net/ethernet/ti/cpsw.c if (vid == cpsw->data.default_vlan) cpsw 2191 drivers/net/ethernet/ti/cpsw.c ret = pm_runtime_get_sync(cpsw->dev); cpsw 2193 drivers/net/ethernet/ti/cpsw.c pm_runtime_put_noidle(cpsw->dev); cpsw 2197 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac) { cpsw 2200 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->data.slaves; i++) { cpsw 2201 drivers/net/ethernet/ti/cpsw.c if (vid == cpsw->slaves[i].port_vlan) cpsw 2207 drivers/net/ethernet/ti/cpsw.c ret = cpsw_ale_del_vlan(cpsw->ale, vid, 0); cpsw 2208 drivers/net/ethernet/ti/cpsw.c ret |= cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr, cpsw 2210 drivers/net/ethernet/ti/cpsw.c ret |= cpsw_ale_del_mcast(cpsw->ale, priv->ndev->broadcast, cpsw 2212 drivers/net/ethernet/ti/cpsw.c ret |= cpsw_ale_flush_multicast(cpsw->ale, 0, vid); cpsw 2214 drivers/net/ethernet/ti/cpsw.c pm_runtime_put(cpsw->dev); cpsw 2221 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 2232 drivers/net/ethernet/ti/cpsw.c min_rate = cpdma_chan_get_min_rate(cpsw->dma); cpsw 2239 drivers/net/ethernet/ti/cpsw.c if (rate > cpsw->speed) { cpsw 2244 drivers/net/ethernet/ti/cpsw.c ret = pm_runtime_get_sync(cpsw->dev); cpsw 2246 drivers/net/ethernet/ti/cpsw.c pm_runtime_put_noidle(cpsw->dev); cpsw 2250 drivers/net/ethernet/ti/cpsw.c ret = cpdma_chan_set_rate(cpsw->txv[queue].ch, ch_rate); cpsw 2251 drivers/net/ethernet/ti/cpsw.c pm_runtime_put(cpsw->dev); cpsw 2257 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->data.slaves; i++) { cpsw 2258 drivers/net/ethernet/ti/cpsw.c slave = &cpsw->slaves[i]; cpsw 2265 drivers/net/ethernet/ti/cpsw.c cpsw_split_res(cpsw); cpsw 2273 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 2286 drivers/net/ethernet/ti/cpsw.c ret = pm_runtime_get_sync(cpsw->dev); cpsw 2288 drivers/net/ethernet/ti/cpsw.c pm_runtime_put_noidle(cpsw->dev); cpsw 2315 drivers/net/ethernet/ti/cpsw.c offset = cpsw->version == CPSW_VERSION_1 ? cpsw 2318 drivers/net/ethernet/ti/cpsw.c slave = &cpsw->slaves[cpsw_slave_index(cpsw, priv)]; cpsw 2321 drivers/net/ethernet/ti/cpsw.c pm_runtime_put_sync(cpsw->dev); cpsw 2402 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 2404 drivers/net/ethernet/ti/cpsw.c cpsw_intr_disable(cpsw); cpsw 2405 drivers/net/ethernet/ti/cpsw.c cpsw_rx_interrupt(cpsw->irqs_table[0], cpsw); cpsw 2406 drivers/net/ethernet/ti/cpsw.c cpsw_tx_interrupt(cpsw->irqs_table[1], cpsw); cpsw 2407 drivers/net/ethernet/ti/cpsw.c cpsw_intr_enable(cpsw); cpsw 2434 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 2435 drivers/net/ethernet/ti/cpsw.c struct platform_device *pdev = to_platform_device(cpsw->dev); cpsw 2668 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = platform_get_drvdata(pdev); cpsw 2669 drivers/net/ethernet/ti/cpsw.c struct cpsw_platform_data *data = &cpsw->data; cpsw 2697 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = priv->cpsw; cpsw 2698 drivers/net/ethernet/ti/cpsw.c struct cpsw_platform_data *data = &cpsw->data; cpsw 2703 drivers/net/ethernet/ti/cpsw.c ndev = devm_alloc_etherdev_mqs(cpsw->dev, sizeof(struct cpsw_priv), cpsw 2706 drivers/net/ethernet/ti/cpsw.c dev_err(cpsw->dev, "cpsw: error allocating net_device\n"); cpsw 2711 drivers/net/ethernet/ti/cpsw.c priv_sl2->cpsw = cpsw; cpsw 2719 drivers/net/ethernet/ti/cpsw.c dev_info(cpsw->dev, "cpsw: Detected MACID = %pM\n", cpsw 2723 drivers/net/ethernet/ti/cpsw.c dev_info(cpsw->dev, "cpsw: Random MACID = %pM\n", cpsw 2729 drivers/net/ethernet/ti/cpsw.c cpsw->slaves[1].ndev = ndev; cpsw 2736 drivers/net/ethernet/ti/cpsw.c SET_NETDEV_DEV(ndev, cpsw->dev); cpsw 2737 drivers/net/ethernet/ti/cpsw.c ndev->dev.of_node = cpsw->slaves[1].data->slave_node; cpsw 2740 drivers/net/ethernet/ti/cpsw.c dev_err(cpsw->dev, "cpsw: error registering net device\n"); cpsw 2770 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw; cpsw 2774 drivers/net/ethernet/ti/cpsw.c cpsw = devm_kzalloc(dev, sizeof(struct cpsw_common), GFP_KERNEL); cpsw 2775 drivers/net/ethernet/ti/cpsw.c if (!cpsw) cpsw 2778 drivers/net/ethernet/ti/cpsw.c platform_set_drvdata(pdev, cpsw); cpsw 2779 drivers/net/ethernet/ti/cpsw.c cpsw->dev = dev; cpsw 2794 drivers/net/ethernet/ti/cpsw.c cpsw->bus_freq_mhz = clk_get_rate(clk) / 1000000; cpsw 2800 drivers/net/ethernet/ti/cpsw.c cpsw->regs = ss_regs; cpsw 2802 drivers/net/ethernet/ti/cpsw.c cpsw->wr_regs = devm_platform_ioremap_resource(pdev, 1); cpsw 2803 drivers/net/ethernet/ti/cpsw.c if (IS_ERR(cpsw->wr_regs)) cpsw 2804 drivers/net/ethernet/ti/cpsw.c return PTR_ERR(cpsw->wr_regs); cpsw 2810 drivers/net/ethernet/ti/cpsw.c cpsw->irqs_table[0] = irq; cpsw 2816 drivers/net/ethernet/ti/cpsw.c cpsw->irqs_table[1] = irq; cpsw 2832 drivers/net/ethernet/ti/cpsw.c ret = cpsw_probe_dt(&cpsw->data, pdev); cpsw 2838 drivers/net/ethernet/ti/cpsw.c cpsw->quirk_irq = 1; cpsw 2840 drivers/net/ethernet/ti/cpsw.c data = &cpsw->data; cpsw 2841 drivers/net/ethernet/ti/cpsw.c cpsw->slaves = devm_kcalloc(dev, cpsw 2844 drivers/net/ethernet/ti/cpsw.c if (!cpsw->slaves) { cpsw 2849 drivers/net/ethernet/ti/cpsw.c cpsw->rx_packet_max = max(rx_packet_max, CPSW_MAX_PACKET_SIZE); cpsw 2850 drivers/net/ethernet/ti/cpsw.c cpsw->descs_pool_size = descs_pool_size; cpsw 2852 drivers/net/ethernet/ti/cpsw.c ret = cpsw_init_common(cpsw, ss_regs, ale_ageout, cpsw 2858 drivers/net/ethernet/ti/cpsw.c ch = cpsw->quirk_irq ? 0 : 7; cpsw 2859 drivers/net/ethernet/ti/cpsw.c cpsw->txv[0].ch = cpdma_chan_create(cpsw->dma, ch, cpsw_tx_handler, 0); cpsw 2860 drivers/net/ethernet/ti/cpsw.c if (IS_ERR(cpsw->txv[0].ch)) { cpsw 2862 drivers/net/ethernet/ti/cpsw.c ret = PTR_ERR(cpsw->txv[0].ch); cpsw 2866 drivers/net/ethernet/ti/cpsw.c cpsw->rxv[0].ch = cpdma_chan_create(cpsw->dma, 0, cpsw_rx_handler, 1); cpsw 2867 drivers/net/ethernet/ti/cpsw.c if (IS_ERR(cpsw->rxv[0].ch)) { cpsw 2869 drivers/net/ethernet/ti/cpsw.c ret = PTR_ERR(cpsw->rxv[0].ch); cpsw 2872 drivers/net/ethernet/ti/cpsw.c cpsw_split_res(cpsw); cpsw 2883 drivers/net/ethernet/ti/cpsw.c priv->cpsw = cpsw; cpsw 2899 drivers/net/ethernet/ti/cpsw.c cpsw->slaves[0].ndev = ndev; cpsw 2905 drivers/net/ethernet/ti/cpsw.c netif_napi_add(ndev, &cpsw->napi_rx, cpsw 2906 drivers/net/ethernet/ti/cpsw.c cpsw->quirk_irq ? cpsw_rx_poll : cpsw_rx_mq_poll, cpsw 2908 drivers/net/ethernet/ti/cpsw.c netif_tx_napi_add(ndev, &cpsw->napi_tx, cpsw 2909 drivers/net/ethernet/ti/cpsw.c cpsw->quirk_irq ? cpsw_tx_poll : cpsw_tx_mq_poll, cpsw 2914 drivers/net/ethernet/ti/cpsw.c ndev->dev.of_node = cpsw->slaves[0].data->slave_node; cpsw 2922 drivers/net/ethernet/ti/cpsw.c if (cpsw->data.dual_emac) { cpsw 2937 drivers/net/ethernet/ti/cpsw.c ret = devm_request_irq(dev, cpsw->irqs_table[0], cpsw_rx_interrupt, cpsw 2938 drivers/net/ethernet/ti/cpsw.c 0, dev_name(dev), cpsw); cpsw 2945 drivers/net/ethernet/ti/cpsw.c ret = devm_request_irq(dev, cpsw->irqs_table[1], cpsw_tx_interrupt, cpsw 2946 drivers/net/ethernet/ti/cpsw.c 0, dev_name(&pdev->dev), cpsw); cpsw 2954 drivers/net/ethernet/ti/cpsw.c &ss_res->start, cpsw->irqs_table[0], descs_pool_size); cpsw 2963 drivers/net/ethernet/ti/cpsw.c cpts_release(cpsw->cpts); cpsw 2964 drivers/net/ethernet/ti/cpsw.c cpdma_ctlr_destroy(cpsw->dma); cpsw 2975 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = platform_get_drvdata(pdev); cpsw 2984 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->data.slaves; i++) cpsw 2985 drivers/net/ethernet/ti/cpsw.c if (cpsw->slaves[i].ndev) cpsw 2986 drivers/net/ethernet/ti/cpsw.c unregister_netdev(cpsw->slaves[i].ndev); cpsw 2988 drivers/net/ethernet/ti/cpsw.c cpts_release(cpsw->cpts); cpsw 2989 drivers/net/ethernet/ti/cpsw.c cpdma_ctlr_destroy(cpsw->dma); cpsw 2999 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = dev_get_drvdata(dev); cpsw 3004 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->data.slaves; i++) cpsw 3005 drivers/net/ethernet/ti/cpsw.c if (cpsw->slaves[i].ndev) cpsw 3006 drivers/net/ethernet/ti/cpsw.c if (netif_running(cpsw->slaves[i].ndev)) cpsw 3007 drivers/net/ethernet/ti/cpsw.c cpsw_ndo_stop(cpsw->slaves[i].ndev); cpsw 3019 drivers/net/ethernet/ti/cpsw.c struct cpsw_common *cpsw = dev_get_drvdata(dev); cpsw 3028 drivers/net/ethernet/ti/cpsw.c for (i = 0; i < cpsw->data.slaves; i++) cpsw 3029 drivers/net/ethernet/ti/cpsw.c if (cpsw->slaves[i].ndev) cpsw 3030 drivers/net/ethernet/ti/cpsw.c if (netif_running(cpsw->slaves[i].ndev)) cpsw 3031 drivers/net/ethernet/ti/cpsw.c cpsw_ndo_open(cpsw->slaves[i].ndev); cpsw 157 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 159 drivers/net/ethernet/ti/cpsw_ethtool.c coal->rx_coalesce_usecs = cpsw->coal_intvl; cpsw 171 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 175 drivers/net/ethernet/ti/cpsw_ethtool.c int_ctrl = readl(&cpsw->wr_regs->int_control); cpsw 176 drivers/net/ethernet/ti/cpsw_ethtool.c prescale = cpsw->bus_freq_mhz * 4; cpsw 204 drivers/net/ethernet/ti/cpsw_ethtool.c writel(num_interrupts, &cpsw->wr_regs->rx_imax); cpsw 205 drivers/net/ethernet/ti/cpsw_ethtool.c writel(num_interrupts, &cpsw->wr_regs->tx_imax); cpsw 212 drivers/net/ethernet/ti/cpsw_ethtool.c writel(int_ctrl, &cpsw->wr_regs->int_control); cpsw 215 drivers/net/ethernet/ti/cpsw_ethtool.c cpsw->coal_intvl = coal_intvl; cpsw 222 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 227 drivers/net/ethernet/ti/cpsw_ethtool.c (cpsw->rx_ch_num + cpsw->tx_ch_num) * cpsw 253 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 265 drivers/net/ethernet/ti/cpsw_ethtool.c cpsw_add_ch_strings(&p, cpsw->rx_ch_num, 1); cpsw 266 drivers/net/ethernet/ti/cpsw_ethtool.c cpsw_add_ch_strings(&p, cpsw->tx_ch_num, 0); cpsw 275 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 281 drivers/net/ethernet/ti/cpsw_ethtool.c data[l] = readl(cpsw->hw_stats + cpsw 284 drivers/net/ethernet/ti/cpsw_ethtool.c for (ch = 0; ch < cpsw->rx_ch_num; ch++) { cpsw 285 drivers/net/ethernet/ti/cpsw_ethtool.c cpdma_chan_get_stats(cpsw->rxv[ch].ch, &ch_stats); cpsw 293 drivers/net/ethernet/ti/cpsw_ethtool.c for (ch = 0; ch < cpsw->tx_ch_num; ch++) { cpsw 294 drivers/net/ethernet/ti/cpsw_ethtool.c cpdma_chan_get_stats(cpsw->txv[ch].ch, &ch_stats); cpsw 316 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 317 drivers/net/ethernet/ti/cpsw_ethtool.c int slave_no = cpsw_slave_index(cpsw, priv); cpsw 322 drivers/net/ethernet/ti/cpsw_ethtool.c if (cpsw->slaves[slave_no].phy) cpsw 323 drivers/net/ethernet/ti/cpsw_ethtool.c phy_ethtool_get_wol(cpsw->slaves[slave_no].phy, wol); cpsw 329 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 330 drivers/net/ethernet/ti/cpsw_ethtool.c int slave_no = cpsw_slave_index(cpsw, priv); cpsw 332 drivers/net/ethernet/ti/cpsw_ethtool.c if (cpsw->slaves[slave_no].phy) cpsw 333 drivers/net/ethernet/ti/cpsw_ethtool.c return phy_ethtool_set_wol(cpsw->slaves[slave_no].phy, wol); cpsw 340 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 342 drivers/net/ethernet/ti/cpsw_ethtool.c return cpsw->data.ale_entries * ALE_ENTRY_WORDS * sizeof(u32); cpsw 348 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 351 drivers/net/ethernet/ti/cpsw_ethtool.c regs->version = cpsw->version; cpsw 353 drivers/net/ethernet/ti/cpsw_ethtool.c cpsw_ale_dump(cpsw->ale, reg); cpsw 359 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 362 drivers/net/ethernet/ti/cpsw_ethtool.c ret = pm_runtime_get_sync(cpsw->dev); cpsw 365 drivers/net/ethernet/ti/cpsw_ethtool.c pm_runtime_put_noidle(cpsw->dev); cpsw 376 drivers/net/ethernet/ti/cpsw_ethtool.c ret = pm_runtime_put(priv->cpsw->dev); cpsw 383 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 385 drivers/net/ethernet/ti/cpsw_ethtool.c ch->max_rx = cpsw->quirk_irq ? 1 : CPSW_MAX_QUEUES; cpsw 386 drivers/net/ethernet/ti/cpsw_ethtool.c ch->max_tx = cpsw->quirk_irq ? 1 : CPSW_MAX_QUEUES; cpsw 390 drivers/net/ethernet/ti/cpsw_ethtool.c ch->rx_count = cpsw->rx_ch_num; cpsw 391 drivers/net/ethernet/ti/cpsw_ethtool.c ch->tx_count = cpsw->tx_ch_num; cpsw 399 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 400 drivers/net/ethernet/ti/cpsw_ethtool.c int slave_no = cpsw_slave_index(cpsw, priv); cpsw 402 drivers/net/ethernet/ti/cpsw_ethtool.c if (!cpsw->slaves[slave_no].phy) cpsw 405 drivers/net/ethernet/ti/cpsw_ethtool.c phy_ethtool_ksettings_get(cpsw->slaves[slave_no].phy, ecmd); cpsw 413 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 414 drivers/net/ethernet/ti/cpsw_ethtool.c int slave_no = cpsw_slave_index(cpsw, priv); cpsw 416 drivers/net/ethernet/ti/cpsw_ethtool.c if (!cpsw->slaves[slave_no].phy) cpsw 419 drivers/net/ethernet/ti/cpsw_ethtool.c return phy_ethtool_ksettings_set(cpsw->slaves[slave_no].phy, ecmd); cpsw 425 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 426 drivers/net/ethernet/ti/cpsw_ethtool.c int slave_no = cpsw_slave_index(cpsw, priv); cpsw 428 drivers/net/ethernet/ti/cpsw_ethtool.c if (cpsw->slaves[slave_no].phy) cpsw 429 drivers/net/ethernet/ti/cpsw_ethtool.c return phy_ethtool_get_eee(cpsw->slaves[slave_no].phy, edata); cpsw 437 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 438 drivers/net/ethernet/ti/cpsw_ethtool.c int slave_no = cpsw_slave_index(cpsw, priv); cpsw 440 drivers/net/ethernet/ti/cpsw_ethtool.c if (cpsw->slaves[slave_no].phy) cpsw 441 drivers/net/ethernet/ti/cpsw_ethtool.c return phy_ethtool_set_eee(cpsw->slaves[slave_no].phy, edata); cpsw 449 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 450 drivers/net/ethernet/ti/cpsw_ethtool.c int slave_no = cpsw_slave_index(cpsw, priv); cpsw 452 drivers/net/ethernet/ti/cpsw_ethtool.c if (cpsw->slaves[slave_no].phy) cpsw 453 drivers/net/ethernet/ti/cpsw_ethtool.c return genphy_restart_aneg(cpsw->slaves[slave_no].phy); cpsw 460 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 464 drivers/net/ethernet/ti/cpsw_ethtool.c cpsw_intr_disable(cpsw); cpsw 468 drivers/net/ethernet/ti/cpsw_ethtool.c for (i = 0; i < cpsw->data.slaves; i++) { cpsw 469 drivers/net/ethernet/ti/cpsw_ethtool.c ndev = cpsw->slaves[i].ndev; cpsw 480 drivers/net/ethernet/ti/cpsw_ethtool.c cpdma_ctlr_stop(cpsw->dma); cpsw 486 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 490 drivers/net/ethernet/ti/cpsw_ethtool.c if (cpsw->usage_count) { cpsw 495 drivers/net/ethernet/ti/cpsw_ethtool.c cpdma_ctlr_start(cpsw->dma); cpsw 496 drivers/net/ethernet/ti/cpsw_ethtool.c cpsw_intr_enable(cpsw); cpsw 500 drivers/net/ethernet/ti/cpsw_ethtool.c for (i = 0; i < cpsw->data.slaves; i++) { cpsw 501 drivers/net/ethernet/ti/cpsw_ethtool.c ndev = cpsw->slaves[i].ndev; cpsw 509 drivers/net/ethernet/ti/cpsw_ethtool.c static int cpsw_check_ch_settings(struct cpsw_common *cpsw, cpsw 512 drivers/net/ethernet/ti/cpsw_ethtool.c if (cpsw->quirk_irq) { cpsw 513 drivers/net/ethernet/ti/cpsw_ethtool.c dev_err(cpsw->dev, "Maximum one tx/rx queue is allowed"); cpsw 524 drivers/net/ethernet/ti/cpsw_ethtool.c if (ch->rx_count > cpsw->data.channels || cpsw 525 drivers/net/ethernet/ti/cpsw_ethtool.c ch->tx_count > cpsw->data.channels) cpsw 534 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 541 drivers/net/ethernet/ti/cpsw_ethtool.c ch = &cpsw->rx_ch_num; cpsw 542 drivers/net/ethernet/ti/cpsw_ethtool.c vec = cpsw->rxv; cpsw 545 drivers/net/ethernet/ti/cpsw_ethtool.c ch = &cpsw->tx_ch_num; cpsw 546 drivers/net/ethernet/ti/cpsw_ethtool.c vec = cpsw->txv; cpsw 552 drivers/net/ethernet/ti/cpsw_ethtool.c vec[*ch].ch = cpdma_chan_create(cpsw->dma, vch, handler, rx); cpsw 581 drivers/net/ethernet/ti/cpsw_ethtool.c static void cpsw_fail(struct cpsw_common *cpsw) cpsw 586 drivers/net/ethernet/ti/cpsw_ethtool.c for (i = 0; i < cpsw->data.slaves; i++) { cpsw 587 drivers/net/ethernet/ti/cpsw_ethtool.c ndev = cpsw->slaves[i].ndev; cpsw 598 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 602 drivers/net/ethernet/ti/cpsw_ethtool.c ret = cpsw_check_ch_settings(cpsw, chs); cpsw 608 drivers/net/ethernet/ti/cpsw_ethtool.c new_pools = (chs->rx_count != cpsw->rx_ch_num) && cpsw->usage_count; cpsw 618 drivers/net/ethernet/ti/cpsw_ethtool.c for (i = 0; i < cpsw->data.slaves; i++) { cpsw 619 drivers/net/ethernet/ti/cpsw_ethtool.c sl_ndev = cpsw->slaves[i].ndev; cpsw 624 drivers/net/ethernet/ti/cpsw_ethtool.c ret = netif_set_real_num_tx_queues(sl_ndev, cpsw->tx_ch_num); cpsw 630 drivers/net/ethernet/ti/cpsw_ethtool.c ret = netif_set_real_num_rx_queues(sl_ndev, cpsw->rx_ch_num); cpsw 637 drivers/net/ethernet/ti/cpsw_ethtool.c cpsw_split_res(cpsw); cpsw 640 drivers/net/ethernet/ti/cpsw_ethtool.c cpsw_destroy_xdp_rxqs(cpsw); cpsw 641 drivers/net/ethernet/ti/cpsw_ethtool.c ret = cpsw_create_xdp_rxqs(cpsw); cpsw 651 drivers/net/ethernet/ti/cpsw_ethtool.c cpsw_fail(cpsw); cpsw 659 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = priv->cpsw; cpsw 662 drivers/net/ethernet/ti/cpsw_ethtool.c ering->tx_max_pending = cpsw->descs_pool_size - CPSW_MAX_QUEUES; cpsw 663 drivers/net/ethernet/ti/cpsw_ethtool.c ering->tx_pending = cpdma_get_num_tx_descs(cpsw->dma); cpsw 664 drivers/net/ethernet/ti/cpsw_ethtool.c ering->rx_max_pending = cpsw->descs_pool_size - CPSW_MAX_QUEUES; cpsw 665 drivers/net/ethernet/ti/cpsw_ethtool.c ering->rx_pending = cpdma_get_num_rx_descs(cpsw->dma); cpsw 671 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 678 drivers/net/ethernet/ti/cpsw_ethtool.c ering->rx_pending > (cpsw->descs_pool_size - CPSW_MAX_QUEUES)) cpsw 681 drivers/net/ethernet/ti/cpsw_ethtool.c descs_num = cpdma_get_num_rx_descs(cpsw->dma); cpsw 687 drivers/net/ethernet/ti/cpsw_ethtool.c ret = cpdma_set_num_rx_descs(cpsw->dma, ering->rx_pending); cpsw 695 drivers/net/ethernet/ti/cpsw_ethtool.c if (cpsw->usage_count) { cpsw 696 drivers/net/ethernet/ti/cpsw_ethtool.c cpsw_destroy_xdp_rxqs(cpsw); cpsw 697 drivers/net/ethernet/ti/cpsw_ethtool.c ret = cpsw_create_xdp_rxqs(cpsw); cpsw 706 drivers/net/ethernet/ti/cpsw_ethtool.c cpdma_set_num_rx_descs(cpsw->dma, descs_num); cpsw 707 drivers/net/ethernet/ti/cpsw_ethtool.c dev_err(cpsw->dev, "cannot set ring params, closing device\n"); cpsw 708 drivers/net/ethernet/ti/cpsw_ethtool.c cpsw_fail(cpsw); cpsw 715 drivers/net/ethernet/ti/cpsw_ethtool.c struct cpsw_common *cpsw = ndev_to_cpsw(ndev); cpsw 724 drivers/net/ethernet/ti/cpsw_ethtool.c info->phc_index = cpsw->cpts->phc_index; cpsw 22 drivers/net/ethernet/ti/cpsw_priv.c int cpsw_init_common(struct cpsw_common *cpsw, void __iomem *ss_regs, cpsw 30 drivers/net/ethernet/ti/cpsw_priv.c struct device *dev = cpsw->dev; cpsw 34 drivers/net/ethernet/ti/cpsw_priv.c data = &cpsw->data; cpsw 35 drivers/net/ethernet/ti/cpsw_priv.c cpsw->rx_ch_num = 1; cpsw 36 drivers/net/ethernet/ti/cpsw_priv.c cpsw->tx_ch_num = 1; cpsw 38 drivers/net/ethernet/ti/cpsw_priv.c cpsw->version = readl(&cpsw->regs->id_ver); cpsw 43 drivers/net/ethernet/ti/cpsw_priv.c switch (cpsw->version) { cpsw 45 drivers/net/ethernet/ti/cpsw_priv.c cpsw->host_port_regs = ss_regs + CPSW1_HOST_PORT_OFFSET; cpsw 47 drivers/net/ethernet/ti/cpsw_priv.c cpsw->hw_stats = ss_regs + CPSW1_HW_STATS; cpsw 59 drivers/net/ethernet/ti/cpsw_priv.c cpsw->host_port_regs = ss_regs + CPSW2_HOST_PORT_OFFSET; cpsw 61 drivers/net/ethernet/ti/cpsw_priv.c cpsw->hw_stats = ss_regs + CPSW2_HW_STATS; cpsw 71 drivers/net/ethernet/ti/cpsw_priv.c dev_err(dev, "unknown version 0x%08x\n", cpsw->version); cpsw 75 drivers/net/ethernet/ti/cpsw_priv.c for (i = 0; i < cpsw->data.slaves; i++) { cpsw 76 drivers/net/ethernet/ti/cpsw_priv.c struct cpsw_slave *slave = &cpsw->slaves[i]; cpsw 77 drivers/net/ethernet/ti/cpsw_priv.c void __iomem *regs = cpsw->regs; cpsw 80 drivers/net/ethernet/ti/cpsw_priv.c slave->data = &cpsw->data.slave_data[i]; cpsw 96 drivers/net/ethernet/ti/cpsw_priv.c cpsw->ale = cpsw_ale_create(&ale_params); cpsw 97 drivers/net/ethernet/ti/cpsw_priv.c if (!cpsw->ale) { cpsw 116 drivers/net/ethernet/ti/cpsw_priv.c dma_params.bus_freq_mhz = cpsw->bus_freq_mhz; cpsw 119 drivers/net/ethernet/ti/cpsw_priv.c cpsw->dma = cpdma_ctlr_create(&dma_params); cpsw 120 drivers/net/ethernet/ti/cpsw_priv.c if (!cpsw->dma) { cpsw 125 drivers/net/ethernet/ti/cpsw_priv.c cpsw->cpts = cpts_create(cpsw->dev, cpts_regs, cpsw->dev->of_node); cpsw 126 drivers/net/ethernet/ti/cpsw_priv.c if (IS_ERR(cpsw->cpts)) { cpsw 127 drivers/net/ethernet/ti/cpsw_priv.c ret = PTR_ERR(cpsw->cpts); cpsw 128 drivers/net/ethernet/ti/cpsw_priv.c cpdma_ctlr_destroy(cpsw->dma); cpsw 370 drivers/net/ethernet/ti/cpsw_priv.h struct cpsw_common *cpsw; cpsw 373 drivers/net/ethernet/ti/cpsw_priv.h #define ndev_to_cpsw(ndev) (((struct cpsw_priv *)netdev_priv(ndev))->cpsw) cpsw 376 drivers/net/ethernet/ti/cpsw_priv.h #define cpsw_slave_index(cpsw, priv) \ cpsw 377 drivers/net/ethernet/ti/cpsw_priv.h ((cpsw->data.dual_emac) ? priv->emac_port : \ cpsw 378 drivers/net/ethernet/ti/cpsw_priv.h cpsw->data.active_slave) cpsw 392 drivers/net/ethernet/ti/cpsw_priv.h int cpsw_init_common(struct cpsw_common *cpsw, void __iomem *ss_regs, cpsw 395 drivers/net/ethernet/ti/cpsw_priv.h void cpsw_split_res(struct cpsw_common *cpsw); cpsw 397 drivers/net/ethernet/ti/cpsw_priv.h void cpsw_intr_enable(struct cpsw_common *cpsw); cpsw 398 drivers/net/ethernet/ti/cpsw_priv.h void cpsw_intr_disable(struct cpsw_common *cpsw); cpsw 400 drivers/net/ethernet/ti/cpsw_priv.h int cpsw_create_xdp_rxqs(struct cpsw_common *cpsw); cpsw 401 drivers/net/ethernet/ti/cpsw_priv.h void cpsw_destroy_xdp_rxqs(struct cpsw_common *cpsw);