net/ethoc: add CONFIG_DM_ETH support

Extract reusable parts from ethoc_init, ethoc_set_mac_address,
ethoc_send and ethoc_receive, move the rest under #ifdef CONFIG_DM_ETH.
Add U_BOOT_DRIVER, eth_ops structure and implement required methods.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
Max Filippov
2016-08-05 18:26:17 +03:00
committed by Joe Hershberger
parent a84a757ae7
commit 5d43feabf3
2 changed files with 193 additions and 46 deletions

View File

@@ -0,0 +1,20 @@
/*
* Copyright (C) 2016 Cadence Design Systems Inc.
*
* SPDX-License-Identifier: GPL-2.0
*/
#ifndef _ETHOC_H
#define _ETHOC_H
#include <net.h>
#ifdef CONFIG_DM_ETH
struct ethoc_eth_pdata {
struct eth_pdata eth_pdata;
};
#endif
#endif /* _ETHOC_H */