Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
a46c30fd
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a46c30fd
编写于
6月 23, 2006
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[NET] myri_sbus: Convert to new SBUS device layer.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
ecba38ab
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
61 addition
and
55 deletion
+61
-55
drivers/net/myri_sbus.c
drivers/net/myri_sbus.c
+61
-55
未找到文件。
drivers/net/myri_sbus.c
浏览文件 @
a46c30fd
/* myri_sbus.
h
: MyriCOM MyriNET SBUS card driver.
/* myri_sbus.
c
: MyriCOM MyriNET SBUS card driver.
*
* Copyright (C) 1996, 1999
David S. Miller (davem@redhat.com
)
* Copyright (C) 1996, 1999
, 2006 David S. Miller (davem@davemloft.net
)
*/
static
char
version
[]
=
"myri_sbus.c:v
1.9 12/Sep/99 David S. Miller (davem@redhat.com
)
\n
"
;
"myri_sbus.c:v
2.0 June 23, 2006 David S. Miller (davem@davemloft.net
)
\n
"
;
#include <linux/module.h>
#include <linux/config.h>
...
...
@@ -81,10 +81,6 @@ static char version[] =
#define DHDR(x)
#endif
#ifdef MODULE
static
struct
myri_eth
*
root_myri_dev
;
#endif
static
void
myri_reset_off
(
void
__iomem
*
lp
,
void
__iomem
*
cregs
)
{
/* Clear IRQ mask. */
...
...
@@ -896,8 +892,9 @@ static void dump_eeprom(struct myri_eth *mp)
}
#endif
static
int
__init
myri_ether_init
(
struct
sbus_dev
*
sdev
,
int
num
)
static
int
__init
myri_ether_init
(
struct
sbus_dev
*
sdev
)
{
static
int
num
;
static
unsigned
version_printed
;
struct
net_device
*
dev
;
struct
myri_eth
*
mp
;
...
...
@@ -913,6 +910,9 @@ static int __init myri_ether_init(struct sbus_dev *sdev, int num)
if
(
version_printed
++
==
0
)
printk
(
version
);
SET_MODULE_OWNER
(
dev
);
SET_NETDEV_DEV
(
dev
,
&
sdev
->
ofdev
.
dev
);
mp
=
(
struct
myri_eth
*
)
dev
->
priv
;
spin_lock_init
(
&
mp
->
irq_lock
);
mp
->
myri_sdev
=
sdev
;
...
...
@@ -1092,10 +1092,9 @@ static int __init myri_ether_init(struct sbus_dev *sdev, int num)
goto
err_free_irq
;
}
#ifdef MODULE
mp
->
next_module
=
root_myri_dev
;
root_myri_dev
=
mp
;
#endif
dev_set_drvdata
(
&
sdev
->
ofdev
.
dev
,
mp
);
num
++
;
printk
(
"%s: MyriCOM MyriNET Ethernet "
,
dev
->
name
);
...
...
@@ -1114,61 +1113,68 @@ static int __init myri_ether_init(struct sbus_dev *sdev, int num)
return
-
ENODEV
;
}
static
int
__init
myri_sbus_match
(
struct
sbus_dev
*
sdev
)
{
char
*
name
=
sdev
->
prom_name
;
if
(
!
strcmp
(
name
,
"MYRICOM,mlanai"
)
||
!
strcmp
(
name
,
"myri"
))
return
1
;
static
int
__devinit
myri_sbus_probe
(
struct
of_device
*
dev
,
const
struct
of_device_id
*
match
)
{
struct
sbus_dev
*
sdev
=
to_sbus_device
(
&
dev
->
dev
)
;
return
0
;
return
myri_ether_init
(
sdev
)
;
}
static
int
__
init
myri_sbus_probe
(
void
)
static
int
__
devexit
myri_sbus_remove
(
struct
of_device
*
dev
)
{
struct
sbus_bus
*
bus
;
struct
sbus_dev
*
sdev
=
NULL
;
static
int
called
;
int
cards
=
0
,
v
;
struct
myri_eth
*
mp
=
dev_get_drvdata
(
&
dev
->
dev
);
struct
net_device
*
net_dev
=
mp
->
dev
;
#ifdef MODULE
root_myri_dev
=
NULL
;
#endif
unregister_netdevice
(
net_dev
);
if
(
called
)
return
-
ENODEV
;
called
++
;
for_each_sbus
(
bus
)
{
for_each_sbusdev
(
sdev
,
bus
)
{
if
(
myri_sbus_match
(
sdev
))
{
cards
++
;
DET
((
"Found myricom myrinet as %s
\n
"
,
sdev
->
prom_name
));
if
((
v
=
myri_ether_init
(
sdev
,
(
cards
-
1
))))
return
v
;
}
}
free_irq
(
net_dev
->
irq
,
net_dev
);
if
(
mp
->
eeprom
.
cpuvers
<
CPUVERS_4_0
)
{
sbus_iounmap
(
mp
->
regs
,
mp
->
reg_size
);
}
else
{
sbus_iounmap
(
mp
->
cregs
,
PAGE_SIZE
);
sbus_iounmap
(
mp
->
lregs
,
(
256
*
1024
));
sbus_iounmap
(
mp
->
lanai
,
(
512
*
1024
));
}
if
(
!
cards
)
return
-
ENODEV
;
free_netdev
(
net_dev
);
dev_set_drvdata
(
&
dev
->
dev
,
NULL
);
return
0
;
}
static
void
__exit
myri_sbus_cleanup
(
void
)
static
struct
of_device_id
myri_sbus_match
[]
=
{
{
.
name
=
"MYRICOM,mlanai"
,
},
{
.
name
=
"myri"
,
},
{},
};
MODULE_DEVICE_TABLE
(
of
,
myri_sbus_match
);
static
struct
of_platform_driver
myri_sbus_driver
=
{
.
name
=
"myri"
,
.
match_table
=
myri_sbus_match
,
.
probe
=
myri_sbus_probe
,
.
remove
=
__devexit_p
(
myri_sbus_remove
),
};
static
int
__init
myri_sbus_init
(
void
)
{
return
of_register_driver
(
&
myri_sbus_driver
,
&
sbus_bus_type
);
}
static
void
__exit
myri_sbus_exit
(
void
)
{
#ifdef MODULE
while
(
root_myri_dev
)
{
struct
myri_eth
*
next
=
root_myri_dev
->
next_module
;
unregister_netdev
(
root_myri_dev
->
dev
);
/* this will also free the co-allocated 'root_myri_dev' */
free_netdev
(
root_myri_dev
->
dev
);
root_myri_dev
=
next
;
}
#endif
/* MODULE */
of_unregister_driver
(
&
myri_sbus_driver
);
}
module_init
(
myri_sbus_probe
);
module_exit
(
myri_sbus_cleanup
);
module_init
(
myri_sbus_init
);
module_exit
(
myri_sbus_exit
);
MODULE_LICENSE
(
"GPL"
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录