From nobody Sat Apr 18 14:13:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F09FC43334 for ; Wed, 13 Jul 2022 07:56:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234932AbiGMH4S (ORCPT ); Wed, 13 Jul 2022 03:56:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234523AbiGMH4M (ORCPT ); Wed, 13 Jul 2022 03:56:12 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BFC2DA590 for ; Wed, 13 Jul 2022 00:56:11 -0700 (PDT) Received: from pd956d63d.dip0.t-ipconnect.de ([217.86.214.61] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1oBXE4-0000JP-RV; Wed, 13 Jul 2022 09:56:04 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser , Joe Perches Subject: [PATCH] staging: r8188eu: fall back to random mac address Date: Wed, 13 Jul 2022 09:55:52 +0200 Message-Id: <20220713075552.140927-1-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Call eth_random_addr to generate a random mac address if we cannot load the mac address from the efuses. Do not use a constant mac address as fallback. This may create conflicts if we have several r8188eu devices on the network. Suggested-by: Joe Perches Signed-off-by: Martin Kaiser Reviewed-by: Pavel Skripkin Tested-by: Philipp Hortmann # Edimax N150 --- drivers/staging/r8188eu/hal/usb_halinit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8= 188eu/hal/usb_halinit.c index 68d012a442a8..8902dda7b8d8 100644 --- a/drivers/staging/r8188eu/hal/usb_halinit.c +++ b/drivers/staging/r8188eu/hal/usb_halinit.c @@ -912,11 +912,10 @@ unsigned int rtl8188eu_inirp_init(struct adapter *Ada= pter) =20 static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo= , bool AutoLoadFail) { - u8 sMacAddr[6] =3D {0x00, 0xE0, 0x4C, 0x81, 0x88, 0x02}; struct eeprom_priv *eeprom =3D &adapt->eeprompriv; =20 if (AutoLoadFail) { - memcpy(eeprom->mac_addr, sMacAddr, ETH_ALEN); + eth_random_addr(eeprom->mac_addr); } else { /* Read Permanent MAC address */ memcpy(eeprom->mac_addr, &hwinfo[EEPROM_MAC_ADDR_88EU], ETH_ALEN); --=20 2.30.2