Skip to contentSkip to conversation

drivers/net/usb/asix: fixed asix_get_wol reported wrong wol status issue

PATCH Superseded ASIX Allan Email [office] 2 participants 3 messages Dec 22, 2011 – Dec 23, 2011

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net/usb/asix: fixed asix_get_wol reported wrong wol status issue

Dear David,

This is my first time to submit the driver patch onto Linux kernel mainline source. Please correct me if anything is wrong on my submission way or email format. Thanks a lot for your great helps.

========
Fixed the asix_get_wol() routine reported wrong wol status issue.
This fix had been verified on x86 Linux kernel 3.0.0-12-generic system with AX88772A/AX88772/Belkin AX88178 USB dongles, and the wol function works fine (can be waked up by receiving the magic packets).

---

drivers/net/usb/asix.c +5 -1
diff --uprN a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
@@ -36,7 +36,7 @@
 #include <linux/usb/usbnet.h>
 #include <linux/slab.h>
 
-#define DRIVER_VERSION "08-Nov-2011"
+#define DRIVER_VERSION "22-Dec-2011"
 #define DRIVER_NAME "asix"
 
 /* ASIX AX8817X based USB 2.0 Ethernet Devices */
@@ -689,6 +689,10 @@ asix_get_wol(struct net_device *net, str
 	}
 	wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
 	wolinfo->wolopts = 0;
+	if (opt & AX_MONITOR_LINK)
+		wolinfo->wolopts |= WAKE_PHY;
+	if (opt & AX_MONITOR_MAGIC)
+		wolinfo->wolopts |= WAKE_MAGIC;
 }
 
 static int

---
Best regards,
Allan Chou
Technical Support Division
ASIX Electronics Corporation
TEL: 886-3-5799500 ext.228
FAX: 886-3-5799558
E-mail: [email protected]
http://www.asix.com.tw/

-----Original Message-----
From: allan [mailto:[email protected]]
Sent: Saturday, December 17, 2011 10:36 AM
To: 'Grant Grundler'
Cc: 'Eugene'; '[email protected]'; 'Freddy Xin'; 'ASIX Louis [蘇威陸]'
Subject: RE: drivers/net/usb/asix: bug in asix_get_wol

Dear Grant,

I will double check this issue and submit the revised patch to Linux kernel mainline source next week. Thanks a lot for your great helps.

---
Best regards,
Allan Chou
Technical Support Division
ASIX Electronics Corporation
TEL: 886-3-5799500 ext.228
FAX: 886-3-5799558
E-mail: [email protected]
http://www.asix.com.tw/

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Grant Grundler
Sent: Saturday, December 17, 2011 6:16 AM
To: ASIX Allan Email [office]
Cc: Eugene; [email protected]; Freddy Xin; ASIX Louis [蘇威陸]
Subject: Re: drivers/net/usb/asix: bug in asix_get_wol

Quoted 1 line · ASIX Allan Email [office]

Resend without attachment due to below email server error.

...

Quoted 8 lines

-----Original Message-----
From: ASIX Allan Email [office] [mailto:[email protected]]
Sent: Friday, December 16, 2011 11:38 AM
To: 'Grant Grundler'; 'Eugene'
Cc: '[email protected]'; 'Freddy Xin'; ASIX Louis [蘇威陸]
Subject: RE: drivers/net/usb/asix: bug in asix_get_wol
Importance: High

Quoted 5 lines

Dear Grant and Eugene,

Please refer to the attached file and below statements to modify the asix_get_wol() routine and let us know if this suggestion can solve your issues or not? Thanks a lot.

Allan,
Thanks for the response but it doesn't answer my previous question. Let me ask the same question differently.

Does WOL support in asix driver need more than the four lines of code? Ie does MONITOR_MODE need to be enabled or anything like that?

Quoted 19 lines

================
static void
asix_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)

