Re: [PATCH 1/3] net: asix: Add in_pm parameter

2016-07-26 Thread Grant Grundler
On Tue, Jul 26, 2016 at 2:14 PM, Robert Foss  wrote:
...
> Thanks for the feedback (for this patch and the other ones)!
> I'm preparing a v2 and will submit it withing a day or two.

Excellent! very welcome and thanks again for picking this up.

...
>> FTR, current  drivers/net/usb/ax88179_178a.c uses "in_pm" as well.
>
> Ah! Would you like that to be noted in the commit message?

No - I generally do not muck with commit messages that I didn't write.
It's part of the "finger print" of a patch (so one can trace origin
across distro's and kernel versions).

My comment was intended for reviewers and could be included in the
"comments after the commit message". (ie below the "---" marker in the
patch email).

...
>> BTW, I have two additional changes for AX88772x support sitting in my
>> "needs more work" queue (for quite a while already):
>>https://chromium-review.googlesource.com/#/c/229620/
>>"asix: autoneg will set WRITE_MEDIUM reg"
>>
>>https://chromium-review.googlesource.com/#/c/231162/
>>"net: asix: see 802.3 spec for phy reset"
>>
>> I would certainly approve if _anyone_ picked these up, tested them,
>> and then submitted them to netdev.
>
> Unfortunately I am without appropriate hardware at the moment.

That's a risky thing to point out for two reasons:

1) I can send you more HW than you could possibly ever use. :)

2) Reviewers of this patch series are already wondering how you
verified the AX88772x patches work on current kernel.org (or
netdev-next) branches.

Please email me with your shipping address (OFFLIST!) and I'll try to
send you some Asix HW to test with.  I'm located in "Silicon Valley"
(USA) and can easily ship in the US. Other countries is a bit harder
and in some cases not possible.

cheers,
grant


Re: [PATCH 1/3] net: asix: Add in_pm parameter

2016-07-26 Thread Grant Grundler
On Tue, Jul 26, 2016 at 2:14 PM, Robert Foss  wrote:
...
> Thanks for the feedback (for this patch and the other ones)!
> I'm preparing a v2 and will submit it withing a day or two.

Excellent! very welcome and thanks again for picking this up.

...
>> FTR, current  drivers/net/usb/ax88179_178a.c uses "in_pm" as well.
>
> Ah! Would you like that to be noted in the commit message?

No - I generally do not muck with commit messages that I didn't write.
It's part of the "finger print" of a patch (so one can trace origin
across distro's and kernel versions).

My comment was intended for reviewers and could be included in the
"comments after the commit message". (ie below the "---" marker in the
patch email).

...
>> BTW, I have two additional changes for AX88772x support sitting in my
>> "needs more work" queue (for quite a while already):
>>https://chromium-review.googlesource.com/#/c/229620/
>>"asix: autoneg will set WRITE_MEDIUM reg"
>>
>>https://chromium-review.googlesource.com/#/c/231162/
>>"net: asix: see 802.3 spec for phy reset"
>>
>> I would certainly approve if _anyone_ picked these up, tested them,
>> and then submitted them to netdev.
>
> Unfortunately I am without appropriate hardware at the moment.

That's a risky thing to point out for two reasons:

1) I can send you more HW than you could possibly ever use. :)

2) Reviewers of this patch series are already wondering how you
verified the AX88772x patches work on current kernel.org (or
netdev-next) branches.

Please email me with your shipping address (OFFLIST!) and I'll try to
send you some Asix HW to test with.  I'm located in "Silicon Valley"
(USA) and can easily ship in the US. Other countries is a bit harder
and in some cases not possible.

cheers,
grant


Re: [PATCH 1/3] net: asix: Add in_pm parameter

2016-07-26 Thread Robert Foss

From: Grant Grundler 


For the record, I believe I am not the author of these patches.

I believe the original author is
Signed-off-by: Freddy Xin 

as recorded in the following code reviews (and testing) that I was
responsible for:

https://chromium-review.googlesource.com/#/q/owner:%22Grant+Grundler%22+status:merged+asix+in_pm

And I would certainly be happy to see this code go upstream and
expected ASIX would submit this change upstream.

Thanks for the feedback (for this patch and the other ones)!
I'm preparing a v2 and will submit it withing a day or two.




In order to R/W registers in suspend/resume functions, in_pm flags are
added to some functions to determine whether the nopm version of usb
functions is called.


FTR, current  drivers/net/usb/ax88179_178a.c uses "in_pm" as well.

