Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp195433imw; Wed, 13 Jul 2022 23:00:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tNpNVqH3qlnvGqduTTe89GOCmPcsTG+VtmLHKI1JhXv5LpY+tca+PxMzisY8QLwrDK7D4I X-Received: by 2002:a17:90b:3149:b0:1f0:3539:e7ae with SMTP id ip9-20020a17090b314900b001f03539e7aemr14536535pjb.80.1657778402382; Wed, 13 Jul 2022 23:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657778402; cv=none; d=google.com; s=arc-20160816; b=VPoMarqW4oxR3Adhcb4N/6OGKDxxPwE9QquljDRBDvapaMKy/b2sBMgbBLf/FGffjV CeOLBMRMI2u8wZXxLFI7d+16jYCK40f9qhB2+h3oq7cefAPLL5qs33F/Y/TB/FNIc6ef KHNwESuDoSfLf31Pv0aAfPpp8RChc/nKs4FBsjK/ZCMWSyrVeY4cYa0x+X+xOL6GphnU GFQ27i6JlI5o0lMJUyrsceiWMiGI3g+2f3IKY7CpMfGW1ZO6J/0XPwtYXC68SsP8AF4w 5Fmbrmg+jnZKi6Eeh144LWEHzrTaGSntdbDi43QTQaBCLF5pIfgpoJa7k+SSJ4wMPSrS Q4yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=vy2MfzyPa9L9lOgfb/9mBRNFtfqDs9SVVZs/k4VMVS0=; b=DpeajBmjdput+iutLEiZefS9eOJDDQGtu3j7FDojwTy9UHa0xem00ahzEESv3Vko5t CbLvPcI9SBhpGlVKiRER3G3pYzJHlFhYbezHjiCecrxSJAl/EBf1G6j2F9+NI/fGYxlB 9rK8RQPNFKUYme69K4f006cWzK5njSCZI2HKoZJc/r/NonyyMeq/oRXTlik2wt5v3ZS8 nRDUzacIjhw3xK6rlHH4t3uv4RiDyP6rwSOkYK87PGM9CdtszVrLJjbVfRBpVSik6Hwq zwU9aElFRce9tJv1phfLvl0ev9jp6gZDG5QyV7Lh/N8E/n6cUE2TP6ZhWl37zYy5nnjq 7KjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TQjZUMSl; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g21-20020a17090ace9500b001ef9401c3bdsi665259pju.75.2022.07.13.22.59.50; Wed, 13 Jul 2022 23:00:02 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TQjZUMSl; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231866AbiGNFJ3 (ORCPT + 99 others); Thu, 14 Jul 2022 01:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234529AbiGNFIw (ORCPT ); Thu, 14 Jul 2022 01:08:52 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EEBF1B7BB for ; Wed, 13 Jul 2022 22:08:12 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id z23so1339784eju.8 for ; Wed, 13 Jul 2022 22:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=vy2MfzyPa9L9lOgfb/9mBRNFtfqDs9SVVZs/k4VMVS0=; b=TQjZUMSlaxkD994q2eniPOaQWVp4nLnWWtZwj1dClkwHmKDtjngLeVM4JhD7iXd04e OFvK4BORx1KndCIbYZiYzEr1zkaXAu/2jbrz13QK8qZ56nyaE9JyfItIInCtfdom3Z5B 5jAo9FDohAj1fbT4wfRe551R+WjD61L0I4kMyN/UPtA5bPvbs1mZn4yDYeCY/Y7l/IKr cQlqXhG/rh9RwIPo8JR8+TXX0ZHYvfD8pSWY3/yLSUobSLqTNtXjxQgl21LA8a7upEJ5 W5hkVX9eBw9r/l87TO8V79t+tiWbRCejxudQaoGzwE76gDnasNNKrwn341VBXKbenKM6 3Bbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=vy2MfzyPa9L9lOgfb/9mBRNFtfqDs9SVVZs/k4VMVS0=; b=xmOxnaZml3irhRXKJWu7CFHY6+sAzVKs1jYGTRon5mqAjhYpBbQQPTC6cvzfhnhYzY 45IPrUUyh8sYIB+yLZ6stjFo5oZ5aGg6bH0MLkzujXVsl2c2hA4YkkQfXzLrmjZqFX0c ZOPcWC/LZjzRydN5TcdMAmdf8v8PpxmlrLNRGx8Ehtq8yKtFU1VpuSF5hCZcCN7mbtRx dh4iztUkMD+cxxJOEfviOiAgXd+dz4H9pEpxDm778iFh37pCt+i/0aRJRF8DEGYJgbdb ho7S0ypy0NgR14rn6sC0/BSSVFZnvrzKXrlyntQDQxF7hI6uK9juiqpVVWwkUcB7A39J hfjQ== X-Gm-Message-State: AJIora8R82mwIujbiHwwdAkIdbUYR/Orpc0oCaEpB+ghu+8pBCqEiWdk cFqJhvHvxvtFmLQxisMGiVBgJxrwjFU= X-Received: by 2002:a17:907:1dce:b0:72b:40c4:deec with SMTP id og14-20020a1709071dce00b0072b40c4deecmr7009870ejc.70.1657775291239; Wed, 13 Jul 2022 22:08:11 -0700 (PDT) Received: from [192.168.1.101] (p54a07b82.dip0.t-ipconnect.de. [84.160.123.130]) by smtp.gmail.com with ESMTPSA id e2-20020a50fb82000000b0042bdb6a3602sm376821edq.69.2022.07.13.22.08.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Jul 2022 22:08:10 -0700 (PDT) Message-ID: Date: Thu, 14 Jul 2022 07:08:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] staging: r8188eu: fall back to random mac address Content-Language: en-US To: Martin Kaiser , Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Joe Perches References: <20220713075552.140927-1-martin@kaiser.cx> From: Philipp Hortmann In-Reply-To: <20220713075552.140927-1-martin@kaiser.cx> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 On 7/13/22 09:55, Martin Kaiser wrote: > 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); Tested with: static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail) { struct eeprom_priv *eeprom = &adapt->eeprompriv; struct dvobj_priv *dvobj = adapter_to_dvobj(adapt); struct device *device = dvobj_to_dev(dvobj); dev_info(device, "AutoLoadFail: %i", AutoLoadFail); if (!AutoLoadFail) { eth_random_addr(eeprom->mac_addr); } else { /* Read Permanent MAC address */ memcpy(eeprom->mac_addr, &hwinfo[EEPROM_MAC_ADDR_88EU], ETH_ALEN); } dev_info(device, "Test - MAC Address = %pM\n", eeprom->mac_addr); } Log: [ 1799.018943] r8188eu 2-1.6:1.0: AutoLoadFail: 0 [ 1799.018969] r8188eu 2-1.6:1.0: Test - MAC Address = be:0a:e8:72:a8:4a [ 1866.151995] r8188eu 2-1.6:1.0: AutoLoadFail: 0 [ 1866.152014] r8188eu 2-1.6:1.0: Test - MAC Address = 76:9b:4f:91:28:5f [ 1900.266003] r8188eu 2-1.6:1.0: AutoLoadFail: 0 [ 1900.266008] r8188eu 2-1.6:1.0: Test - MAC Address = 5e:9d:d5:f5:ef:26 Tested-by: Philipp Hortmann # Edimax N150