Lines Matching refs:mac_dev

201 static void dpaa_eth_cgr_set_speed(struct mac_device *mac_dev, int speed);
209 struct mac_device *mac_dev = priv->mac_dev; in dpaa_netdev_init() local
223 mac_addr = mac_dev->addr; in dpaa_netdev_init()
225 net_dev->mem_start = (unsigned long)priv->mac_dev->res->start; in dpaa_netdev_init()
226 net_dev->mem_end = (unsigned long)priv->mac_dev->res->end; in dpaa_netdev_init()
258 err = mac_dev->change_addr(mac_dev->fman_mac, in dpaa_netdev_init()
274 mac_dev->phylink_config.dev = &net_dev->dev; in dpaa_netdev_init()
275 mac_dev->phylink_config.type = PHYLINK_NETDEV; in dpaa_netdev_init()
276 mac_dev->update_speed = dpaa_eth_cgr_set_speed; in dpaa_netdev_init()
277 mac_dev->phylink = phylink_create(&mac_dev->phylink_config, in dpaa_netdev_init()
278 dev_fwnode(mac_dev->dev), in dpaa_netdev_init()
279 mac_dev->phy_if, in dpaa_netdev_init()
280 mac_dev->phylink_ops); in dpaa_netdev_init()
281 if (IS_ERR(mac_dev->phylink)) { in dpaa_netdev_init()
282 err = PTR_ERR(mac_dev->phylink); in dpaa_netdev_init()
293 phylink_destroy(mac_dev->phylink); in dpaa_netdev_init()
302 struct mac_device *mac_dev; in dpaa_stop() local
308 mac_dev = priv->mac_dev; in dpaa_stop()
316 phylink_stop(mac_dev->phylink); in dpaa_stop()
317 mac_dev->disable(mac_dev->fman_mac); in dpaa_stop()
319 for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { in dpaa_stop()
320 error = fman_port_disable(mac_dev->port[i]); in dpaa_stop()
325 phylink_disconnect_phy(mac_dev->phylink); in dpaa_stop()
416 struct mac_device *mac_dev; in dpaa_mac_dev_get() local
424 mac_dev = eth_data->mac_dev; in dpaa_mac_dev_get()
425 if (!mac_dev) { in dpaa_mac_dev_get()
430 return mac_dev; in dpaa_mac_dev_get()
436 struct mac_device *mac_dev; in dpaa_set_mac_address() local
450 mac_dev = priv->mac_dev; in dpaa_set_mac_address()
452 err = mac_dev->change_addr(mac_dev->fman_mac, in dpaa_set_mac_address()
473 if (!!(net_dev->flags & IFF_PROMISC) != priv->mac_dev->promisc) { in dpaa_set_rx_mode()
474 priv->mac_dev->promisc = !priv->mac_dev->promisc; in dpaa_set_rx_mode()
475 err = priv->mac_dev->set_promisc(priv->mac_dev->fman_mac, in dpaa_set_rx_mode()
476 priv->mac_dev->promisc); in dpaa_set_rx_mode()
483 if (!!(net_dev->flags & IFF_ALLMULTI) != priv->mac_dev->allmulti) { in dpaa_set_rx_mode()
484 priv->mac_dev->allmulti = !priv->mac_dev->allmulti; in dpaa_set_rx_mode()
485 err = priv->mac_dev->set_allmulti(priv->mac_dev->fman_mac, in dpaa_set_rx_mode()
486 priv->mac_dev->allmulti); in dpaa_set_rx_mode()
493 err = priv->mac_dev->set_multi(net_dev, priv->mac_dev); in dpaa_set_rx_mode()
858 if (priv->mac_dev->phylink_config.mac_capabilities & MAC_10000FD) in dpaa_eth_cgr_init()
878 priv->cgr_data.cgr.cgrid, priv->mac_dev->addr, in dpaa_eth_cgr_init()
885 static void dpaa_eth_cgr_set_speed(struct mac_device *mac_dev, int speed) in dpaa_eth_cgr_set_speed() argument
887 struct net_device *net_dev = to_net_dev(mac_dev->phylink_config.dev); in dpaa_eth_cgr_set_speed()
1315 static int dpaa_eth_init_ports(struct mac_device *mac_dev, in dpaa_eth_init_ports() argument
1321 struct fman_port *rxport = mac_dev->port[RX]; in dpaa_eth_init_ports()
1322 struct fman_port *txport = mac_dev->port[TX]; in dpaa_eth_init_ports()
1722 if (!fman_port_get_tstamp(priv->mac_dev->port[TX], vaddr, in dpaa_cleanup_tx_fd()
2743 if (!fman_port_get_tstamp(priv->mac_dev->port[RX], vaddr, &ns)) in rx_default_dqrr()
2751 !fman_port_get_hash_result_offset(priv->mac_dev->port[RX], in rx_default_dqrr()
2923 struct mac_device *mac_dev; in dpaa_open() local
2928 mac_dev = priv->mac_dev; in dpaa_open()
2931 err = phylink_of_phy_connect(mac_dev->phylink, in dpaa_open()
2932 mac_dev->dev->of_node, 0); in dpaa_open()
2936 for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { in dpaa_open()
2937 err = fman_port_enable(mac_dev->port[i]); in dpaa_open()
2942 err = priv->mac_dev->enable(mac_dev->fman_mac); in dpaa_open()
2947 phylink_start(mac_dev->phylink); in dpaa_open()
2954 for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) in dpaa_open()
2955 fman_port_disable(mac_dev->port[i]); in dpaa_open()
2956 phylink_disconnect_phy(mac_dev->phylink); in dpaa_open()
3086 priv->mac_dev->set_tstamp(priv->mac_dev->fman_mac, true); in dpaa_ts_ioctl()
3099 priv->mac_dev->set_tstamp(priv->mac_dev->fman_mac, true); in dpaa_ts_ioctl()
3116 return phylink_mii_ioctl(priv->mac_dev->phylink, rq, in dpaa_ioctl()
3247 priv->ingress_cgr.cgrid, priv->mac_dev->addr); in dpaa_ingress_cgr_init()
3291 struct mac_device *mac_dev; in dpaa_eth_probe() local
3362 mac_dev = dpaa_mac_dev_get(pdev); in dpaa_eth_probe()
3363 if (IS_ERR(mac_dev)) { in dpaa_eth_probe()
3365 err = PTR_ERR(mac_dev); in dpaa_eth_probe()
3370 priv->rx_dma_dev = fman_port_get_device(mac_dev->port[RX]); in dpaa_eth_probe()
3371 priv->tx_dma_dev = fman_port_get_device(mac_dev->port[TX]); in dpaa_eth_probe()
3423 priv->mac_dev = mac_dev; in dpaa_eth_probe()
3439 err = dpaa_fq_setup(priv, &dpaa_fq_cbs, priv->mac_dev->port[TX]); in dpaa_eth_probe()
3471 err = dpaa_eth_init_ports(mac_dev, dpaa_bp, &port_fqs, in dpaa_eth_probe()
3540 phylink_destroy(priv->mac_dev->phylink); in dpaa_remove()