mediatek: mt76-6e-usb Fix to build error 65/289965/4
authorHoegeun Kwon <hoegeun.kwon@samsung.com>
Thu, 16 Mar 2023 08:45:03 +0000 (17:45 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Thu, 23 Mar 2023 06:46:04 +0000 (15:46 +0900)
Copied entire code from v5.18.y, fix build error that occurred.

Signed-off-by: astsam <info@no-problem.cc>
Change-Id: Icb2c24cc3d81cb14a2dc8db6e1208d2ba42cec17
[Patch url: https://github.com/astsam/mt7921/commit/98007d648b31581e2fa99069c4319f820cbbc30a\]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
drivers/net/wireless/mediatek/mt76-6e-usb/mt76.h
drivers/net/wireless/mediatek/mt76-6e-usb/mt76_connac_mcu.c
drivers/net/wireless/mediatek/mt76-6e-usb/mt7915/init.c
drivers/net/wireless/mediatek/mt76-6e-usb/mt7915/main.c
drivers/net/wireless/mediatek/mt76-6e-usb/mt7915/mcu.c

index 522c523..c617bd0 100644 (file)
 #include "util.h"
 #include "testmode.h"
 
+#ifdef IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_0US                  0x0
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_8US                  0x1
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US                 0x2
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_RESERVED             0x3
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK                 0xc0
+#endif
+
 #define MT_MCU_RING_SIZE       32
 #define MT_RX_BUF_SIZE         2048
 #define MT_SKB_HEAD_LEN                256
index 7cb17bf..2dcf1fd 100644 (file)
@@ -2685,10 +2685,6 @@ int mt76_connac_mcu_bss_basic_tlv(struct sk_buff *skb,
        case NL80211_IFTYPE_AP:
                if (ieee80211_hw_check(phy->hw, SUPPORTS_MULTI_BSSID)) {
                        u8 bssid_id = vif->bss_conf.bssid_indicator;
-                       struct wiphy *wiphy = phy->hw->wiphy;
-
-                       if (bssid_id > ilog2(wiphy->mbssid_max_interfaces))
-                               return -EINVAL;
 
                        bss->non_tx_bssid = vif->bss_conf.bssid_index;
                        bss->max_bssid = bssid_id;
index 6d29366..b73786e 100644 (file)
@@ -343,7 +343,6 @@ mt7915_init_wiphy(struct ieee80211_hw *hw)
        wiphy->n_iface_combinations = ARRAY_SIZE(if_comb);
        wiphy->reg_notifier = mt7915_regd_notifier;
        wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
-       wiphy->mbssid_max_interfaces = 16;
 
        wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BSS_COLOR);
        wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_VHT_IBSS);
@@ -352,12 +351,6 @@ mt7915_init_wiphy(struct ieee80211_hw *hw)
        wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BEACON_RATE_VHT);
        wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BEACON_RATE_HE);
 
-       if (!mdev->dev->of_node ||
-           !of_property_read_bool(mdev->dev->of_node,
-                                  "mediatek,disable-radar-background"))
-               wiphy_ext_feature_set(wiphy,
-                                     NL80211_EXT_FEATURE_RADAR_BACKGROUND);
-
        ieee80211_hw_set(hw, HAS_RATE_CONTROL);
        ieee80211_hw_set(hw, SUPPORTS_TX_ENCAP_OFFLOAD);
        ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);
index 187cf4c..b6176ea 100644 (file)
@@ -1427,5 +1427,4 @@ const struct ieee80211_ops mt7915_ops = {
 #ifdef CONFIG_MAC80211_DEBUGFS
        .sta_add_debugfs = mt7915_sta_add_debugfs,
 #endif
-       .set_radar_background = mt7915_set_radar_background,
 };
index 736c9c3..ae8094d 100644 (file)
@@ -371,12 +371,7 @@ mt7915_mcu_rx_radar_detected(struct mt7915_dev *dev, struct sk_buff *skb)
        if ((r->band_idx && !dev->phy.band_idx) && dev->mt76.phy2)
                mphy = dev->mt76.phy2;
 
-       if (r->band_idx == MT_RX_SEL2)
-               cfg80211_background_radar_event(mphy->hw->wiphy,
-                                               &dev->rdd2_chandef,
-                                               GFP_ATOMIC);
-       else
-               ieee80211_radar_detected(mphy->hw);
+       ieee80211_radar_detected(mphy->hw);
        dev->hw_pattern++;
 }
 
@@ -1826,61 +1821,6 @@ mt7915_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb,
 }
 
 static void
-mt7915_mcu_beacon_mbss(struct sk_buff *rskb, struct sk_buff *skb,
-                      struct ieee80211_vif *vif, struct bss_info_bcn *bcn,
-                      struct ieee80211_mutable_offsets *offs)
-{
-       struct bss_info_bcn_mbss *mbss;
-       const struct element *elem;
-       struct tlv *tlv;
-
-       if (!vif->bss_conf.bssid_indicator)
-               return;
-
-       tlv = mt7915_mcu_add_nested_subtlv(rskb, BSS_INFO_BCN_MBSSID,
-                                          sizeof(*mbss), &bcn->sub_ntlv,
-                                          &bcn->len);
-
-       mbss = (struct bss_info_bcn_mbss *)tlv;
-       mbss->offset[0] = cpu_to_le16(offs->tim_offset);
-       mbss->bitmap = cpu_to_le32(1);
-
-       for_each_element_id(elem, WLAN_EID_MULTIPLE_BSSID,
-                           &skb->data[offs->mbssid_off],
-                           skb->len - offs->mbssid_off) {
-               const struct element *sub_elem;
-
-               if (elem->datalen < 2)
-                       continue;
-
-               for_each_element(sub_elem, elem->data + 1, elem->datalen - 1) {
-                       const struct ieee80211_bssid_index *idx;
-                       const u8 *idx_ie;
-
-                       if (sub_elem->id || sub_elem->datalen < 4)
-                               continue; /* not a valid BSS profile */
-
-                       /* Find WLAN_EID_MULTI_BSSID_IDX
-                        * in the merged nontransmitted profile
-                        */
-                       idx_ie = cfg80211_find_ie(WLAN_EID_MULTI_BSSID_IDX,
-                                                 sub_elem->data,
-                                                 sub_elem->datalen);
-                       if (!idx_ie || idx_ie[1] < sizeof(*idx))
-                               continue;
-
-                       idx = (void *)(idx_ie + 2);
-                       if (!idx->bssid_index || idx->bssid_index > 31)
-                               continue;
-
-                       mbss->offset[idx->bssid_index] =
-                               cpu_to_le16(idx_ie - skb->data);
-                       mbss->bitmap |= cpu_to_le32(BIT(idx->bssid_index));
-               }
-       }
-}
-
-static void
 mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct ieee80211_vif *vif,
                       struct sk_buff *rskb, struct sk_buff *skb,
                       struct bss_info_bcn *bcn,
@@ -2040,7 +1980,6 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw,
        mt7915_mcu_beacon_check_caps(phy, vif, skb);
 
        mt7915_mcu_beacon_cntdwn(vif, rskb, skb, bcn, &offs);
-       mt7915_mcu_beacon_mbss(rskb, skb, vif, bcn, &offs);
        mt7915_mcu_beacon_cont(dev, vif, rskb, skb, bcn, &offs);
        dev_kfree_skb(skb);