Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
58076497
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
58076497
编写于
7月 27, 2013
作者:
A
Andreas Färber
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
etraxfs_eth: Rename fs_eth to ETRAXFSEthState
Also add a typedef. Signed-off-by:
N
Andreas Färber
<
afaerber@suse.de
>
上级
8784dfa4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
19 deletion
+19
-19
hw/net/etraxfs_eth.c
hw/net/etraxfs_eth.c
+19
-19
未找到文件。
hw/net/etraxfs_eth.c
浏览文件 @
58076497
...
...
@@ -324,9 +324,9 @@ static void mdio_cycle(struct qemu_mdio *bus)
#define TYPE_ETRAX_FS_ETH "etraxfs-eth"
#define ETRAX_FS_ETH(obj) \
OBJECT_CHECK(
struct fs_eth
, (obj), TYPE_ETRAX_FS_ETH)
OBJECT_CHECK(
ETRAXFSEthState
, (obj), TYPE_ETRAX_FS_ETH)
struct
fs_eth
typedef
struct
ETRAXFSEthState
{
SysBusDevice
parent_obj
;
...
...
@@ -354,9 +354,9 @@ struct fs_eth
/* PHY. */
struct
qemu_phy
phy
;
};
}
ETRAXFSEthState
;
static
void
eth_validate_duplex
(
struct
fs_eth
*
eth
)
static
void
eth_validate_duplex
(
ETRAXFSEthState
*
eth
)
{
struct
qemu_phy
*
phy
;
unsigned
int
phy_duplex
;
...
...
@@ -387,7 +387,7 @@ static void eth_validate_duplex(struct fs_eth *eth)
static
uint64_t
eth_read
(
void
*
opaque
,
hwaddr
addr
,
unsigned
int
size
)
{
struct
fs_eth
*
eth
=
opaque
;
ETRAXFSEthState
*
eth
=
opaque
;
uint32_t
r
=
0
;
addr
>>=
2
;
...
...
@@ -404,7 +404,7 @@ eth_read(void *opaque, hwaddr addr, unsigned int size)
return
r
;
}
static
void
eth_update_ma
(
struct
fs_eth
*
eth
,
int
ma
)
static
void
eth_update_ma
(
ETRAXFSEthState
*
eth
,
int
ma
)
{
int
reg
;
int
i
=
0
;
...
...
@@ -433,7 +433,7 @@ static void
eth_write
(
void
*
opaque
,
hwaddr
addr
,
uint64_t
val64
,
unsigned
int
size
)
{
struct
fs_eth
*
eth
=
opaque
;
ETRAXFSEthState
*
eth
=
opaque
;
uint32_t
value
=
val64
;
addr
>>=
2
;
...
...
@@ -477,7 +477,7 @@ eth_write(void *opaque, hwaddr addr,
/* The ETRAX FS has a groupt address table (GAT) which works like a k=1 bloom
filter dropping group addresses we have not joined. The filter has 64
bits (m). The has function is a simple nible xor of the group addr. */
static
int
eth_match_groupaddr
(
struct
fs_eth
*
eth
,
const
unsigned
char
*
sa
)
static
int
eth_match_groupaddr
(
ETRAXFSEthState
*
eth
,
const
unsigned
char
*
sa
)
{
unsigned
int
hsh
;
int
m_individual
=
eth
->
regs
[
RW_REC_CTRL
]
&
4
;
...
...
@@ -528,7 +528,7 @@ static int eth_can_receive(NetClientState *nc)
static
ssize_t
eth_receive
(
NetClientState
*
nc
,
const
uint8_t
*
buf
,
size_t
size
)
{
unsigned
char
sa_bcast
[
6
]
=
{
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
};
struct
fs_eth
*
eth
=
qemu_get_nic_opaque
(
nc
);
ETRAXFSEthState
*
eth
=
qemu_get_nic_opaque
(
nc
);
int
use_ma0
=
eth
->
regs
[
RW_REC_CTRL
]
&
1
;
int
use_ma1
=
eth
->
regs
[
RW_REC_CTRL
]
&
2
;
int
r_bcast
=
eth
->
regs
[
RW_REC_CTRL
]
&
8
;
...
...
@@ -552,12 +552,12 @@ static ssize_t eth_receive(NetClientState *nc, const uint8_t *buf, size_t size)
/* FIXME: Find another way to pass on the fake csum. */
etraxfs_dmac_input
(
eth
->
dma_in
,
(
void
*
)
buf
,
size
+
4
,
1
);
return
size
;
return
size
;
}
static
int
eth_tx_push
(
void
*
opaque
,
unsigned
char
*
buf
,
int
len
,
bool
eop
)
{
struct
fs_eth
*
eth
=
opaque
;
ETRAXFSEthState
*
eth
=
opaque
;
D
(
printf
(
"%s buf=%p len=%d
\n
"
,
__func__
,
buf
,
len
));
qemu_send_packet
(
qemu_get_queue
(
eth
->
nic
),
buf
,
len
);
...
...
@@ -566,7 +566,7 @@ static int eth_tx_push(void *opaque, unsigned char *buf, int len, bool eop)
static
void
eth_set_link
(
NetClientState
*
nc
)
{
struct
fs_eth
*
eth
=
qemu_get_nic_opaque
(
nc
);
ETRAXFSEthState
*
eth
=
qemu_get_nic_opaque
(
nc
);
D
(
printf
(
"%s %d
\n
"
,
__func__
,
nc
->
link_down
));
eth
->
phy
.
link
=
!
nc
->
link_down
;
}
...
...
@@ -583,7 +583,7 @@ static const MemoryRegionOps eth_ops = {
static
void
eth_cleanup
(
NetClientState
*
nc
)
{
struct
fs_eth
*
eth
=
qemu_get_nic_opaque
(
nc
);
ETRAXFSEthState
*
eth
=
qemu_get_nic_opaque
(
nc
);
/* Disconnect the client. */
eth
->
dma_out
->
client
.
push
=
NULL
;
...
...
@@ -605,7 +605,7 @@ static NetClientInfo net_etraxfs_info = {
static
int
fs_eth_init
(
SysBusDevice
*
sbd
)
{
DeviceState
*
dev
=
DEVICE
(
sbd
);
struct
fs_eth
*
s
=
ETRAX_FS_ETH
(
dev
);
ETRAXFSEthState
*
s
=
ETRAX_FS_ETH
(
dev
);
if
(
!
s
->
dma_out
||
!
s
->
dma_in
)
{
hw_error
(
"Unconnected ETRAX-FS Ethernet MAC.
\n
"
);
...
...
@@ -632,10 +632,10 @@ static int fs_eth_init(SysBusDevice *sbd)
}
static
Property
etraxfs_eth_properties
[]
=
{
DEFINE_PROP_UINT32
(
"phyaddr"
,
struct
fs_eth
,
phyaddr
,
1
),
DEFINE_PROP_PTR
(
"dma_out"
,
struct
fs_eth
,
vdma_out
),
DEFINE_PROP_PTR
(
"dma_in"
,
struct
fs_eth
,
vdma_in
),
DEFINE_NIC_PROPERTIES
(
struct
fs_eth
,
conf
),
DEFINE_PROP_UINT32
(
"phyaddr"
,
ETRAXFSEthState
,
phyaddr
,
1
),
DEFINE_PROP_PTR
(
"dma_out"
,
ETRAXFSEthState
,
vdma_out
),
DEFINE_PROP_PTR
(
"dma_in"
,
ETRAXFSEthState
,
vdma_in
),
DEFINE_NIC_PROPERTIES
(
ETRAXFSEthState
,
conf
),
DEFINE_PROP_END_OF_LIST
(),
};
...
...
@@ -651,7 +651,7 @@ static void etraxfs_eth_class_init(ObjectClass *klass, void *data)
static
const
TypeInfo
etraxfs_eth_info
=
{
.
name
=
TYPE_ETRAX_FS_ETH
,
.
parent
=
TYPE_SYS_BUS_DEVICE
,
.
instance_size
=
sizeof
(
struct
fs_eth
),
.
instance_size
=
sizeof
(
ETRAXFSEthState
),
.
class_init
=
etraxfs_eth_class_init
,
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录