Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
f5a702b2
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看板
提交
f5a702b2
编写于
5月 25, 2005
作者:
提交者:
Jeff Garzik
5月 25, 2005
浏览文件
操作
浏览文件
下载
差异文件
Automatic merge of /spare/repo/netdev-2.6 branch ns83820
上级
5ea6f2c3
c16ef1ce
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
40 deletion
+29
-40
drivers/net/ns83820.c
drivers/net/ns83820.c
+29
-40
未找到文件。
drivers/net/ns83820.c
浏览文件 @
f5a702b2
#define
_VERSION "0.20
"
#define
VERSION "0.22
"
/* ns83820.c by Benjamin LaHaise with contributions.
*
* Questions/comments/discussion to linux-ns83820@kvack.org.
...
...
@@ -63,9 +63,11 @@
* - fix missed txok introduced during performance
* tuning
* 0.20 - fix stupid RFEN thinko. i am such a smurf.
*
* 20040828 0.21 - add hardware vlan accleration
* by Neil Horman <nhorman@redhat.com>
* 20050406 0.22 - improved DAC ifdefs from Andi Kleen
* - removal of dead code from Adrian Bunk
* - fix half duplex collision behaviour
* Driver Overview
* ===============
*
...
...
@@ -129,18 +131,6 @@ static int lnksts = 0; /* CFG_LNKSTS bit polarity */
#undef Dprintk
#define Dprintk dprintk
#if defined(CONFIG_HIGHMEM64G) || defined(__ia64__)
#define USE_64BIT_ADDR "+"
#endif
#if defined(USE_64BIT_ADDR)
#define VERSION _VERSION USE_64BIT_ADDR
#define TRY_DAC 1
#else
#define VERSION _VERSION
#define TRY_DAC 0
#endif
/* tunables */
#define RX_BUF_SIZE 1500
/* 8192 */
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
...
...
@@ -386,22 +376,16 @@ static int lnksts = 0; /* CFG_LNKSTS bit polarity */
#define LINK_DOWN 0x02
#define LINK_UP 0x04
#ifdef USE_64BIT_ADDR
#define HW_ADDR_LEN 8
#define HW_ADDR_LEN sizeof(dma_addr_t)
#define desc_addr_set(desc, addr) \
do { \
u64 __addr = (addr);
\
(desc)[0] = cpu_to_le32(__addr);
\
(desc)[1] = cpu_to_le32(__addr >> 32);
\
((desc)[0] = cpu_to_le32(addr));
\
if (HW_ADDR_LEN == 8)
\
(desc)[1] = cpu_to_le32(((u64)addr) >> 32);
\
} while(0)
#define desc_addr_get(desc) \
(((u64)le32_to_cpu((desc)[1]) << 32) \
| le32_to_cpu((desc)[0]))
#else
#define HW_ADDR_LEN 4
#define desc_addr_set(desc, addr) ((desc)[0] = cpu_to_le32(addr))
#define desc_addr_get(desc) (le32_to_cpu((desc)[0]))
#endif
(le32_to_cpu((desc)[0]) | \
(HW_ADDR_LEN == 8 ? ((dma_addr_t)le32_to_cpu((desc)[1]))<<32 : 0))
#define DESC_LINK 0
#define DESC_BUFPTR (DESC_LINK + HW_ADDR_LEN/4)
...
...
@@ -727,11 +711,23 @@ static void fastcall phy_intr(struct net_device *ndev)
speed
=
((
cfg
/
CFG_SPDSTS0
)
&
3
);
fullduplex
=
(
cfg
&
CFG_DUPSTS
);
if
(
fullduplex
)
if
(
fullduplex
)
{
new_cfg
|=
CFG_SB
;
writel
(
readl
(
dev
->
base
+
TXCFG
)
|
TXCFG_CSI
|
TXCFG_HBI
,
dev
->
base
+
TXCFG
);
writel
(
readl
(
dev
->
base
+
RXCFG
)
|
RXCFG_RX_FD
,
dev
->
base
+
RXCFG
);
}
else
{
writel
(
readl
(
dev
->
base
+
TXCFG
)
&
~
(
TXCFG_CSI
|
TXCFG_HBI
),
dev
->
base
+
TXCFG
);
writel
(
readl
(
dev
->
base
+
RXCFG
)
&
~
(
RXCFG_RX_FD
),
dev
->
base
+
RXCFG
);
}
if
((
cfg
&
CFG_LNKSTS
)
&&
((
new_cfg
^
dev
->
CFG_cache
)
&
CFG_MODE_100
0
))
{
((
new_cfg
^
dev
->
CFG_cache
)
!=
0
))
{
writel
(
new_cfg
,
dev
->
base
+
CFG
);
dev
->
CFG_cache
=
new_cfg
;
}
...
...
@@ -1189,7 +1185,6 @@ static int ns83820_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
for
(;;)
{
volatile
u32
*
desc
=
dev
->
tx_descs
+
(
free_idx
*
DESC_SIZE
);
u32
residue
=
0
;
dprintk
(
"frag[%3u]: %4u @ 0x%08Lx
\n
"
,
free_idx
,
len
,
(
unsigned
long
long
)
buf
);
...
...
@@ -1199,17 +1194,11 @@ static int ns83820_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
desc_addr_set
(
desc
+
DESC_BUFPTR
,
buf
);
desc
[
DESC_EXTSTS
]
=
cpu_to_le32
(
extsts
);
cmdsts
=
((
nr_frags
|
residue
)
?
CMDSTS_MORE
:
do_intr
?
CMDSTS_INTR
:
0
);
cmdsts
=
((
nr_frags
)
?
CMDSTS_MORE
:
do_intr
?
CMDSTS_INTR
:
0
);
cmdsts
|=
(
desc
==
first_desc
)
?
0
:
CMDSTS_OWN
;
cmdsts
|=
len
;
desc
[
DESC_CMDSTS
]
=
cpu_to_le32
(
cmdsts
);
if
(
residue
)
{
buf
+=
len
;
len
=
residue
;
continue
;
}
if
(
!
nr_frags
)
break
;
...
...
@@ -1841,7 +1830,8 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
int
using_dac
=
0
;
/* See if we can set the dma mask early on; failure is fatal. */
if
(
TRY_DAC
&&
!
pci_set_dma_mask
(
pci_dev
,
0xffffffffffffffffULL
))
{
if
(
sizeof
(
dma_addr_t
)
==
8
&&
!
pci_set_dma_mask
(
pci_dev
,
0xffffffffffffffffULL
))
{
using_dac
=
1
;
}
else
if
(
!
pci_set_dma_mask
(
pci_dev
,
0xffffffff
))
{
using_dac
=
0
;
...
...
@@ -1972,9 +1962,8 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
/* When compiled with 64 bit addressing, we must always enable
* the 64 bit descriptor format.
*/
#ifdef USE_64BIT_ADDR
dev
->
CFG_cache
|=
CFG_M64ADDR
;
#endif
if
(
sizeof
(
dma_addr_t
)
==
8
)
dev
->
CFG_cache
|=
CFG_M64ADDR
;
if
(
using_dac
)
dev
->
CFG_cache
|=
CFG_T64ADDR
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录