Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
0193fc5e
Commit
0193fc5e
authored
Mar 23, 2012
by
Francois Romieu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rrunner: stop using net_device.{base_addr, irq}.
Signed-off-by:
Francois Romieu
<
romieu@fr.zoreil.com
>
parent
a7425458
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
47 deletions
+35
-47
drivers/net/hippi/rrunner.c
drivers/net/hippi/rrunner.c
+35
-47
No files found.
drivers/net/hippi/rrunner.c
View file @
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
);
if
(
dev
)
{
struct
rr_private
*
rr
=
netdev_priv
(
dev
);
if
(
!
(
readl
(
&
rr
->
regs
->
HostCtrl
)
&
NIC_HALTED
))
{
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
);
unregister_netdev
(
dev
);
iounmap
(
rr
->
regs
);
free_netdev
(
dev
);
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment