Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp10086yba; Mon, 1 Apr 2019 00:18:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdLEZhWlvgWyL5gV5x665LenWPfM8xGnePfh4/Bzkvsvg9/KfniV6/l9JEYHSWSxIX0kdS X-Received: by 2002:a17:902:2e03:: with SMTP id q3mr61717626plb.166.1554103083641; Mon, 01 Apr 2019 00:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554103083; cv=none; d=google.com; s=arc-20160816; b=aE8QXmABN/+LcorKva6YZQubL18pCll5J2NvjAjUx9RA9PRNGbWJ/RAjaXruwBHI1L tzsjUt2E383THN7jQJxh1n2zMyB/brvfXeliB3j5S+fDdx3be6MDyWkZfvFP7M2OzRIw Zl9X9qHQlO95jvEn+LvV59Br5faNQL57iKxe+VuO3EqHuQyzpxw6u7ad8Gwz+qYesaeC LxYtpNglrt3SRs4I8TPGr7jJEP7f2325H9diwwgzLXw78e2MVUIJ7ycw7eVgFPFtxB7g xdpagRndjMSS1Tc3l04sZrkoOqVPnOZadWUuAGjOvrw4jiTgmZj7Icv9/RZJcZ1BmEzG IATg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=KNgAmqkmfsalYT/5KbGa1riULm/Njm4hl9v1bCFAnpA=; b=Pg2ysMgV0kxVJVQX/ymamTgaSZ9lo4AhUt3BYq04uezB2oF83m1WfA/puZhll4uUhj nxnx7LoqNsCsmC8PCJ0EzhXJM00aBV9UhTk0wLcsyrmZjU2xjIjDAev694VILzs11EvV XaSo4QePeuXa4f9jayIdp826O2oFxoVvv0S0VA6RpCLyxteqIz/qoeDNaJRYfkV6D9bW 8grKKVd5QzK6/tnOTOT0r79KYQ8DufsILc9JiEmc1ObnsSjUeFvS4AF1YcfxvhSPdbe3 HY9DwIVr+4yHP29n1uLpqDWJJ1Yv47gU+9n1MrE1F4W5yt6ykHWs/AWVgFkJwwvXMBsn 3vJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 r39si8591156pld.10.2019.04.01.00.17.47; Mon, 01 Apr 2019 00:18:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731919AbfDAHQz (ORCPT + 99 others); Mon, 1 Apr 2019 03:16:55 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:44976 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731888AbfDAHQx (ORCPT ); Mon, 1 Apr 2019 03:16:53 -0400 X-UUID: ba8bde23ba0d4f7a8d4286da09e07c73-20190401 X-UUID: ba8bde23ba0d4f7a8d4286da09e07c73-20190401 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1916109555; Mon, 01 Apr 2019 15:16:48 +0800 Received: from MTKMBS01DR.mediatek.inc (172.21.101.111) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 1 Apr 2019 15:16:47 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01dr.mediatek.inc (172.21.101.111) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 1 Apr 2019 15:16:46 +0800 Received: from mtkslt306.mediatek.inc (10.21.14.136) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 1 Apr 2019 15:16:46 +0800 From: Ryder Lee To: Lorenzo Bianconi , Felix Fietkau CC: Roy Luo , Sean Wang , "Nelson Chang" , YF Luo , Kai Lin , Rorscha Yang , Kyle Lee , Miller Shen , Haipin Liang , KL Huang , YH chen , , , , "Ryder Lee" Subject: [PATCH v3 3/4] mt76: use macro for sn and seq_ctrl conversion Date: Mon, 1 Apr 2019 15:16:43 +0800 Message-ID: <64e6331f3ddbd0a1f254fb3dfc3bed732ba64bf2.1554102584.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use macro to convert sn and seq_ctrl for better readability. Signed-off-by: Roy Luo Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/agg-rx.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7603/main.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/agg-rx.c b/drivers/net/wireless/mediatek/mt76/agg-rx.c index 73c8b28..27e3ff0 100644 --- a/drivers/net/wireless/mediatek/mt76/agg-rx.c +++ b/drivers/net/wireless/mediatek/mt76/agg-rx.c @@ -135,7 +135,7 @@ return; status->tid = le16_to_cpu(bar->control) >> 12; - seqno = le16_to_cpu(bar->start_seq_num) >> 4; + seqno = IEEE80211_SEQ_TO_SN(le16_to_cpu(bar->start_seq_num)); tid = rcu_dereference(wcid->aggr[status->tid]); if (!tid) return; diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c index e498169..2f2961e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c @@ -627,7 +627,7 @@ void mt7603_mac_tx_ba_reset(struct mt7603_dev *dev, int wcid, int tid, int ssn, status->aggr = unicast && !ieee80211_is_qos_nullfunc(hdr->frame_control); status->tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; - status->seqno = hdr->seq_ctrl >> 4; + status->seqno = IEEE80211_SEQ_TO_SN(hdr->seq_ctrl); return 0; } diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c index 5d38392..0c78044 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c @@ -594,7 +594,7 @@ mt7603_mac_tx_ba_reset(dev, msta->wcid.idx, tid, *ssn, -1); break; case IEEE80211_AMPDU_TX_START: - mtxq->agg_ssn = *ssn << 4; + mtxq->agg_ssn = IEEE80211_SN_TO_SEQ(*ssn); ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid); break; case IEEE80211_AMPDU_TX_STOP_CONT: diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c index b137ce8..f0e1e12 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c @@ -378,7 +378,7 @@ int mt76x02_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ieee80211_send_bar(vif, sta->addr, tid, mtxq->agg_ssn); break; case IEEE80211_AMPDU_TX_START: - mtxq->agg_ssn = *ssn << 4; + mtxq->agg_ssn = IEEE80211_SN_TO_SEQ(*ssn); ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid); break; case IEEE80211_AMPDU_TX_STOP_CONT: -- 1.9.1