Lines Matching defs:mac_dev
44 static void mac_exception(struct mac_device *mac_dev,
49 mac_dev->set_exception(mac_dev->fman_mac,
51 dev_err(mac_dev->dev, "10G MAC got RX FIFO Error = %x\n", ex);
54 dev_dbg(mac_dev->dev, "%s:%s() -> %d\n", KBUILD_BASENAME ".c",
61 struct mac_device *mac_dev)
69 priv = mac_dev->priv;
71 data.mac_dev = mac_dev;
82 pdev->dev.parent = mac_dev->dev;
116 int (*init)(struct mac_device *mac_dev, struct device_node *mac_node,
120 struct mac_device *mac_dev;
132 mac_dev = devm_kzalloc(dev, sizeof(*mac_dev), GFP_KERNEL);
133 if (!mac_dev)
138 platform_set_drvdata(_of_dev, mac_dev);
141 mac_dev->priv = priv;
142 mac_dev->dev = dev;
158 mac_dev->fman_dev = &of_dev->dev;
170 priv->fman = fman_bind(mac_dev->fman_dev);
181 put_device(mac_dev->fman_dev);
186 mac_dev->res = platform_get_mem_or_io(_of_dev, 0);
187 if (!mac_dev->res) {
194 mac_dev->res);
200 mac_dev->vaddr = devm_ioremap(dev, mac_dev->res->start,
201 resource_size(mac_dev->res));
202 if (!mac_dev->vaddr) {
228 err = of_get_mac_address(mac_node, mac_dev->addr);
241 if (nph != ARRAY_SIZE(mac_dev->port)) {
266 mac_dev->fman_port_devs[i] = &of_dev->dev;
268 mac_dev->port[i] = fman_port_bind(mac_dev->fman_port_devs[i]);
269 if (!mac_dev->port[i]) {
279 put_device(mac_dev->fman_port_devs[i]);
292 mac_dev->phy_if = phy_if;
299 err = init(mac_dev, mac_node, ¶ms);
303 if (!is_zero_ether_addr(mac_dev->addr))
304 dev_info(dev, "FMan MAC address: %pM\n", mac_dev->addr);
306 priv->eth_dev = dpaa_eth_add_device(fman_id, mac_dev);
317 /* mac_dev is kzalloc'ed */
319 put_device(mac_dev->fman_port_devs[i]);
321 put_device(mac_dev->fman_dev);
329 struct mac_device *mac_dev = platform_get_drvdata(pdev);
333 put_device(mac_dev->fman_port_devs[i]);
334 put_device(mac_dev->fman_dev);
336 platform_device_unregister(mac_dev->priv->eth_dev);