RE: [PATCH net 3/7] lan78xx: Check for supported Wake-on-LAN modes

2018-09-25 Thread Woojung.Huh
Hi Florian, > @@ -1401,19 +1401,10 @@ static int lan78xx_set_wol(struct net_device ... > + if (pdata->wol & ~WAKE_ALL) > + return -EINVAL; If I understand correctly, it needs to check againt "wol->wolopts" than pdata->wol. > + > + pdata->wol = wol->wolopts; Thanks. Woo

Re: [PATCH net 3/7] lan78xx: Check for supported Wake-on-LAN modes

2018-09-25 Thread Florian Fainelli
On 09/25/2018 10:32 AM, woojung@microchip.com wrote: > Hi Florian, > + if (pdata->wol == 0) + return -EINVAL; + >>> It will make function return when disabling WOL. >> >> Huh, yes, good point. >> >>> Is there other place handling this scenario? >> >> How do you mean? >

RE: [PATCH net 3/7] lan78xx: Check for supported Wake-on-LAN modes

2018-09-25 Thread Woojung.Huh
Hi Florian, > >> + if (pdata->wol == 0) > >> + return -EINVAL; > >> + > > It will make function return when disabling WOL. > > Huh, yes, good point. > > > Is there other place handling this scenario? > > How do you mean? > I meant there is another path I might miss when disabling WOL

Re: [PATCH net 3/7] lan78xx: Check for supported Wake-on-LAN modes

2018-09-25 Thread Florian Fainelli
On 09/25/2018 10:19 AM, woojung@microchip.com wrote: > Hi Florian, > >> @@ -1415,6 +1415,9 @@ static int lan78xx_set_wol(struct net_device *netdev, >> if (wol->wolopts & WAKE_ARP) >> pdata->wol |= WAKE_ARP; >> >> +if (pdata->wol == 0) >> +return -EINVAL; >> +

RE: [PATCH net 3/7] lan78xx: Check for supported Wake-on-LAN modes

2018-09-25 Thread Woojung.Huh
Hi Florian, > @@ -1415,6 +1415,9 @@ static int lan78xx_set_wol(struct net_device *netdev, > if (wol->wolopts & WAKE_ARP) > pdata->wol |= WAKE_ARP; > > + if (pdata->wol == 0) > + return -EINVAL; > + It will make function return when disabling WOL. Is there other

[PATCH net 3/7] lan78xx: Check for supported Wake-on-LAN modes

2018-09-24 Thread Florian Fainelli
The driver supports a fair amount of Wake-on-LAN modes, but is not checking that the user specified one that is supported. Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Signed-off-by: Florian Fainelli --- drivers/net/usb/lan78xx.c | 3 +++ 1 fi