From patchwork Tue Nov 12 12:26:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Schmutzler X-Patchwork-Id: 1193500 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adrianschmutzler.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nl85OzeL"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47C6Sd6Tymz9sPF for ; Tue, 12 Nov 2019 23:27:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:Message-ID:Date:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=mHPzeMZdMCeQNg2NCw9s83Z4m0eHsxFCCSWE7Zr+Oek=; b=nl8 5OzeLjqaNZ1ZGl1pcemcoio8sN/Z5Klg6n5hhwBEQsagiGCGvOgA9BkGbfnrYL1RxkJ4kd588eq0F SjQjp+97sFk0AkMftrIaCvKlZg8w2IGNuKJlRlfenmWZyKpXJqjTI2jJ2IFe0wwgpElETz8w85uqc H168uVPbN/ctlndv30POaySiyPC8Sf1GOX0P+jOuQT/677gnlQEl1N4+weL0rYPhRLvCCB0OdEQJk FogXsgt2rPcys8Ow6zVyT+/jdo4Blk9ZMju3sy5pELBTvtFLB4toBwiCOCieqXvNSJJk/yGWs5iyy bbeFvqDIEBtuWlZ/C6EkoZR3ihxAj7g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iUVG3-0004BG-J7; Tue, 12 Nov 2019 12:26:55 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iUVG0-0004Ag-1c for openwrt-devel@lists.openwrt.org; Tue, 12 Nov 2019 12:26:53 +0000 Received: from btcskp ([132.180.49.42]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MKt3r-1iC9SS08HF-00LG0P; Tue, 12 Nov 2019 13:26:45 +0100 From: "Adrian Schmutzler" To: "'Mathias Kresin'" Date: Tue, 12 Nov 2019 13:26:44 +0100 Message-ID: <000e01d59954$7241b8b0$56c52a10$@adrianschmutzler.de> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: AdWZVG6WVWupbuHfTvy4ayfUCeP3Qg== Content-Language: de X-Provags-ID: V03:K1:uSoYcwhd+0MnjViJoEKYqyFZRt+NAD4lIcmq5xJc0X19r3F6vh4 eKuJoCUC1mht9U+m60frNVC1+lCCt9dw5J/oD7JQ5+T7OLF54xYvy25vRJZ+KyLqVIwqeJb 9PVKs/jqExu8KeAjA89TMbBi8XNcSvmZBALmTOzz4+3yVsOYjM+QYCmOdvK1Hn6kdz0N3BX WFNrVjKWiDvkv4BduawfA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:9eGbXUu8VEQ=:PY2gy7vMotEjA/UD/gZkBZ 7F/EsM/R/wnp6z2pN7fw1tcr2Pco/tMurLFjcHDTlzrrRXKvF0kWiloEpUHr1wvncSuLIZbVw VtWpeaxhspA+DJ9egg6x5k1f6sTzFn7BfZEpt+5z0Z47RD/YzaAeFDIqMEbVeuX0xaqyGhDV7 pne22pHvMXId0W6NZxPYPTGqpFAyIy7CeiW9eZ5xTlMDQbuXNIYF7PI4EvF2zEv5M+Zi3hpqN pav/HSaCQFLZTS3Xw4gRaw5C1m0XEGO9GkCn1s1zVvTHqXme5I7sXKnLbcCszlsU8TcZ6ZpYW tn33/xWRGP8P7Cx2K8sd27rhu2l60RhAmlA8k7e1ILSgj/jsfZ8L2TsTrgC1xTz/9H3OEm7/O fzka4JHCE8HcDOpBj7Xl/fX8xvSb9Z7ZtD4wHVdll1UxVyTmsp8s4Jk1jqUflPpAsaF5gsc+f 3cI2MCc87P5MxlFRKDyfZnnfVhdy1zgmsnNbRxnSl5VnBmr/BegbtIhbXQo0+k8ur9rqEyKvo 4xa+lzrQBeCS06bS5Kc6E12WFhDCKKgq+vGmwjSkMeFRhfjRImP+xQqKD51xnzj+KSpyG8NcM 62LYyzlqzCH3wWT4mZ0Gb209Ongor+EgpkZAPnI3dHgb1uBpfA23EUfGluvttyPiU0uc46U/v B5AzVABRbGAmMQiYA126Sb+B9Uu3v294fC38+6M2rATDrLYMl5+OLlMyyJ7hNPGM9sA2UJs8E rL4RMQs976qaJDkFhptenNY4In7HkubeO3M7RA6XielYKalLqhuNqRmJQqV2Qk7K+8rEUDsR8 /SK6Og7si24zBa5oAceW2eVhew/3UOcYPaZnvpMqI9/2q1df49WUEvW2kNBthrVPiMN5xi6zO eJaZW9UePNKZfL50yUr+eZ8nkorjRHKhdP14u/fn4= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191112_042652_383253_90253406 X-CRM114-Status: GOOD ( 15.13 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [212.227.17.24 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] OpenWrt: read label MAC address for FRITZ!WLAN Repeater 300E X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@lists.openwrt.org Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Hi, I'm currently trying to remove the dependency of label_mac in 02_network from phy setup, i.e. replacing stuff like $(cat /sys/class/ieee80211/phyX/macaddress) with extraction from the proper flash location. One obstacle is the AVM FRITZ!WLAN Repeater 300E, where the calibration data is extracted with caldata_extract_reverse "urloader" 0x1541 0x440 Is there a sufficiently easy way to get the MAC address out of there _without_ relying on initialized Wifi? I'm looking for something like label_mac=$(some_extraction_function "urloader" ) Technically, it should be somewhere in the reversed caldata, shouldn't it? If this is not possible (with reasonable effort), I would just calculate it based on the lan_mac in 02_network. Best Adrian -----Original Message----- From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org] On Behalf Of Adrian Schmutzler Sent: Montag, 11. November 2019 00:32 To: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH 2/2] ath79: read label MAC address from flash instead of using phy0/phy1 This replaces all uses of $(cat /sys/class/ieee80211/phyX/macaddress) by retrieval from the proper flash locations. This will make 02_network independent of WiFi setup again. For the AVM FRITZ!WLAN Repeater 300E this replacement is non-trivial. As it would be the only device in the whole trunk to keep the old mechanism, this drops label MAC address for this device for now. Signed-off-by: Adrian Schmutzler --- Is there an easy way to retrieve phy0 MAC address from fritz-300e? Can it by deduced from the caldata extraction by assuming the standard MAC offset after reverse? --- target/linux/ath79/generic/base-files/etc/board.d/02_network | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)")) diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 34f6e31047..a8ab07aef5 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -292,11 +292,10 @@ ath79_setup_macs() ubnt,nanostation-m|\ ubnt,rocket-m|\ ubnt,unifi) - label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) + label_mac=$(mtd_get_mac_binary art 0x1002) ;; avm,fritz300e) lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)")) - label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) ;; avm,fritz4020)