Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
37bb30e8
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看板
提交
37bb30e8
编写于
10月 31, 2005
作者:
R
Russell King
提交者:
Russell King
10月 31, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ARM] Convert EBSA110 network driver to a platform driver
Signed-off-by:
N
Russell King
<
rmk+kernel@arm.linux.org.uk
>
上级
1be7228d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
12 deletion
+57
-12
arch/arm/mach-ebsa110/core.c
arch/arm/mach-ebsa110/core.c
+25
-1
drivers/net/arm/am79c961a.c
drivers/net/arm/am79c961a.c
+32
-9
drivers/net/arm/am79c961a.h
drivers/net/arm/am79c961a.h
+0
-2
未找到文件。
arch/arm/mach-ebsa110/core.c
浏览文件 @
37bb30e8
...
...
@@ -251,9 +251,33 @@ static struct platform_device serial_device = {
},
};
static
struct
resource
am79c961_resources
[]
=
{
{
.
start
=
0x220
,
.
end
=
0x238
,
.
flags
=
IORESOURCE_IO
,
},
{
.
start
=
IRQ_EBSA110_ETHERNET
,
.
end
=
IRQ_EBSA110_ETHERNET
,
.
flags
=
IORESOURCE_IRQ
,
},
};
static
struct
platform_device
am79c961_device
=
{
.
name
=
"am79c961"
,
.
id
=
-
1
,
.
num_resources
=
ARRAY_SIZE
(
am79c961_resources
),
.
resource
=
am79c961_resources
,
};
static
struct
platform_device
*
ebsa110_devices
[]
=
{
&
serial_device
,
&
am79c961_device
,
};
static
int
__init
ebsa110_init
(
void
)
{
return
platform_
device_register
(
&
serial_device
);
return
platform_
add_devices
(
ebsa110_devices
,
ARRAY_SIZE
(
ebsa110_devices
)
);
}
arch_initcall
(
ebsa110_init
);
...
...
drivers/net/arm/am79c961a.c
浏览文件 @
37bb30e8
...
...
@@ -26,11 +26,11 @@
#include <linux/init.h>
#include <linux/crc32.h>
#include <linux/bitops.h>
#include <linux/platform_device.h>
#include <asm/system.h>
#include <asm/irq.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/system.h>
#define TX_BUFFERS 15
#define RX_BUFFERS 25
...
...
@@ -280,10 +280,13 @@ static void am79c961_timer(unsigned long data)
lnkstat
=
read_ireg
(
dev
->
base_addr
,
ISALED0
)
&
ISALED0_LNKST
;
carrier
=
netif_carrier_ok
(
dev
);
if
(
lnkstat
&&
!
carrier
)
if
(
lnkstat
&&
!
carrier
)
{
netif_carrier_on
(
dev
);
else
if
(
!
lnkstat
&&
carrier
)
printk
(
"%s: link up
\n
"
,
dev
->
name
);
}
else
if
(
!
lnkstat
&&
carrier
)
{
netif_carrier_off
(
dev
);
printk
(
"%s: link down
\n
"
,
dev
->
name
);
}
mod_timer
(
&
priv
->
timer
,
jiffies
+
msecs_to_jiffies
(
500
));
}
...
...
@@ -665,17 +668,25 @@ static void __init am79c961_banner(void)
printk
(
KERN_INFO
"%s"
,
version
);
}
static
int
__init
am79c961_
init
(
void
)
static
int
__init
am79c961_
probe
(
struct
device
*
_dev
)
{
struct
platform_device
*
pdev
=
to_platform_device
(
_dev
);
struct
resource
*
res
;
struct
net_device
*
dev
;
struct
dev_priv
*
priv
;
int
i
,
ret
;
res
=
platform_get_resource
(
pdev
,
IORESOURCE_IO
,
0
);
if
(
!
res
)
return
-
ENODEV
;
dev
=
alloc_etherdev
(
sizeof
(
struct
dev_priv
));
ret
=
-
ENOMEM
;
if
(
!
dev
)
goto
out
;
SET_NETDEV_DEV
(
dev
,
&
pdev
->
dev
);
priv
=
netdev_priv
(
dev
);
/*
...
...
@@ -683,8 +694,8 @@ static int __init am79c961_init(void)
* The PNP initialisation should have been
* done by the ether bootp loader.
*/
dev
->
base_addr
=
0x220
;
dev
->
irq
=
IRQ_EBSA110_ETHERNET
;
dev
->
base_addr
=
res
->
start
;
dev
->
irq
=
platform_get_irq
(
pdev
,
0
)
;
ret
=
-
ENODEV
;
if
(
!
request_region
(
dev
->
base_addr
,
0x18
,
dev
->
name
))
...
...
@@ -705,11 +716,11 @@ static int __init am79c961_init(void)
inb
(
dev
->
base_addr
+
4
)
!=
0x2b
)
goto
release
;
am79c961_banner
();
for
(
i
=
0
;
i
<
6
;
i
++
)
dev
->
dev_addr
[
i
]
=
inb
(
dev
->
base_addr
+
i
*
2
)
&
0xff
;
am79c961_banner
();
spin_lock_init
(
&
priv
->
chip_lock
);
init_timer
(
&
priv
->
timer
);
priv
->
timer
.
data
=
(
unsigned
long
)
dev
;
...
...
@@ -732,6 +743,7 @@ static int __init am79c961_init(void)
if
(
ret
==
0
)
{
printk
(
KERN_INFO
"%s: ether address "
,
dev
->
name
);
/* Retrive and print the ethernet address. */
for
(
i
=
0
;
i
<
6
;
i
++
)
printk
(
i
==
5
?
"%02x
\n
"
:
"%02x:"
,
dev
->
dev_addr
[
i
]);
...
...
@@ -746,4 +758,15 @@ static int __init am79c961_init(void)
return
ret
;
}
static
struct
device_driver
am79c961_driver
=
{
.
name
=
"am79c961"
,
.
bus
=
&
platform_bus_type
,
.
probe
=
am79c961_probe
,
};
static
int
__init
am79c961_init
(
void
)
{
return
driver_register
(
&
am79c961_driver
);
}
__initcall
(
am79c961_init
);
drivers/net/arm/am79c961a.h
浏览文件 @
37bb30e8
...
...
@@ -143,6 +143,4 @@ struct dev_priv {
struct
timer_list
timer
;
};
extern
int
am79c961_probe
(
struct
net_device
*
dev
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录