From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A200F606A322 for ; Fri, 4 Dec 2026 12:36:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=cTMlDKEI; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=nZQgO0Hr; dkim=pass (2048-bit key) header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=zaJ9T5TI DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=QUGEItSBguKQ7lu3wEOfliXO5fqLcCHaQW4TkGmciHI=; b=cTMlDKEIhBiSGc+uQ/bRVndNAY tDMu74b3xiUuImeWdiUTxcOLIx66XUxkbXArWhvjbgr5srGMBshikmPCX5AO8bHTClYlKvUJdiI8f d4WNeaNoclJtldpifGe2TR8Lgw8rClzHn+qcyCO0K/CcI3hoev6j45MHTc+nyRpzjuZAVhMRGhXYb wY+l8EXCbwlpBD8cRbCX2FyP+CgNh3qKeGUH3PtVAZ9G9tbsfLlJ1fUBadr0igjkGwfM8om7QKSLw GilOysXcKQeBNcpplXoib8CaFKByADroZs7en17qjA9+pcI20iVTGeicLRqsBWGdYrHOA70EQG6F4 0ahvjahQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZSWd-00000000IOi-1CFJ; Fri, 04 Dec 2026 12:36:31 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZSW4-00000000IHZ-3T3t; Fri, 04 Dec 2026 12:35:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=QUGEItSBguKQ7lu3wEOfliXO5fqLcCHaQW4TkGmciHI=; b=nZQgO0HraTSWZM/KQPfhy6HH4z Ot3GcDQnE5mNMUE2rCVZtBQTM0gZTz73UVUCrMIIFEUd019WseSkqt9gl+LLGGLvuV5SBQ7jdKcCD hyg7rcTTwjCYQTcjgm2xyhYBVTR4WHNX1EWVG33oK/7iR2z8YDAfhShbYXG6zn1LWR1sD03MrdEDH WWs3eYwEVzFhuHKGB1+EbscSGtoCvEZEinxEb5tIKhKTs+vjp+OfJSOkvwtwsbmH/st7eNVz6TOI9 +uoRydGtT7O/wB8SUWGPa+k5ljy2Yws7PsUVEjS8rnvSWx2q1b3fWPyiPXFZLiXK1prOVo9IJB2zN S0B+bJ/Q==; Received: from mail.simonwunderlich.de ([23.88.38.48]) by desiato.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZSW1-0000000EOFM-2RAO; Fri, 04 Dec 2026 12:35:55 +0000 Received: by mail.simonwunderlich.de (Postfix) id 1DA55FA004; Fri, 04 Dec 2026 13:35:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=simonwunderlich.de; s=09092022; t=1796387749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QUGEItSBguKQ7lu3wEOfliXO5fqLcCHaQW4TkGmciHI=; b=zaJ9T5TIVe1J+mrobzfOjb8wUvPaKMbihjQOZhZzI2vNb5omvtaGs5sf4iUEgZ7yBZ3JDB m0Z5AuL26A+9ZP+o3AtdzrMk2Vl0c91fMJFowFhHR8XfpOOZ/OJ3uSfgKqgMDGtoBQ+7Vn 4+hKmcn/vUhfxkVnUsNjluVwhhoR29X8ntKERa+qBmDbAZ22MkMAf00xNS1EVUHz5MPrPS JWo1SDyZlUBT1FaDF2Qc4rIKIpdtYfXXB0SW4PA24+0FwhC6he0+RPVDurspgM/IlIoqWQ sH8OMmO7b1my7SaGksRauiYEZcOpVtIW/nYQr32lhYXjMyjWoZ5IwUZjuz8LmA== From: Sven Eckelmann To: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Benjamin Koerner Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, sw@simonwunderlich.de, Harshal Gohel , Benjamin Koerner Subject: Re: [PATCH RFC mt76-next] wifi: mt76: mt7996: support spectrum scan / IQ capture Date: Fri, 04 Dec 2026 13:35:43 +0100 Message-ID: <7816043.MhkbZ0Pkbq@ripper> In-Reply-To: <20261204-spectrum-scan-v1-1-db13123ecce5@simonwunderlich.de> References: <20261204-spectrum-scan-v1-1-db13123ecce5@simonwunderlich.de> X-Archived-By: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3473357.VLH7GnMWUR"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_123553_559592_EBFD2E8F X-CRM114-Status: GOOD ( 15.42 ) X-Spam-Score: -0.2 (/) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" X-Spam-Status: No, score=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 --nextPart3473357.VLH7GnMWUR Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Sven Eckelmann Date: Fri, 04 Dec 2026 13:35:43 +0100 Message-ID: <7816043.MhkbZ0Pkbq@ripper> MIME-Version: 1.0 On Friday, 4 December 2026 11:55:27 CET Benjamin Koerner wrote: > +static u16 mt7996_spectrum_gain_db(u8 gain) > +{ > + const u16 gain_db[] = { 1, 55, 47, 39 }; > + > + if (gain < ARRAY_SIZE(gain_db)) > + return gain_db[gain]; > + > + return 1; > +} This hardware supports more gains. We already discussed that we might to add them too. But here a specific idea from Simon: The gains are most likely hardware specific. And it is a little bit awkward to remember which name belongs to which gain. It might therefore be a good idea to have a read-only file "gains_available" (like the scaling governor) which shows which gains can be selected. And then the user can then write these values to gain file. Either the actual dB value from this list or the alias. But the aliases high/medium/low can of course also be dropped when this would not be appropriate. If it is not one from the list then the write will be rejected with an -EINVAL. And maybe we disallow "auto" because then the samples are returned with a random gain (which we don't know and don't get reported). The list could then for example look like this: 55 (high) 47 (medium) 39 (low) 31 23 15 5 Regards, Sven --nextPart3473357.VLH7GnMWUR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQS81G/PswftH/OW8cVND3cr0xT1ywUCaxKznwAKCRBND3cr0xT1 y/jyAQDHl8+0wjlK039LFu5b+uaNYSg5ODGtGFDssxmTlMAjSwEAi9S51Qj4gmi7 IUlOY6TCeNuNy9hu5lVxIMKD7U5+/QM= =XuTX -----END PGP SIGNATURE----- --nextPart3473357.VLH7GnMWUR--