Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1789669pxb; Fri, 26 Feb 2021 23:42:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtAvfqWhAOmAsrvcTRQyHpQx/1w+oERvl5MZLmmJkAZdiiXPh0goiYyo/XnAtYREKyCtGT X-Received: by 2002:a17:907:3e14:: with SMTP id hp20mr7208332ejc.106.1614411770768; Fri, 26 Feb 2021 23:42:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614411770; cv=none; d=google.com; s=arc-20160816; b=pBEj6AvxJPWt/UPwuQPBjdfep9VnaY4lH98RfNvQ03LRfWoFcaHqRKFoB2XrLohq6R 2ULm5ttQ198SLEtUfXA4NGdhjGali0Jmk8XpGx7J3Y/TWpgQF4XIvgYrLBWjto0p8lNK Zs6Hj0UK9+k+mKgaIuCCk/SC1/nsUwOKmOhcUqz3tDIRypYxMTXi4BrfU/lcow6hkjZS ZeVA1DbSD9qJqJOGD/dOu4PGCgiVB5IkBhfeGZ6t7zJ8OsY9wgFXTWUrUvtxEa4HbkiC F+EwyCQ46zdy/8M6pYWZLpwdUOXJ1nyCy9X4bczgdBkiUbUIkUxYKh4l9ntL0H+NaHsf LlEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=tNmh1ae/waBzTtZr9SpdwgFnLwud4Nof2Eko6Rfv7vw=; b=W8Ej4rwcw+TPgvDHIFIeYv7a29f5trh9QK+CbBammdZA94mv6HgsNnMtF2oYO9ajg1 vajgLLwtGil6p/vhvQPtKkcpnzJxvDAtrfhb4ie9/J5HGIbAoAIFy3RqFxVlN4P0rX8F ZEba6KAQazfARu/L0P3uovLCenv4we3NNnTKO0LRJyp+sZfDz+QahVH8aCjuQvWsaq95 mqqE6ZWD5/xQRSsQUXsyJyez+foEHaq0ekPlV0iGz/EMh3CjAXlnZcLUEKkECj+wFk4w CS6pJ5V7QTeF+/Yo7oGJbu9jhR0sMs3AXBTfahSpEYMCaoCd4UYiquLUur8fqhFM68nA lbbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si7717162edd.595.2021.02.26.23.42.13; Fri, 26 Feb 2021 23:42:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229863AbhB0HlM (ORCPT + 99 others); Sat, 27 Feb 2021 02:41:12 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:58050 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229751AbhB0HlL (ORCPT ); Sat, 27 Feb 2021 02:41:11 -0500 X-UUID: 665ba4bed37d44daa98358a3a77d9a30-20210227 X-UUID: 665ba4bed37d44daa98358a3a77d9a30-20210227 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 834555198; Sat, 27 Feb 2021 15:40:25 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 27 Feb 2021 15:40:23 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 27 Feb 2021 15:40:23 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Shayne Chen , , , Ryder Lee Subject: [PATCH 1/5] mt76: mt7615: fix CSA notification for DBDC Date: Sat, 27 Feb 2021 15:39:42 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: EA1C5E3E32218177D76903F4A34CD4015FFB7D72857672C39A62C94C6E93C04B2000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add CSA notification for second phy. Signed-off-by: Ryder Lee --- .../net/wireless/mediatek/mt76/mt7615/mcu.c | 24 +++++++++++++++---- .../net/wireless/mediatek/mt76/mt7615/mcu.h | 11 ++++++++- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 65c6ab14fe6f..44daee41aa6c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -372,6 +372,22 @@ mt7615_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) ieee80211_csa_finish(vif); } +static void +mt7615_mcu_rx_csa_notify(struct mt7615_dev *dev, struct sk_buff *skb) +{ + struct mt76_phy *mphy = &dev->mt76.phy; + struct mt7615_mcu_csa_notify *c; + + c = (struct mt7615_mcu_csa_notify *)skb->data; + + if (c->band_idx && dev->mt76.phy2) + mphy = dev->mt76.phy2; + + ieee80211_iterate_active_interfaces_atomic(mphy->hw, + IEEE80211_IFACE_ITER_RESUME_ALL, + mt7615_mcu_csa_finish, mphy->hw); +} + static void mt7615_mcu_rx_radar_detected(struct mt7615_dev *dev, struct sk_buff *skb) { @@ -380,7 +396,7 @@ mt7615_mcu_rx_radar_detected(struct mt7615_dev *dev, struct sk_buff *skb) r = (struct mt7615_mcu_rdd_report *)skb->data; - if (r->idx && dev->mt76.phy2) + if (r->band_idx && dev->mt76.phy2) mphy = dev->mt76.phy2; ieee80211_radar_detected(mphy->hw); @@ -419,9 +435,7 @@ mt7615_mcu_rx_ext_event(struct mt7615_dev *dev, struct sk_buff *skb) mt7615_mcu_rx_radar_detected(dev, skb); break; case MCU_EXT_EVENT_CSA_NOTIFY: - ieee80211_iterate_active_interfaces_atomic(dev->mt76.hw, - IEEE80211_IFACE_ITER_RESUME_ALL, - mt7615_mcu_csa_finish, dev); + mt7615_mcu_rx_csa_notify(dev, skb); break; case MCU_EXT_EVENT_FW_LOG_2_HOST: mt7615_mcu_rx_log_message(dev, skb); @@ -2176,7 +2190,7 @@ int mt7615_mcu_set_chan_info(struct mt7615_phy *phy, int cmd) .center_chan2 = ieee80211_frequency_to_channel(freq2), }; - if (dev->mt76.hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) + if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD; else if ((chandef->chan->flags & IEEE80211_CHAN_RADAR) && chandef->chan->dfs_state != NL80211_DFS_AVAILABLE) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.h index 411ebb56baef..dbf72b1396c7 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.h @@ -176,10 +176,19 @@ struct mt7615_mcu_rxd { u8 s2d_index; }; +struct mt7615_mcu_csa_notify { + struct mt7615_mcu_rxd rxd; + + u8 omac_idx; + u8 csa_count; + u8 band_idx; + u8 rsv; +} __packed; + struct mt7615_mcu_rdd_report { struct mt7615_mcu_rxd rxd; - u8 idx; + u8 band_idx; u8 long_detected; u8 constant_prf_detected; u8 staggered_prf_detected; -- 2.18.0