Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6569070ybn; Sun, 29 Sep 2019 23:33:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOmFBjIE2CWcYfN+tt+ZAOGXr3jZJXPaU3h/kPpr18dTFPBocHAxdijmik4GbtTc9WpkJk X-Received: by 2002:aa7:d750:: with SMTP id a16mr17943018eds.27.1569825185808; Sun, 29 Sep 2019 23:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569825185; cv=none; d=google.com; s=arc-20160816; b=MTILgSgXXlOdDqKq99yZaR2oXVTr1c8dUwWRicQwZNgXpIkUr78gujovhW1dfEtiot SGUYi3wWnQpoKXEfWfFnADfChqBaRxSGjUtv+syD0fA5TR2Uet9jcIE8i3dzTbBRqvOt l1hFWrnoeESzy51nqwB6Q845ySwGva94JSbKaw2dlrkwqjNW/rk5Nq7Eo0+wrnVoeKUn LVDh5qr8YispkFPAqRKtEvivYidgVn7eHLZeDvv4ZYiIO+bezkqi0fVXyyvmv8ewIZtb yhEaqkUqPT+4fjKQX49VkCrg0Hs+Yiidkg8AH0lbOsn21TlIWqVZgUrVM6zGfAAEP2ZY a5rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:date:to:from :message-id; bh=wf3FEOrwvlRhOoxl/7YrQJTA1apqUfybFA6sG8u4PgQ=; b=Hl3/XBuucyibRioLG0n9WpGs02h2RlHXE+V+8Zeie/dBRd4DlyPdwd82oSNuukihWj el+LM/ty7ssaMbUengsYc9N6pvlv7YHvZhKDylowciDPnqrvK2IMCSZFZyki9Y1nAlET RyLthSK571qRSPZ9glpdgV0lOLSiu21yU2Vu8PvJi0GcuoqS0N7us4xAWDg7mpYs6Qoy nXCCIGm7dcwwNpma0KdWBTxBGil1xQ2stP/T9nuB5FTSVl4emCuC1XcOxMoJB0zftHIk rzh/1gf3eZnX2OucfcB1lCL+RC1mkfh5wuuflVOOmwu8XZsXCg8YqbMuswOUqYJkdGFb BUzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10si5995677edh.358.2019.09.29.23.32.41; Sun, 29 Sep 2019 23:33:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729731AbfI3Gal (ORCPT + 99 others); Mon, 30 Sep 2019 02:30:41 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:45624 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729521AbfI3Gak (ORCPT ); Mon, 30 Sep 2019 02:30:40 -0400 Received: from [91.156.6.193] (helo=redipa) by farmhouse.coelho.fi with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.92) (envelope-from ) id 1iEpCY-0008Pa-LD; Mon, 30 Sep 2019 09:30:36 +0300 Message-ID: <8223ddc8f648f7ed2073ddcc5f7812df224f2068.camel@coelho.fi> From: Luca Coelho To: greearb@candelatech.com, linux-wireless@vger.kernel.org Date: Mon, 30 Sep 2019 09:30:29 +0300 In-Reply-To: <20190905212801.13404-1-greearb@candelatech.com> References: <20190905212801.13404-1-greearb@candelatech.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on farmhouse.coelho.fi X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH] iwl-mvm: Report tx/rx antennas. Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, 2019-09-05 at 14:28 -0700, greearb@candelatech.com wrote: > From: Ben Greear > > This makes it easier for user-space to know how many antennas the > radio has. Seems to work with the AX200 radio, at least. > > Signed-off-by: Ben Greear > --- > drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c > index 964c7baabede..f90b003f154a 100644 > --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c > +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c > @@ -440,10 +440,19 @@ const static struct wiphy_iftype_ext_capab he_iftypes_ext_capa[] = { > }, > }; > > +static int iwl_mvm_op_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant) > +{ > + struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); > + *tx_ant = iwl_mvm_get_valid_tx_ant(mvm); > + *rx_ant = iwl_mvm_get_valid_rx_ant(mvm); > + return 0; > +} > + > int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) > { > struct ieee80211_hw *hw = mvm->hw; > int num_mac, ret, i; > + u32 tx_ant, rx_ant; > static const u32 mvm_ciphers[] = { > WLAN_CIPHER_SUITE_WEP40, > WLAN_CIPHER_SUITE_WEP104, > @@ -813,6 +822,10 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) > wiphy_ext_feature_set(hw->wiphy, > NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER); > > + iwl_mvm_op_get_antenna(hw, &tx_ant, &rx_ant); > + hw->wiphy->available_antennas_tx = tx_ant; > + hw->wiphy->available_antennas_rx = rx_ant; > + I changed this slightly so we call iwl_mvm_get_valid_tx/rx_ant() here instead of calling the op function. Then we don't need the local variables and it's a bit clearer IMHO. > ret = ieee80211_register_hw(mvm->hw); > if (ret) { > iwl_mvm_leds_exit(mvm); > @@ -5167,6 +5180,7 @@ const struct ieee80211_ops iwl_mvm_hw_ops = { > .tx = iwl_mvm_mac_tx, > .wake_tx_queue = iwl_mvm_mac_wake_tx_queue, > .ampdu_action = iwl_mvm_mac_ampdu_action, > + .get_antenna = iwl_mvm_op_get_antenna, > .start = iwl_mvm_mac_start, > .reconfig_complete = iwl_mvm_mac_reconfig_complete, > .stop = iwl_mvm_mac_stop, I've applied this (with the above-mentioned change) to our internal tree and it should reach the mainline following our usual upstreaming process. Thanks! -- Cheers, Luca.