Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
bug2833
cloud-kernel
提交
373a5e02
cloud-kernel
项目概览
bug2833
/
cloud-kernel
与 Fork 源项目一致
Fork自
openanolis / cloud-kernel
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
373a5e02
编写于
8月 27, 2008
作者:
J
Jeff Garzik
提交者:
Jeff Garzik
8月 27, 2008
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-2.6.27' of
git://git.marvell.com/mv643xx_eth
into upstream-fixes
上级
c2d42545
c4560318
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
15 deletion
+20
-15
drivers/net/mv643xx_eth.c
drivers/net/mv643xx_eth.c
+20
-15
未找到文件。
drivers/net/mv643xx_eth.c
浏览文件 @
373a5e02
...
...
@@ -55,7 +55,7 @@
#include <asm/system.h>
static
char
mv643xx_eth_driver_name
[]
=
"mv643xx_eth"
;
static
char
mv643xx_eth_driver_version
[]
=
"1.
2
"
;
static
char
mv643xx_eth_driver_version
[]
=
"1.
3
"
;
#define MV643XX_ETH_CHECKSUM_OFFLOAD_TX
#define MV643XX_ETH_NAPI
...
...
@@ -474,11 +474,19 @@ static void rxq_refill(struct rx_queue *rxq)
/*
* Reserve 2+14 bytes for an ethernet header (the
* hardware automatically prepends 2 bytes of dummy
* data to each received packet),
4 bytes for a VLAN
*
header, and 4 bytes for the trailing FCS -- 24
* bytes total.
* data to each received packet),
16 bytes for up to
*
four VLAN tags, and 4 bytes for the trailing FCS
*
-- 36
bytes total.
*/
skb_size
=
mp
->
dev
->
mtu
+
24
;
skb_size
=
mp
->
dev
->
mtu
+
36
;
/*
* Make sure that the skb size is a multiple of 8
* bytes, as the lower three bits of the receive
* descriptor's buffer size field are ignored by
* the hardware.
*/
skb_size
=
(
skb_size
+
7
)
&
~
7
;
skb
=
dev_alloc_skb
(
skb_size
+
dma_get_cache_alignment
()
-
1
);
if
(
skb
==
NULL
)
...
...
@@ -509,10 +517,8 @@ static void rxq_refill(struct rx_queue *rxq)
skb_reserve
(
skb
,
2
);
}
if
(
rxq
->
rx_desc_count
!=
rxq
->
rx_ring_size
)
{
rxq
->
rx_oom
.
expires
=
jiffies
+
(
HZ
/
10
);
add_timer
(
&
rxq
->
rx_oom
);
}
if
(
rxq
->
rx_desc_count
!=
rxq
->
rx_ring_size
)
mod_timer
(
&
rxq
->
rx_oom
,
jiffies
+
(
HZ
/
10
));
spin_unlock_irqrestore
(
&
mp
->
lock
,
flags
);
}
...
...
@@ -529,7 +535,7 @@ static int rxq_process(struct rx_queue *rxq, int budget)
int
rx
;
rx
=
0
;
while
(
rx
<
budget
)
{
while
(
rx
<
budget
&&
rxq
->
rx_desc_count
)
{
struct
rx_desc
*
rx_desc
;
unsigned
int
cmd_sts
;
struct
sk_buff
*
skb
;
...
...
@@ -554,7 +560,7 @@ static int rxq_process(struct rx_queue *rxq, int budget)
spin_unlock_irqrestore
(
&
mp
->
lock
,
flags
);
dma_unmap_single
(
NULL
,
rx_desc
->
buf_ptr
+
2
,
mp
->
dev
->
mtu
+
24
,
DMA_FROM_DEVICE
);
rx_desc
->
buf_size
,
DMA_FROM_DEVICE
);
rxq
->
rx_desc_count
--
;
rx
++
;
...
...
@@ -636,9 +642,9 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget)
txq_reclaim
(
mp
->
txq
+
i
,
0
);
if
(
netif_carrier_ok
(
mp
->
dev
))
{
spin_lock
(
&
mp
->
lock
);
spin_lock
_irq
(
&
mp
->
lock
);
__txq_maybe_wake
(
mp
->
txq
+
mp
->
txq_primary
);
spin_unlock
(
&
mp
->
lock
);
spin_unlock
_irq
(
&
mp
->
lock
);
}
}
#endif
...
...
@@ -650,8 +656,6 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget)
if
(
rx
<
budget
)
{
netif_rx_complete
(
mp
->
dev
,
napi
);
wrl
(
mp
,
INT_CAUSE
(
mp
->
port_num
),
0
);
wrl
(
mp
,
INT_CAUSE_EXT
(
mp
->
port_num
),
0
);
wrl
(
mp
,
INT_MASK
(
mp
->
port_num
),
INT_TX_END
|
INT_RX
|
INT_EXT
);
}
...
...
@@ -1796,6 +1800,7 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id)
*/
#ifdef MV643XX_ETH_NAPI
if
(
int_cause
&
INT_RX
)
{
wrl
(
mp
,
INT_CAUSE
(
mp
->
port_num
),
~
(
int_cause
&
INT_RX
));
wrl
(
mp
,
INT_MASK
(
mp
->
port_num
),
0x00000000
);
rdl
(
mp
,
INT_MASK
(
mp
->
port_num
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录