{
       struct usbnet *dev = netdev_priv(net);
       u8 opt;

       if (asix_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, &opt) < 0) {
               wolinfo->supported = 0;
               wolinfo->wolopts = 0;
               return;
       }
       wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
       wolinfo->wolopts = 0;
       if (opt & AX_MONITOR_LINK)
               wolinfo->wolopts |= WAKE_PHY;
       if (opt & AX_MONITOR_MAGIC)
               wolinfo->wolopts |= WAKE_MAGIC;
}

This looks remarkably similar to the code Eugene said enables WOL for him (and it works). I not able to find any difference.

If you believe it was a mistake to remove these four lines of code, please submit a patch (See Documentation/SubmittingPatches) to add them back. You can add a "Tested-by: Eugene <[email protected]>" line after your own "Signed-off-by:" in the patch.

thanks!
grant

#1 lore raw
Quoted 3 lines · ASIX Allan Email [office]

Dear David,

This is my first time to submit the driver patch onto Linux kernel mainline source. Please correct me if anything is wrong on my submission way or email format. Thanks a lot for your great helps.

Hi Allan,
Thanks for submitting the patch. I can advise as well since this probably won't get applied due to how the email is "structured".

Your email which includes the patch needs to follow the "patch format" described in Documentation/SubmittingPatches (see linux source tree).

Your email should have three main sections:
1) commit log entry + signed-off-by lines followed by one line with "---" (and nothing else). This text summarizes *why* the patch is
needed: what bug it fixes or feature it enables.
2) optional comments/information about the testing of the patch (e.g. "tested on Samsung Chromebook" or other comments that do NOT belong in the commit log entry above. This section can be empty - not required.
3) "diff -u" format patch (this is what "git diff" will produce).

Do not append any other emails or additional text.

thanks!
grant

Quoted 130 lines

========
Fixed the asix_get_wol() routine reported wrong wol status issue.
This fix had been verified on x86 Linux kernel 3.0.0-12-generic system with AX88772A/AX88772/Belkin AX88178 USB dongles, and the wol function works fine (can be waked up by receiving the magic packets).

---
diff --uprN a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c

drivers/net/usb/asix.c    2011-12-22 18:20:39.000000000 +0800 renamed from drivers/net/usb/asix.c    2011-12-15 14:01:49.000000000 +0800 +5 -1
@@ -36,7 +36,7 @@
  #include <linux/usb/usbnet.h>
  #include <linux/slab.h>
 
-#define DRIVER_VERSION "08-Nov-2011"
+#define DRIVER_VERSION "22-Dec-2011"
  #define DRIVER_NAME "asix"
 
  /* ASIX AX8817X based USB 2.0 Ethernet Devices */
@@ -689,6 +689,10 @@ asix_get_wol(struct net_device *net, str
        }
        wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
        wolinfo->wolopts = 0;
+       if (opt & AX_MONITOR_LINK)
+               wolinfo->wolopts |= WAKE_PHY;
+       if (opt & AX_MONITOR_MAGIC)
+               wolinfo->wolopts |= WAKE_MAGIC;
  }
 

 static int

---
Best regards,
Allan Chou
Technical Support Division
ASIX Electronics Corporation
TEL: 886-3-5799500 ext.228
FAX: 886-3-5799558
E-mail: [email protected]
http://www.asix.com.tw/

-----Original Message-----
From: allan [mailto:[email protected]]
Sent: Saturday, December 17, 2011 10:36 AM
To: 'Grant Grundler'
Cc: 'Eugene'; '[email protected]'; 'Freddy Xin'; 'ASIX Louis [蘇威陸]'
Subject: RE: drivers/net/usb/asix: bug in asix_get_wol

Dear Grant,

I will double check this issue and submit the revised patch to Linux kernel mainline source next week. Thanks a lot for your great helps.

---
Best regards,
Allan Chou
Technical Support Division
ASIX Electronics Corporation
TEL: 886-3-5799500 ext.228
FAX: 886-3-5799558
E-mail: [email protected]
http://www.asix.com.tw/

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Grant Grundler
Sent: Saturday, December 17, 2011 6:16 AM
To: ASIX Allan Email [office]
Cc: Eugene; [email protected]; Freddy Xin; ASIX Louis [蘇威陸]
Subject: Re: drivers/net/usb/asix: bug in asix_get_wol

