Lines Matching +full:c +full:- +full:phy
1 // SPDX-License-Identifier: ISC
2 /* Copyright (C) 2020 MediaTek Inc. */
6 #include <linux/hwmon-sysfs.h>
49 struct mt7915_phy *phy = dev_get_drvdata(dev); in mt7915_thermal_temp_show() local
50 int i = to_sensor_dev_attr(attr)->index; in mt7915_thermal_temp_show()
55 temperature = mt7915_mcu_get_temperature(phy); in mt7915_thermal_temp_show()
63 phy->throttle_temp[i - 1] * 1000); in mt7915_thermal_temp_show()
65 return sprintf(buf, "%hhu\n", phy->throttle_state); in mt7915_thermal_temp_show()
67 return -EINVAL; in mt7915_thermal_temp_show()
75 struct mt7915_phy *phy = dev_get_drvdata(dev); in mt7915_thermal_temp_store() local
76 int ret, i = to_sensor_dev_attr(attr)->index; in mt7915_thermal_temp_store()
83 mutex_lock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_store()
85 phy->throttle_temp[i - 1] = val; in mt7915_thermal_temp_store()
86 mutex_unlock(&phy->dev->mt76.mutex); in mt7915_thermal_temp_store()
118 struct mt7915_phy *phy = cdev->devdata; in mt7915_thermal_get_cur_throttle_state() local
120 *state = phy->cdev_state; in mt7915_thermal_get_cur_throttle_state()
129 struct mt7915_phy *phy = cdev->devdata; in mt7915_thermal_set_cur_throttle_state() local
130 u8 throttling = MT7915_THERMAL_THROTTLE_MAX - state; in mt7915_thermal_set_cur_throttle_state()
134 return -EINVAL; in mt7915_thermal_set_cur_throttle_state()
136 if (phy->throttle_temp[0] > phy->throttle_temp[1]) in mt7915_thermal_set_cur_throttle_state()
139 if (state == phy->cdev_state) in mt7915_thermal_set_cur_throttle_state()
146 ret = mt7915_mcu_set_thermal_throttling(phy, throttling); in mt7915_thermal_set_cur_throttle_state()
150 phy->cdev_state = state; in mt7915_thermal_set_cur_throttle_state()
161 static void mt7915_unregister_thermal(struct mt7915_phy *phy) in mt7915_unregister_thermal() argument
163 struct wiphy *wiphy = phy->mt76->hw->wiphy; in mt7915_unregister_thermal()
165 if (!phy->cdev) in mt7915_unregister_thermal()
168 sysfs_remove_link(&wiphy->dev.kobj, "cooling_device"); in mt7915_unregister_thermal()
169 thermal_cooling_device_unregister(phy->cdev); in mt7915_unregister_thermal()
172 static int mt7915_thermal_init(struct mt7915_phy *phy) in mt7915_thermal_init() argument
174 struct wiphy *wiphy = phy->mt76->hw->wiphy; in mt7915_thermal_init()
179 name = devm_kasprintf(&wiphy->dev, GFP_KERNEL, "mt7915_%s", in mt7915_thermal_init()
182 cdev = thermal_cooling_device_register(name, phy, &mt7915_thermal_ops); in mt7915_thermal_init()
184 if (sysfs_create_link(&wiphy->dev.kobj, &cdev->device.kobj, in mt7915_thermal_init()
188 phy->cdev = cdev; in mt7915_thermal_init()
194 hwmon = devm_hwmon_device_register_with_groups(&wiphy->dev, name, phy, in mt7915_thermal_init()
200 phy->throttle_temp[0] = 110; in mt7915_thermal_init()
201 phy->throttle_temp[1] = 120; in mt7915_thermal_init()
203 return mt7915_mcu_set_thermal_throttling(phy, in mt7915_thermal_init()
230 if (dev->mt76.led_al) in mt7915_led_set_config()
269 int i, n_chains = hweight8(dev->mphy.antenna_mask); in mt7915_init_txpower()
271 int pwr_delta = mt7915_eeprom_get_power_delta(dev, sband->band); in mt7915_init_txpower()
274 for (i = 0; i < sband->n_channels; i++) { in mt7915_init_txpower()
275 struct ieee80211_channel *chan = &sband->channels[i]; in mt7915_init_txpower()
287 target_power = mt76_get_rate_power_limits(&dev->mphy, chan, in mt7915_init_txpower()
292 chan->max_power = min_t(int, chan->max_reg_power, in mt7915_init_txpower()
294 chan->orig_mpwr = target_power; in mt7915_init_txpower()
304 struct mt76_phy *mphy = hw->priv; in mt7915_regd_notifier()
305 struct mt7915_phy *phy = mphy->priv; in mt7915_regd_notifier() local
307 memcpy(dev->mt76.alpha2, request->alpha2, sizeof(dev->mt76.alpha2)); in mt7915_regd_notifier()
308 dev->mt76.region = request->dfs_region; in mt7915_regd_notifier()
310 if (dev->mt76.region == NL80211_DFS_UNSET) in mt7915_regd_notifier()
311 mt7915_mcu_rdd_background_enable(phy, NULL); in mt7915_regd_notifier()
313 mt7915_init_txpower(dev, &mphy->sband_2g.sband); in mt7915_regd_notifier()
314 mt7915_init_txpower(dev, &mphy->sband_5g.sband); in mt7915_regd_notifier()
315 mt7915_init_txpower(dev, &mphy->sband_6g.sband); in mt7915_regd_notifier()
317 mphy->dfs_state = MT_DFS_STATE_UNKNOWN; in mt7915_regd_notifier()
318 mt7915_dfs_init_radar_detector(phy); in mt7915_regd_notifier()
324 struct mt7915_phy *phy = mt7915_hw_phy(hw); in mt7915_init_wiphy() local
325 struct mt76_dev *mdev = &phy->dev->mt76; in mt7915_init_wiphy()
326 struct wiphy *wiphy = hw->wiphy; in mt7915_init_wiphy()
327 struct mt7915_dev *dev = phy->dev; in mt7915_init_wiphy()
329 hw->queues = 4; in mt7915_init_wiphy()
330 hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE; in mt7915_init_wiphy()
331 hw->max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE; in mt7915_init_wiphy()
332 hw->netdev_features = NETIF_F_RXCSUM; in mt7915_init_wiphy()
334 hw->radiotap_timestamp.units_pos = in mt7915_init_wiphy()
337 phy->slottime = 9; in mt7915_init_wiphy()
339 hw->sta_data_size = sizeof(struct mt7915_sta); in mt7915_init_wiphy()
340 hw->vif_data_size = sizeof(struct mt7915_vif); in mt7915_init_wiphy()
342 wiphy->iface_combinations = if_comb; in mt7915_init_wiphy()
343 wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); in mt7915_init_wiphy()
344 wiphy->reg_notifier = mt7915_regd_notifier; in mt7915_init_wiphy()
345 wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; in mt7915_init_wiphy()
346 wiphy->mbssid_max_interfaces = 16; in mt7915_init_wiphy()
357 if (!mdev->dev->of_node || in mt7915_init_wiphy()
358 !of_property_read_bool(mdev->dev->of_node, in mt7915_init_wiphy()
359 "mediatek,disable-radar-background")) in mt7915_init_wiphy()
370 hw->max_tx_fragments = 4; in mt7915_init_wiphy()
372 if (phy->mt76->cap.has_2ghz) { in mt7915_init_wiphy()
373 phy->mt76->sband_2g.sband.ht_cap.cap |= in mt7915_init_wiphy()
376 phy->mt76->sband_2g.sband.ht_cap.ampdu_density = in mt7915_init_wiphy()
380 if (phy->mt76->cap.has_5ghz) { in mt7915_init_wiphy()
381 phy->mt76->sband_5g.sband.ht_cap.cap |= in mt7915_init_wiphy()
384 phy->mt76->sband_5g.sband.ht_cap.ampdu_density = in mt7915_init_wiphy()
387 if (is_mt7915(&dev->mt76)) { in mt7915_init_wiphy()
388 phy->mt76->sband_5g.sband.vht_cap.cap |= in mt7915_init_wiphy()
392 if (!dev->dbdc_support) in mt7915_init_wiphy()
393 phy->mt76->sband_5g.sband.vht_cap.cap |= in mt7915_init_wiphy()
397 phy->mt76->sband_5g.sband.vht_cap.cap |= in mt7915_init_wiphy()
402 phy->mt76->sband_5g.sband.vht_cap.cap |= in mt7915_init_wiphy()
408 mt76_set_stream_caps(phy->mt76, true); in mt7915_init_wiphy()
409 mt7915_set_stream_vht_txbf_caps(phy); in mt7915_init_wiphy()
410 mt7915_set_stream_he_caps(phy); in mt7915_init_wiphy()
412 wiphy->available_antennas_rx = phy->mt76->antenna_mask; in mt7915_init_wiphy()
413 wiphy->available_antennas_tx = phy->mt76->antenna_mask; in mt7915_init_wiphy()
452 u32 rx_len = is_mt7915(&dev->mt76) ? 0x400 : 0x680; in mt7915_mac_init()
455 if (!is_mt7915(&dev->mt76) && dev->hif2) in mt7915_mac_init()
461 if (!is_mt7915(&dev->mt76)) in mt7915_mac_init()
464 /* enable hardware de-agg */ in mt7915_mac_init()
474 i = dev->mt76.led_pin ? MT_LED_GPIO_MUX3 : MT_LED_GPIO_MUX2; in mt7915_mac_init()
483 if (dev->dbdc_support) { in mt7915_txbf_init()
501 struct mt7915_phy *phy; in mt7915_alloc_ext_phy() local
504 if (!dev->dbdc_support) in mt7915_alloc_ext_phy()
507 mphy = mt76_alloc_phy(&dev->mt76, sizeof(*phy), &mt7915_ops, MT_BAND1); in mt7915_alloc_ext_phy()
509 return ERR_PTR(-ENOMEM); in mt7915_alloc_ext_phy()
511 phy = mphy->priv; in mt7915_alloc_ext_phy()
512 phy->dev = dev; in mt7915_alloc_ext_phy()
513 phy->mt76 = mphy; in mt7915_alloc_ext_phy()
515 /* Bind main phy to band0 and ext_phy to band1 for dbdc case */ in mt7915_alloc_ext_phy()
516 phy->band_idx = 1; in mt7915_alloc_ext_phy()
518 return phy; in mt7915_alloc_ext_phy()
522 mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy) in mt7915_register_ext_phy() argument
524 struct mt76_phy *mphy = phy->mt76; in mt7915_register_ext_phy()
527 INIT_DELAYED_WORK(&mphy->mac_work, mt7915_mac_work); in mt7915_register_ext_phy()
529 mt7915_eeprom_parse_hw_cap(dev, phy); in mt7915_register_ext_phy()
531 memcpy(mphy->macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR2, in mt7915_register_ext_phy()
533 /* Make the secondary PHY MAC address local without overlapping with in mt7915_register_ext_phy()
536 if (!is_valid_ether_addr(mphy->macaddr)) { in mt7915_register_ext_phy()
537 memcpy(mphy->macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR, in mt7915_register_ext_phy()
539 mphy->macaddr[0] |= 2; in mt7915_register_ext_phy()
540 mphy->macaddr[0] ^= BIT(7); in mt7915_register_ext_phy()
544 /* init wiphy according to mphy and phy */ in mt7915_register_ext_phy()
545 mt7915_init_wiphy(mphy->hw); in mt7915_register_ext_phy()
552 ret = mt7915_thermal_init(phy); in mt7915_register_ext_phy()
556 mt7915_init_debugfs(phy); in mt7915_register_ext_phy()
572 mt7915_init_txpower(dev, &dev->mphy.sband_2g.sband); in mt7915_init_work()
573 mt7915_init_txpower(dev, &dev->mphy.sband_5g.sband); in mt7915_init_work()
574 mt7915_init_txpower(dev, &dev->mphy.sband_6g.sband); in mt7915_init_work()
583 if (is_mt7915(&dev->mt76)) { in mt7915_wfsys_reset()
596 /* release wfsys then mcu re-executes romcode */ in mt7915_wfsys_reset()
609 dev_err(dev->mt76.dev, "wifi subsystem reset failure\n"); in mt7915_wfsys_reset()
617 } else if (is_mt7986(&dev->mt76)) { in mt7915_wfsys_reset()
636 dev->phy.band_idx = 0; in mt7915_band_config()
638 if (is_mt7986(&dev->mt76)) { in mt7915_band_config()
643 * of adie chips and the main phy is bound to band1 when in mt7915_band_config()
647 dev->phy.band_idx = 1; in mt7915_band_config()
651 ret = is_mt7915(&dev->mt76) ? in mt7915_band_config()
666 INIT_WORK(&dev->init_work, mt7915_init_work); in mt7915_init_hardware()
672 set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state); in mt7915_init_hardware()
682 if (dev->flash_mode) { in mt7915_init_hardware()
689 idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA); in mt7915_init_hardware()
691 return -ENOSPC; in mt7915_init_hardware()
693 dev->mt76.global_wcid.idx = idx; in mt7915_init_hardware()
694 dev->mt76.global_wcid.hw_key_idx = -1; in mt7915_init_hardware()
695 dev->mt76.global_wcid.tx_info |= MT_WCID_TX_INFO_SET; in mt7915_init_hardware()
696 rcu_assign_pointer(dev->mt76.wcid[idx], &dev->mt76.global_wcid); in mt7915_init_hardware()
701 void mt7915_set_stream_vht_txbf_caps(struct mt7915_phy *phy) in mt7915_set_stream_vht_txbf_caps() argument
706 if (!phy->mt76->cap.has_5ghz) in mt7915_set_stream_vht_txbf_caps()
709 nss = hweight8(phy->mt76->chainmask); in mt7915_set_stream_vht_txbf_caps()
710 cap = &phy->mt76->sband_5g.sband.vht_cap.cap; in mt7915_set_stream_vht_txbf_caps()
726 nss - 1); in mt7915_set_stream_vht_txbf_caps()
734 struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem; in mt7915_set_stream_he_txbf_caps()
735 u8 c, nss_160; in mt7915_set_stream_he_txbf_caps() local
738 if (is_mt7915(&dev->mt76) && !dev->dbdc_support) in mt7915_set_stream_he_txbf_caps()
748 elem->phy_cap_info[3] &= ~IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
749 elem->phy_cap_info[4] &= ~IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
751 c = IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK | in mt7915_set_stream_he_txbf_caps()
753 elem->phy_cap_info[5] &= ~c; in mt7915_set_stream_he_txbf_caps()
755 c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB | in mt7915_set_stream_he_txbf_caps()
757 elem->phy_cap_info[6] &= ~c; in mt7915_set_stream_he_txbf_caps()
759 elem->phy_cap_info[7] &= ~IEEE80211_HE_PHY_CAP7_MAX_NC_MASK; in mt7915_set_stream_he_txbf_caps()
761 c = IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US; in mt7915_set_stream_he_txbf_caps()
762 if (!is_mt7915(&dev->mt76)) in mt7915_set_stream_he_txbf_caps()
763 c |= IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO | in mt7915_set_stream_he_txbf_caps()
765 elem->phy_cap_info[2] |= c; in mt7915_set_stream_he_txbf_caps()
767 c = IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE | in mt7915_set_stream_he_txbf_caps()
770 elem->phy_cap_info[4] |= c; in mt7915_set_stream_he_txbf_caps()
773 c = IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU | in mt7915_set_stream_he_txbf_caps()
777 c |= IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO; in mt7915_set_stream_he_txbf_caps()
779 elem->phy_cap_info[6] |= c; in mt7915_set_stream_he_txbf_caps()
785 elem->phy_cap_info[7] |= min_t(int, nss - 1, 2) << 3; in mt7915_set_stream_he_txbf_caps()
790 elem->phy_cap_info[3] |= IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
791 elem->phy_cap_info[4] |= IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER; in mt7915_set_stream_he_txbf_caps()
796 c = FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK, in mt7915_set_stream_he_txbf_caps()
797 nss - 1) | in mt7915_set_stream_he_txbf_caps()
799 nss_160 - 1); in mt7915_set_stream_he_txbf_caps()
800 elem->phy_cap_info[5] |= c; in mt7915_set_stream_he_txbf_caps()
802 c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB | in mt7915_set_stream_he_txbf_caps()
804 elem->phy_cap_info[6] |= c; in mt7915_set_stream_he_txbf_caps()
806 if (!is_mt7915(&dev->mt76)) { in mt7915_set_stream_he_txbf_caps()
807 c = IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ | in mt7915_set_stream_he_txbf_caps()
809 elem->phy_cap_info[7] |= c; in mt7915_set_stream_he_txbf_caps()
819 he_ppet[0] = FIELD_PREP(IEEE80211_PPE_THRES_NSS_MASK, nss - 1) | in mt7915_gen_ppe_thresh()
827 for (i = 0; i < ppet_size - 1; i++) in mt7915_gen_ppe_thresh()
831 (0xff >> (8 - (ppet_bits - 1) % 8)); in mt7915_gen_ppe_thresh()
835 mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band, in mt7915_init_he_caps() argument
838 struct mt7915_dev *dev = phy->dev; in mt7915_init_he_caps()
839 int i, idx = 0, nss = hweight8(phy->mt76->chainmask); in mt7915_init_he_caps()
845 if (is_mt7915(&dev->mt76) && !dev->dbdc_support) in mt7915_init_he_caps()
865 &he_cap->he_cap_elem; in mt7915_init_he_caps()
867 &he_cap->he_mcs_nss_supp; in mt7915_init_he_caps()
881 he_cap->has_he = true; in mt7915_init_he_caps()
883 he_cap_elem->mac_cap_info[0] = in mt7915_init_he_caps()
885 he_cap_elem->mac_cap_info[3] = in mt7915_init_he_caps()
888 he_cap_elem->mac_cap_info[4] = in mt7915_init_he_caps()
892 he_cap_elem->phy_cap_info[0] = in mt7915_init_he_caps()
895 he_cap_elem->phy_cap_info[0] = in mt7915_init_he_caps()
900 he_cap_elem->phy_cap_info[1] = in mt7915_init_he_caps()
902 he_cap_elem->phy_cap_info[2] = in mt7915_init_he_caps()
908 he_cap_elem->mac_cap_info[0] |= in mt7915_init_he_caps()
910 he_cap_elem->mac_cap_info[2] |= in mt7915_init_he_caps()
912 he_cap_elem->mac_cap_info[4] |= in mt7915_init_he_caps()
914 he_cap_elem->mac_cap_info[5] |= in mt7915_init_he_caps()
916 he_cap_elem->phy_cap_info[3] |= in mt7915_init_he_caps()
919 he_cap_elem->phy_cap_info[6] |= in mt7915_init_he_caps()
922 he_cap_elem->phy_cap_info[9] |= in mt7915_init_he_caps()
927 he_cap_elem->mac_cap_info[1] |= in mt7915_init_he_caps()
931 he_cap_elem->phy_cap_info[0] |= in mt7915_init_he_caps()
934 he_cap_elem->phy_cap_info[0] |= in mt7915_init_he_caps()
937 he_cap_elem->phy_cap_info[1] |= in mt7915_init_he_caps()
940 he_cap_elem->phy_cap_info[3] |= in mt7915_init_he_caps()
943 he_cap_elem->phy_cap_info[6] |= in mt7915_init_he_caps()
947 he_cap_elem->phy_cap_info[7] |= in mt7915_init_he_caps()
950 he_cap_elem->phy_cap_info[8] |= in mt7915_init_he_caps()
955 he_cap_elem->phy_cap_info[9] |= in mt7915_init_he_caps()
965 he_mcs->rx_mcs_80 = cpu_to_le16(mcs_map); in mt7915_init_he_caps()
966 he_mcs->tx_mcs_80 = cpu_to_le16(mcs_map); in mt7915_init_he_caps()
967 he_mcs->rx_mcs_160 = cpu_to_le16(mcs_map_160); in mt7915_init_he_caps()
968 he_mcs->tx_mcs_160 = cpu_to_le16(mcs_map_160); in mt7915_init_he_caps()
969 he_mcs->rx_mcs_80p80 = cpu_to_le16(mcs_map_160); in mt7915_init_he_caps()
970 he_mcs->tx_mcs_80p80 = cpu_to_le16(mcs_map_160); in mt7915_init_he_caps()
974 memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres)); in mt7915_init_he_caps()
975 if (he_cap_elem->phy_cap_info[6] & in mt7915_init_he_caps()
977 mt7915_gen_ppe_thresh(he_cap->ppe_thres, nss); in mt7915_init_he_caps()
979 he_cap_elem->phy_cap_info[9] |= in mt7915_init_he_caps()
1004 void mt7915_set_stream_he_caps(struct mt7915_phy *phy) in mt7915_set_stream_he_caps() argument
1010 if (phy->mt76->cap.has_2ghz) { in mt7915_set_stream_he_caps()
1011 data = phy->iftype[NL80211_BAND_2GHZ]; in mt7915_set_stream_he_caps()
1012 n = mt7915_init_he_caps(phy, NL80211_BAND_2GHZ, data); in mt7915_set_stream_he_caps()
1014 band = &phy->mt76->sband_2g.sband; in mt7915_set_stream_he_caps()
1015 band->iftype_data = data; in mt7915_set_stream_he_caps()
1016 band->n_iftype_data = n; in mt7915_set_stream_he_caps()
1019 if (phy->mt76->cap.has_5ghz) { in mt7915_set_stream_he_caps()
1020 data = phy->iftype[NL80211_BAND_5GHZ]; in mt7915_set_stream_he_caps()
1021 n = mt7915_init_he_caps(phy, NL80211_BAND_5GHZ, data); in mt7915_set_stream_he_caps()
1023 band = &phy->mt76->sband_5g.sband; in mt7915_set_stream_he_caps()
1024 band->iftype_data = data; in mt7915_set_stream_he_caps()
1025 band->n_iftype_data = n; in mt7915_set_stream_he_caps()
1028 if (phy->mt76->cap.has_6ghz) { in mt7915_set_stream_he_caps()
1029 data = phy->iftype[NL80211_BAND_6GHZ]; in mt7915_set_stream_he_caps()
1030 n = mt7915_init_he_caps(phy, NL80211_BAND_6GHZ, data); in mt7915_set_stream_he_caps()
1032 band = &phy->mt76->sband_6g.sband; in mt7915_set_stream_he_caps()
1033 band->iftype_data = data; in mt7915_set_stream_he_caps()
1034 band->n_iftype_data = n; in mt7915_set_stream_he_caps()
1040 struct mt7915_phy *phy = mt7915_ext_phy(dev); in mt7915_unregister_ext_phy() local
1041 struct mt76_phy *mphy = dev->mt76.phys[MT_BAND1]; in mt7915_unregister_ext_phy()
1043 if (!phy) in mt7915_unregister_ext_phy()
1046 mt7915_unregister_thermal(phy); in mt7915_unregister_ext_phy()
1048 ieee80211_free_hw(mphy->hw); in mt7915_unregister_ext_phy()
1056 tasklet_disable(&dev->irq_tasklet); in mt7915_stop_hardware()
1058 if (is_mt7986(&dev->mt76)) in mt7915_stop_hardware()
1069 dev->phy.dev = dev; in mt7915_register_device()
1070 dev->phy.mt76 = &dev->mt76.phy; in mt7915_register_device()
1071 dev->mt76.phy.priv = &dev->phy; in mt7915_register_device()
1072 INIT_WORK(&dev->rc_work, mt7915_mac_sta_rc_work); in mt7915_register_device()
1073 INIT_DELAYED_WORK(&dev->mphy.mac_work, mt7915_mac_work); in mt7915_register_device()
1074 INIT_LIST_HEAD(&dev->sta_rc_list); in mt7915_register_device()
1075 INIT_LIST_HEAD(&dev->sta_poll_list); in mt7915_register_device()
1076 INIT_LIST_HEAD(&dev->twt_list); in mt7915_register_device()
1077 spin_lock_init(&dev->sta_poll_lock); in mt7915_register_device()
1079 init_waitqueue_head(&dev->reset_wait); in mt7915_register_device()
1080 INIT_WORK(&dev->reset_work, mt7915_mac_reset_work); in mt7915_register_device()
1082 dev->dbdc_support = mt7915_band_config(dev); in mt7915_register_device()
1095 dev->mt76.test_ops = &mt7915_testmode_ops; in mt7915_register_device()
1100 dev->mt76.led_cdev.brightness_set = mt7915_led_set_brightness; in mt7915_register_device()
1101 dev->mt76.led_cdev.blink_set = mt7915_led_set_blink; in mt7915_register_device()
1104 ret = mt76_register_device(&dev->mt76, true, mt76_rates, in mt7915_register_device()
1109 ret = mt7915_thermal_init(&dev->phy); in mt7915_register_device()
1113 ieee80211_queue_work(mt76_hw(dev), &dev->init_work); in mt7915_register_device()
1121 mt7915_init_debugfs(&dev->phy); in mt7915_register_device()
1126 mt7915_unregister_thermal(&dev->phy); in mt7915_register_device()
1128 mt76_unregister_device(&dev->mt76); in mt7915_register_device()
1133 ieee80211_free_hw(phy2->mt76->hw); in mt7915_register_device()
1140 mt7915_unregister_thermal(&dev->phy); in mt7915_unregister_device()
1141 mt76_unregister_device(&dev->mt76); in mt7915_unregister_device()
1144 mt76_free_device(&dev->mt76); in mt7915_unregister_device()