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()
470 return priv->mac_dev->add_hash_mac_addr(priv->mac_dev->fman_mac, in dpaa_addr_sync()
478 return priv->mac_dev->remove_hash_mac_addr(priv->mac_dev->fman_mac, in dpaa_addr_unsync()
489 if (!!(net_dev->flags & IFF_PROMISC) != priv->mac_dev->promisc) { in dpaa_set_rx_mode()
490 priv->mac_dev->promisc = !priv->mac_dev->promisc; in dpaa_set_rx_mode()
491 err = priv->mac_dev->set_promisc(priv->mac_dev->fman_mac, in dpaa_set_rx_mode()
492 priv->mac_dev->promisc); in dpaa_set_rx_mode()
499 if (!!(net_dev->flags & IFF_ALLMULTI) != priv->mac_dev->allmulti) { in dpaa_set_rx_mode()
500 priv->mac_dev->allmulti = !priv->mac_dev->allmulti; in dpaa_set_rx_mode()
501 err = priv->mac_dev->set_allmulti(priv->mac_dev->fman_mac, in dpaa_set_rx_mode()
502 priv->mac_dev->allmulti); in dpaa_set_rx_mode()
874 if (priv->mac_dev->phylink_config.mac_capabilities & MAC_10000FD) in dpaa_eth_cgr_init()
894 priv->cgr_data.cgr.cgrid, priv->mac_dev->addr, in dpaa_eth_cgr_init()
901 static void dpaa_eth_cgr_set_speed(struct mac_device *mac_dev, int speed) in dpaa_eth_cgr_set_speed() argument
903 struct net_device *net_dev = to_net_dev(mac_dev->phylink_config.dev); in dpaa_eth_cgr_set_speed()
1331 static int dpaa_eth_init_ports(struct mac_device *mac_dev, in dpaa_eth_init_ports() argument
1337 struct fman_port *rxport = mac_dev->port[RX]; in dpaa_eth_init_ports()
1338 struct fman_port *txport = mac_dev->port[TX]; in dpaa_eth_init_ports()
1738 if (!fman_port_get_tstamp(priv->mac_dev->port[TX], vaddr, in dpaa_cleanup_tx_fd()
2765 if (!fman_port_get_tstamp(priv->mac_dev->port[RX], vaddr, &ns)) in rx_default_dqrr()
2773 !fman_port_get_hash_result_offset(priv->mac_dev->port[RX], in rx_default_dqrr()
2945 struct mac_device *mac_dev; in dpaa_open() local
2950 mac_dev = priv->mac_dev; in dpaa_open()
2953 err = phylink_of_phy_connect(mac_dev->phylink, in dpaa_open()
2954 mac_dev->dev->of_node, 0); in dpaa_open()
2958 for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { in dpaa_open()
2959 err = fman_port_enable(mac_dev->port[i]); in dpaa_open()
2964 err = priv->mac_dev->enable(mac_dev->fman_mac); in dpaa_open()
2969 phylink_start(mac_dev->phylink); in dpaa_open()
2976 for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) in dpaa_open()
2977 fman_port_disable(mac_dev->port[i]); in dpaa_open()
2978 phylink_disconnect_phy(mac_dev->phylink); in dpaa_open()
3108 priv->mac_dev->set_tstamp(priv->mac_dev->fman_mac, true); in dpaa_ts_ioctl()
3121 priv->mac_dev->set_tstamp(priv->mac_dev->fman_mac, true); in dpaa_ts_ioctl()
3138 return phylink_mii_ioctl(priv->mac_dev->phylink, rq, in dpaa_ioctl()
3269 priv->ingress_cgr.cgrid, priv->mac_dev->addr); in dpaa_ingress_cgr_init()
3313 struct mac_device *mac_dev; in dpaa_eth_probe() local
3384 mac_dev = dpaa_mac_dev_get(pdev); in dpaa_eth_probe()
3385 if (IS_ERR(mac_dev)) { in dpaa_eth_probe()
3387 err = PTR_ERR(mac_dev); in dpaa_eth_probe()
3392 priv->rx_dma_dev = fman_port_get_device(mac_dev->port[RX]); in dpaa_eth_probe()
3393 priv->tx_dma_dev = fman_port_get_device(mac_dev->port[TX]); in dpaa_eth_probe()
3445 priv->mac_dev = mac_dev; in dpaa_eth_probe()
3461 err = dpaa_fq_setup(priv, &dpaa_fq_cbs, priv->mac_dev->port[TX]); in dpaa_eth_probe()
3493 err = dpaa_eth_init_ports(mac_dev, dpaa_bp, &port_fqs, in dpaa_eth_probe()
3562 phylink_destroy(priv->mac_dev->phylink); in dpaa_remove()