Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2962856ybl; Sun, 2 Feb 2020 10:52:46 -0800 (PST) X-Google-Smtp-Source: APXvYqyrQNrAPldvHQz/BPFgjJzFwVO77zZO6ltI4F/LpHpzeDrtgzAhReYv9DiHGoLp2rvf6W5i X-Received: by 2002:aca:4c9:: with SMTP id 192mr13003382oie.105.1580669566377; Sun, 02 Feb 2020 10:52:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580669566; cv=none; d=google.com; s=arc-20160816; b=qPICzM/OzM9AJaxt4HCf2LFSSq8Zsvw87ACa24Wwke5yehhxyUrMxkl6aaXVhFy8Xc b4MQqib2tM8NkOyOz94zcclvXCXI2f/Ug/g33qxOImkqo0qX/8NtY7Dca5u0o8Dk+eYT ZZbWjkPVFGckc6kr04bt1EXRytvftwApcCf6UjauOYUYJ19MXhMsxoxuNtfLqs+tpxwv KbAwIpKoBgrFZpbsj2BRSdT6qMQHI6Yn0zQD6ga3y+QO4G/ADHqXVWaNTNvnlZQkjoL+ 8hn5MGzfECXje1rwlDSWodYLqQ0q8EL1JXPusKjGh/YcY2ZWxX0rXHSA9V2XeKLjrdMy UIOA== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=CcngjrDQ9ytK0uU7zvhoLsLpGBN8JYCvqR5FHGlJYIQ=; b=u8lx/t9h2UCBM8+0ItVakzvrarsjyUthjjrdB9KEeiRYAfjzyIGiqBIYKuIjA+ehEP I7JS+MXymQWupXI9nQ69huNA4HYNRlCelB66UWwLTYbM2mowHYnddgax8jN83N++e4+e LazvZM8Lhf56MmKUSdrn7SyCu72qR7h58PvcRN+0YDYq1+aupJKYFI7nf1S+mOrxGePR O9F8LLeszVDV19edfKxpcXjSUJlYo9s32PxJqpiAJKdU+RF4NlypiTdxvKiW+YmNVEYn 8vnf/521+ITWWQ1m6MV2Lhz7RbRxb9mX6pnmR/YhdVLANU/2brrqdrtdJhWLtSuixyqi K5Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=s1DfTPGt; 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 30si7687140otr.75.2020.02.02.10.52.25; Sun, 02 Feb 2020 10:52:46 -0800 (PST) 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=fail header.i=@nbd.name header.s=20160729 header.b=s1DfTPGt; 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 S1726916AbgBBSwL (ORCPT + 99 others); Sun, 2 Feb 2020 13:52:11 -0500 Received: from nbd.name ([46.4.11.11]:35598 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726907AbgBBSwL (ORCPT ); Sun, 2 Feb 2020 13:52:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=CcngjrDQ9ytK0uU7zvhoLsLpGBN8JYCvqR5FHGlJYIQ=; b=s1DfTPGtCpLgWr4J3k3TbjERGU vTDkQgtt0sdQH6rurH5LF6OrDYCAHCLz/D1tbFdoKkYH1xWtJoM0gCWOprR9x/G/OpF+waPWpmKxI Zem8JOWHy/lL0P+2fC5T3+Gvr+XQ8aeHXVfy8xoj1w0i4/S5BPvLdB/0j7uz9g67p4do=; Received: from [81.95.5.35] (helo=maeck.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iyKLp-0003Ha-It for linux-wireless@vger.kernel.org; Sun, 02 Feb 2020 19:52:09 +0100 Received: by maeck.local (Postfix, from userid 501) id 1230B7B1886F; Sun, 2 Feb 2020 19:52:08 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 2/2] mt76: mt7615: fix monitor mode on second PHY Date: Sun, 2 Feb 2020 19:52:08 +0100 Message-Id: <20200202185208.28026-2-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200202185208.28026-1-nbd@nbd.name> References: <20200202185208.28026-1-nbd@nbd.name> 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 The second PHY receives no packets unless there is an active vif present. Set the WANT_MONITOR_VIF flag to deal with that Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7615/init.c | 3 +++ drivers/net/wireless/mediatek/mt76/mt7615/main.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/init.c b/drivers/net/wireless/mediatek/mt76/mt7615/init.c index e7f251957fca..4c9f52e04bb8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/init.c @@ -415,6 +415,9 @@ int mt7615_register_ext_phy(struct mt7615_dev *dev) mphy->sband_2g.sband.n_channels = 0; mphy->hw->wiphy->bands[NL80211_BAND_2GHZ] = NULL; + /* The second interface does not get any packets unless it has a vif */ + ieee80211_hw_set(mphy->hw, WANT_MONITOR_VIF); + ret = mt76_register_phy(mphy); if (ret) ieee80211_free_hw(mphy->hw); diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index 20184f6ffc62..7f9aa84388fd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -177,9 +177,11 @@ static int mt7615_add_interface(struct ieee80211_hw *hw, MT_WTBL_UPDATE_ADM_COUNT_CLEAR); rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid); - mtxq = (struct mt76_txq *)vif->txq->drv_priv; - mtxq->wcid = &mvif->sta.wcid; - mt76_txq_init(&dev->mt76, vif->txq); + if (vif->txq) { + mtxq = (struct mt76_txq *)vif->txq->drv_priv; + mtxq->wcid = &mvif->sta.wcid; + mt76_txq_init(&dev->mt76, vif->txq); + } out: mutex_unlock(&dev->mt76.mutex); @@ -201,7 +203,8 @@ static void mt7615_remove_interface(struct ieee80211_hw *hw, mt7615_mcu_set_dev_info(dev, vif, 0); rcu_assign_pointer(dev->mt76.wcid[idx], NULL); - mt76_txq_remove(&dev->mt76, vif->txq); + if (vif->txq) + mt76_txq_remove(&dev->mt76, vif->txq); mutex_lock(&dev->mt76.mutex); dev->vif_mask &= ~BIT(mvif->idx); -- 2.24.0