net: dev: Makes sure netif_rx() can be invoked in any context.
[linux-block.git] / include / linux / of_net.h
CommitLineData
55716d26 1/* SPDX-License-Identifier: GPL-2.0-only */
4b6ba8aa
DD
2/*
3 * OF helpers for network devices.
4b6ba8aa
DD
4 */
5
6#ifndef __LINUX_OF_NET_H
7#define __LINUX_OF_NET_H
8
0c65b2b9
AL
9#include <linux/phy.h>
10
8b017fbe 11#if defined(CONFIG_OF) && defined(CONFIG_NET)
4b6ba8aa 12#include <linux/of.h>
aa836df9
FF
13
14struct net_device;
0c65b2b9 15extern int of_get_phy_mode(struct device_node *np, phy_interface_t *interface);
83216e39 16extern int of_get_mac_address(struct device_node *np, u8 *mac);
d466effe 17int of_get_ethdev_address(struct device_node *np, struct net_device *dev);
aa836df9 18extern struct net_device *of_find_net_device_by_node(struct device_node *np);
65b3841b 19#else
0c65b2b9
AL
20static inline int of_get_phy_mode(struct device_node *np,
21 phy_interface_t *interface)
65b3841b
GR
22{
23 return -ENODEV;
24}
25
83216e39 26static inline int of_get_mac_address(struct device_node *np, u8 *mac)
65b3841b 27{
83216e39 28 return -ENODEV;
65b3841b 29}
aa836df9 30
d466effe
JK
31static inline int of_get_ethdev_address(struct device_node *np, struct net_device *dev)
32{
33 return -ENODEV;
34}
35
aa836df9
FF
36static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
37{
38 return NULL;
39}
4b6ba8aa
DD
40#endif
41
42#endif /* __LINUX_OF_NET_H */