-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/bonding/bond_main.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c The bond_main.c and mellanox switch conflicts were cases of overlapping changes. Signed-off-by: David S. Miller <[email protected]>
- Loading branch information
Showing
30 changed files
with
206 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,13 @@ | |
#include <uapi/linux/mdio.h> | ||
#include <linux/mdio.h> | ||
#include <linux/usb/cdc.h> | ||
#include <linux/suspend.h> | ||
|
||
/* Information for net-next */ | ||
#define NETNEXT_VERSION "08" | ||
|
||
/* Information for net */ | ||
#define NET_VERSION "2" | ||
#define NET_VERSION "3" | ||
|
||
#define DRIVER_VERSION "v1." NETNEXT_VERSION "." NET_VERSION | ||
#define DRIVER_AUTHOR "Realtek linux nic maintainers <[email protected]>" | ||
|
@@ -604,6 +605,9 @@ struct r8152 { | |
struct delayed_work schedule; | ||
struct mii_if_info mii; | ||
struct mutex control; /* use for hw setting */ | ||
#ifdef CONFIG_PM_SLEEP | ||
struct notifier_block pm_notifier; | ||
#endif | ||
|
||
struct rtl_ops { | ||
void (*init)(struct r8152 *); | ||
|
@@ -3036,6 +3040,33 @@ static void rtl_work_func_t(struct work_struct *work) | |
usb_autopm_put_interface(tp->intf); | ||
} | ||
|
||
#ifdef CONFIG_PM_SLEEP | ||
static int rtl_notifier(struct notifier_block *nb, unsigned long action, | ||
void *data) | ||
{ | ||
struct r8152 *tp = container_of(nb, struct r8152, pm_notifier); | ||
|
||
switch (action) { | ||
case PM_HIBERNATION_PREPARE: | ||
case PM_SUSPEND_PREPARE: | ||
usb_autopm_get_interface(tp->intf); | ||
break; | ||
|
||
case PM_POST_HIBERNATION: | ||
case PM_POST_SUSPEND: | ||
usb_autopm_put_interface(tp->intf); | ||
break; | ||
|
||
case PM_POST_RESTORE: | ||
case PM_RESTORE_PREPARE: | ||
default: | ||
break; | ||
} | ||
|
||
return NOTIFY_DONE; | ||
} | ||
#endif | ||
|
||
static int rtl8152_open(struct net_device *netdev) | ||
{ | ||
struct r8152 *tp = netdev_priv(netdev); | ||
|
@@ -3078,6 +3109,10 @@ static int rtl8152_open(struct net_device *netdev) | |
mutex_unlock(&tp->control); | ||
|
||
usb_autopm_put_interface(tp->intf); | ||
#ifdef CONFIG_PM_SLEEP | ||
tp->pm_notifier.notifier_call = rtl_notifier; | ||
register_pm_notifier(&tp->pm_notifier); | ||
#endif | ||
|
||
out: | ||
return res; | ||
|
@@ -3088,6 +3123,9 @@ static int rtl8152_close(struct net_device *netdev) | |
struct r8152 *tp = netdev_priv(netdev); | ||
int res = 0; | ||
|
||
#ifdef CONFIG_PM_SLEEP | ||
unregister_pm_notifier(&tp->pm_notifier); | ||
#endif | ||
napi_disable(&tp->napi); | ||
clear_bit(WORK_ENABLE, &tp->flags); | ||
usb_kill_urb(tp->intr_urb); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.