Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
c645b181
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,发现更多精彩内容 >>
提交
c645b181
编写于
12月 09, 2008
作者:
W
Wolfgang Denk
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.denx.de/u-boot-net
上级
5e3ab68e
6a86bb6c
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
30 addition
and
13 deletion
+30
-13
common/cmd_net.c
common/cmd_net.c
+12
-8
drivers/net/tsec.c
drivers/net/tsec.c
+3
-0
include/net.h
include/net.h
+6
-0
include/tsec.h
include/tsec.h
+4
-0
net/net.c
net/net.c
+4
-3
net/tftp.c
net/tftp.c
+1
-2
未找到文件。
common/cmd_net.c
浏览文件 @
c645b181
...
@@ -154,8 +154,10 @@ static int
...
@@ -154,8 +154,10 @@ static int
netboot_common
(
proto_t
proto
,
cmd_tbl_t
*
cmdtp
,
int
argc
,
char
*
argv
[])
netboot_common
(
proto_t
proto
,
cmd_tbl_t
*
cmdtp
,
int
argc
,
char
*
argv
[])
{
{
char
*
s
;
char
*
s
;
char
*
end
;
int
rcode
=
0
;
int
rcode
=
0
;
int
size
;
int
size
;
ulong
addr
;
/* pre-set load_addr */
/* pre-set load_addr */
if
((
s
=
getenv
(
"loadaddr"
))
!=
NULL
)
{
if
((
s
=
getenv
(
"loadaddr"
))
!=
NULL
)
{
...
@@ -166,15 +168,17 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
...
@@ -166,15 +168,17 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
case
1
:
case
1
:
break
;
break
;
case
2
:
/* only one arg - accept two forms:
case
2
:
/*
* just load address, or just boot file name.
* Only one arg - accept two forms:
* The latter form must be written "filename" here.
* Just load address, or just boot file name. The latter
* form must be written in a format which can not be
* mis-interpreted as a valid number.
*/
*/
if
(
argv
[
1
][
0
]
==
'"'
)
{
/* just boot filename */
addr
=
simple_strtoul
(
argv
[
1
],
&
end
,
16
);
copy_filename
(
BootFile
,
argv
[
1
],
sizeof
(
BootFile
));
if
(
end
==
(
argv
[
1
]
+
strlen
(
argv
[
1
])))
}
else
{
/* load address */
load_addr
=
addr
;
load_addr
=
simple_strtoul
(
argv
[
1
],
NULL
,
16
);
else
}
copy_filename
(
BootFile
,
argv
[
1
],
sizeof
(
BootFile
));
break
;
break
;
case
3
:
load_addr
=
simple_strtoul
(
argv
[
1
],
NULL
,
16
);
case
3
:
load_addr
=
simple_strtoul
(
argv
[
1
],
NULL
,
16
);
...
...
drivers/net/tsec.c
浏览文件 @
c645b181
...
@@ -1196,6 +1196,9 @@ struct phy_info phy_info_M88E1121R = {
...
@@ -1196,6 +1196,9 @@ struct phy_info phy_info_M88E1121R = {
{
MIIM_88E1121_PHY_LED_CTRL
,
miim_read
,
{
MIIM_88E1121_PHY_LED_CTRL
,
miim_read
,
&
mii_88E1121_set_led
},
&
mii_88E1121_set_led
},
{
MIIM_CONTROL
,
MIIM_CONTROL_INIT
,
&
mii_cr_init
},
{
MIIM_CONTROL
,
MIIM_CONTROL_INIT
,
&
mii_cr_init
},
/* Disable IRQs and de-assert interrupt */
{
MIIM_88E1121_PHY_IRQ_EN
,
0
,
NULL
},
{
MIIM_88E1121_PHY_IRQ_STATUS
,
miim_read
,
NULL
},
{
miim_end
,}
{
miim_end
,}
},
},
(
struct
phy_cmd
[]){
/* startup */
(
struct
phy_cmd
[]){
/* startup */
...
...
include/net.h
浏览文件 @
c645b181
...
@@ -200,6 +200,12 @@ typedef struct {
...
@@ -200,6 +200,12 @@ typedef struct {
ushort
udp_xsum
;
/* Checksum */
ushort
udp_xsum
;
/* Checksum */
}
IP_t
;
}
IP_t
;
#define IP_OFFS 0x1fff
/* ip offset *= 8 */
#define IP_FLAGS 0xe000
/* first 3 bits */
#define IP_FLAGS_RES 0x8000
/* reserved */
#define IP_FLAGS_DFRAG 0x4000
/* don't fragments */
#define IP_FLAGS_MFRAG 0x2000
/* more fragments */
#define IP_HDR_SIZE_NO_UDP (sizeof (IP_t) - 8)
#define IP_HDR_SIZE_NO_UDP (sizeof (IP_t) - 8)
#define IP_HDR_SIZE (sizeof (IP_t))
#define IP_HDR_SIZE (sizeof (IP_t))
...
...
include/tsec.h
浏览文件 @
c645b181
...
@@ -226,6 +226,10 @@
...
@@ -226,6 +226,10 @@
#define MIIM_88E1121_PHY_LED_PAGE 3
#define MIIM_88E1121_PHY_LED_PAGE 3
#define MIIM_88E1121_PHY_LED_DEF 0x0030
#define MIIM_88E1121_PHY_LED_DEF 0x0030
/* 88E1121 PHY IRQ Enable/Status Register */
#define MIIM_88E1121_PHY_IRQ_EN 18
#define MIIM_88E1121_PHY_IRQ_STATUS 19
#define MIIM_88E1121_PHY_PAGE 22
#define MIIM_88E1121_PHY_PAGE 22
/* 88E1145 Extended PHY Specific Control Register */
/* 88E1145 Extended PHY Specific Control Register */
...
...
net/net.c
浏览文件 @
c645b181
...
@@ -738,7 +738,7 @@ int PingSend(void)
...
@@ -738,7 +738,7 @@ int PingSend(void)
ip
->
ip_tos
=
0
;
ip
->
ip_tos
=
0
;
ip
->
ip_len
=
htons
(
IP_HDR_SIZE_NO_UDP
+
8
);
ip
->
ip_len
=
htons
(
IP_HDR_SIZE_NO_UDP
+
8
);
ip
->
ip_id
=
htons
(
NetIPID
++
);
ip
->
ip_id
=
htons
(
NetIPID
++
);
ip
->
ip_off
=
htons
(
0x4000
);
/* No fragmentation
*/
ip
->
ip_off
=
htons
(
IP_FLAGS_DFRAG
);
/* Don't fragment
*/
ip
->
ip_ttl
=
255
;
ip
->
ip_ttl
=
255
;
ip
->
ip_p
=
0x01
;
/* ICMP */
ip
->
ip_p
=
0x01
;
/* ICMP */
ip
->
ip_sum
=
0
;
ip
->
ip_sum
=
0
;
...
@@ -1402,7 +1402,8 @@ NetReceive(volatile uchar * inpkt, int len)
...
@@ -1402,7 +1402,8 @@ NetReceive(volatile uchar * inpkt, int len)
if
((
ip
->
ip_hl_v
&
0xf0
)
!=
0x40
)
{
if
((
ip
->
ip_hl_v
&
0xf0
)
!=
0x40
)
{
return
;
return
;
}
}
if
(
ip
->
ip_off
&
htons
(
0x1fff
))
{
/* Can't deal w/ fragments */
/* Can't deal with fragments */
if
(
ip
->
ip_off
&
htons
(
IP_OFFS
|
IP_FLAGS_MFRAG
))
{
return
;
return
;
}
}
/* can't deal with headers > 20 bytes */
/* can't deal with headers > 20 bytes */
...
@@ -1701,7 +1702,7 @@ NetSetIP(volatile uchar * xip, IPaddr_t dest, int dport, int sport, int len)
...
@@ -1701,7 +1702,7 @@ NetSetIP(volatile uchar * xip, IPaddr_t dest, int dport, int sport, int len)
ip
->
ip_tos
=
0
;
ip
->
ip_tos
=
0
;
ip
->
ip_len
=
htons
(
IP_HDR_SIZE
+
len
);
ip
->
ip_len
=
htons
(
IP_HDR_SIZE
+
len
);
ip
->
ip_id
=
htons
(
NetIPID
++
);
ip
->
ip_id
=
htons
(
NetIPID
++
);
ip
->
ip_off
=
htons
(
0x4000
);
/* No fragmentation
*/
ip
->
ip_off
=
htons
(
IP_FLAGS_DFRAG
);
/* Don't fragment
*/
ip
->
ip_ttl
=
255
;
ip
->
ip_ttl
=
255
;
ip
->
ip_p
=
17
;
/* UDP */
ip
->
ip_p
=
17
;
/* UDP */
ip
->
ip_sum
=
0
;
ip
->
ip_sum
=
0
;
...
...
net/tftp.c
浏览文件 @
c645b181
...
@@ -499,9 +499,8 @@ TftpStart (void)
...
@@ -499,9 +499,8 @@ TftpStart (void)
strncpy
(
tftp_filename
,
BootFile
,
MAX_LEN
);
strncpy
(
tftp_filename
,
BootFile
,
MAX_LEN
);
tftp_filename
[
MAX_LEN
-
1
]
=
0
;
tftp_filename
[
MAX_LEN
-
1
]
=
0
;
}
else
{
}
else
{
*
p
++
=
'\0'
;
TftpServerIP
=
string_to_ip
(
BootFile
);
TftpServerIP
=
string_to_ip
(
BootFile
);
strncpy
(
tftp_filename
,
p
,
MAX_LEN
);
strncpy
(
tftp_filename
,
p
+
1
,
MAX_LEN
);
tftp_filename
[
MAX_LEN
-
1
]
=
0
;
tftp_filename
[
MAX_LEN
-
1
]
=
0
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录