Quoted 1 line · ASIX Allan Email [office]

Resend without attachment due to below email server error.

...

Quoted 8 lines

-----Original Message-----
From: ASIX Allan Email [office] [mailto:[email protected]]
Sent: Friday, December 16, 2011 11:38 AM
To: 'Grant Grundler'; 'Eugene'
Cc: '[email protected]'; 'Freddy Xin'; ASIX Louis [蘇威陸]
Subject: RE: drivers/net/usb/asix: bug in asix_get_wol
Importance: High

Quoted 5 lines

Dear Grant and Eugene,

Please refer to the attached file and below statements to modify the asix_get_wol() routine and let us know if this suggestion can solve your issues or not? Thanks a lot.

Allan,
Thanks for the response but it doesn't answer my previous question. Let me ask the same question differently.

Does WOL support in asix driver need more than the four lines of code? Ie does MONITOR_MODE need to be enabled or anything like that?

Quoted 7 lines

================
static void
asix_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo) {
       struct usbnet *dev = netdev_priv(net);
       u8 opt;

Quoted 12 lines

       if (asix_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, &opt) < 0) { wolinfo->supported = 0;
               wolinfo->wolopts = 0;
               return;
       }
       wolinfo->supported = WAKE_PHY | WAKE_MAGIC; wolinfo->wolopts = 0;
       if (opt & AX_MONITOR_LINK)
               wolinfo->wolopts |= WAKE_PHY;
       if (opt & AX_MONITOR_MAGIC)
               wolinfo->wolopts |= WAKE_MAGIC;
}

This looks remarkably similar to the code Eugene said enables WOL for him (and it works). I not able to find any difference.

If you believe it was a mistake to remove these four lines of code, please submit a patch (See Documentation/SubmittingPatches)  to add them back. You can add a "Tested-by: Eugene <[email protected]>" line after your own "Signed-off-by:" in the patch.

thanks!
grant

author
#2 lore raw

Dear Grant,

Thanks a lot for your great suggestions. I had re-submitted the driver patch again. Please correct me if there are anything I should improve on the revised driver patch submission. Thanks a lot in advance.

---
Best regards,
Allan Chou
Technical Support Division
ASIX Electronics Corporation
TEL: 886-3-5799500 ext.228
FAX: 886-3-5799558
E-mail: [email protected]
http://www.asix.com.tw/

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Grant Grundler
Sent: Friday, December 23, 2011 3:02 AM
To: ASIX Allan Email [office]
Cc: [email protected]; [email protected]; [email protected]; Freddy Xin; Eugene; ASIX Louis [蘇威陸]
Subject: Re: [PATCH] drivers/net/usb/asix: fixed asix_get_wol reported wrong wol status issue

Quoted 3 lines · ASIX Allan Email [office]

Dear David,

This is my first time to submit the driver patch onto Linux kernel mainline source. Please correct me if anything is wrong on my submission way or email format. Thanks a lot for your great helps.

Hi Allan,
Thanks for submitting the patch. I can advise as well since this probably won't get applied due to how the email is "structured".

Your email which includes the patch needs to follow the "patch format" described in Documentation/SubmittingPatches (see linux source tree).

Your email should have three main sections:
1) commit log entry + signed-off-by lines followed by one line with "---" (and nothing else). This text summarizes *why* the patch is
needed: what bug it fixes or feature it enables.
2) optional comments/information about the testing of the patch (e.g. "tested on Samsung Chromebook" or other comments that do NOT belong in the commit log entry above. This section can be empty - not required.
3) "diff -u" format patch (this is what "git diff" will produce).

Do not append any other emails or additional text.

thanks!
grant

Quoted 130 lines

========
Fixed the asix_get_wol() routine reported wrong wol status issue.
This fix had been verified on x86 Linux kernel 3.0.0-12-generic system with AX88772A/AX88772/Belkin AX88178 USB dongles, and the wol function works fine (can be waked up by receiving the magic packets).

---
diff --uprN a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c

