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
a4e1e020
Commit
a4e1e020
authored
Oct 14, 2003
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[netdrvr xircom_cb] fix race in statistics pointer setting
by converting to use alloc_etherdev.
parent
5b84ad19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
drivers/net/tulip/xircom_cb.c
drivers/net/tulip/xircom_cb.c
+18
-17
No files found.
drivers/net/tulip/xircom_cb.c
View file @
a4e1e020
...
...
@@ -230,7 +230,8 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
This way, we can fail gracefully if not enough memory
is available.
*/
if
((
dev
=
init_etherdev
(
NULL
,
sizeof
(
struct
xircom_private
)))
==
NULL
)
{
dev
=
alloc_etherdev
(
sizeof
(
struct
xircom_private
));
if
(
!
dev
)
{
printk
(
KERN_ERR
"xircom_probe: failed to allocate etherdev
\n
"
);
goto
device_fail
;
}
...
...
@@ -250,7 +251,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
SET_MODULE_OWNER
(
dev
);
SET_NETDEV_DEV
(
dev
,
&
pdev
->
dev
);
printk
(
KERN_INFO
"%s: Xircom cardbus revision %i at irq %i
\n
"
,
dev
->
name
,
chip_rev
,
pdev
->
irq
);
private
->
dev
=
dev
;
private
->
pdev
=
pdev
;
...
...
@@ -259,7 +260,6 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
dev
->
irq
=
pdev
->
irq
;
dev
->
base_addr
=
private
->
io_port
;
initialize_card
(
private
);
read_mac_address
(
private
);
setup_descriptors
(
private
);
...
...
@@ -272,7 +272,12 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
SET_ETHTOOL_OPS
(
dev
,
&
netdev_ethtool_ops
);
pci_set_drvdata
(
pdev
,
dev
);
if
(
register_netdev
(
dev
))
{
printk
(
KERN_ERR
"xircom_probe: netdevice registration failed.
\n
"
);
goto
reg_fail
;
}
printk
(
KERN_INFO
"%s: Xircom cardbus revision %i at irq %i
\n
"
,
dev
->
name
,
chip_rev
,
pdev
->
irq
);
/* start the transmitter to get a heartbeat */
/* TODO: send 2 dummy packets here */
transceiver_voodoo
(
private
);
...
...
@@ -287,10 +292,12 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
leave
(
"xircom_probe"
);
return
0
;
reg_fail:
kfree
(
private
->
tx_buffer
);
tx_buf_fail:
kfree
(
private
->
rx_buffer
);
rx_buf_fail:
kfree
(
dev
);
free_netdev
(
dev
);
device_fail:
return
-
ENODEV
;
}
...
...
@@ -305,22 +312,16 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
static
void
__devexit
xircom_remove
(
struct
pci_dev
*
pdev
)
{
struct
net_device
*
dev
=
pci_get_drvdata
(
pdev
);
struct
xircom_private
*
card
;
struct
xircom_private
*
card
=
dev
->
priv
;
enter
(
"xircom_remove"
);
if
(
dev
!=
NULL
)
{
card
=
dev
->
priv
;
if
(
card
!=
NULL
)
{
if
(
card
->
rx_buffer
!=
NULL
)
pci_free_consistent
(
pdev
,
8192
,
card
->
rx_buffer
,
card
->
rx_dma_handle
);
card
->
rx_buffer
=
NULL
;
if
(
card
->
tx_buffer
!=
NULL
)
pci_free_consistent
(
pdev
,
8192
,
card
->
tx_buffer
,
card
->
tx_dma_handle
);
card
->
tx_buffer
=
NULL
;
}
}
pci_free_consistent
(
pdev
,
8192
,
card
->
rx_buffer
,
card
->
rx_dma_handle
);
pci_free_consistent
(
pdev
,
8192
,
card
->
tx_buffer
,
card
->
tx_dma_handle
);
release_region
(
dev
->
base_addr
,
128
);
unregister_netdev
(
dev
);
free_netdev
(
dev
);
pci_set_drvdata
(
pdev
,
NULL
);
leave
(
"xircom_remove"
);
}
...
...
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