Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp29388pxb; Tue, 12 Apr 2022 15:55:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyT+etazVM+8tvG1+WrogNXcXcoxEsl525d+1q6Lf4KRS8WQ0w/OngapD61lgw/+RMFbzk3 X-Received: by 2002:a17:902:b092:b0:156:a40f:f716 with SMTP id p18-20020a170902b09200b00156a40ff716mr39543060plr.72.1649804123497; Tue, 12 Apr 2022 15:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649804123; cv=none; d=google.com; s=arc-20160816; b=HjwnBv0W2LQ/I7QyAekT+pvAkNH57Bkc2w54C2/NoVfzVIO+4hK0mOCfyjMjsxBAB+ kn/lyQAQzUDCuOB3kOKOGa+zYh3hvatAOzdP2AvbrPb0MCY/xYTU82UVKkWpnu1VG45i 1mjuL8Y6r6FYS1k/LRplJCCfK57JOTGsii1FrpCbr6Eymiatad2ipsfneC3wJnpVnVjH UYeruHx+SG9li6b6W+BBxWoe9OOf2EMelk9j2v//V1cDISTr22Gt033XTGMw/RCwsWGo J6vqmSgy6NNiz7mf0S4TlDggDyOJKDvnWf/VxYG8AtIANV93TyB7H/xcYAMBcOb2jBPQ sGsQ== 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:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=EXRqyyFbECu6GEBfrNfZPIBbjds5Ej7Fq838pGzWpHc=; b=LCLYus9WdDESqsQcEGtCxQShjsOaQNvUw7/pC7qrOW8jWLIH3WmT6WjNg9FODXz7MH a0Q4Z/OXvzpLa3uoPHSPsw74cOndbII/XifzW+2wMuZ4l0YQYarfPQIPrSepXxEh+JRI UUIk6fIhdHA1BDaB6U1elsyExV/6jCd1JviFbio8A6cOumpsbo5QwrvvQo3Z0Mva4nT4 I/mVPs0Swuj5NaFc78NEC7LmSb4EN61xvxa0iH1dlYeuMFqfzHQtDvTx3GKzemn/7oye 8S8xWXhkFaBHsk7Nfh7Lsc25TSrRa5H7zuhdsF3wqFFXbOdYzTqzhi49pU5iVEkKr3l6 uBpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=dcFjm0Mc; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y1-20020a63ce01000000b0039d945d133fsi3321909pgf.324.2022.04.12.15.55.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:55:23 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=dcFjm0Mc; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 530D411BE4E; Tue, 12 Apr 2022 14:36:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357455AbiDLJ4H (ORCPT + 70 others); Tue, 12 Apr 2022 05:56:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356182AbiDLHek (ORCPT ); Tue, 12 Apr 2022 03:34:40 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61FAB265C for ; Tue, 12 Apr 2022 00:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=EXRqyyFbECu6GEBfrNfZPIBbjds5Ej7Fq838pGzWpHc=; b=dcFjm0Mc2ZG7YRfXxLPx2nio/n E0LWy8kDXNcjn32L7FeEEs3AF9gw6L5ZgdsN7jMk/NQWrIkltePH0/ri8FbR30Ef1yA2h0JZS+uTF HCs5zJSXrPAe4CkRJbtJ6NaLA9ccA+VNkUov/IgZKSjsBWMiaJlms7+Qorr6hNYKUaas=; Received: from p57a6f1f9.dip0.t-ipconnect.de ([87.166.241.249] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1neAe8-0007N0-LC; Tue, 12 Apr 2022 09:09:04 +0200 Message-ID: <35ae1b48-e9e6-3c05-1abe-7d11dfb03797@nbd.name> Date: Tue, 12 Apr 2022 09:09:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] mt76: mt7915: add device name in eeprom request Content-Language: en-US To: Daniel Danzberger , linux-wireless@vger.kernel.org References: <20220411142309.886165-1-daniel@dd-wrt.com> From: Felix Fietkau In-Reply-To: <20220411142309.886165-1-daniel@dd-wrt.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-wireless@vger.kernel.org On 11.04.22 16:23, Daniel Danzberger wrote: > When an eerpom is requested from userspace via request_firmware, the > device name is appened to the firmware name so the userspace can load > different eeproms/caldata for different devices. > > Signed-off-by: Daniel Danzberger > --- > mt7915/eeprom.c | 7 ++++++- > mt7915/mt7915.h | 16 ++++++++-------- > 2 files changed, 14 insertions(+), 9 deletions(-) > > diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c > index 4b1a9811..99c1d650 100644 > --- a/mt7915/eeprom.c > +++ b/mt7915/eeprom.c > @@ -76,8 +76,13 @@ mt7915_eeprom_load_default(struct mt7915_dev *dev) > u8 *eeprom = dev->mt76.eeprom.data; > const struct firmware *fw = NULL; > int ret; > + char eeprom_name[100]; > > - ret = request_firmware(&fw, mt7915_eeprom_name(dev), dev->mt76.dev); > + scnprintf(eeprom_name, sizeof(eeprom_name), > + "mediatek/%s-%s.bin", > + mt7915_eeprom_name(dev), dev_name(dev->mt76.dev)); In order to not break compatibility, please keep the existing code that loads eeprom files based on the chip name. For the device name based eeprom file, you don't need to include the chip id. Just make it mt76-eeprom-.bin or something like that. I also think you don't need the mediatek/ prefix here, since that's usually used for files shipped with linux-firmware.git - Felix