]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mt76: add phy_idx in mt76_rx_status
authorLorenzo Bianconi <lorenzo@kernel.org>
Mon, 4 Jul 2022 07:02:19 +0000 (09:02 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 11 Jul 2022 11:40:03 +0000 (13:40 +0200)
Introduce phy_idx mt76_rx_status instead of ext_idx. This is a
preliminary patch to add newer chipset support

Co-developed-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mac80211.c
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/mt7615/mac.c
drivers/net/wireless/mediatek/mt76/mt7915/mac.c

index cb41f54bdd1c8f98c4f8e6bb8df4dc194480d9e2..331e92e72672d8021a06662fb234da686d6541eb 100644 (file)
@@ -739,7 +739,7 @@ static void mt76_rx_release_burst(struct mt76_phy *phy, enum mt76_rxq_id q,
 void mt76_rx(struct mt76_dev *dev, enum mt76_rxq_id q, struct sk_buff *skb)
 {
        struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb;
-       struct mt76_phy *phy = mt76_dev_phy(dev, status->ext_phy);
+       struct mt76_phy *phy = mt76_dev_phy(dev, status->phy_idx);
 
        if (!test_bit(MT76_STATE_RUNNING, &phy->state)) {
                dev_kfree_skb(skb);
@@ -1015,7 +1015,7 @@ mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb,
               sizeof(mstat.chain_signal));
 
        *sta = wcid_to_sta(mstat.wcid);
-       *hw = mt76_phy_hw(dev, mstat.ext_phy);
+       *hw = mt76_phy_hw(dev, mstat.phy_idx);
 }
 
 static void
@@ -1178,7 +1178,7 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb)
        u8 tidno = status->qos_ctl & IEEE80211_QOS_CTL_TID_MASK;
        bool ps;
 
-       hw = mt76_phy_hw(dev, status->ext_phy);
+       hw = mt76_phy_hw(dev, status->phy_idx);
        if (ieee80211_is_pspoll(hdr->frame_control) && !wcid &&
            !(status->flag & RX_FLAG_8023)) {
                sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr2, NULL);
index 5fd9e5d29463a3caad59b4f23c8256236698acde..72390707ee7314a46315c662fcad6351a923cf57 100644 (file)
@@ -574,7 +574,7 @@ struct mt76_rx_status {
 
        u8 iv[6];
 
-       u8 ext_phy:1;
+       u8 phy_idx:2;
        u8 aggr:1;
        u8 qos_ctl;
        u16 seqno;
@@ -998,17 +998,18 @@ static inline int mt76_init_mcu_queue(struct mt76_dev *dev, int qid, int idx,
 }
 
 static inline struct mt76_phy *
-mt76_dev_phy(struct mt76_dev *dev, bool phy_ext)
+mt76_dev_phy(struct mt76_dev *dev, u8 phy_idx)
 {
-       if (phy_ext && dev->phy2)
+       if (phy_idx && dev->phy2)
                return dev->phy2;
+
        return &dev->phy;
 }
 
 static inline struct ieee80211_hw *
-mt76_phy_hw(struct mt76_dev *dev, bool phy_ext)
+mt76_phy_hw(struct mt76_dev *dev, u8 phy_idx)
 {
-       return mt76_dev_phy(dev, phy_ext)->hw;
+       return mt76_dev_phy(dev, phy_idx)->hw;
 }
 
 static inline u8 *
index 372862768bb4c023a2edcb89a4022582967af213..1eb9d286091d719cdb07812839b14224d72afd83 100644 (file)
@@ -500,7 +500,7 @@ static int mt7615_mac_fill_rx(struct mt7615_dev *dev, struct sk_buff *skb)
        if (phy_idx == 1 && phy2) {
                mphy = dev->mt76.phy2;
                phy = phy2;
-               status->ext_phy = true;
+               status->phy_idx = phy_idx;
        }
 
        if (!mt7615_firmware_offload(dev) && chfreq != phy->chfreq)
index 757b4e1c3164d4d4000d8987171c302beed12044..718025518bab87b7fff8fdc61a86d7c6d5e5551c 100644 (file)
@@ -247,7 +247,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb)
                        return -EINVAL;
 
                phy = mphy->priv;
-               status->ext_phy = true;
+               status->phy_idx = 1;
        }
 
        if (!test_bit(MT76_STATE_RUNNING, &mphy->state))