Ah! Would you like that to be noted in the commit message?



Save BMCR and ANAR PHY registers in suspend function and restore them
in resume function.

Reset HW in resume function to ensure the PHY works correctly.

Signed-off-by: Grant Grundler 


BTW, I have two additional changes for AX88772x support sitting in my
"needs more work" queue (for quite a while already):
   https://chromium-review.googlesource.com/#/c/229620/
   "asix: autoneg will set WRITE_MEDIUM reg"

   https://chromium-review.googlesource.com/#/c/231162/
   "net: asix: see 802.3 spec for phy reset"

I would certainly approve if _anyone_ picked these up, tested them,
and then submitted them to netdev.

Unfortunately I am without appropriate hardware at the moment.



cheers,
grant


---
 drivers/net/usb/asix.h |  40 +++--
 drivers/net/usb/asix_common.c  | 180 +++-
 drivers/net/usb/asix_devices.c | 373 -
 drivers/net/usb/ax88172a.c |  29 ++--
 4 files changed, 472 insertions(+), 150 deletions(-)

diff --git a/drivers/net/usb/asix.h b/drivers/net/usb/asix.h
index a2d3ea6..d109242 100644
--- a/drivers/net/usb/asix.h
+++ b/drivers/net/usb/asix.h
@@ -46,6 +46,7 @@
 #define AX_CMD_SET_SW_MII  0x06
 #define AX_CMD_READ_MII_REG0x07
 #define AX_CMD_WRITE_MII_REG   0x08
+#define AX_CMD_STATMNGSTS_REG  0x09
 #define AX_CMD_SET_HW_MII  0x0a
 #define AX_CMD_READ_EEPROM 0x0b
 #define AX_CMD_WRITE_EEPROM0x0c
@@ -71,6 +72,17 @@
 #define AX_CMD_SW_RESET0x20
 #define AX_CMD_SW_PHY_STATUS   0x21
 #define AX_CMD_SW_PHY_SELECT   0x22
+#define AX_QCTCTRL 0x2A
+
+#define AX_CHIPCODE_MASK   0x70
+#define AX_AX88772_CHIPCODE0x00
+#define AX_AX88772A_CHIPCODE   0x10
+#define AX_AX88772B_CHIPCODE   0x20
+#define AX_HOST_EN 0x01
+
+#define AX_PHYSEL_PSEL 0x01
+#define AX_PHYSEL_SSMII0
+#define AX_PHYSEL_SSEN 0x10

 #define AX_PHY_SELECT_MASK (BIT(3) | BIT(2))
 #define AX_PHY_SELECT_INTERNAL 0
@@ -173,6 +185,10 @@ struct asix_rx_fixup_info {
 };

 struct asix_common_private {
+   void (*resume)(struct usbnet *dev);
+   void (*suspend)(struct usbnet *dev);
+   u16 presvd_phy_advertise;
+   u16 presvd_phy_bmcr;
struct asix_rx_fixup_info rx_fixup_info;
 };

@@ -182,10 +198,10 @@ extern const struct driver_info ax88172a_info;
 #define FLAG_EEPROM_MAC(1UL << 0)  /* init device MAC from 
eeprom */

 int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
- u16 size, void *data);
+ u16 size, void *data, int in_pm);

 int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
-  u16 size, void *data);
+  u16 size, void *data, int in_pm);

 void asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value,
  u16 index, u16 size, void *data);
@@ -197,27 +213,31 @@ int asix_rx_fixup_common(struct usbnet *dev, struct 
sk_buff *skb);
 struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
  gfp_t flags);

-int asix_set_sw_mii(struct usbnet *dev);
-int asix_set_hw_mii(struct usbnet *dev);
+int asix_set_sw_mii(struct usbnet *dev, int in_pm);
+int asix_set_hw_mii(struct usbnet *dev, int in_pm);

 int asix_read_phy_addr(struct usbnet *dev, int internal);
 int asix_get_phy_addr(struct usbnet *dev);

-int asix_sw_reset(struct usbnet *dev, u8 flags);
+int asix_sw_reset(struct usbnet *dev, u8 flags, int in_pm);

-u16 asix_read_rx_ctl(struct usbnet *dev);
-int asix_write_rx_ctl(struct usbnet *dev, u16 mode);
+u16 asix_read_rx_ctl(struct usbnet *dev, int in_pm);
+int asix_write_rx_ctl(struct usbnet *dev, u16 mode, int in_pm);

