From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=23.88.38.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387752; b=qTMQfBk1xqEHfIqWfKUNOIR6YACAcz9ramF5IH8erUrGc+NYSF6KG6QlHXenJMD63vjV oePbkjiieafyK4yWHWz370nCZ4qw0PmL2uKIiHefbI+iLi3JqjDE0swnR8W8mxzADFXBR jX6cOGtTRc9gH3tNu6Wqcdvo99J24vje7Ixmsbgmf/rLojLS+ViF10OQnPYaSBnRfdpfk gBzGxEMj3JrGWwl3WXP9xAPoULHw44Gj/Gf+fBIfMWIyx5FKjRJGyLr5MN2roR0JF+bF/ hKIlB8okcZ8Q8tBWKx3HzBBOhV10pUAcDt0MpgU0WkASbXNHRdRTLk1AU/hYIr6vTSQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387752; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version:Content-Type; bh=QUGEItSBguKQ7lu3wEOfliXO5fqLcCHaQW4TkGmciHI=; b=CN7cooRjyJ005uf2J0moLgsopMp6sLS+BjafxqGZKU3tn+1yaWRspQSBUmWJ06Hui354 RkhhRRfxc0CWPGQRSnqKZaCBMV8xd40H2egBwVUbCec3oDBhRa/Xrxho7UhjDbL9h0qww fD20mzv/JrcComAz7epwKcHdVndrZ7p2LEeaCBPFSwn4K6f8LB/lfBncNYZRx42FPqlqV pNvXh23Dv77ah70X8U6IPp87RhFEGxt3h1HWDmsxAUOnB7Vu5r4XkLOE21FyV6LtzgcW/ iVXjG0PgZ/F65moWUm26iHl90oa/yXre0YOkpnDhwpjpmOb8iYA7+kQNmjW3R7MCW2Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=simonwunderlich.de; spf=pass smtp.mailfrom=simonwunderlich.de; dkim=pass header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=zaJ9T5TI; arc=none smtp.remote-ip=23.88.38.48 Received: from mail.simonwunderlich.de (mail.simonwunderlich.de [23.88.38.48]) (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 E3605606A32F; Fri, 4 Dec 2026 12:35:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E3605606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=simonwunderlich.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=simonwunderlich.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=zaJ9T5TI 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-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3473357.VLH7GnMWUR"; micalg="pgp-sha512"; protocol="application/pgp-signature" --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--