mt76: use macro for sn and seq_ctrl conversion
authorRyder Lee <ryder.lee@mediatek.com>
Mon, 1 Apr 2019 07:16:43 +0000 (15:16 +0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 1 May 2019 11:03:59 +0000 (13:03 +0200)
Use macro to convert sn and seq_ctrl for better readability.

Signed-off-by: Roy Luo <royluo@google.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/agg-rx.c
drivers/net/wireless/mediatek/mt76/mt7603/mac.c
drivers/net/wireless/mediatek/mt76/mt7603/main.c
drivers/net/wireless/mediatek/mt76/mt76x02_util.c

index 73c8b2805c978cb688e73bbd72156078eb98a492..27e3ff039c4813451fc7f0fb775da6a7dff734a2 100644 (file)
@@ -135,7 +135,7 @@ mt76_rx_aggr_check_ctl(struct sk_buff *skb, struct sk_buff_head *frames)
                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;
index c10adebde3832ff63b2edbb2873d81c147f37df2..2fd63597d305091809b36261b40e0db6619240d5 100644 (file)
@@ -590,7 +590,7 @@ mt7603_mac_fill_rx(struct mt7603_dev *dev, struct sk_buff *skb)
        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;
 }
index 18db78a9d63aa198531dae005e1c137c06bc5931..18a33d92160173aba93a3b85908db914669767ee 100644 (file)
@@ -593,7 +593,7 @@ mt7603_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                mt7603_mac_tx_ba_reset(dev, msta->wcid.idx, tid, -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:
index 37af727878132d5a6f5bbb395f2d5bb9c467c665..ad8a53def7f79ff15c14e43a05ad58a26d378d77 100644 (file)
@@ -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: