lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BL0PR11MB29133BBDC826A8B79F59FEB1E7212@BL0PR11MB2913.namprd11.prod.outlook.com>
Date: Wed, 6 Mar 2024 23:44:58 +0000
From: <Woojung.Huh@...rochip.com>
To: <Parthiban.Veerasooran@...rochip.com>, <davem@...emloft.net>,
	<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
	<horms@...nel.org>, <saeedm@...dia.com>, <anthony.l.nguyen@...el.com>,
	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>, <andrew@...n.ch>,
	<corbet@....net>, <linux-doc@...r.kernel.org>, <robh+dt@...nel.org>,
	<krzysztof.kozlowski+dt@...aro.org>, <conor+dt@...nel.org>,
	<devicetree@...r.kernel.org>, <Horatiu.Vultur@...rochip.com>,
	<ruanjinjie@...wei.com>, <Steen.Hegelund@...rochip.com>,
	<vladimir.oltean@....com>
CC: <UNGLinuxDriver@...rochip.com>, <Thorsten.Kummermehr@...rochip.com>,
	<Pier.Beruto@...emi.com>, <Selvamani.Rajagopal@...emi.com>,
	<Nicolas.Ferre@...rochip.com>, <benjamin.bigler@...nformulastudent.ch>
Subject: RE: [PATCH net-next v3 11/12] microchip: lan865x: add driver support
 for Microchip's LAN865X MAC-PHY

Hi Parthiban,

> diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c
> b/drivers/net/ethernet/microchip/lan865x/lan865x.c
...
> +static void lan865x_multicast_work_handler(struct work_struct *work)
> +{
> +	struct lan865x_priv *priv = container_of(work, struct lan865x_priv,
> +						 multicast_work);
> +	u32 regval = 0;
> +
> +	if (priv->netdev->flags & IFF_PROMISC) {
> +		/* Enabling promiscuous mode */
> +		regval |= MAC_NET_CFG_PROMISCUOUS_MODE;
> +		regval &= (~MAC_NET_CFG_MULTICAST_MODE);
> +		regval &= (~MAC_NET_CFG_UNICAST_MODE);
> +	} else if (priv->netdev->flags & IFF_ALLMULTI) {
> +		/* Enabling all multicast mode */
> +		regval &= (~MAC_NET_CFG_PROMISCUOUS_MODE);
> +		regval |= MAC_NET_CFG_MULTICAST_MODE;
> +		regval &= (~MAC_NET_CFG_UNICAST_MODE);
> +	} else if (!netdev_mc_empty(priv->netdev)) {
> +		lan865x_set_specific_multicast_addr(priv->netdev);
> +		regval &= (~MAC_NET_CFG_PROMISCUOUS_MODE);
> +		regval &= (~MAC_NET_CFG_MULTICAST_MODE);
> +		regval |= MAC_NET_CFG_UNICAST_MODE;
> +	} else {
> +		/* enabling local mac address only */
> +		if (oa_tc6_write_register(priv->tc6, LAN865X_REG_MAC_H_HASH,
> +					  regval)) {

Your intention to write 0 into LAN865X_REG_MAC_H_HASH?
If then, using 0 than regval makes more clear.

> +			netdev_err(priv->netdev, "Failed to write reg_hashh");
> +			return;
> +		}
> +		if (oa_tc6_write_register(priv->tc6, LAN865X_REG_MAC_L_HASH,
> +					  regval)) {

Same here.

> +			netdev_err(priv->netdev, "Failed to write reg_hashl");
> +			return;
> +		}
> +	}
> +	if (oa_tc6_write_register(priv->tc6, LAN865X_REG_MAC_NET_CFG,
> regval))
> +		netdev_err(priv->netdev,
> +			   "Failed to enable promiscuous/multicast/normal mode");
> +}
> +


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