Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4331861img; Tue, 26 Mar 2019 07:29:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQ0uSvf5mMMDdcsPOn9bitxbEhVXmTQ4pB22AQleT5d9R5I9Alk+SDA2wcFt5U5AuD3fX8 X-Received: by 2002:a65:5a81:: with SMTP id c1mr27731586pgt.391.1553610558599; Tue, 26 Mar 2019 07:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553610558; cv=none; d=google.com; s=arc-20160816; b=itnR0ofv9rZsA3+81npacq3wn3BZZ2Dx013GMRcDn/qnOpKKZ8354K1e/b+hn1KP4G QSVIVJFK6HLpvbDR646Xkmo2cdqLGUPHOhROA2WKuBPalEAahtHVCZTi0iitRTfJhYJv h6uZHF+pskFV1jWgRjZ/0bDPyyxNsq/94loNVA9k5YaLoyL1N2FMq6zuTK36zvZdPNqX 5wimbtoKwP8KijsNAtgelBa8VZvTgwBRgG1TjsIzrU0RNkpGg5QJDC9WP3DD0lNN0N59 ID8b0VGxJn65pQiSv6rUPms9vlRQTgqP6xJStOkWkUmbFX6HcvWk5JZzrptLFCLW6NT/ eaZw== 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=Dt1YsfEMuJa4HvA5OfD5ry+Iaqa50uBRxM8CvshMmMRVcjExHX2YrXtDLhvDE54ZST 8Iw3wN4dHcXBSmi93AYOuG46mIUoQiBqZH852ZVi230RfIysP1V3LhGsM1S6cE6jNGre IUaSA2vt3b236SPFnVnAT5J4zBQpcPCqfwdSdd6ofDZi2hvkYhUJBKknIcMdy8l723Jc RiY40uf9Q2QKSxYBajj7GJhXC1W4Lgtmr36pAjvX8jt5hR00d0nuJGtwhPmMR626357c fcTA/6NsgKVlMRS+CLxzIkvixbnsmzgRzB6AHbi6jTiEGO3SOPk0cqylvWZjnPJrTclP dQhg== 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 f7si12234487pgg.234.2019.03.26.07.29.02; Tue, 26 Mar 2019 07:29:18 -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 S1731813AbfCZO2W (ORCPT + 99 others); Tue, 26 Mar 2019 10:28:22 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:32818 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731729AbfCZO2T (ORCPT ); Tue, 26 Mar 2019 10:28:19 -0400 X-UUID: 044b2ce15da344f993e381d3b1099a43-20190326 X-UUID: 044b2ce15da344f993e381d3b1099a43-20190326 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1732120422; Tue, 26 Mar 2019 22:28:15 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 26 Mar 2019 22:28:13 +0800 Received: from mtkslt306.mediatek.inc (10.21.14.136) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 26 Mar 2019 22:28:13 +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 , , , , Ryder Lee Subject: [PATCH 3/4] mt76: use macro for sn and seq_ctrl conversion Date: Tue, 26 Mar 2019 22:28:09 +0800 Message-ID: <7b4aa870b4f1da720ce8b93ee1d9e4a6e254737d.1553607739.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-TM-SNTS-SMTP: 6D0FD367ACF931BF4BDA1C549375BFE175648A3CB72CC84A68981683718296D82000:8 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