Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1299912rdh; Mon, 25 Sep 2023 08:38:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgLdrxfDcUJ1/4vhTrnDA0ajxyd1UJ5A3at+ui21IAJpBZNRJLGYOc0qyKZ419rq2nuz/P X-Received: by 2002:a05:6a00:1990:b0:68f:bbc3:df44 with SMTP id d16-20020a056a00199000b0068fbbc3df44mr9467512pfl.0.1695656319449; Mon, 25 Sep 2023 08:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695656319; cv=none; d=google.com; s=arc-20160816; b=0ES3M93PYV3OOBUYgUas6s+qoQfc2kU5wpprEeIHrxgM5zdFper/pkFEFIZVv/ivzK YesxJmOglwQUyz97if8FebLZTO1sc0Fjwq+2MXyeqiG11yqRVAVBQVx6bk+EJsASoBRC dMAILOjTBLaLnP2VbRxYeSFsQbslcIu7jnFtQ4WqRAIHg2de6K87RcFyt4tnDKWnfrsh GSchylpvjxeZ+Z6b5b4n0L+2HM2H+ydGfoWKI9VoxXXZlx1lSATcG+TI8V3NNhIB3A45 ngrhhtQC1kdEgd4p+3u86fG6BgGKJ4I9S1kKa1cH57BuAVP6K45xfKn1iHNE7ewFr3WT ZJng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=M1hPzSJuLBW1+FWm/Ve3X8Sn0QK2spKaLZ5yy/mAmEE=; fh=/O+9XbaB7fQ/ZEofnBo04cLsZ/azg1kcaH+9Vs+pyTo=; b=lLjqnqmO8tsME5qXuPffyKnyX/L0LiLkq4V8++X2lELMbADFeziOBuKvNLiUDK34hi 9VwLh5FoJiwCV5iqy7HFkOyf/WHlAycUuTiuG5nBIT6pR22LNpVgLUrbBLXIv5lDix6c xGAn5+stnD6rN7YMkf2wxAu/losMbfQsQVfjNLcACZgq/JQLfQ5shjcPG+4jl29g3hGs 8vmHbVBwNA45vyLO+9j13OX2DQ3V6D8j4/Tz7H5SykUH04QqrEeSvwvp1wKLeavw1rkO xlVn5XAee4PQrXdbhK+DT12daVSnn/1bXajLpCNug0ocHAXakoTn0oocN+mPGbwUw3rK 5Lyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=GpGNYEhL; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id cl3-20020a056a0032c300b00690c0055246si10383314pfb.294.2023.09.25.08.38.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 08:38:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=GpGNYEhL; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B09DE8132A7D; Sun, 24 Sep 2023 23:38:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232120AbjIYGic (ORCPT + 56 others); Mon, 25 Sep 2023 02:38:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232080AbjIYGia (ORCPT ); Mon, 25 Sep 2023 02:38:30 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D023A9 for ; Sun, 24 Sep 2023 23:38:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=M1hPzSJuLBW1+FWm/Ve3X8Sn0QK2spKaLZ5yy/mAmEE=; t=1695623903; x=1696833503; b=GpGNYEhLnlAUDd8bNTDj72YiquVGAUAmTAoYw/zBdfeeEZ2 +iFV+bnSb6p7m2hBf3M4zJIt0c/k0izJdFpbfqVsUfTyzB+hKXcPdnwPmLzInHZW8N5CIBVPo7Tq2 C/+R5YE8C/jhLVSmhd6ojUW5kWltfJni1TPOnYkJFfMhIgQ1mhsa1qVm+PtcrLOYYo4eMdjjp8HhR wh69rD/JJ79F0XyHEw8t35WsbkkUp7etrj196P+cophBRWU/9vtfbDQirkK7X+o/JPX1cRnNnkp8T fBZSvtYr++L8Yrc2n0EcZk0qqc/6fwConnzVbRACvBcuOM6H0hpCjr9psRmrvVdQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1qkfEW-003DrB-1E; Mon, 25 Sep 2023 08:38:16 +0200 Message-ID: <35c14b437f8c4b61e2fc14c6b156bf5de330a493.camel@sipsolutions.net> Subject: Re: [PATCH v3] wifi: mac80211: add exported tpt_led_trig function for softmac driver From: Johannes Berg To: Yi-Chia Hsieh , Felix Fietkau Cc: Lorenzo Bianconi , Ryder Lee , Shayne Chen , Evelyn Tsai , Money Wang , Peter Chiu , Benjamin Lin , linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Date: Mon, 25 Sep 2023 08:38:14 +0200 In-Reply-To: <038706d9bbf434642013e880300d4f597f13b514.1695329290.git.yi-chia.hsieh@mediatek.com> References: <038706d9bbf434642013e880300d4f597f13b514.1695329290.git.yi-chia.hsieh@mediatek.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sun, 24 Sep 2023 23:38:28 -0700 (PDT) > +++ b/include/net/mac80211.h > @@ -4733,6 +4733,8 @@ __ieee80211_create_tpt_led_trigger(struct ieee80211= _hw *hw, > unsigned int flags, > const struct ieee80211_tpt_blink *blink_table, > unsigned int blink_table_len); > +void __ieee80211_tpt_led_trig_trx(struct ieee80211_hw *hw, > + int tx_bytes, int rx_bytes); Hm, I think you misunderstood what I said. I still think you need to have a well-documented function or two here, but now you can make the exported versions of this be inlines calling this new function. But also this now fails the build if !CONFIG_MAC80211_LEDS, you need to have an ifdef somewhere. > +void __ieee80211_tpt_led_trig_trx(struct ieee80211_hw *hw, > + int tx_bytes, int rx_bytes) > +{ > + struct ieee80211_local *local =3D hw_to_local(hw); > + > + if (atomic_read(&local->tpt_led_active)) { > + local->tpt_led_trigger->tx_bytes +=3D tx_bytes; > + local->tpt_led_trigger->rx_bytes +=3D rx_bytes; > + } > +} > +EXPORT_SYMBOL(__ieee80211_tpt_led_trig_trx); Even that won't build. > --- a/net/mac80211/led.h > +++ b/net/mac80211/led.h > @@ -71,8 +71,7 @@ static inline void > ieee80211_tpt_led_trig_tx(struct ieee80211_local *local, int bytes) > { > #ifdef CONFIG_MAC80211_LEDS > - if (atomic_read(&local->tpt_led_active)) > - local->tpt_led_trigger->tx_bytes +=3D bytes; > + __ieee80211_tpt_led_trig_trx(&local->hw, bytes, 0); > #endif Ah. Actually what I was thinking is that __ieee80211_tpt_led_trig_trx is still an inline, and then the ieee80211_tpt_led_trig_trx() exported to drivers can call this alongside these inlines - that way mac80211 still gets the (trivial) code inlined. johannes