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
36838bad
Commit
36838bad
authored
Aug 03, 2002
by
Felipe Damasio
Committed by
David Mosberger
Aug 03, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add suspend/resume support to 8139cp net driver
parent
b12034e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
1 deletion
+59
-1
drivers/net/8139cp.c
drivers/net/8139cp.c
+59
-1
No files found.
drivers/net/8139cp.c
View file @
36838bad
...
...
@@ -21,13 +21,13 @@
Contributors:
Wake-on-LAN support - Felipe Damasio <felipewd@terra.com.br>
PCI suspend/resume - Felipe Damasio <felipewd@terra.com.br>
TODO, in rough priority order:
* dev->tx_timeout
* LinkChg interrupt
* Support forcing media type with a module parameter,
like dl2k.c/sundance.c
* Implement PCI suspend/resume
* Constants (module parms?) for Rx work limit
* support 64-bit PCI DMA
* Complete reset on PciErr
...
...
@@ -360,6 +360,7 @@ struct cp_private {
unsigned
int
board_type
;
unsigned
int
wol_enabled
:
1
;
/* Is Wake-on-LAN enabled? */
u32
power_state
[
16
];
struct
mii_if_info
mii_if
;
};
...
...
@@ -1896,11 +1897,68 @@ static void __devexit cp_remove_one (struct pci_dev *pdev)
kfree
(
dev
);
}
#ifdef CONFIG_PM
static
int
cp_suspend
(
struct
pci_dev
*
pdev
,
u32
state
)
{
struct
net_device
*
dev
;
struct
cp_private
*
cp
;
unsigned
long
flags
;
dev
=
pci_get_drvdata
(
pdev
);
cp
=
dev
->
priv
;
if
(
!
dev
||
!
netif_running
(
dev
))
return
0
;
netif_device_detach
(
dev
);
netif_stop_queue
(
dev
);
spin_lock_irqsave
(
&
cp
->
lock
,
flags
);
/* Disable Rx and Tx */
cpw16
(
IntrMask
,
0
);
cpw8
(
Cmd
,
cpr8
(
Cmd
)
&
(
~
RxOn
|
~
TxOn
));
spin_unlock_irqrestore
(
&
cp
->
lock
,
flags
);
if
(
cp
->
pdev
&&
cp
->
wol_enabled
)
{
pci_save_state
(
cp
->
pdev
,
cp
->
power_state
);
cp_set_d3_state
(
cp
);
}
return
0
;
}
static
int
cp_resume
(
struct
pci_dev
*
pdev
)
{
struct
net_device
*
dev
;
struct
cp_private
*
cp
;
dev
=
pci_get_drvdata
(
pdev
);
cp
=
dev
->
priv
;
netif_device_attach
(
dev
);
if
(
cp
->
pdev
&&
cp
->
wol_enabled
)
{
pci_set_power_state
(
cp
->
pdev
,
0
);
pci_restore_state
(
cp
->
pdev
,
cp
->
power_state
);
}
cp_init_hw
(
cp
);
netif_start_queue
(
dev
);
return
0
;
}
#endif
/* CONFIG_PM */
static
struct
pci_driver
cp_driver
=
{
.
name
=
DRV_NAME
,
.
id_table
=
cp_pci_tbl
,
.
probe
=
cp_init_one
,
.
remove
=
__devexit_p
(
cp_remove_one
),
#ifdef CONFIG_PM
.
resume
=
cp_resume
,
.
suspend
=
cp_suspend
,
#endif
};
static
int
__init
cp_init
(
void
)
...
...
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