| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * OF helpers for network devices. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This file is released under the GPLv2 |
|---|
| 5 | 4 | */ |
|---|
| 6 | 5 | |
|---|
| 7 | 6 | #ifndef __LINUX_OF_NET_H |
|---|
| 8 | 7 | #define __LINUX_OF_NET_H |
|---|
| 9 | 8 | |
|---|
| 9 | +#include <linux/phy.h> |
|---|
| 10 | + |
|---|
| 10 | 11 | #ifdef CONFIG_OF_NET |
|---|
| 11 | 12 | #include <linux/of.h> |
|---|
| 12 | 13 | |
|---|
| 13 | 14 | struct net_device; |
|---|
| 14 | | -extern int of_get_phy_mode(struct device_node *np); |
|---|
| 15 | +extern int of_get_phy_mode(struct device_node *np, phy_interface_t *interface); |
|---|
| 15 | 16 | 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 | 17 | extern struct net_device *of_find_net_device_by_node(struct device_node *np); |
|---|
| 18 | 18 | #else |
|---|
| 19 | | -static inline int of_get_phy_mode(struct device_node *np) |
|---|
| 19 | +static inline int of_get_phy_mode(struct device_node *np, |
|---|
| 20 | + phy_interface_t *interface) |
|---|
| 20 | 21 | { |
|---|
| 21 | 22 | return -ENODEV; |
|---|
| 22 | 23 | } |
|---|
| 23 | 24 | |
|---|
| 24 | 25 | static inline const void *of_get_mac_address(struct device_node *np) |
|---|
| 25 | 26 | { |
|---|
| 26 | | - return NULL; |
|---|
| 27 | | -} |
|---|
| 28 | | - |
|---|
| 29 | | -static inline int of_get_nvmem_mac_address(struct device_node *np, void *addr) |
|---|
| 30 | | -{ |
|---|
| 31 | | - return -ENODEV; |
|---|
| 27 | + return ERR_PTR(-ENODEV); |
|---|
| 32 | 28 | } |
|---|
| 33 | 29 | |
|---|
| 34 | 30 | static inline struct net_device *of_find_net_device_by_node(struct device_node *np) |
|---|