Lines Matching refs:mac_dev
44 static void mac_exception(struct mac_device *mac_dev, in mac_exception() argument
49 mac_dev->set_exception(mac_dev->fman_mac, in mac_exception()
51 dev_err(mac_dev->dev, "10G MAC got RX FIFO Error = %x\n", ex); in mac_exception()
54 dev_dbg(mac_dev->dev, "%s:%s() -> %d\n", KBUILD_BASENAME ".c", in mac_exception()
58 int fman_set_multi(struct net_device *net_dev, struct mac_device *mac_dev) in fman_set_multi() argument
66 priv = mac_dev->priv; in fman_set_multi()
71 err = mac_dev->remove_hash_mac_addr(mac_dev->fman_mac, addr); in fman_set_multi()
82 err = mac_dev->add_hash_mac_addr(mac_dev->fman_mac, addr); in fman_set_multi()
110 int fman_set_mac_active_pause(struct mac_device *mac_dev, bool rx, bool tx) in fman_set_mac_active_pause() argument
112 struct fman_mac *fman_mac = mac_dev->fman_mac; in fman_set_mac_active_pause()
115 if (rx != mac_dev->rx_pause_active) { in fman_set_mac_active_pause()
116 err = mac_dev->set_rx_pause(fman_mac, rx); in fman_set_mac_active_pause()
118 mac_dev->rx_pause_active = rx; in fman_set_mac_active_pause()
121 if (tx != mac_dev->tx_pause_active) { in fman_set_mac_active_pause()
125 err = mac_dev->set_tx_pause(fman_mac, 0, pause_time, 0); in fman_set_mac_active_pause()
128 mac_dev->tx_pause_active = tx; in fman_set_mac_active_pause()
146 void fman_get_pause_cfg(struct mac_device *mac_dev, bool *rx_pause, in fman_get_pause_cfg() argument
149 struct phy_device *phy_dev = mac_dev->phy_dev; in fman_get_pause_cfg()
161 if (!mac_dev->autoneg_pause) { in fman_get_pause_cfg()
162 *rx_pause = mac_dev->rx_pause_req; in fman_get_pause_cfg()
163 *tx_pause = mac_dev->tx_pause_req; in fman_get_pause_cfg()
221 struct mac_device *mac_dev) in dpaa_eth_add_device() argument
229 priv = mac_dev->priv; in dpaa_eth_add_device()
231 data.mac_dev = mac_dev; in dpaa_eth_add_device()
242 pdev->dev.parent = mac_dev->dev; in dpaa_eth_add_device()
276 int (*init)(struct mac_device *mac_dev, struct device_node *mac_node, in mac_probe()
280 struct mac_device *mac_dev; in mac_probe() local
292 mac_dev = devm_kzalloc(dev, sizeof(*mac_dev), GFP_KERNEL); in mac_probe()
293 if (!mac_dev) in mac_probe()
300 mac_dev->priv = priv; in mac_probe()
301 mac_dev->dev = dev; in mac_probe()
340 mac_dev->res = platform_get_mem_or_io(_of_dev, 0); in mac_probe()
341 if (!mac_dev->res) { in mac_probe()
347 mac_dev->res); in mac_probe()
353 mac_dev->vaddr = devm_ioremap(dev, mac_dev->res->start, in mac_probe()
354 resource_size(mac_dev->res)); in mac_probe()
355 if (!mac_dev->vaddr) { in mac_probe()
372 err = of_get_mac_address(mac_node, mac_dev->addr); in mac_probe()
384 if (nph != ARRAY_SIZE(mac_dev->port)) { in mac_probe()
390 for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { in mac_probe()
407 mac_dev->port[i] = fman_port_bind(&of_dev->dev); in mac_probe()
408 if (!mac_dev->port[i]) { in mac_probe()
425 mac_dev->phy_if = phy_if; in mac_probe()
427 priv->speed = phy2speed[mac_dev->phy_if]; in mac_probe()
429 mac_dev->if_support = DTSEC_SUPPORTED; in mac_probe()
431 if (mac_dev->phy_if == PHY_INTERFACE_MODE_SGMII) in mac_probe()
432 mac_dev->if_support &= ~(SUPPORTED_10baseT_Half | in mac_probe()
437 mac_dev->if_support |= SUPPORTED_1000baseT_Full; in mac_probe()
440 if (mac_dev->phy_if == PHY_INTERFACE_MODE_XGMII) in mac_probe()
441 mac_dev->if_support = SUPPORTED_10000baseT_Full; in mac_probe()
444 mac_dev->phy_node = of_parse_phandle(mac_node, "phy-handle", 0); in mac_probe()
452 err = init(mac_dev, mac_node, ¶ms); in mac_probe()
455 of_node_put(mac_dev->phy_node); in mac_probe()
460 mac_dev->autoneg_pause = true; in mac_probe()
465 mac_dev->rx_pause_req = true; in mac_probe()
466 mac_dev->tx_pause_req = true; in mac_probe()
467 mac_dev->rx_pause_active = false; in mac_probe()
468 mac_dev->tx_pause_active = false; in mac_probe()
469 err = fman_set_mac_active_pause(mac_dev, true, true); in mac_probe()
473 if (!is_zero_ether_addr(mac_dev->addr)) in mac_probe()
474 dev_info(dev, "FMan MAC address: %pM\n", mac_dev->addr); in mac_probe()
476 priv->eth_dev = dpaa_eth_add_device(fman_id, mac_dev); in mac_probe()
492 struct mac_device *mac_dev = platform_get_drvdata(pdev); in mac_remove() local
494 platform_device_unregister(mac_dev->priv->eth_dev); in mac_remove()