of_net.h 882 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
/*
 * OF helpers for network devices.
 *
 * This file is released under the GPLv2
 */

#ifndef __LINUX_OF_NET_H
#define __LINUX_OF_NET_H

#ifdef CONFIG_OF_NET
#include <linux/of.h>
12 13

struct net_device;
14
extern int of_get_phy_mode(struct device_node *np);
15
extern const void *of_get_mac_address(struct device_node *np);
16
extern int of_get_nvmem_mac_address(struct device_node *np, void *addr);
17
extern struct net_device *of_find_net_device_by_node(struct device_node *np);
18
#else
19
static inline int of_get_phy_mode(struct device_node *np)
20 21 22 23 24 25 26 27
{
	return -ENODEV;
}

static inline const void *of_get_mac_address(struct device_node *np)
{
	return NULL;
}
28

29 30 31 32 33
static inline int of_get_nvmem_mac_address(struct device_node *np, void *addr)
{
	return -ENODEV;
}

34 35 36 37
static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
{
	return NULL;
}
38 39 40
#endif

#endif /* __LINUX_OF_NET_H */