Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp448464imw; Wed, 13 Jul 2022 01:15:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sS+ZmhIMFN9KC1q6+Z0j6Y7RFvHRTiMj8n2Wpk4jlr9YRpUtNPIPF50SdO58Dncnx6QsAG X-Received: by 2002:a17:907:b590:b0:72b:949c:c737 with SMTP id qx16-20020a170907b59000b0072b949cc737mr2267493ejc.155.1657700100416; Wed, 13 Jul 2022 01:15:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657700100; cv=none; d=google.com; s=arc-20160816; b=i3qNOfyAJ1v/gBBWsAmokSwM9OG8u9xdZm2+QVB8Hya8EKTij4agw15weO0jCPiUF4 mmqgrA16uVHhkYHcXbGIqvysPohq6i499iIQmKkOb3r4Pin7bHBISf9vR0FRNktDZ6FW 1iQy2pFNXMjUCFXYtW16F5whw4VxuCBDkJ31H6c3DJiBdEON3nHX9oCK7MAA7/aiTcRe LrdYFvTuLv/kbA/lGrof4vD5u/fIP0bp9xWWT1IMCXb9h0j1RZWMuBntIi7npRI93xPp c5sc6mqXQqftiYTTkZkt5KuEn9Q/h6UjvmHqf+fL8Wdsev97o4g97cs36nrs4IFn2JJB McTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=TcHNJJZ7cMBNb7mf++P2dhcsUh8RKl/GK9TFVQOVRbg=; b=eCNZMUzjgcBwlCfHGPQIxlrr7rx1zPdw/f/bubTspMkr5LOUILcLJUhiN1iDjLr0fh NcvjYTMYXf1favEQXHD8gmbx+gCilJFsZceqRrNbQZkpjkauJLoJ1cJP3RitovBllsMY lhdhz5vvlKbFO3v78Kc1azqKHId07U/vIlUk2oLChZ+2Cth/KEqxnKPId+EwAmngo1x4 TDmzjL5M8fYg5aHqSWpL5UP4j8+8HQot1J6o2GNKfEvPCdd+/Vx6H45YRLde25uHx8Cl zDr0VKs60jSr8v0r7oAD/IfUKrxG8VeINgh3KC48XpWxXr/B5gxVxR8vUT+e7gP5/NiL j/CQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h16-20020a056402281000b0043aa4f51a26si21904333ede.401.2022.07.13.01.14.35; Wed, 13 Jul 2022 01:15:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234898AbiGMH4Q (ORCPT + 99 others); Wed, 13 Jul 2022 03:56:16 -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: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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/r8188eu/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 *Adapter) static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail) { - u8 sMacAddr[6] = {0x00, 0xE0, 0x4C, 0x81, 0x88, 0x02}; struct eeprom_priv *eeprom = &adapt->eeprompriv; 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); -- 2.30.2