Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
0193fc5e
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看板
提交
0193fc5e
编写于
3月 23, 2012
作者:
F
Francois Romieu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rrunner: stop using net_device.{base_addr, irq}.
Signed-off-by:
N
Francois Romieu
<
romieu@fr.zoreil.com
>
上级
a7425458
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
47 deletion
+35
-47
drivers/net/hippi/rrunner.c
drivers/net/hippi/rrunner.c
+35
-47
未找到文件。
drivers/net/hippi/rrunner.c
浏览文件 @
0193fc5e
...
...
@@ -114,10 +114,9 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
SET_NETDEV_DEV
(
dev
,
&
pdev
->
dev
);
if
(
pci_request_regions
(
pdev
,
"rrunner"
))
{
ret
=
-
EIO
;
ret
=
pci_request_regions
(
pdev
,
"rrunner"
);
if
(
ret
<
0
)
goto
out
;
}
pci_set_drvdata
(
pdev
,
dev
);
...
...
@@ -125,11 +124,8 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
spin_lock_init
(
&
rrpriv
->
lock
);
dev
->
irq
=
pdev
->
irq
;
dev
->
netdev_ops
=
&
rr_netdev_ops
;
dev
->
base_addr
=
pci_resource_start
(
pdev
,
0
);
/* display version info if adapter is found */
if
(
!
version_disp
)
{
/* set display flag to TRUE so that */
...
...
@@ -147,16 +143,14 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
pci_set_master
(
pdev
);
printk
(
KERN_INFO
"%s: Essential RoadRunner serial HIPPI "
"at 0x%08lx, irq %i, PCI latency %i
\n
"
,
dev
->
name
,
dev
->
base_addr
,
dev
->
irq
,
pci_latency
);
"at 0x%08l
l
x, irq %i, PCI latency %i
\n
"
,
dev
->
name
,
pci_resource_start
(
pdev
,
0
),
p
dev
->
irq
,
pci_latency
);
/*
* Remap the regs into kernel space.
* Remap the
MMIO
regs into kernel space.
*/
rrpriv
->
regs
=
ioremap
(
dev
->
base_addr
,
0x1000
);
if
(
!
rrpriv
->
regs
){
rrpriv
->
regs
=
pci_iomap
(
pdev
,
0
,
0x1000
);
if
(
!
rrpriv
->
regs
)
{
printk
(
KERN_ERR
"%s: Unable to map I/O register, "
"RoadRunner will be disabled.
\n
"
,
dev
->
name
);
ret
=
-
EIO
;
...
...
@@ -203,8 +197,6 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
rr_init
(
dev
);
dev
->
base_addr
=
0
;
ret
=
register_netdev
(
dev
);
if
(
ret
)
goto
out
;
...
...
@@ -218,7 +210,7 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
pci_free_consistent
(
pdev
,
TX_TOTAL_SIZE
,
rrpriv
->
tx_ring
,
rrpriv
->
tx_ring_dma
);
if
(
rrpriv
->
regs
)
iounmap
(
rrpriv
->
regs
);
pci_iounmap
(
pdev
,
rrpriv
->
regs
);
if
(
pdev
)
{
pci_release_regions
(
pdev
);
pci_set_drvdata
(
pdev
,
NULL
);
...
...
@@ -232,29 +224,26 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
static
void
__devexit
rr_remove_one
(
struct
pci_dev
*
pdev
)
{
struct
net_device
*
dev
=
pci_get_drvdata
(
pdev
);
struct
rr_private
*
rr
=
netdev_priv
(
dev
);
if
(
dev
)
{
struct
rr_private
*
rr
=
netdev_priv
(
dev
);
if
(
!
(
readl
(
&
rr
->
regs
->
HostCtrl
)
&
NIC_HALTED
)){
printk
(
KERN_ERR
"%s: trying to unload running NIC
\n
"
,
dev
->
name
);
writel
(
HALT_NIC
,
&
rr
->
regs
->
HostCtrl
);
}
pci_free_consistent
(
pdev
,
EVT_RING_SIZE
,
rr
->
evt_ring
,
rr
->
evt_ring_dma
);
pci_free_consistent
(
pdev
,
RX_TOTAL_SIZE
,
rr
->
rx_ring
,
rr
->
rx_ring_dma
);
pci_free_consistent
(
pdev
,
TX_TOTAL_SIZE
,
rr
->
tx_ring
,
rr
->
tx_ring_dma
);
unregister_netdev
(
dev
);
iounmap
(
rr
->
regs
);
free_netdev
(
dev
);
pci_release_regions
(
pdev
);
pci_disable_device
(
pdev
);
pci_set_drvdata
(
pdev
,
NULL
);
if
(
!
(
readl
(
&
rr
->
regs
->
HostCtrl
)
&
NIC_HALTED
))
{
printk
(
KERN_ERR
"%s: trying to unload running NIC
\n
"
,
dev
->
name
);
writel
(
HALT_NIC
,
&
rr
->
regs
->
HostCtrl
);
}
unregister_netdev
(
dev
);
pci_free_consistent
(
pdev
,
EVT_RING_SIZE
,
rr
->
evt_ring
,
rr
->
evt_ring_dma
);
pci_free_consistent
(
pdev
,
RX_TOTAL_SIZE
,
rr
->
rx_ring
,
rr
->
rx_ring_dma
);
pci_free_consistent
(
pdev
,
TX_TOTAL_SIZE
,
rr
->
tx_ring
,
rr
->
tx_ring_dma
);
pci_iounmap
(
pdev
,
rr
->
regs
);
pci_release_regions
(
pdev
);
pci_disable_device
(
pdev
);
pci_set_drvdata
(
pdev
,
NULL
);
free_netdev
(
dev
);
}
...
...
@@ -1230,9 +1219,9 @@ static int rr_open(struct net_device *dev)
readl
(
&
regs
->
HostCtrl
);
spin_unlock_irqrestore
(
&
rrpriv
->
lock
,
flags
);
if
(
request_irq
(
dev
->
irq
,
rr_interrupt
,
IRQF_SHARED
,
dev
->
name
,
dev
))
{
if
(
request_irq
(
p
dev
->
irq
,
rr_interrupt
,
IRQF_SHARED
,
dev
->
name
,
dev
))
{
printk
(
KERN_WARNING
"%s: Requested IRQ %d is busy
\n
"
,
dev
->
name
,
dev
->
irq
);
dev
->
name
,
p
dev
->
irq
);
ecode
=
-
EAGAIN
;
goto
error
;
}
...
...
@@ -1339,16 +1328,15 @@ static void rr_dump(struct net_device *dev)
static
int
rr_close
(
struct
net_device
*
dev
)
{
struct
rr_private
*
rrpriv
;
struct
rr_regs
__iomem
*
regs
;
struct
rr_private
*
rrpriv
=
netdev_priv
(
dev
);
struct
rr_regs
__iomem
*
regs
=
rrpriv
->
regs
;
struct
pci_dev
*
pdev
=
rrpriv
->
pci_dev
;
unsigned
long
flags
;
u32
tmp
;
short
i
;
netif_stop_queue
(
dev
);
rrpriv
=
netdev_priv
(
dev
);
regs
=
rrpriv
->
regs
;
/*
* Lock to make sure we are not cleaning up while another CPU
...
...
@@ -1387,15 +1375,15 @@ static int rr_close(struct net_device *dev)
rr_raz_tx
(
rrpriv
,
dev
);
rr_raz_rx
(
rrpriv
,
dev
);
pci_free_consistent
(
rrpriv
->
pci_
dev
,
256
*
sizeof
(
struct
ring_ctrl
),
pci_free_consistent
(
p
dev
,
256
*
sizeof
(
struct
ring_ctrl
),
rrpriv
->
rx_ctrl
,
rrpriv
->
rx_ctrl_dma
);
rrpriv
->
rx_ctrl
=
NULL
;
pci_free_consistent
(
rrpriv
->
pci_dev
,
sizeof
(
struct
rr_info
)
,
rrpriv
->
info
,
rrpriv
->
info
_dma
);
pci_free_consistent
(
pdev
,
sizeof
(
struct
rr_info
),
rrpriv
->
info
,
rrpriv
->
info_dma
);
rrpriv
->
info
=
NULL
;
free_irq
(
dev
->
irq
,
dev
);
free_irq
(
p
dev
->
irq
,
dev
);
spin_unlock_irqrestore
(
&
rrpriv
->
lock
,
flags
);
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录