-u16 asix_read_medium_status(struct usbnet *dev);
-int asix_write_medium_mode(struct usbnet *dev, u16 mode);
+u16 asix_read_medium_status(struct usbnet *dev, int in_pm);
+int 

Re: [PATCH 1/3] net: asix: Add in_pm parameter

2016-07-26 Thread Robert Foss

From: Grant Grundler 


For the record, I believe I am not the author of these patches.

I believe the original author is
Signed-off-by: Freddy Xin 

as recorded in the following code reviews (and testing) that I was
responsible for:

https://chromium-review.googlesource.com/#/q/owner:%22Grant+Grundler%22+status:merged+asix+in_pm

And I would certainly be happy to see this code go upstream and
expected ASIX would submit this change upstream.

Thanks for the feedback (for this patch and the other ones)!
I'm preparing a v2 and will submit it withing a day or two.




In order to R/W registers in suspend/resume functions, in_pm flags are
added to some functions to determine whether the nopm version of usb
functions is called.


FTR, current  drivers/net/usb/ax88179_178a.c uses "in_pm" as well.

Ah! Would you like that to be noted in the commit message?



Save BMCR and ANAR PHY registers in suspend function and restore them
in resume function.

Reset HW in resume function to ensure the PHY works correctly.

Signed-off-by: Grant Grundler 


BTW, I have two additional changes for AX88772x support sitting in my
"needs more work" queue (for quite a while already):
   https://chromium-review.googlesource.com/#/c/229620/
   "asix: autoneg will set WRITE_MEDIUM reg"

   https://chromium-review.googlesource.com/#/c/231162/
   "net: asix: see 802.3 spec for phy reset"

I would certainly approve if _anyone_ picked these up, tested them,
and then submitted them to netdev.

Unfortunately I am without appropriate hardware at the moment.



cheers,
grant


---
 drivers/net/usb/asix.h |  40 +++--
 drivers/net/usb/asix_common.c  | 180 +++-
 drivers/net/usb/asix_devices.c | 373 -
 drivers/net/usb/ax88172a.c |  29 ++--
 4 files changed, 472 insertions(+), 150 deletions(-)

diff --git a/drivers/net/usb/asix.h b/drivers/net/usb/asix.h
index a2d3ea6..d109242 100644
--- a/drivers/net/usb/asix.h
+++ b/drivers/net/usb/asix.h
@@ -46,6 +46,7 @@
 #define AX_CMD_SET_SW_MII  0x06
 #define AX_CMD_READ_MII_REG0x07
 #define AX_CMD_WRITE_MII_REG   0x08
+#define AX_CMD_STATMNGSTS_REG  0x09
 #define AX_CMD_SET_HW_MII  0x0a
 #define AX_CMD_READ_EEPROM 0x0b
 #define AX_CMD_WRITE_EEPROM0x0c
@@ -71,6 +72,17 @@
 #define AX_CMD_SW_RESET0x20
 #define AX_CMD_SW_PHY_STATUS   0x21
 #define AX_CMD_SW_PHY_SELECT   0x22
+#define AX_QCTCTRL 0x2A
+
+#define AX_CHIPCODE_MASK   0x70
+#define AX_AX88772_CHIPCODE0x00
+#define AX_AX88772A_CHIPCODE   0x10
+#define AX_AX88772B_CHIPCODE   0x20
+#define AX_HOST_EN 0x01
+
+#define AX_PHYSEL_PSEL 0x01
+#define AX_PHYSEL_SSMII0
+#define AX_PHYSEL_SSEN 0x10

 #define AX_PHY_SELECT_MASK (BIT(3) | BIT(2))
 #define AX_PHY_SELECT_INTERNAL 0
@@ -173,6 +185,10 @@ struct asix_rx_fixup_info {
 };

 struct asix_common_private {
+   void (*resume)(struct usbnet *dev);
+   void (*suspend)(struct usbnet *dev);
+   u16 presvd_phy_advertise;
+   u16 presvd_phy_bmcr;
struct asix_rx_fixup_info rx_fixup_info;
 };

@@ -182,10 +198,10 @@ extern const struct driver_info ax88172a_info;
 #define FLAG_EEPROM_MAC(1UL << 0)  /* init device MAC from 
eeprom */

 int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
- u16 size, void *data);
+ u16 size, void *data, int in_pm);

 int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
-  u16 size, void *data);
+  u16 size, void *data, int in_pm);

 void asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value,
  u16 index, u16 size, void *data);
