Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
e1f024eb
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e1f024eb
编写于
7月 11, 2008
作者:
K
Krzysztof Hałasa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
WAN: Simplify sca_init_port() in HD64572 driver.
Signed-off-by:
N
Krzysztof Hałasa
<
khc@pm.waw.pl
>
上级
fcfe9ff3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
36 deletion
+31
-36
drivers/net/wan/hd64572.c
drivers/net/wan/hd64572.c
+31
-36
未找到文件。
drivers/net/wan/hd64572.c
浏览文件 @
e1f024eb
...
...
@@ -131,6 +131,7 @@ static inline void sca_set_carrier(port_t *port)
static
void
sca_init_port
(
port_t
*
port
)
{
card_t
*
card
=
port
->
card
;
u16
dmac_rx
=
get_dmac_rx
(
port
),
dmac_tx
=
get_dmac_tx
(
port
);
int
transmit
,
i
;
port
->
rxin
=
0
;
...
...
@@ -138,7 +139,6 @@ static void sca_init_port(port_t *port)
port
->
txlast
=
0
;
for
(
transmit
=
0
;
transmit
<
2
;
transmit
++
)
{
u16
dmac
=
transmit
?
get_dmac_tx
(
port
)
:
get_dmac_rx
(
port
);
u16
buffs
=
transmit
?
card
->
tx_ring_buffers
:
card
->
rx_ring_buffers
;
...
...
@@ -152,42 +152,37 @@ static void sca_init_port(port_t *port)
writew
(
0
,
&
desc
->
len
);
writeb
(
0
,
&
desc
->
stat
);
}
/* DMA disable - to halt state */
sca_out
(
0
,
transmit
?
DSR_TX
(
port
->
chan
)
:
DSR_RX
(
port
->
chan
),
card
);
/* software ABORT - to initial state */
sca_out
(
DCR_ABORT
,
transmit
?
DCR_TX
(
port
->
chan
)
:
DCR_RX
(
port
->
chan
),
card
);
/* current desc addr */
sca_outl
(
desc_offset
(
port
,
0
,
transmit
),
dmac
+
CDAL
,
card
);
if
(
!
transmit
)
sca_outl
(
desc_offset
(
port
,
buffs
-
1
,
transmit
),
dmac
+
EDAL
,
card
);
else
sca_outl
(
desc_offset
(
port
,
0
,
transmit
),
dmac
+
EDAL
,
card
);
/* clear frame end interrupt counter */
sca_out
(
DCR_CLEAR_EOF
,
transmit
?
DCR_TX
(
port
->
chan
)
:
DCR_RX
(
port
->
chan
),
card
);
if
(
!
transmit
)
{
/* Receive */
/* set buffer length */
sca_outw
(
HDLC_MAX_MRU
,
dmac
+
BFLL
,
card
);
/* Chain mode, Multi-frame */
sca_out
(
0x14
,
DMR_RX
(
port
->
chan
),
card
);
sca_out
(
DIR_EOME
,
DIR_RX
(
port
->
chan
),
card
);
/* DMA enable */
sca_out
(
DSR_DE
,
DSR_RX
(
port
->
chan
),
card
);
}
else
{
/* Transmit */
/* Chain mode, Multi-frame */
sca_out
(
0x14
,
DMR_TX
(
port
->
chan
),
card
);
/* enable underflow interrupts */
sca_out
(
DIR_EOME
,
DIR_TX
(
port
->
chan
),
card
);
}
}
/* DMA disable - to halt state */
sca_out
(
0
,
DSR_RX
(
port
->
chan
),
card
);
sca_out
(
0
,
DSR_TX
(
port
->
chan
),
card
);
/* software ABORT - to initial state */
sca_out
(
DCR_ABORT
,
DCR_RX
(
port
->
chan
),
card
);
sca_out
(
DCR_ABORT
,
DCR_TX
(
port
->
chan
),
card
);
/* current desc addr */
sca_outl
(
desc_offset
(
port
,
0
,
0
),
dmac_rx
+
CDAL
,
card
);
sca_outl
(
desc_offset
(
port
,
card
->
tx_ring_buffers
-
1
,
0
),
dmac_rx
+
EDAL
,
card
);
sca_outl
(
desc_offset
(
port
,
0
,
1
),
dmac_tx
+
CDAL
,
card
);
sca_outl
(
desc_offset
(
port
,
0
,
1
),
dmac_tx
+
EDAL
,
card
);
/* clear frame end interrupt counter */
sca_out
(
DCR_CLEAR_EOF
,
DCR_RX
(
port
->
chan
),
card
);
sca_out
(
DCR_CLEAR_EOF
,
DCR_TX
(
port
->
chan
),
card
);
/* Receive */
sca_outw
(
HDLC_MAX_MRU
,
dmac_rx
+
BFLL
,
card
);
/* set buffer length */
sca_out
(
0x14
,
DMR_RX
(
port
->
chan
),
card
);
/* Chain mode, Multi-frame */
sca_out
(
DIR_EOME
,
DIR_RX
(
port
->
chan
),
card
);
/* enable interrupts */
sca_out
(
DSR_DE
,
DSR_RX
(
port
->
chan
),
card
);
/* DMA enable */
/* Transmit */
sca_out
(
0x14
,
DMR_TX
(
port
->
chan
),
card
);
/* Chain mode, Multi-frame */
sca_out
(
DIR_EOME
,
DIR_TX
(
port
->
chan
),
card
);
/* enable interrupts */
sca_set_carrier
(
port
);
netif_napi_add
(
port
->
netdev
,
&
port
->
napi
,
sca_poll
,
NAPI_WEIGHT
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录