Lines Matching +full:c +full:- +full:phy
1 // SPDX-License-Identifier: ISC
2 /* Copyright (C) 2020 MediaTek Inc. */
6 #include <linux/hwmon-sysfs.h>
54 struct mt7915_phy *phy = dev_get_drvdata(dev); in mt7915_thermal_temp_show() local
55 int i = to_sensor_dev_attr(attr)->index; in mt7915_thermal_temp_show()
60 mutex_lock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_show()
61 temperature = mt7915_mcu_get_temperature(phy); in mt7915_thermal_temp_show()
62 mutex_unlock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_show()
70 phy->throttle_temp[i - 1] * 1000); in mt7915_thermal_temp_show()
72 return sprintf(buf, "%hhu\n", phy->throttle_state); in mt7915_thermal_temp_show()
74 return -EINVAL; in mt7915_thermal_temp_show()
82 struct mt7915_phy *phy = dev_get_drvdata(dev); in mt7915_thermal_temp_store() local
83 int ret, i = to_sensor_dev_attr(attr)->index; in mt7915_thermal_temp_store()
90 mutex_lock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_store()
93 if ((i - 1 == MT7915_CRIT_TEMP_IDX && in mt7915_thermal_temp_store()
94 val > phy->throttle_temp[MT7915_MAX_TEMP_IDX]) || in mt7915_thermal_temp_store()
95 (i - 1 == MT7915_MAX_TEMP_IDX && in mt7915_thermal_temp_store()
96 val < phy->throttle_temp[MT7915_CRIT_TEMP_IDX])) { in mt7915_thermal_temp_store()
97 dev_err(phy->dev->mt76.dev, in mt7915_thermal_temp_store()
99 mutex_unlock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_store()
100 return -EINVAL; in mt7915_thermal_temp_store()
103 phy->throttle_temp[i - 1] = val; in mt7915_thermal_temp_store()
104 ret = mt7915_mcu_set_thermal_protect(phy); in mt7915_thermal_temp_store()
105 mutex_unlock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_store()
139 struct mt7915_phy *phy = cdev->devdata; in mt7915_thermal_get_cur_throttle_state() local
141 *state = phy->cdev_state; in mt7915_thermal_get_cur_throttle_state()
150 struct mt7915_phy *phy = cdev->devdata; in mt7915_thermal_set_cur_throttle_state() local
151 u8 throttling = MT7915_THERMAL_THROTTLE_MAX - state; in mt7915_thermal_set_cur_throttle_state()
155 dev_err(phy->dev->mt76.dev, in mt7915_thermal_set_cur_throttle_state()
157 return -EINVAL; in mt7915_thermal_set_cur_throttle_state()
160 if (state == phy->cdev_state) in mt7915_thermal_set_cur_throttle_state()
167 mutex_lock(&phy->dev->mt76.mutex); in mt7915_thermal_set_cur_throttle_state()
168 ret = mt7915_mcu_set_thermal_throttling(phy, throttling); in mt7915_thermal_set_cur_throttle_state()
169 mutex_unlock(&phy->dev->mt76.mutex); in mt7915_thermal_set_cur_throttle_state()
173 phy->cdev_state = state; in mt7915_thermal_set_cur_throttle_state()
184 static void mt7915_unregister_thermal(struct mt7915_phy *phy) in mt7915_unregister_thermal() argument
186 struct wiphy *wiphy = phy->mt76->hw->wiphy; in mt7915_unregister_thermal()
188 if (!phy->cdev) in mt7915_unregister_thermal()
191 sysfs_remove_link(&wiphy->dev.kobj, "cooling_device"); in mt7915_unregister_thermal()
192 thermal_cooling_device_unregister(phy->cdev); in mt7915_unregister_thermal()
196 static int mt7915_thermal_init(struct mt7915_phy *phy) in mt7915_thermal_init() argument
199 struct wiphy *wiphy = phy->mt76->hw->wiphy; in mt7915_thermal_init()
204 name = devm_kasprintf(&wiphy->dev, GFP_KERNEL, "mt7915_%s", in mt7915_thermal_init()
207 return -ENOMEM; in mt7915_thermal_init()
209 cdev = thermal_cooling_device_register(name, phy, &mt7915_thermal_ops); in mt7915_thermal_init()
211 if (sysfs_create_link(&wiphy->dev.kobj, &cdev->device.kobj, in mt7915_thermal_init()
215 phy->cdev = cdev; in mt7915_thermal_init()
219 phy->throttle_temp[MT7915_CRIT_TEMP_IDX] = MT7915_CRIT_TEMP; in mt7915_thermal_init()
220 phy->throttle_temp[MT7915_MAX_TEMP_IDX] = MT7915_MAX_TEMP; in mt7915_thermal_init()
225 hwmon = devm_hwmon_device_register_with_groups(&wiphy->dev, name, phy, in mt7915_thermal_init()
242 dev = container_of(mphy->dev, struct mt7915_dev, mt76); in mt7915_led_set_config()
248 mt76_wr(dev, MT_LED_STATUS_0(mphy->band_idx), val); in mt7915_led_set_config()
249 mt76_wr(dev, MT_LED_STATUS_1(mphy->band_idx), val); in mt7915_led_set_config()
252 mt76_wr(dev, MT_LED_EN(mphy->band_idx), 1); in mt7915_led_set_config()
256 if (dev->mphy.leds.al) in mt7915_led_set_config()
258 if (mphy->band_idx) in mt7915_led_set_config()
261 mt76_wr(dev, MT_LED_CTRL(mphy->band_idx), val); in mt7915_led_set_config()
262 mt76_clear(dev, MT_LED_CTRL(mphy->band_idx), MT_LED_CTRL_KICK); in mt7915_led_set_config()
298 static void __mt7915_init_txpower(struct mt7915_phy *phy, in __mt7915_init_txpower() argument
301 struct mt7915_dev *dev = phy->dev; in __mt7915_init_txpower()
302 int i, n_chains = hweight16(phy->mt76->chainmask); in __mt7915_init_txpower()
304 int pwr_delta = mt7915_eeprom_get_power_delta(dev, sband->band); in __mt7915_init_txpower()
307 for (i = 0; i < sband->n_channels; i++) { in __mt7915_init_txpower()
308 struct ieee80211_channel *chan = &sband->channels[i]; in __mt7915_init_txpower()
320 target_power = mt76_get_rate_power_limits(phy->mt76, chan, in __mt7915_init_txpower()
325 chan->max_power = min_t(int, chan->max_reg_power, in __mt7915_init_txpower()
327 chan->orig_mpwr = target_power; in __mt7915_init_txpower()
331 void mt7915_init_txpower(struct mt7915_phy *phy) in mt7915_init_txpower() argument
333 if (!phy) in mt7915_init_txpower()
336 if (phy->mt76->cap.has_2ghz) in mt7915_init_txpower()
337 __mt7915_init_txpower(phy, &phy->mt76->sband_2g.sband); in mt7915_init_txpower()
338 if (phy->mt76->cap.has_5ghz) in mt7915_init_txpower()
339 __mt7915_init_txpower(phy, &phy->mt76->sband_5g.sband); in mt7915_init_txpower()
340 if (phy->mt76->cap.has_6ghz) in mt7915_init_txpower()
341 __mt7915_init_txpower(phy, &phy->mt76->sband_6g.sband); in mt7915_init_txpower()
350 struct mt76_phy *mphy = hw->priv; in mt7915_regd_notifier()
351 struct mt7915_phy *phy = mphy->priv; in mt7915_regd_notifier() local
353 memcpy(dev->mt76.alpha2, request->alpha2, sizeof(dev->mt76.alpha2)); in mt7915_regd_notifier()
354 dev->mt76.region = request->dfs_region; in mt7915_regd_notifier()
356 if (dev->mt76.region == NL80211_DFS_UNSET) in mt7915_regd_notifier()
357 mt7915_mcu_rdd_background_enable(phy, NULL); in mt7915_regd_notifier()
359 mt7915_init_txpower(phy); in mt7915_regd_notifier()
361 mphy->dfs_state = MT_DFS_STATE_UNKNOWN; in mt7915_regd_notifier()
362 mt7915_dfs_init_radar_detector(phy); in mt7915_regd_notifier()
366 mt7915_init_wiphy(struct mt7915_phy *phy) in mt7915_init_wiphy() argument
368 struct mt76_phy *mphy = phy->mt76; in mt7915_init_wiphy()
369 struct ieee80211_hw *hw = mphy->hw; in mt7915_init_wiphy()
370 struct mt76_dev *mdev = &phy->dev->mt76; in mt7915_init_wiphy()
371 struct wiphy *wiphy = hw->wiphy; in mt7915_init_wiphy()
372 struct mt7915_dev *dev = phy->dev; in mt7915_init_wiphy()
374 hw->queues = 4; in mt7915_init_wiphy()
375 hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE; in mt7915_init_wiphy()
376 hw->max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE; in mt7915_init_wiphy()
377 hw->netdev_features = NETIF_F_RXCSUM; in mt7915_init_wiphy()
379 if (mtk_wed_device_active(&mdev->mmio.wed)) in mt7915_init_wiphy()
380 hw->netdev_features |= NETIF_F_HW_TC; in mt7915_init_wiphy()
382 hw->radiotap_timestamp.units_pos = in mt7915_init_wiphy()
385 phy->slottime = 9; in mt7915_init_wiphy()
387 hw->sta_data_size = sizeof(struct mt7915_sta); in mt7915_init_wiphy()
388 hw->vif_data_size = sizeof(struct mt7915_vif); in mt7915_init_wiphy()
390 wiphy->iface_combinations = if_comb; in mt7915_init_wiphy()
391 wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); in mt7915_init_wiphy()
392 wiphy->reg_notifier = mt7915_regd_notifier; in mt7915_init_wiphy()
393 wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; in mt7915_init_wiphy()
394 wiphy->mbssid_max_interfaces = 16; in mt7915_init_wiphy()
407 if (!is_mt7915(&dev->mt76)) in mt7915_init_wiphy()
411 if (!mdev->dev->of_node || in mt7915_init_wiphy()
412 !of_property_read_bool(mdev->dev->of_node, in mt7915_init_wiphy()
413 "mediatek,disable-radar-background")) in mt7915_init_wiphy()
425 hw->max_tx_fragments = 4; in mt7915_init_wiphy()
427 if (phy->mt76->cap.has_2ghz) { in mt7915_init_wiphy()
428 phy->mt76->sband_2g.sband.ht_cap.cap |= in mt7915_init_wiphy()
431 if (is_mt7915(&dev->mt76)) in mt7915_init_wiphy()
432 phy->mt76->sband_2g.sband.ht_cap.ampdu_density = in mt7915_init_wiphy()
435 phy->mt76->sband_2g.sband.ht_cap.ampdu_density = in mt7915_init_wiphy()
439 if (phy->mt76->cap.has_5ghz) { in mt7915_init_wiphy()
442 vht_cap = &phy->mt76->sband_5g.sband.vht_cap; in mt7915_init_wiphy()
443 phy->mt76->sband_5g.sband.ht_cap.cap |= in mt7915_init_wiphy()
447 if (is_mt7915(&dev->mt76)) { in mt7915_init_wiphy()
448 phy->mt76->sband_5g.sband.ht_cap.ampdu_density = in mt7915_init_wiphy()
451 vht_cap->cap |= in mt7915_init_wiphy()
455 if (!dev->dbdc_support) in mt7915_init_wiphy()
456 vht_cap->cap |= in mt7915_init_wiphy()
460 phy->mt76->sband_5g.sband.ht_cap.ampdu_density = in mt7915_init_wiphy()
463 vht_cap->cap |= in mt7915_init_wiphy()
468 vht_cap->cap |= in mt7915_init_wiphy()
473 if (!is_mt7915(&dev->mt76) || !dev->dbdc_support) in mt7915_init_wiphy()
477 mt76_set_stream_caps(phy->mt76, true); in mt7915_init_wiphy()
478 mt7915_set_stream_vht_txbf_caps(phy); in mt7915_init_wiphy()
479 mt7915_set_stream_he_caps(phy); in mt7915_init_wiphy()
480 mt7915_init_txpower(phy); in mt7915_init_wiphy()
482 wiphy->available_antennas_rx = phy->mt76->antenna_mask; in mt7915_init_wiphy()
483 wiphy->available_antennas_tx = phy->mt76->antenna_mask; in mt7915_init_wiphy()
487 mphy->leds.cdev.brightness_set = mt7915_led_set_brightness; in mt7915_init_wiphy()
488 mphy->leds.cdev.blink_set = mt7915_led_set_blink; in mt7915_init_wiphy()
540 if (is_mt7915(&dev->mt76)) in mt7915_mac_init_band()
550 /* filter out non-resp frames and get instanstaeous signal reporting */ in mt7915_mac_init_band()
559 if (mtk_wed_device_active(&dev->mt76.mmio.wed)) in mt7915_mac_init_band()
569 if (dev->dbdc_support) { in mt7915_init_led_mux()
570 switch (mt76_chip(&dev->mt76)) { in mt7915_init_led_mux()
592 } else if (dev->mphy.leds.pin) { in mt7915_init_led_mux()
593 switch (mt76_chip(&dev->mt76)) { in mt7915_init_led_mux()
610 switch (mt76_chip(&dev->mt76)) { in mt7915_init_led_mux()
632 u32 rx_len = is_mt7915(&dev->mt76) ? 0x400 : 0x680; in mt7915_mac_init()
635 if (!is_mt7915(&dev->mt76) && dev->hif2) in mt7915_mac_init()
641 if (!is_mt7915(&dev->mt76)) in mt7915_mac_init()
646 /* enable hardware de-agg */ in mt7915_mac_init()
662 if (dev->dbdc_support) { in mt7915_txbf_init()
680 struct mt7915_phy *phy; in mt7915_alloc_ext_phy() local
683 if (!dev->dbdc_support) in mt7915_alloc_ext_phy()
686 mphy = mt76_alloc_phy(&dev->mt76, sizeof(*phy), &mt7915_ops, MT_BAND1); in mt7915_alloc_ext_phy()
688 return ERR_PTR(-ENOMEM); in mt7915_alloc_ext_phy()
690 phy = mphy->priv; in mt7915_alloc_ext_phy()
691 phy->dev = dev; in mt7915_alloc_ext_phy()
692 phy->mt76 = mphy; in mt7915_alloc_ext_phy()
694 /* Bind main phy to band0 and ext_phy to band1 for dbdc case */ in mt7915_alloc_ext_phy()
695 phy->mt76->band_idx = 1; in mt7915_alloc_ext_phy()
697 return phy; in mt7915_alloc_ext_phy()
701 mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy) in mt7915_register_ext_phy() argument
703 struct mt76_phy *mphy = phy->mt76; in mt7915_register_ext_phy()
706 INIT_DELAYED_WORK(&mphy->mac_work, mt7915_mac_work); in mt7915_register_ext_phy()
708 mt7915_eeprom_parse_hw_cap(dev, phy); in mt7915_register_ext_phy()
711 memcpy(mphy->macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR2, in mt7915_register_ext_phy()
713 memcpy(mphy->macaddr, (u8 *)dev->mt76.eeprom.data + MT_EE_MAC_ADDR2, in mt7915_register_ext_phy()
716 /* Make the secondary PHY MAC address local without overlapping with in mt7915_register_ext_phy()
719 if (!is_valid_ether_addr(mphy->macaddr)) { in mt7915_register_ext_phy()
721 memcpy(mphy->macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR, in mt7915_register_ext_phy()
723 memcpy(mphy->macaddr, (u8 *)dev->mt76.eeprom.data + MT_EE_MAC_ADDR, in mt7915_register_ext_phy()
726 mphy->macaddr[0] |= 2; in mt7915_register_ext_phy()
727 mphy->macaddr[0] ^= BIT(7); in mt7915_register_ext_phy()
731 /* init wiphy according to mphy and phy */ in mt7915_register_ext_phy()
732 mt7915_init_wiphy(phy); in mt7915_register_ext_phy()
739 ret = mt7915_thermal_init(phy); in mt7915_register_ext_phy()
744 mt7915_init_debugfs(phy); in mt7915_register_ext_phy()
769 if (is_mt7915(&dev->mt76)) { in mt7915_wfsys_reset()
782 /* release wfsys then mcu re-executes romcode */ in mt7915_wfsys_reset()
795 dev_err(dev->mt76.dev, "wifi subsystem reset failure\n"); in mt7915_wfsys_reset()
803 } else if (is_mt798x(&dev->mt76)) { in mt7915_wfsys_reset()
822 dev->phy.mt76->band_idx = 0; in mt7915_band_config()
824 if (is_mt798x(&dev->mt76)) { in mt7915_band_config()
829 * of adie chips and the main phy is bound to band1 when in mt7915_band_config()
833 dev->phy.mt76->band_idx = 1; in mt7915_band_config()
837 ret = is_mt7915(&dev->mt76) ? in mt7915_band_config()
852 INIT_WORK(&dev->init_work, mt7915_init_work); in mt7915_init_hardware()
858 set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state); in mt7915_init_hardware()
868 if (dev->cal) { in mt7915_init_hardware()
875 idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA); in mt7915_init_hardware()
877 return -ENOSPC; in mt7915_init_hardware()
879 dev->mt76.global_wcid.idx = idx; in mt7915_init_hardware()
880 dev->mt76.global_wcid.hw_key_idx = -1; in mt7915_init_hardware()
881 dev->mt76.global_wcid.tx_info |= MT_WCID_TX_INFO_SET; in mt7915_init_hardware()
882 rcu_assign_pointer(dev->mt76.wcid[idx], &dev->mt76.global_wcid); in mt7915_init_hardware()
887 void mt7915_set_stream_vht_txbf_caps(struct mt7915_phy *phy) in mt7915_set_stream_vht_txbf_caps() argument
892 if (!phy->mt76->cap.has_5ghz) in mt7915_set_stream_vht_txbf_caps()
895 sts = hweight8(phy->mt76->chainmask); in mt7915_set_stream_vht_txbf_caps()
896 cap = &phy->mt76->sband_5g.sband.vht_cap.cap; in mt7915_set_stream_vht_txbf_caps()
901 sts - 1); in mt7915_set_stream_vht_txbf_caps()
913 sts - 1); in mt7915_set_stream_vht_txbf_caps()
917 mt7915_set_stream_he_txbf_caps(struct mt7915_phy *phy, in mt7915_set_stream_he_txbf_caps() argument
920 struct mt7915_dev *dev = phy->dev; in mt7915_set_stream_he_txbf_caps()
921 struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem; in mt7915_set_stream_he_txbf_caps()
922 int sts = hweight8(phy->mt76->chainmask); in mt7915_set_stream_he_txbf_caps()
923 u8 c, sts_160 = sts; in mt7915_set_stream_he_txbf_caps() local
926 if (is_mt7915(&dev->mt76)) { in mt7915_set_stream_he_txbf_caps()
927 if (!dev->dbdc_support) in mt7915_set_stream_he_txbf_caps()
938 elem->phy_cap_info[3] &= ~IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
939 elem->phy_cap_info[4] &= ~IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
941 c = IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK; in mt7915_set_stream_he_txbf_caps()
943 c |= IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK; in mt7915_set_stream_he_txbf_caps()
944 elem->phy_cap_info[5] &= ~c; in mt7915_set_stream_he_txbf_caps()
946 c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB | in mt7915_set_stream_he_txbf_caps()
948 elem->phy_cap_info[6] &= ~c; in mt7915_set_stream_he_txbf_caps()
950 elem->phy_cap_info[7] &= ~IEEE80211_HE_PHY_CAP7_MAX_NC_MASK; in mt7915_set_stream_he_txbf_caps()
952 c = IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US; in mt7915_set_stream_he_txbf_caps()
953 if (!is_mt7915(&dev->mt76)) in mt7915_set_stream_he_txbf_caps()
954 c |= IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO | in mt7915_set_stream_he_txbf_caps()
956 elem->phy_cap_info[2] |= c; in mt7915_set_stream_he_txbf_caps()
958 c = IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE | in mt7915_set_stream_he_txbf_caps()
961 c |= IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4; in mt7915_set_stream_he_txbf_caps()
962 elem->phy_cap_info[4] |= c; in mt7915_set_stream_he_txbf_caps()
965 c = IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU | in mt7915_set_stream_he_txbf_caps()
969 c |= IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO; in mt7915_set_stream_he_txbf_caps()
971 elem->phy_cap_info[6] |= c; in mt7915_set_stream_he_txbf_caps()
977 elem->phy_cap_info[7] |= min_t(int, sts - 1, 2) << 3; in mt7915_set_stream_he_txbf_caps()
982 elem->phy_cap_info[3] |= IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
984 c = FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK, in mt7915_set_stream_he_txbf_caps()
985 sts - 1); in mt7915_set_stream_he_txbf_caps()
987 c |= FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK, in mt7915_set_stream_he_txbf_caps()
988 sts_160 - 1); in mt7915_set_stream_he_txbf_caps()
989 elem->phy_cap_info[5] |= c; in mt7915_set_stream_he_txbf_caps()
994 elem->phy_cap_info[4] |= IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
996 c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB | in mt7915_set_stream_he_txbf_caps()
998 elem->phy_cap_info[6] |= c; in mt7915_set_stream_he_txbf_caps()
1000 if (!is_mt7915(&dev->mt76)) { in mt7915_set_stream_he_txbf_caps()
1001 c = IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ | in mt7915_set_stream_he_txbf_caps()
1003 elem->phy_cap_info[7] |= c; in mt7915_set_stream_he_txbf_caps()
1008 mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band, in mt7915_init_he_caps() argument
1011 struct mt7915_dev *dev = phy->dev; in mt7915_init_he_caps()
1012 int i, idx = 0, nss = hweight8(phy->mt76->antenna_mask); in mt7915_init_he_caps()
1017 if (!is_mt7915(&dev->mt76)) in mt7915_init_he_caps()
1019 else if (!dev->dbdc_support) in mt7915_init_he_caps()
1041 &he_cap->he_cap_elem; in mt7915_init_he_caps()
1043 &he_cap->he_mcs_nss_supp; in mt7915_init_he_caps()
1057 he_cap->has_he = true; 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[3] = in mt7915_init_he_caps()
1064 he_cap_elem->mac_cap_info[4] = in mt7915_init_he_caps()
1068 he_cap_elem->phy_cap_info[0] = in mt7915_init_he_caps()
1071 he_cap_elem->phy_cap_info[0] = in mt7915_init_he_caps()
1075 he_cap_elem->phy_cap_info[0] = in mt7915_init_he_caps()
1078 he_cap_elem->phy_cap_info[1] = in mt7915_init_he_caps()
1080 he_cap_elem->phy_cap_info[2] = in mt7915_init_he_caps()
1086 he_cap_elem->mac_cap_info[0] |= in mt7915_init_he_caps()
1088 he_cap_elem->mac_cap_info[2] |= in mt7915_init_he_caps()
1090 he_cap_elem->mac_cap_info[4] |= in mt7915_init_he_caps()
1092 he_cap_elem->mac_cap_info[5] |= in mt7915_init_he_caps()
1094 he_cap_elem->phy_cap_info[3] |= in mt7915_init_he_caps()
1097 he_cap_elem->phy_cap_info[6] |= in mt7915_init_he_caps()
1100 he_cap_elem->phy_cap_info[9] |= in mt7915_init_he_caps()
1105 he_cap_elem->mac_cap_info[1] |= in mt7915_init_he_caps()
1109 he_cap_elem->phy_cap_info[0] |= in mt7915_init_he_caps()
1112 he_cap_elem->phy_cap_info[0] |= in mt7915_init_he_caps()
1115 he_cap_elem->phy_cap_info[1] |= in mt7915_init_he_caps()
1118 he_cap_elem->phy_cap_info[3] |= in mt7915_init_he_caps()
1121 he_cap_elem->phy_cap_info[6] |= in mt7915_init_he_caps()
1125 he_cap_elem->phy_cap_info[7] |= in mt7915_init_he_caps()
1128 he_cap_elem->phy_cap_info[8] |= in mt7915_init_he_caps()
1132 he_cap_elem->phy_cap_info[8] |= in mt7915_init_he_caps()
1135 he_cap_elem->phy_cap_info[9] |= in mt7915_init_he_caps()
1146 he_mcs->rx_mcs_80 = cpu_to_le16(mcs_map); in mt7915_init_he_caps()
1147 he_mcs->tx_mcs_80 = cpu_to_le16(mcs_map); in mt7915_init_he_caps()
1148 he_mcs->rx_mcs_160 = cpu_to_le16(mcs_map_160); in mt7915_init_he_caps()
1149 he_mcs->tx_mcs_160 = cpu_to_le16(mcs_map_160); in mt7915_init_he_caps()
1151 mt7915_set_stream_he_txbf_caps(phy, he_cap, i); in mt7915_init_he_caps()
1153 memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres)); in mt7915_init_he_caps()
1154 if (he_cap_elem->phy_cap_info[6] & in mt7915_init_he_caps()
1156 mt76_connac_gen_ppe_thresh(he_cap->ppe_thres, nss, band); in mt7915_init_he_caps()
1158 he_cap_elem->phy_cap_info[9] |= in mt7915_init_he_caps()
1183 void mt7915_set_stream_he_caps(struct mt7915_phy *phy) in mt7915_set_stream_he_caps() argument
1189 if (phy->mt76->cap.has_2ghz) { in mt7915_set_stream_he_caps()
1190 data = phy->iftype[NL80211_BAND_2GHZ]; in mt7915_set_stream_he_caps()
1191 n = mt7915_init_he_caps(phy, NL80211_BAND_2GHZ, data); in mt7915_set_stream_he_caps()
1193 band = &phy->mt76->sband_2g.sband; in mt7915_set_stream_he_caps()
1197 if (phy->mt76->cap.has_5ghz) { in mt7915_set_stream_he_caps()
1198 data = phy->iftype[NL80211_BAND_5GHZ]; in mt7915_set_stream_he_caps()
1199 n = mt7915_init_he_caps(phy, NL80211_BAND_5GHZ, data); in mt7915_set_stream_he_caps()
1201 band = &phy->mt76->sband_5g.sband; in mt7915_set_stream_he_caps()
1205 if (phy->mt76->cap.has_6ghz) { in mt7915_set_stream_he_caps()
1206 data = phy->iftype[NL80211_BAND_6GHZ]; in mt7915_set_stream_he_caps()
1207 n = mt7915_init_he_caps(phy, NL80211_BAND_6GHZ, data); in mt7915_set_stream_he_caps()
1209 band = &phy->mt76->sband_6g.sband; in mt7915_set_stream_he_caps()
1216 struct mt7915_phy *phy = mt7915_ext_phy(dev); in mt7915_unregister_ext_phy() local
1217 struct mt76_phy *mphy = dev->mt76.phys[MT_BAND1]; in mt7915_unregister_ext_phy()
1219 if (!phy) in mt7915_unregister_ext_phy()
1223 mt7915_unregister_thermal(phy); in mt7915_unregister_ext_phy()
1226 ieee80211_free_hw(mphy->hw); in mt7915_unregister_ext_phy()
1232 mt76_connac2_tx_token_put(&dev->mt76); in mt7915_stop_hardware()
1234 tasklet_disable(&dev->mt76.irq_tasklet); in mt7915_stop_hardware()
1236 if (is_mt798x(&dev->mt76)) in mt7915_stop_hardware()
1245 dev->phy.dev = dev; in mt7915_register_device()
1246 dev->phy.mt76 = &dev->mt76.phy; in mt7915_register_device()
1247 dev->mt76.phy.priv = &dev->phy; in mt7915_register_device()
1248 INIT_WORK(&dev->rc_work, mt7915_mac_sta_rc_work); in mt7915_register_device()
1249 INIT_DELAYED_WORK(&dev->mphy.mac_work, mt7915_mac_work); in mt7915_register_device()
1250 INIT_LIST_HEAD(&dev->sta_rc_list); in mt7915_register_device()
1251 INIT_LIST_HEAD(&dev->twt_list); in mt7915_register_device()
1253 init_waitqueue_head(&dev->reset_wait); in mt7915_register_device()
1254 INIT_WORK(&dev->reset_work, mt7915_mac_reset_work); in mt7915_register_device()
1255 INIT_WORK(&dev->dump_work, mt7915_mac_dump_work); in mt7915_register_device()
1256 mutex_init(&dev->dump_mutex); in mt7915_register_device()
1258 dev->dbdc_support = mt7915_band_config(dev); in mt7915_register_device()
1268 mt7915_init_wiphy(&dev->phy); in mt7915_register_device()
1271 dev->mt76.test_ops = &mt7915_testmode_ops; in mt7915_register_device()
1274 ret = mt76_register_device(&dev->mt76, true, mt76_rates, in mt7915_register_device()
1279 ret = mt7915_thermal_init(&dev->phy); in mt7915_register_device()
1289 ieee80211_queue_work(mt76_hw(dev), &dev->init_work); in mt7915_register_device()
1291 dev->recovery.hw_init_done = true; in mt7915_register_device()
1294 ret = mt7915_init_debugfs(&dev->phy); in mt7915_register_device()
1307 mt7915_unregister_thermal(&dev->phy); in mt7915_register_device()
1310 mt76_unregister_device(&dev->mt76); in mt7915_register_device()
1315 ieee80211_free_hw(phy2->mt76->hw); in mt7915_register_device()
1324 mt7915_unregister_thermal(&dev->phy); in mt7915_unregister_device()
1326 mt76_unregister_device(&dev->mt76); in mt7915_unregister_device()
1329 mt76_free_device(&dev->mt76); in mt7915_unregister_device()