@@ -197,27 +213,31 @@ int asix_rx_fixup_common(struct usbnet *dev, struct 
sk_buff *skb);
 struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
  gfp_t flags);

-int asix_set_sw_mii(struct usbnet *dev);
-int asix_set_hw_mii(struct usbnet *dev);
+int asix_set_sw_mii(struct usbnet *dev, int in_pm);
+int asix_set_hw_mii(struct usbnet *dev, int in_pm);

 int asix_read_phy_addr(struct usbnet *dev, int internal);
 int asix_get_phy_addr(struct usbnet *dev);

-int asix_sw_reset(struct usbnet *dev, u8 flags);
+int asix_sw_reset(struct usbnet *dev, u8 flags, int in_pm);

-u16 asix_read_rx_ctl(struct usbnet *dev);
-int asix_write_rx_ctl(struct usbnet *dev, u16 mode);
+u16 asix_read_rx_ctl(struct usbnet *dev, int in_pm);
+int asix_write_rx_ctl(struct usbnet *dev, u16 mode, int in_pm);

-u16 asix_read_medium_status(struct usbnet *dev);
-int asix_write_medium_mode(struct usbnet *dev, u16 mode);
+u16 asix_read_medium_status(struct usbnet *dev, int in_pm);
+int asix_write_medium_mode(struct usbnet *dev, u16 mode, int in_pm);

-int 

Re: [PATCH 1/3] net: asix: Add in_pm parameter

2016-07-25 Thread David Miller

Please correct the problems Grant Grundler mentioned in all of these
patches, and resubmit this entire series freshly.

Also, please include a proper "[PATCH 0/3] ..." introduction posting
for the series which explains what this series is about, how it
implements what it is doing, and why it is doing things that way.

Thanks.


Re: [PATCH 1/3] net: asix: Add in_pm parameter

2016-07-25 Thread David Miller

Please correct the problems Grant Grundler mentioned in all of these
patches, and resubmit this entire series freshly.

Also, please include a proper "[PATCH 0/3] ..." introduction posting
for the series which explains what this series is about, how it
implements what it is doing, and why it is doing things that way.

Thanks.


Re: [PATCH 1/3] net: asix: Add in_pm parameter

2016-07-25 Thread Grant Grundler
[as plain text this time...]

Robert,

On Mon, Jul 25, 2016 at 10:40 AM,   wrote:
> From: Grant Grundler 

For the record, I believe I am not the author of these patches.

I believe the original author is
Signed-off-by: Freddy Xin 

as recorded in the following code reviews (and testing) that I was
responsible for:

https://chromium-review.googlesource.com/#/q/owner:%22Grant+Grundler%22+status:merged+asix+in_pm

And I would certainly be happy to see this code go upstream and
expected ASIX would submit this change upstream.

> In order to R/W registers in suspend/resume functions, in_pm flags are
> added to some functions to determine whether the nopm version of usb
> functions is called.

FTR, current  drivers/net/usb/ax88179_178a.c uses "in_pm" as well.

> Save BMCR and ANAR PHY registers in suspend function and restore them
> in resume function.
>
> Reset HW in resume function to ensure the PHY works correctly.
>
> Signed-off-by: Grant Grundler 

BTW, I have two additional changes for AX88772x support sitting in my
"needs more work" queue (for quite a while already):
   https://chromium-review.googlesource.com/#/c/229620/
   "asix: autoneg will set WRITE_MEDIUM reg"

   https://chromium-review.googlesource.com/#/c/231162/
   "net: asix: see 802.3 spec for phy reset"

I would certainly approve if _anyone_ picked these up, tested them,
and then submitted them to netdev.

cheers,
grant

