Subject: Re: [PATCH v2] tg3: replace placeholder MAC address with device property

From: Simon Horman <[email-masked]>
Date: Tue, 10 Mar 2026 16:16:52 +0000

On Fri, Mar 06, 2026 at 10:36:55PM +0530, Atharva Tiwari wrote:

...

> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index 75f66587983d..b9950651b20c 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -17030,6 +17030,14 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
>  	return err;
>  }
>  
> +static int tg3_is_default_mac_address(u8 *addr)
> +{
> +	u32 addr_high = (addr[0] << 16) | (addr[1] << 8) | addr[2];
> +	u32 addr_low = (addr[3] << 16) | (addr[4] << 8) | addr[5];
> +
> +	return addr_high == 0x00001018 && addr_low == 0;

Hi Paul and Atharva,

I think you can use ether_addr_equal(), or some variant of it, here.

> +}

...