Patchwork bgmac: fix "cmdcfg" calls for promisc and loopback modes

login
register
mail settings
Submitter Rafał Miłecki
Date Feb. 7, 2013, 10:23 a.m.
Message ID <1360232591-25789-1-git-send-email-zajec5@gmail.com>
Download mbox | patch
Permalink /patch/218882/
State Superseded
Delegated to: David Miller
Headers show

Comments

Rafał Miłecki - Feb. 7, 2013, 10:23 a.m.
This makes code match the specs.

Reported-by: Nathan Hintz <nlhintz@hotmail.com>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
 drivers/net/ethernet/broadcom/bgmac.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Florian Fainelli - Feb. 7, 2013, 2:55 p.m.
Hello Rafal,

On 02/07/2013 11:23 AM, Rafał Miłecki wrote:
> This makes code match the specs.

And this probably deserves a better commit message too. Especially as 
you are inverting booleans, without the actual consumer of that boolean 
parameter being in the context of the patch.

Thanks!

>
> Reported-by: Nathan Hintz <nlhintz@hotmail.com>
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
>   drivers/net/ethernet/broadcom/bgmac.c |    8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
> index f90d1dc..8cf5e39 100644
> --- a/drivers/net/ethernet/broadcom/bgmac.c
> +++ b/drivers/net/ethernet/broadcom/bgmac.c
> @@ -776,9 +776,9 @@ static void bgmac_set_rx_mode(struct net_device *net_dev)
>   	struct bgmac *bgmac = netdev_priv(net_dev);
>
>   	if (net_dev->flags & IFF_PROMISC)
> -		bgmac_cmdcfg_maskset(bgmac, ~0, BGMAC_CMDCFG_PROM, false);
> +		bgmac_cmdcfg_maskset(bgmac, ~0, BGMAC_CMDCFG_PROM, true);
>   	else
> -		bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_PROM, 0, false);
> +		bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_PROM, 0, true);
>   }
>
>   #if 0 /* We don't use that regs yet */
> @@ -1039,9 +1039,9 @@ static void bgmac_chip_init(struct bgmac *bgmac, bool full_init)
>   	bgmac_write_mac_address(bgmac, bgmac->net_dev->dev_addr);
>
>   	if (bgmac->loopback)
> -		bgmac_cmdcfg_maskset(bgmac, ~0, BGMAC_CMDCFG_ML, true);
> +		bgmac_cmdcfg_maskset(bgmac, ~0, BGMAC_CMDCFG_ML, false);
>   	else
> -		bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_ML, 0, true);
> +		bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_ML, 0, false);
>
>   	bgmac_write(bgmac, BGMAC_RXMAX_LENGTH, 32 + ETHER_MAX_LEN);
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index f90d1dc..8cf5e39 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -776,9 +776,9 @@  static void bgmac_set_rx_mode(struct net_device *net_dev)
 	struct bgmac *bgmac = netdev_priv(net_dev);
 
 	if (net_dev->flags & IFF_PROMISC)
-		bgmac_cmdcfg_maskset(bgmac, ~0, BGMAC_CMDCFG_PROM, false);
+		bgmac_cmdcfg_maskset(bgmac, ~0, BGMAC_CMDCFG_PROM, true);
 	else
-		bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_PROM, 0, false);
+		bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_PROM, 0, true);
 }
 
 #if 0 /* We don't use that regs yet */
@@ -1039,9 +1039,9 @@  static void bgmac_chip_init(struct bgmac *bgmac, bool full_init)
 	bgmac_write_mac_address(bgmac, bgmac->net_dev->dev_addr);
 
 	if (bgmac->loopback)
-		bgmac_cmdcfg_maskset(bgmac, ~0, BGMAC_CMDCFG_ML, true);
+		bgmac_cmdcfg_maskset(bgmac, ~0, BGMAC_CMDCFG_ML, false);
 	else
-		bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_ML, 0, true);
+		bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_ML, 0, false);
 
 	bgmac_write(bgmac, BGMAC_RXMAX_LENGTH, 32 + ETHER_MAX_LEN);