Lines Matching +full:c +full:- +full:phy
1 // SPDX-License-Identifier: ISC
2 /* Copyright (C) 2020 MediaTek Inc. */
6 #include <linux/hwmon-sysfs.h>
50 struct mt7915_phy *phy = dev_get_drvdata(dev); in mt7915_thermal_temp_show() local
51 int i = to_sensor_dev_attr(attr)->index; in mt7915_thermal_temp_show()
56 mutex_lock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_show()
57 temperature = mt7915_mcu_get_temperature(phy); in mt7915_thermal_temp_show()
58 mutex_unlock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_show()
66 phy->throttle_temp[i - 1] * 1000); in mt7915_thermal_temp_show()
68 return sprintf(buf, "%hhu\n", phy->throttle_state); in mt7915_thermal_temp_show()
70 return -EINVAL; in mt7915_thermal_temp_show()
78 struct mt7915_phy *phy = dev_get_drvdata(dev); in mt7915_thermal_temp_store() local
79 int ret, i = to_sensor_dev_attr(attr)->index; in mt7915_thermal_temp_store()
86 mutex_lock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_store()
89 if ((i - 1 == MT7915_CRIT_TEMP_IDX && in mt7915_thermal_temp_store()
90 val > phy->throttle_temp[MT7915_MAX_TEMP_IDX]) || in mt7915_thermal_temp_store()
91 (i - 1 == MT7915_MAX_TEMP_IDX && in mt7915_thermal_temp_store()
92 val < phy->throttle_temp[MT7915_CRIT_TEMP_IDX])) { in mt7915_thermal_temp_store()
93 dev_err(phy->dev->mt76.dev, in mt7915_thermal_temp_store()
95 mutex_unlock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_store()
96 return -EINVAL; in mt7915_thermal_temp_store()
99 phy->throttle_temp[i - 1] = val; in mt7915_thermal_temp_store()
100 ret = mt7915_mcu_set_thermal_protect(phy); in mt7915_thermal_temp_store()
101 mutex_unlock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_store()
135 struct mt7915_phy *phy = cdev->devdata; in mt7915_thermal_get_cur_throttle_state() local
137 *state = phy->cdev_state; in mt7915_thermal_get_cur_throttle_state()
146 struct mt7915_phy *phy = cdev->devdata; in mt7915_thermal_set_cur_throttle_state() local
147 u8 throttling = MT7915_THERMAL_THROTTLE_MAX - state; in mt7915_thermal_set_cur_throttle_state()
151 dev_err(phy->dev->mt76.dev, in mt7915_thermal_set_cur_throttle_state()
153 return -EINVAL; in mt7915_thermal_set_cur_throttle_state()
156 if (state == phy->cdev_state) in mt7915_thermal_set_cur_throttle_state()
163 mutex_lock(&phy->dev->mt76.mutex); in mt7915_thermal_set_cur_throttle_state()
164 ret = mt7915_mcu_set_thermal_throttling(phy, throttling); in mt7915_thermal_set_cur_throttle_state()
165 mutex_unlock(&phy->dev->mt76.mutex); in mt7915_thermal_set_cur_throttle_state()
169 phy->cdev_state = state; in mt7915_thermal_set_cur_throttle_state()
180 static void mt7915_unregister_thermal(struct mt7915_phy *phy) in mt7915_unregister_thermal() argument
182 struct wiphy *wiphy = phy->mt76->hw->wiphy; in mt7915_unregister_thermal()
184 if (!phy->cdev) in mt7915_unregister_thermal()
187 sysfs_remove_link(&wiphy->dev.kobj, "cooling_device"); in mt7915_unregister_thermal()
188 thermal_cooling_device_unregister(phy->cdev); in mt7915_unregister_thermal()
191 static int mt7915_thermal_init(struct mt7915_phy *phy) in mt7915_thermal_init() argument
193 struct wiphy *wiphy = phy->mt76->hw->wiphy; in mt7915_thermal_init()
198 name = devm_kasprintf(&wiphy->dev, GFP_KERNEL, "mt7915_%s", in mt7915_thermal_init()
201 return -ENOMEM; in mt7915_thermal_init()
203 cdev = thermal_cooling_device_register(name, phy, &mt7915_thermal_ops); in mt7915_thermal_init()
205 if (sysfs_create_link(&wiphy->dev.kobj, &cdev->device.kobj, in mt7915_thermal_init()
209 phy->cdev = cdev; in mt7915_thermal_init()
213 phy->throttle_temp[MT7915_CRIT_TEMP_IDX] = MT7915_CRIT_TEMP; in mt7915_thermal_init()
214 phy->throttle_temp[MT7915_MAX_TEMP_IDX] = MT7915_MAX_TEMP; in mt7915_thermal_init()
219 hwmon = devm_hwmon_device_register_with_groups(&wiphy->dev, name, phy, in mt7915_thermal_init()
232 dev = container_of(mphy->dev, struct mt7915_dev, mt76); in mt7915_led_set_config()
238 mt76_wr(dev, MT_LED_STATUS_0(mphy->band_idx), val); in mt7915_led_set_config()
239 mt76_wr(dev, MT_LED_STATUS_1(mphy->band_idx), val); in mt7915_led_set_config()
242 mt76_wr(dev, MT_LED_EN(mphy->band_idx), 1); in mt7915_led_set_config()
246 if (dev->mphy.leds.al) in mt7915_led_set_config()
248 if (mphy->band_idx) in mt7915_led_set_config()
251 mt76_wr(dev, MT_LED_CTRL(mphy->band_idx), val); in mt7915_led_set_config()
252 mt76_clear(dev, MT_LED_CTRL(mphy->band_idx), MT_LED_CTRL_KICK); in mt7915_led_set_config()
283 static void __mt7915_init_txpower(struct mt7915_phy *phy, in __mt7915_init_txpower() argument
286 struct mt7915_dev *dev = phy->dev; in __mt7915_init_txpower()
287 int i, n_chains = hweight16(phy->mt76->chainmask); in __mt7915_init_txpower()
289 int pwr_delta = mt7915_eeprom_get_power_delta(dev, sband->band); in __mt7915_init_txpower()
292 for (i = 0; i < sband->n_channels; i++) { in __mt7915_init_txpower()
293 struct ieee80211_channel *chan = &sband->channels[i]; in __mt7915_init_txpower()
305 target_power = mt76_get_rate_power_limits(phy->mt76, chan, in __mt7915_init_txpower()
310 chan->max_power = min_t(int, chan->max_reg_power, in __mt7915_init_txpower()
312 chan->orig_mpwr = target_power; in __mt7915_init_txpower()
316 void mt7915_init_txpower(struct mt7915_phy *phy) in mt7915_init_txpower() argument
318 if (!phy) in mt7915_init_txpower()
321 if (phy->mt76->cap.has_2ghz) in mt7915_init_txpower()
322 __mt7915_init_txpower(phy, &phy->mt76->sband_2g.sband); in mt7915_init_txpower()
323 if (phy->mt76->cap.has_5ghz) in mt7915_init_txpower()
324 __mt7915_init_txpower(phy, &phy->mt76->sband_5g.sband); in mt7915_init_txpower()
325 if (phy->mt76->cap.has_6ghz) in mt7915_init_txpower()
326 __mt7915_init_txpower(phy, &phy->mt76->sband_6g.sband); in mt7915_init_txpower()
335 struct mt76_phy *mphy = hw->priv; in mt7915_regd_notifier()
336 struct mt7915_phy *phy = mphy->priv; in mt7915_regd_notifier() local
338 memcpy(dev->mt76.alpha2, request->alpha2, sizeof(dev->mt76.alpha2)); in mt7915_regd_notifier()
339 dev->mt76.region = request->dfs_region; in mt7915_regd_notifier()
341 if (dev->mt76.region == NL80211_DFS_UNSET) in mt7915_regd_notifier()
342 mt7915_mcu_rdd_background_enable(phy, NULL); in mt7915_regd_notifier()
344 mt7915_init_txpower(phy); in mt7915_regd_notifier()
346 mphy->dfs_state = MT_DFS_STATE_UNKNOWN; in mt7915_regd_notifier()
347 mt7915_dfs_init_radar_detector(phy); in mt7915_regd_notifier()
351 mt7915_init_wiphy(struct mt7915_phy *phy) in mt7915_init_wiphy() argument
353 struct mt76_phy *mphy = phy->mt76; in mt7915_init_wiphy()
354 struct ieee80211_hw *hw = mphy->hw; in mt7915_init_wiphy()
355 struct mt76_dev *mdev = &phy->dev->mt76; in mt7915_init_wiphy()
356 struct wiphy *wiphy = hw->wiphy; in mt7915_init_wiphy()
357 struct mt7915_dev *dev = phy->dev; in mt7915_init_wiphy()
359 hw->queues = 4; in mt7915_init_wiphy()
360 hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE; in mt7915_init_wiphy()
361 hw->max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE; in mt7915_init_wiphy()
362 hw->netdev_features = NETIF_F_RXCSUM; in mt7915_init_wiphy()
364 if (mtk_wed_device_active(&mdev->mmio.wed)) in mt7915_init_wiphy()
365 hw->netdev_features |= NETIF_F_HW_TC; in mt7915_init_wiphy()
367 hw->radiotap_timestamp.units_pos = in mt7915_init_wiphy()
370 phy->slottime = 9; in mt7915_init_wiphy()
372 hw->sta_data_size = sizeof(struct mt7915_sta); in mt7915_init_wiphy()
373 hw->vif_data_size = sizeof(struct mt7915_vif); in mt7915_init_wiphy()
375 wiphy->iface_combinations = if_comb; in mt7915_init_wiphy()
376 wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); in mt7915_init_wiphy()
377 wiphy->reg_notifier = mt7915_regd_notifier; in mt7915_init_wiphy()
378 wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; in mt7915_init_wiphy()
379 wiphy->mbssid_max_interfaces = 16; in mt7915_init_wiphy()
392 if (!is_mt7915(&dev->mt76)) in mt7915_init_wiphy()
395 if (!mdev->dev->of_node || in mt7915_init_wiphy()
396 !of_property_read_bool(mdev->dev->of_node, in mt7915_init_wiphy()
397 "mediatek,disable-radar-background")) in mt7915_init_wiphy()
408 hw->max_tx_fragments = 4; in mt7915_init_wiphy()
410 if (phy->mt76->cap.has_2ghz) { in mt7915_init_wiphy()
411 phy->mt76->sband_2g.sband.ht_cap.cap |= in mt7915_init_wiphy()
414 if (is_mt7915(&dev->mt76)) in mt7915_init_wiphy()
415 phy->mt76->sband_2g.sband.ht_cap.ampdu_density = in mt7915_init_wiphy()
418 phy->mt76->sband_2g.sband.ht_cap.ampdu_density = in mt7915_init_wiphy()
422 if (phy->mt76->cap.has_5ghz) { in mt7915_init_wiphy()
425 vht_cap = &phy->mt76->sband_5g.sband.vht_cap; in mt7915_init_wiphy()
426 phy->mt76->sband_5g.sband.ht_cap.cap |= in mt7915_init_wiphy()
430 if (is_mt7915(&dev->mt76)) { in mt7915_init_wiphy()
431 phy->mt76->sband_5g.sband.ht_cap.ampdu_density = in mt7915_init_wiphy()
434 vht_cap->cap |= in mt7915_init_wiphy()
438 if (!dev->dbdc_support) in mt7915_init_wiphy()
439 vht_cap->cap |= in mt7915_init_wiphy()
443 phy->mt76->sband_5g.sband.ht_cap.ampdu_density = in mt7915_init_wiphy()
446 vht_cap->cap |= in mt7915_init_wiphy()
451 vht_cap->cap |= in mt7915_init_wiphy()
456 if (!is_mt7915(&dev->mt76) || !dev->dbdc_support) in mt7915_init_wiphy()
460 mt76_set_stream_caps(phy->mt76, true); in mt7915_init_wiphy()
461 mt7915_set_stream_vht_txbf_caps(phy); in mt7915_init_wiphy()
462 mt7915_set_stream_he_caps(phy); in mt7915_init_wiphy()
463 mt7915_init_txpower(phy); in mt7915_init_wiphy()
465 wiphy->available_antennas_rx = phy->mt76->antenna_mask; in mt7915_init_wiphy()
466 wiphy->available_antennas_tx = phy->mt76->antenna_mask; in mt7915_init_wiphy()
470 mphy->leds.cdev.brightness_set = mt7915_led_set_brightness; in mt7915_init_wiphy()
471 mphy->leds.cdev.blink_set = mt7915_led_set_blink; in mt7915_init_wiphy()
523 if (is_mt7915(&dev->mt76)) in mt7915_mac_init_band()
533 /* filter out non-resp frames and get instanstaeous signal reporting */ in mt7915_mac_init_band()
542 if (mtk_wed_device_active(&dev->mt76.mmio.wed)) in mt7915_mac_init_band()
552 if (dev->dbdc_support) { in mt7915_init_led_mux()
553 switch (mt76_chip(&dev->mt76)) { in mt7915_init_led_mux()
575 } else if (dev->mphy.leds.pin) { in mt7915_init_led_mux()
576 switch (mt76_chip(&dev->mt76)) { in mt7915_init_led_mux()
593 switch (mt76_chip(&dev->mt76)) { in mt7915_init_led_mux()
615 u32 rx_len = is_mt7915(&dev->mt76) ? 0x400 : 0x680; in mt7915_mac_init()
618 if (!is_mt7915(&dev->mt76) && dev->hif2) in mt7915_mac_init()
624 if (!is_mt7915(&dev->mt76)) in mt7915_mac_init()
629 /* enable hardware de-agg */ in mt7915_mac_init()
645 if (dev->dbdc_support) { in mt7915_txbf_init()
663 struct mt7915_phy *phy; in mt7915_alloc_ext_phy() local
666 if (!dev->dbdc_support) in mt7915_alloc_ext_phy()
669 mphy = mt76_alloc_phy(&dev->mt76, sizeof(*phy), &mt7915_ops, MT_BAND1); in mt7915_alloc_ext_phy()
671 return ERR_PTR(-ENOMEM); in mt7915_alloc_ext_phy()
673 phy = mphy->priv; in mt7915_alloc_ext_phy()
674 phy->dev = dev; in mt7915_alloc_ext_phy()
675 phy->mt76 = mphy; in mt7915_alloc_ext_phy()
677 /* Bind main phy to band0 and ext_phy to band1 for dbdc case */ in mt7915_alloc_ext_phy()
678 phy->mt76->band_idx = 1; in mt7915_alloc_ext_phy()
680 return phy; in mt7915_alloc_ext_phy()
684 mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy) in mt7915_register_ext_phy() argument
686 struct mt76_phy *mphy = phy->mt76; in mt7915_register_ext_phy()
689 INIT_DELAYED_WORK(&mphy->mac_work, mt7915_mac_work); in mt7915_register_ext_phy()
691 mt7915_eeprom_parse_hw_cap(dev, phy); in mt7915_register_ext_phy()
693 memcpy(mphy->macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR2, in mt7915_register_ext_phy()
695 /* Make the secondary PHY MAC address local without overlapping with in mt7915_register_ext_phy()
698 if (!is_valid_ether_addr(mphy->macaddr)) { in mt7915_register_ext_phy()
699 memcpy(mphy->macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR, in mt7915_register_ext_phy()
701 mphy->macaddr[0] |= 2; in mt7915_register_ext_phy()
702 mphy->macaddr[0] ^= BIT(7); in mt7915_register_ext_phy()
706 /* init wiphy according to mphy and phy */ in mt7915_register_ext_phy()
707 mt7915_init_wiphy(phy); in mt7915_register_ext_phy()
714 ret = mt7915_thermal_init(phy); in mt7915_register_ext_phy()
718 mt7915_init_debugfs(phy); in mt7915_register_ext_phy()
742 if (is_mt7915(&dev->mt76)) { in mt7915_wfsys_reset()
755 /* release wfsys then mcu re-executes romcode */ in mt7915_wfsys_reset()
768 dev_err(dev->mt76.dev, "wifi subsystem reset failure\n"); in mt7915_wfsys_reset()
776 } else if (is_mt798x(&dev->mt76)) { in mt7915_wfsys_reset()
795 dev->phy.mt76->band_idx = 0; in mt7915_band_config()
797 if (is_mt798x(&dev->mt76)) { in mt7915_band_config()
802 * of adie chips and the main phy is bound to band1 when in mt7915_band_config()
806 dev->phy.mt76->band_idx = 1; in mt7915_band_config()
810 ret = is_mt7915(&dev->mt76) ? in mt7915_band_config()
825 INIT_WORK(&dev->init_work, mt7915_init_work); in mt7915_init_hardware()
831 set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state); in mt7915_init_hardware()
841 if (dev->cal) { in mt7915_init_hardware()
848 idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA); in mt7915_init_hardware()
850 return -ENOSPC; in mt7915_init_hardware()
852 dev->mt76.global_wcid.idx = idx; in mt7915_init_hardware()
853 dev->mt76.global_wcid.hw_key_idx = -1; in mt7915_init_hardware()
854 dev->mt76.global_wcid.tx_info |= MT_WCID_TX_INFO_SET; in mt7915_init_hardware()
855 rcu_assign_pointer(dev->mt76.wcid[idx], &dev->mt76.global_wcid); in mt7915_init_hardware()
860 void mt7915_set_stream_vht_txbf_caps(struct mt7915_phy *phy) in mt7915_set_stream_vht_txbf_caps() argument
865 if (!phy->mt76->cap.has_5ghz) in mt7915_set_stream_vht_txbf_caps()
868 sts = hweight8(phy->mt76->chainmask); in mt7915_set_stream_vht_txbf_caps()
869 cap = &phy->mt76->sband_5g.sband.vht_cap.cap; in mt7915_set_stream_vht_txbf_caps()
874 sts - 1); in mt7915_set_stream_vht_txbf_caps()
886 sts - 1); in mt7915_set_stream_vht_txbf_caps()
890 mt7915_set_stream_he_txbf_caps(struct mt7915_phy *phy, in mt7915_set_stream_he_txbf_caps() argument
893 struct mt7915_dev *dev = phy->dev; in mt7915_set_stream_he_txbf_caps()
894 struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem; in mt7915_set_stream_he_txbf_caps()
895 int sts = hweight8(phy->mt76->chainmask); in mt7915_set_stream_he_txbf_caps()
896 u8 c, sts_160 = sts; in mt7915_set_stream_he_txbf_caps() local
899 if (is_mt7915(&dev->mt76)) { in mt7915_set_stream_he_txbf_caps()
900 if (!dev->dbdc_support) in mt7915_set_stream_he_txbf_caps()
911 elem->phy_cap_info[3] &= ~IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
912 elem->phy_cap_info[4] &= ~IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
914 c = IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK; in mt7915_set_stream_he_txbf_caps()
916 c |= IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK; in mt7915_set_stream_he_txbf_caps()
917 elem->phy_cap_info[5] &= ~c; in mt7915_set_stream_he_txbf_caps()
919 c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB | in mt7915_set_stream_he_txbf_caps()
921 elem->phy_cap_info[6] &= ~c; in mt7915_set_stream_he_txbf_caps()
923 elem->phy_cap_info[7] &= ~IEEE80211_HE_PHY_CAP7_MAX_NC_MASK; in mt7915_set_stream_he_txbf_caps()
925 c = IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US; in mt7915_set_stream_he_txbf_caps()
926 if (!is_mt7915(&dev->mt76)) in mt7915_set_stream_he_txbf_caps()
927 c |= IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO | in mt7915_set_stream_he_txbf_caps()
929 elem->phy_cap_info[2] |= c; in mt7915_set_stream_he_txbf_caps()
931 c = IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE | in mt7915_set_stream_he_txbf_caps()
934 c |= IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4; in mt7915_set_stream_he_txbf_caps()
935 elem->phy_cap_info[4] |= c; in mt7915_set_stream_he_txbf_caps()
938 c = IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU | in mt7915_set_stream_he_txbf_caps()
942 c |= IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO; in mt7915_set_stream_he_txbf_caps()
944 elem->phy_cap_info[6] |= c; in mt7915_set_stream_he_txbf_caps()
950 elem->phy_cap_info[7] |= min_t(int, sts - 1, 2) << 3; in mt7915_set_stream_he_txbf_caps()
955 elem->phy_cap_info[3] |= IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
957 c = FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK, in mt7915_set_stream_he_txbf_caps()
958 sts - 1); in mt7915_set_stream_he_txbf_caps()
960 c |= FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK, in mt7915_set_stream_he_txbf_caps()
961 sts_160 - 1); in mt7915_set_stream_he_txbf_caps()
962 elem->phy_cap_info[5] |= c; in mt7915_set_stream_he_txbf_caps()
967 elem->phy_cap_info[4] |= IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
969 c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB | in mt7915_set_stream_he_txbf_caps()
971 elem->phy_cap_info[6] |= c; in mt7915_set_stream_he_txbf_caps()
973 if (!is_mt7915(&dev->mt76)) { in mt7915_set_stream_he_txbf_caps()
974 c = IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ | in mt7915_set_stream_he_txbf_caps()
976 elem->phy_cap_info[7] |= c; in mt7915_set_stream_he_txbf_caps()
981 mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band, in mt7915_init_he_caps() argument
984 struct mt7915_dev *dev = phy->dev; in mt7915_init_he_caps()
985 int i, idx = 0, nss = hweight8(phy->mt76->antenna_mask); in mt7915_init_he_caps()
990 if (!is_mt7915(&dev->mt76)) in mt7915_init_he_caps()
992 else if (!dev->dbdc_support) in mt7915_init_he_caps()
1014 &he_cap->he_cap_elem; in mt7915_init_he_caps()
1016 &he_cap->he_mcs_nss_supp; in mt7915_init_he_caps()
1030 he_cap->has_he = true; in mt7915_init_he_caps()
1032 he_cap_elem->mac_cap_info[0] = in mt7915_init_he_caps()
1034 he_cap_elem->mac_cap_info[3] = in mt7915_init_he_caps()
1037 he_cap_elem->mac_cap_info[4] = in mt7915_init_he_caps()
1041 he_cap_elem->phy_cap_info[0] = in mt7915_init_he_caps()
1044 he_cap_elem->phy_cap_info[0] = in mt7915_init_he_caps()
1048 he_cap_elem->phy_cap_info[0] = in mt7915_init_he_caps()
1051 he_cap_elem->phy_cap_info[1] = in mt7915_init_he_caps()
1053 he_cap_elem->phy_cap_info[2] = in mt7915_init_he_caps()
1059 he_cap_elem->mac_cap_info[0] |= in mt7915_init_he_caps()
1061 he_cap_elem->mac_cap_info[2] |= in mt7915_init_he_caps()
1063 he_cap_elem->mac_cap_info[4] |= in mt7915_init_he_caps()
1065 he_cap_elem->mac_cap_info[5] |= in mt7915_init_he_caps()
1067 he_cap_elem->phy_cap_info[3] |= in mt7915_init_he_caps()
1070 he_cap_elem->phy_cap_info[6] |= in mt7915_init_he_caps()
1073 he_cap_elem->phy_cap_info[9] |= in mt7915_init_he_caps()
1078 he_cap_elem->mac_cap_info[1] |= in mt7915_init_he_caps()
1082 he_cap_elem->phy_cap_info[0] |= in mt7915_init_he_caps()
1085 he_cap_elem->phy_cap_info[0] |= in mt7915_init_he_caps()
1088 he_cap_elem->phy_cap_info[1] |= in mt7915_init_he_caps()
1091 he_cap_elem->phy_cap_info[3] |= in mt7915_init_he_caps()
1094 he_cap_elem->phy_cap_info[6] |= in mt7915_init_he_caps()
1098 he_cap_elem->phy_cap_info[7] |= in mt7915_init_he_caps()
1101 he_cap_elem->phy_cap_info[8] |= in mt7915_init_he_caps()
1105 he_cap_elem->phy_cap_info[8] |= in mt7915_init_he_caps()
1108 he_cap_elem->phy_cap_info[9] |= in mt7915_init_he_caps()
1119 he_mcs->rx_mcs_80 = cpu_to_le16(mcs_map); in mt7915_init_he_caps()
1120 he_mcs->tx_mcs_80 = cpu_to_le16(mcs_map); in mt7915_init_he_caps()
1121 he_mcs->rx_mcs_160 = cpu_to_le16(mcs_map_160); in mt7915_init_he_caps()
1122 he_mcs->tx_mcs_160 = cpu_to_le16(mcs_map_160); in mt7915_init_he_caps()
1124 mt7915_set_stream_he_txbf_caps(phy, he_cap, i); in mt7915_init_he_caps()
1126 memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres)); in mt7915_init_he_caps()
1127 if (he_cap_elem->phy_cap_info[6] & in mt7915_init_he_caps()
1129 mt76_connac_gen_ppe_thresh(he_cap->ppe_thres, nss, band); in mt7915_init_he_caps()
1131 he_cap_elem->phy_cap_info[9] |= in mt7915_init_he_caps()
1156 void mt7915_set_stream_he_caps(struct mt7915_phy *phy) in mt7915_set_stream_he_caps() argument
1162 if (phy->mt76->cap.has_2ghz) { in mt7915_set_stream_he_caps()
1163 data = phy->iftype[NL80211_BAND_2GHZ]; in mt7915_set_stream_he_caps()
1164 n = mt7915_init_he_caps(phy, NL80211_BAND_2GHZ, data); in mt7915_set_stream_he_caps()
1166 band = &phy->mt76->sband_2g.sband; in mt7915_set_stream_he_caps()
1170 if (phy->mt76->cap.has_5ghz) { in mt7915_set_stream_he_caps()
1171 data = phy->iftype[NL80211_BAND_5GHZ]; in mt7915_set_stream_he_caps()
1172 n = mt7915_init_he_caps(phy, NL80211_BAND_5GHZ, data); in mt7915_set_stream_he_caps()
1174 band = &phy->mt76->sband_5g.sband; in mt7915_set_stream_he_caps()
1178 if (phy->mt76->cap.has_6ghz) { in mt7915_set_stream_he_caps()
1179 data = phy->iftype[NL80211_BAND_6GHZ]; in mt7915_set_stream_he_caps()
1180 n = mt7915_init_he_caps(phy, NL80211_BAND_6GHZ, data); in mt7915_set_stream_he_caps()
1182 band = &phy->mt76->sband_6g.sband; in mt7915_set_stream_he_caps()
1189 struct mt7915_phy *phy = mt7915_ext_phy(dev); in mt7915_unregister_ext_phy() local
1190 struct mt76_phy *mphy = dev->mt76.phys[MT_BAND1]; in mt7915_unregister_ext_phy()
1192 if (!phy) in mt7915_unregister_ext_phy()
1195 mt7915_unregister_thermal(phy); in mt7915_unregister_ext_phy()
1197 ieee80211_free_hw(mphy->hw); in mt7915_unregister_ext_phy()
1203 mt76_connac2_tx_token_put(&dev->mt76); in mt7915_stop_hardware()
1205 tasklet_disable(&dev->mt76.irq_tasklet); in mt7915_stop_hardware()
1207 if (is_mt798x(&dev->mt76)) in mt7915_stop_hardware()
1216 dev->phy.dev = dev; in mt7915_register_device()
1217 dev->phy.mt76 = &dev->mt76.phy; in mt7915_register_device()
1218 dev->mt76.phy.priv = &dev->phy; in mt7915_register_device()
1219 INIT_WORK(&dev->rc_work, mt7915_mac_sta_rc_work); in mt7915_register_device()
1220 INIT_DELAYED_WORK(&dev->mphy.mac_work, mt7915_mac_work); in mt7915_register_device()
1221 INIT_LIST_HEAD(&dev->sta_rc_list); in mt7915_register_device()
1222 INIT_LIST_HEAD(&dev->twt_list); in mt7915_register_device()
1224 init_waitqueue_head(&dev->reset_wait); in mt7915_register_device()
1225 INIT_WORK(&dev->reset_work, mt7915_mac_reset_work); in mt7915_register_device()
1226 INIT_WORK(&dev->dump_work, mt7915_mac_dump_work); in mt7915_register_device()
1227 mutex_init(&dev->dump_mutex); in mt7915_register_device()
1229 dev->dbdc_support = mt7915_band_config(dev); in mt7915_register_device()
1239 mt7915_init_wiphy(&dev->phy); in mt7915_register_device()
1242 dev->mt76.test_ops = &mt7915_testmode_ops; in mt7915_register_device()
1245 ret = mt76_register_device(&dev->mt76, true, mt76_rates, in mt7915_register_device()
1250 ret = mt7915_thermal_init(&dev->phy); in mt7915_register_device()
1260 ieee80211_queue_work(mt76_hw(dev), &dev->init_work); in mt7915_register_device()
1262 dev->recovery.hw_init_done = true; in mt7915_register_device()
1264 ret = mt7915_init_debugfs(&dev->phy); in mt7915_register_device()
1275 mt7915_unregister_thermal(&dev->phy); in mt7915_register_device()
1277 mt76_unregister_device(&dev->mt76); in mt7915_register_device()
1282 ieee80211_free_hw(phy2->mt76->hw); in mt7915_register_device()
1290 mt7915_unregister_thermal(&dev->phy); in mt7915_unregister_device()
1291 mt76_unregister_device(&dev->mt76); in mt7915_unregister_device()
1294 mt76_free_device(&dev->mt76); in mt7915_unregister_device()