> ---
>  drivers/net/usb/asix.h |  40 +++--
>  drivers/net/usb/asix_common.c  | 180 +++-
>  drivers/net/usb/asix_devices.c | 373 
> -
>  drivers/net/usb/ax88172a.c |  29 ++--
>  4 files changed, 472 insertions(+), 150 deletions(-)
>
> diff --git a/drivers/net/usb/asix.h b/drivers/net/usb/asix.h
> index a2d3ea6..d109242 100644
> --- a/drivers/net/usb/asix.h
> +++ b/drivers/net/usb/asix.h
> @@ -46,6 +46,7 @@
>  #define AX_CMD_SET_SW_MII  0x06
>  #define AX_CMD_READ_MII_REG0x07
>  #define AX_CMD_WRITE_MII_REG   0x08
> +#define AX_CMD_STATMNGSTS_REG  0x09
>  #define AX_CMD_SET_HW_MII  0x0a
>  #define AX_CMD_READ_EEPROM 0x0b
>  #define AX_CMD_WRITE_EEPROM0x0c
> @@ -71,6 +72,17 @@
>  #define AX_CMD_SW_RESET0x20
>  #define AX_CMD_SW_PHY_STATUS   0x21
>  #define AX_CMD_SW_PHY_SELECT   0x22
> +#define AX_QCTCTRL 0x2A
> +
> +#define AX_CHIPCODE_MASK   0x70
> +#define AX_AX88772_CHIPCODE0x00
> +#define AX_AX88772A_CHIPCODE   0x10
> +#define AX_AX88772B_CHIPCODE   0x20
> +#define AX_HOST_EN 0x01
> +
> +#define AX_PHYSEL_PSEL 0x01
> +#define AX_PHYSEL_SSMII0
> +#define AX_PHYSEL_SSEN 0x10
>
>  #define AX_PHY_SELECT_MASK (BIT(3) | BIT(2))
>  #define AX_PHY_SELECT_INTERNAL 0
> @@ -173,6 +185,10 @@ struct asix_rx_fixup_info {
>  };
>
>  struct asix_common_private {
> +   void (*resume)(struct usbnet *dev);
> +   void (*suspend)(struct usbnet *dev);
> +   u16 presvd_phy_advertise;
> +   u16 presvd_phy_bmcr;
> struct asix_rx_fixup_info rx_fixup_info;
>  };
>
> @@ -182,10 +198,10 @@ extern const struct driver_info ax88172a_info;
>  #define FLAG_EEPROM_MAC(1UL << 0)  /* init device MAC from 
> eeprom */
>
>  int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
> - u16 size, void *data);
> + u16 size, void *data, int in_pm);
>
>  int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
> -  u16 size, void *data);
> +  u16 size, void *data, int in_pm);
>
>  void asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value,
>   u16 index, u16 size, void *data);
> @@ -197,27 +213,31 @@ int asix_rx_fixup_common(struct usbnet *dev, struct 
> sk_buff *skb);
>  struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
>   gfp_t flags);
>
> -int asix_set_sw_mii(struct usbnet *dev);
> -int asix_set_hw_mii(struct usbnet *dev);
> +int asix_set_sw_mii(struct usbnet *dev, int in_pm);
> +int asix_set_hw_mii(struct usbnet *dev, int in_pm);
>
>  int asix_read_phy_addr(struct usbnet *dev, int internal);
>  int asix_get_phy_addr(struct usbnet *dev);
>
> -int asix_sw_reset(struct usbnet *dev, u8 flags);
> +int asix_sw_reset(struct usbnet *dev, u8 flags, int in_pm);
>
> -u16 asix_read_rx_ctl(struct usbnet *dev);
> -int asix_write_rx_ctl(struct usbnet *dev, u16 mode);
> +u16 asix_read_rx_ctl(struct usbnet *dev, int in_pm);
> +int asix_write_rx_ctl(struct usbnet *dev, u16 mode, int in_pm);
>
> -u16 asix_read_medium_status(struct usbnet *dev);
> -int asix_write_medium_mode(struct usbnet *dev, u16 mode);
> +u16 asix_read_medium_status(struct 

Re: [PATCH 1/3] net: asix: Add in_pm parameter

2016-07-25 Thread Grant Grundler
[as plain text this time...]

Robert,

On Mon, Jul 25, 2016 at 10:40 AM,   wrote:
> From: Grant Grundler 

For the record, I believe I am not the author of these patches.

I believe the original author is
Signed-off-by: Freddy Xin 

as recorded in the following code reviews (and testing) that I was
responsible for:

https://chromium-review.googlesource.com/#/q/owner:%22Grant+Grundler%22+status:merged+asix+in_pm

And I would certainly be happy to see this code go upstream and
expected ASIX would submit this change upstream.

> In order to R/W registers in suspend/resume functions, in_pm flags are
> added to some functions to determine whether the nopm version of usb
> functions is called.

FTR, current  drivers/net/usb/ax88179_178a.c uses "in_pm" as well.

> Save BMCR and ANAR PHY registers in suspend function and restore them
> in resume function.
>
> Reset HW in resume function to ensure the PHY works correctly.
>
> Signed-off-by: Grant Grundler 

BTW, I have two additional changes for AX88772x support sitting in my
"needs more work" queue (for quite a while already):
   https://chromium-review.googlesource.com/#/c/229620/
   "asix: autoneg will set WRITE_MEDIUM reg"

   https://chromium-review.googlesource.com/#/c/231162/
   "net: asix: see 802.3 spec for phy reset"

I would certainly approve if _anyone_ picked these up, tested them,
and then submitted them to netdev.

cheers,
grant

> ---
>  drivers/net/usb/asix.h |  40 +++--
>  drivers/net/usb/asix_common.c  | 180 +++-
>  drivers/net/usb/asix_devices.c | 373 
> -
>  drivers/net/usb/ax88172a.c |  29 ++--
>  4 files changed, 472 insertions(+), 150 deletions(-)
>
> diff --git a/drivers/net/usb/asix.h b/drivers/net/usb/asix.h
> index a2d3ea6..d109242 100644
> --- a/drivers/net/usb/asix.h
> +++ b/drivers/net/usb/asix.h
> @@ -46,6 +46,7 @@
>  #define AX_CMD_SET_SW_MII  0x06
>  #define AX_CMD_READ_MII_REG0x07
>  #define AX_CMD_WRITE_MII_REG   0x08
> +#define AX_CMD_STATMNGSTS_REG  0x09
>  #define AX_CMD_SET_HW_MII  0x0a
>  #define AX_CMD_READ_EEPROM 0x0b
>  #define AX_CMD_WRITE_EEPROM0x0c
> @@ -71,6 +72,17 @@
>  #define AX_CMD_SW_RESET0x20
>  #define AX_CMD_SW_PHY_STATUS   0x21
>  #define AX_CMD_SW_PHY_SELECT   0x22
> +#define AX_QCTCTRL 0x2A
> +
> +#define AX_CHIPCODE_MASK   0x70
> +#define AX_AX88772_CHIPCODE0x00
> +#define AX_AX88772A_CHIPCODE   0x10
> +#define AX_AX88772B_CHIPCODE   0x20
> +#define AX_HOST_EN 0x01
> +
> +#define AX_PHYSEL_PSEL 0x01
> +#define AX_PHYSEL_SSMII0
> +#define AX_PHYSEL_SSEN 0x10
>
>  #define AX_PHY_SELECT_MASK (BIT(3) | BIT(2))
>  #define AX_PHY_SELECT_INTERNAL 0
> @@ -173,6 +185,10 @@ struct asix_rx_fixup_info {
>  };
>
>  struct asix_common_private {
> +   void (*resume)(struct usbnet *dev);
> +   void (*suspend)(struct usbnet *dev);
> +   u16 presvd_phy_advertise;
> +   u16 presvd_phy_bmcr;
> struct asix_rx_fixup_info rx_fixup_info;
>  };
>
> @@ -182,10 +198,10 @@ extern const struct driver_info ax88172a_info;
>  #define FLAG_EEPROM_MAC(1UL << 0)  /* init device MAC from 
> eeprom */
>
>  int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
> - u16 size, void *data);
> + u16 size, void *data, int in_pm);
>
>  int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
> -  u16 size, void *data);
> +  u16 size, void *data, int in_pm);
>
>  void asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value,
>   u16 index, u16 size, void *data);
> @@ -197,27 +213,31 @@ int asix_rx_fixup_common(struct usbnet *dev, struct 
> sk_buff *skb);
>  struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
>   gfp_t flags);
>
> -int asix_set_sw_mii(struct usbnet *dev);
> -int asix_set_hw_mii(struct usbnet *dev);
> +int asix_set_sw_mii(struct usbnet *dev, int in_pm);
> +int asix_set_hw_mii(struct usbnet *dev, int in_pm);
>
>  int asix_read_phy_addr(struct usbnet *dev, int internal);
>  int asix_get_phy_addr(struct usbnet *dev);
>
> -int asix_sw_reset(struct usbnet *dev, u8 flags);
> +int asix_sw_reset(struct usbnet *dev, u8 flags, int in_pm);
>
> -u16 asix_read_rx_ctl(struct usbnet *dev);
> -int asix_write_rx_ctl(struct usbnet *dev, u16 mode);
> +u16 asix_read_rx_ctl(struct usbnet *dev, int in_pm);
> +int asix_write_rx_ctl(struct usbnet *dev, u16 mode, int in_pm);
>
> -u16 asix_read_medium_status(struct usbnet *dev);
> -int asix_write_medium_mode(struct usbnet *dev, u16 mode);
> +u16 asix_read_medium_status(struct usbnet *dev, int in_pm);
> +int asix_write_medium_mode(struct usbnet *dev, u16 mode, int in_pm);