Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp369782ybe; Fri, 6 Sep 2019 00:21:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIEQd4VKCmZjj4krb2xe8xZwnnQDLMHF7X3hs9vxqfgMKdrHNMNpgTkrZPjOxMeEAuxlhb X-Received: by 2002:a63:20a:: with SMTP id 10mr6681465pgc.226.1567754499183; Fri, 06 Sep 2019 00:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567754499; cv=none; d=google.com; s=arc-20160816; b=rbfiII8qpb7zLCt9StUE6lpRFDnRFQ4m6HAOH5hlUOvIbwe6OLwoun3xVwQrqwqwdZ 4KQBNAi3LTSkFR229t9sUn4983NqIUKppR6syHbHaYC1/8nYSCPBpFF8bBpY0EhabTiR Jd65R38XOJt3NOGPqEeSPfjWt+t3PMyjByfgXfoueTZHFLnFNQQEBjzhncDQapCOWyRY 2tSaPFYi4cmEFM5Xx1FYG/6Dh5Kf5njOXVD2GnXaaEoZKDiY06IuRaFbTDmXf9OrAj8n Jelqnsl5xQd/8Fd/d/3OqBxeiPdwp+DfJdmVlyYns+fPbaEz2+jsolxlujkA6lZwsOfI Pixg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=4f8xuzBViYyzXVvpkbJ2yRQwekUMCinLt23M3E6S99s=; b=tWvNDB5iNt0+NUzfP63TFS40pd90UQuSRY8nH35RseN+2muTVc1FGAXUAbEyqhUtNd 73zH4Lu7ncBwTHiTz+y3KiospC/iztCiPb5dJLWwJOJOSnEg/s1dQNGjQ4OgK7FbMsE+ gKbgmtg7Cxg0f7tBHgm6TluD8mN+Wqppq/YSU4OA/yg2o9meFttvyMRO+9Uyn7lrNgRq xgg0OXO98rwelFAV390gcCAHj6s97Vec6qtiIC5DVPCs21INuEeMNXdSWjQ/UIld4I5b WswGWBNb+N9j+ttMOFCW+R73eaYVGL1pNDY7HeJKv+EiGd1NZQjKhEaOAwcKOTN9DgCZ s23A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=EnM2xtjk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 85si3824364pgb.583.2019.09.06.00.20.56; Fri, 06 Sep 2019 00:21:39 -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; dkim=pass header.i=@candelatech.com header.s=default header.b=EnM2xtjk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390401AbfIEV2K (ORCPT + 99 others); Thu, 5 Sep 2019 17:28:10 -0400 Received: from mail2.candelatech.com ([208.74.158.173]:46472 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731418AbfIEV2K (ORCPT ); Thu, 5 Sep 2019 17:28:10 -0400 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 2E06F104B; Thu, 5 Sep 2019 14:28:09 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 2E06F104B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1567718889; bh=EcktJhL6buZelYaXXG9yD0fyM04AbSJ3PJjtfjzlFN8=; h=From:To:Cc:Subject:Date:From; b=EnM2xtjkC1Kx/geG72jOe1WCItxxmt7HqfKVjPALHkzvnpINw2Qo0iV62NITbahJr 68nhFhoQGpIa2JoeNhNhX/BgGTV2woYIK0YNMfFCICOeepNjgDU8Hfm8RxLurwCLTR WE/PNceykxdCprO+JMcDj1WkRlfdnniVy2MdkPg0= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: Ben Greear Subject: [PATCH] iwl-mvm: Report tx/rx antennas. Date: Thu, 5 Sep 2019 14:28:01 -0700 Message-Id: <20190905212801.13404-1-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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; + 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, -- 2.20.1