Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
02c2c51c
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
02c2c51c
编写于
9月 30, 2015
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.denx.de/u-boot-net
上级
4af90a6d
8ac46a98
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
43 addition
and
5 deletion
+43
-5
common/bootm.c
common/bootm.c
+2
-0
configs/Bananapi_defconfig
configs/Bananapi_defconfig
+1
-0
configs/Bananapro_defconfig
configs/Bananapro_defconfig
+1
-0
drivers/net/netconsole.c
drivers/net/netconsole.c
+11
-3
drivers/net/phy/phy.c
drivers/net/phy/phy.c
+1
-1
include/net.h
include/net.h
+4
-0
net/Kconfig
net/Kconfig
+6
-0
net/eth.c
net/eth.c
+17
-1
未找到文件。
common/bootm.c
浏览文件 @
02c2c51c
...
...
@@ -474,7 +474,9 @@ ulong bootm_disable_interrupts(void)
#ifdef CONFIG_NETCONSOLE
/* Stop the ethernet stack if NetConsole could have left it up */
eth_halt
();
# ifndef CONFIG_DM_ETH
eth_unregister
(
eth_get_dev
());
# endif
#endif
#if defined(CONFIG_CMD_USB)
...
...
configs/Bananapi_defconfig
浏览文件 @
02c2c51c
...
...
@@ -11,5 +11,6 @@ CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHC
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_NETCONSOLE=y
CONFIG_ETH_DESIGNWARE=y
CONFIG_USB_EHCI_HCD=y
configs/Bananapro_defconfig
浏览文件 @
02c2c51c
...
...
@@ -13,5 +13,6 @@ CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHC
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_NETCONSOLE=y
CONFIG_ETH_DESIGNWARE=y
CONFIG_USB_EHCI_HCD=y
drivers/net/netconsole.c
浏览文件 @
02c2c51c
...
...
@@ -170,7 +170,11 @@ int nc_input_packet(uchar *pkt, struct in_addr src_ip, unsigned dest_port,
static
void
nc_send_packet
(
const
char
*
buf
,
int
len
)
{
#ifdef CONFIG_DM_ETH
struct
udevice
*
eth
;
#else
struct
eth_device
*
eth
;
#endif
int
inited
=
0
;
uchar
*
pkt
;
uchar
*
ether
;
...
...
@@ -183,7 +187,7 @@ static void nc_send_packet(const char *buf, int len)
return
;
if
(
!
memcmp
(
nc_ether
,
net_null_ethaddr
,
6
))
{
if
(
eth
->
state
==
ETH_STATE_ACTIVE
)
if
(
eth
_is_active
(
eth
)
)
return
;
/* inside net loop */
output_packet
=
buf
;
output_packet_len
=
len
;
...
...
@@ -194,7 +198,7 @@ static void nc_send_packet(const char *buf, int len)
return
;
}
if
(
eth
->
state
!=
ETH_STATE_ACTIVE
)
{
if
(
!
eth_is_active
(
eth
)
)
{
if
(
eth_is_on_demand_init
())
{
if
(
eth_init
()
<
0
)
return
;
...
...
@@ -292,7 +296,11 @@ static int nc_stdio_getc(struct stdio_dev *dev)
static
int
nc_stdio_tstc
(
struct
stdio_dev
*
dev
)
{
#ifdef CONFIG_DM_ETH
struct
udevice
*
eth
;
#else
struct
eth_device
*
eth
;
#endif
if
(
input_recursion
)
return
0
;
...
...
@@ -301,7 +309,7 @@ static int nc_stdio_tstc(struct stdio_dev *dev)
return
1
;
eth
=
eth_get_dev
();
if
(
eth
&&
eth
->
state
==
ETH_STATE_ACTIVE
)
if
(
eth
_is_active
(
eth
)
)
return
0
;
/* inside net loop */
input_recursion
=
1
;
...
...
drivers/net/phy/phy.c
浏览文件 @
02c2c51c
...
...
@@ -571,7 +571,7 @@ static struct phy_device *phy_device_create(struct mii_dev *bus, int addr,
memset
(
dev
,
0
,
sizeof
(
*
dev
));
dev
->
duplex
=
-
1
;
dev
->
link
=
1
;
dev
->
link
=
0
;
dev
->
interface
=
interface
;
dev
->
autoneg
=
AUTONEG_ENABLE
;
...
...
include/net.h
浏览文件 @
02c2c51c
...
...
@@ -149,7 +149,9 @@ struct udevice *eth_get_dev(void); /* get the current device */
*/
struct
udevice
*
eth_get_dev_by_name
(
const
char
*
devname
);
unsigned
char
*
eth_get_ethaddr
(
void
);
/* get the current device MAC */
/* Used only when NetConsole is enabled */
int
eth_is_active
(
struct
udevice
*
dev
);
/* Test device for active state */
int
eth_init_state_only
(
void
);
/* Set active state */
void
eth_halt_state_only
(
void
);
/* Set passive state */
#endif
...
...
@@ -195,6 +197,8 @@ static inline unsigned char *eth_get_ethaddr(void)
return
NULL
;
}
/* Used only when NetConsole is enabled */
int
eth_is_active
(
struct
eth_device
*
dev
);
/* Test device for active state */
/* Set active state */
static
inline
__attribute__
((
always_inline
))
int
eth_init_state_only
(
void
)
{
...
...
net/Kconfig
浏览文件 @
02c2c51c
...
...
@@ -16,4 +16,10 @@ config NET_RANDOM_ETHADDR
A new MAC address will be generated on every boot and it will
not be added to the environment.
config NETCONSOLE
bool "NetConsole support"
help
Support the 'nc' input/output device for networked console.
See README.NetConsole for details.
endif # if NET
net/eth.c
浏览文件 @
02c2c51c
...
...
@@ -389,6 +389,17 @@ void eth_halt(void)
priv
->
state
=
ETH_STATE_PASSIVE
;
}
int
eth_is_active
(
struct
udevice
*
dev
)
{
struct
eth_device_priv
*
priv
;
if
(
!
dev
||
!
device_active
(
dev
))
return
0
;
priv
=
dev_get_uclass_priv
(
dev
);
return
priv
->
state
==
ETH_STATE_ACTIVE
;
}
int
eth_send
(
void
*
packet
,
int
length
)
{
struct
udevice
*
current
;
...
...
@@ -580,7 +591,7 @@ UCLASS_DRIVER(eth) = {
.
per_device_auto_alloc_size
=
sizeof
(
struct
eth_device_priv
),
.
flags
=
DM_UC_FLAG_SEQ_ALIAS
,
};
#endif
#endif
/* #ifdef CONFIG_DM_ETH */
#ifndef CONFIG_DM_ETH
...
...
@@ -918,6 +929,11 @@ void eth_halt(void)
eth_current
->
state
=
ETH_STATE_PASSIVE
;
}
int
eth_is_active
(
struct
eth_device
*
dev
)
{
return
dev
&&
dev
->
state
==
ETH_STATE_ACTIVE
;
}
int
eth_send
(
void
*
packet
,
int
length
)
{
if
(
!
eth_current
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录