drivers/net/usb/asix.c 2011-12-22 18:20:39.000000000 +0800 renamed from drivers/net/usb/asix.c 2011-12-15 14:01:49.000000000 +0800 +5 -2
@@ -36,7 +36,7 @@
 #include <linux/usb/usbnet.h>
 #include <linux/slab.h>
 
-#define DRIVER_VERSION "08-Nov-2011"
+#define DRIVER_VERSION "22-Dec-2011"
 #define DRIVER_NAME "asix"
 
 /* ASIX AX8817X based USB 2.0 Ethernet Devices */
@@ -689,6 +689,10 @@ asix_get_wol(struct net_device *net, str
       }
       wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
       wolinfo->wolopts = 0;
+       if (opt & AX_MONITOR_LINK)
+               wolinfo->wolopts |= WAKE_PHY;
+       if (opt & AX_MONITOR_MAGIC)
+               wolinfo->wolopts |= WAKE_MAGIC;
 }
 
 static int
 
 
---

Best regards,
Allan Chou
Technical Support Division
ASIX Electronics Corporation
TEL: 886-3-5799500 ext.228
FAX: 886-3-5799558
E-mail: [email protected]
http://www.asix.com.tw/

-----Original Message-----
From: allan [mailto:[email protected]]
Sent: Saturday, December 17, 2011 10:36 AM
To: 'Grant Grundler'
Cc: 'Eugene'; '[email protected]'; 'Freddy Xin'; 'ASIX Louis [蘇威陸]'
Subject: RE: drivers/net/usb/asix: bug in asix_get_wol

Dear Grant,

I will double check this issue and submit the revised patch to Linux kernel mainline source next week. Thanks a lot for your great helps.

---
Best regards,
Allan Chou
Technical Support Division
ASIX Electronics Corporation
TEL: 886-3-5799500 ext.228
FAX: 886-3-5799558
E-mail: [email protected]
http://www.asix.com.tw/

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Grant Grundler
Sent: Saturday, December 17, 2011 6:16 AM
To: ASIX Allan Email [office]
Cc: Eugene; [email protected]; Freddy Xin; ASIX Louis [蘇威陸]
Subject: Re: drivers/net/usb/asix: bug in asix_get_wol

Quoted 1 line · ASIX Allan Email [office]

Resend without attachment due to below email server error.

...

Quoted 8 lines

-----Original Message-----
From: ASIX Allan Email [office] [mailto:[email protected]]
Sent: Friday, December 16, 2011 11:38 AM
To: 'Grant Grundler'; 'Eugene'
Cc: '[email protected]'; 'Freddy Xin'; ASIX Louis [蘇威陸]
Subject: RE: drivers/net/usb/asix: bug in asix_get_wol
Importance: High

Quoted 5 lines

Dear Grant and Eugene,

Please refer to the attached file and below statements to modify the asix_get_wol() routine and let us know if this suggestion can solve your issues or not? Thanks a lot.

Allan,
Thanks for the response but it doesn't answer my previous question. Let me ask the same question differently.

Does WOL support in asix driver need more than the four lines of code? Ie does MONITOR_MODE need to be enabled or anything like that?

Quoted 19 lines

================
static void
asix_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)

{
       struct usbnet *dev = netdev_priv(net);
       u8 opt;

       if (asix_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, &opt) < 0) {
               wolinfo->supported = 0;
               wolinfo->wolopts = 0;
               return;
       }
       wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
       wolinfo->wolopts = 0;
       if (opt & AX_MONITOR_LINK)
               wolinfo->wolopts |= WAKE_PHY;
       if (opt & AX_MONITOR_MAGIC)
               wolinfo->wolopts |= WAKE_MAGIC;
}

This looks remarkably similar to the code Eugene said enables WOL for him (and it works). I not able to find any difference.

If you believe it was a mistake to remove these four lines of code, please submit a patch (See Documentation/SubmittingPatches) to add them back. You can add a "Tested-by: Eugene <[email protected]>" line after your own "Signed-off-by:" in the patch.

thanks!
grant