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()
61 struct mac_device *mac_dev) in dpaa_eth_add_device() argument
69 priv = mac_dev->priv; in dpaa_eth_add_device()
71 data.mac_dev = mac_dev; in dpaa_eth_add_device()
82 pdev->dev.parent = mac_dev->dev; in dpaa_eth_add_device()
116 int (*init)(struct mac_device *mac_dev, struct device_node *mac_node, in mac_probe()
120 struct mac_device *mac_dev; in mac_probe() local
132 mac_dev = devm_kzalloc(dev, sizeof(*mac_dev), GFP_KERNEL); in mac_probe()
133 if (!mac_dev) in mac_probe()
138 platform_set_drvdata(_of_dev, mac_dev); in mac_probe()
141 mac_dev->priv = priv; in mac_probe()
142 mac_dev->dev = dev; in mac_probe()
158 mac_dev->fman_dev = &of_dev->dev; in mac_probe()
170 priv->fman = fman_bind(mac_dev->fman_dev); in mac_probe()
181 put_device(mac_dev->fman_dev); in mac_probe()
186 mac_dev->res = platform_get_mem_or_io(_of_dev, 0); in mac_probe()
187 if (!mac_dev->res) { in mac_probe()
194 mac_dev->res); in mac_probe()
200 mac_dev->vaddr = devm_ioremap(dev, mac_dev->res->start, in mac_probe()
201 resource_size(mac_dev->res)); in mac_probe()
202 if (!mac_dev->vaddr) { in mac_probe()
228 err = of_get_mac_address(mac_node, mac_dev->addr); in mac_probe()
241 if (nph != ARRAY_SIZE(mac_dev->port)) { in mac_probe()
266 mac_dev->fman_port_devs[i] = &of_dev->dev; in mac_probe()
268 mac_dev->port[i] = fman_port_bind(mac_dev->fman_port_devs[i]); in mac_probe()
269 if (!mac_dev->port[i]) { in mac_probe()
279 put_device(mac_dev->fman_port_devs[i]); in mac_probe()
292 mac_dev->phy_if = phy_if; in mac_probe()
299 err = init(mac_dev, mac_node, ¶ms); in mac_probe()
303 if (!is_zero_ether_addr(mac_dev->addr)) in mac_probe()
304 dev_info(dev, "FMan MAC address: %pM\n", mac_dev->addr); in mac_probe()
306 priv->eth_dev = dpaa_eth_add_device(fman_id, mac_dev); in mac_probe()
319 put_device(mac_dev->fman_port_devs[i]); in mac_probe()
321 put_device(mac_dev->fman_dev); in mac_probe()
329 struct mac_device *mac_dev = platform_get_drvdata(pdev); in mac_remove() local
333 put_device(mac_dev->fman_port_devs[i]); in mac_remove()
334 put_device(mac_dev->fman_dev); in mac_remove()
336 platform_device_unregister(mac_dev->priv->eth_dev); in mac_remove()