Lines Matching +full:txpower +full:- +full:5 +full:g
1 // SPDX-License-Identifier: ISC
6 #include <linux/hwmon-sysfs.h>
17 switch (to_sensor_dev_attr(attr)->index) { in mt7921_thermal_temp_show()
20 struct mt792x_dev *mdev = phy->dev; in mt7921_thermal_temp_show()
33 return -EINVAL; in mt7921_thermal_temp_show()
46 struct wiphy *wiphy = phy->mt76->hw->wiphy; in mt7921_thermal_init()
53 name = devm_kasprintf(&wiphy->dev, GFP_KERNEL, "mt7921_%s", in mt7921_thermal_init()
56 return -ENOMEM; in mt7921_thermal_init()
58 hwmon = devm_hwmon_device_register_with_groups(&wiphy->dev, name, phy, in mt7921_thermal_init()
67 (!(dev->phy.clc_chan_conf & BIT(idx)) && (cfreq) >= (sfreq) && (cfreq) <= (efreq)) in mt7921_regd_channel_update()
69 struct mt76_dev *mdev = &dev->mt76; in mt7921_regd_channel_update()
76 sband = wiphy->bands[NL80211_BAND_5GHZ]; in mt7921_regd_channel_update()
77 band_np = np ? of_get_child_by_name(np, "txpower-5g") : NULL; in mt7921_regd_channel_update()
78 for (i = 0; i < sband->n_channels; i++) { in mt7921_regd_channel_update()
79 ch = &sband->channels[i]; in mt7921_regd_channel_update()
80 cfreq = ch->center_freq; in mt7921_regd_channel_update()
83 ch->flags |= IEEE80211_CHAN_DISABLED; in mt7921_regd_channel_update()
87 /* UNII-4 */ in mt7921_regd_channel_update()
89 ch->flags |= IEEE80211_CHAN_DISABLED; in mt7921_regd_channel_update()
92 sband = wiphy->bands[NL80211_BAND_6GHZ]; in mt7921_regd_channel_update()
96 band_np = np ? of_get_child_by_name(np, "txpower-6g") : NULL; in mt7921_regd_channel_update()
97 for (i = 0; i < sband->n_channels; i++) { in mt7921_regd_channel_update()
98 ch = &sband->channels[i]; in mt7921_regd_channel_update()
99 cfreq = ch->center_freq; in mt7921_regd_channel_update()
102 ch->flags |= IEEE80211_CHAN_DISABLED; in mt7921_regd_channel_update()
106 /* UNII-5/6/7/8 */ in mt7921_regd_channel_update()
111 ch->flags |= IEEE80211_CHAN_DISABLED; in mt7921_regd_channel_update()
117 struct mt76_dev *mdev = &dev->mt76; in mt7921_regd_update()
118 struct ieee80211_hw *hw = mdev->hw; in mt7921_regd_update()
119 struct wiphy *wiphy = hw->wiphy; in mt7921_regd_update()
121 mt7921_mcu_set_clc(dev, mdev->alpha2, dev->country_ie_env); in mt7921_regd_update()
123 mt76_connac_mcu_set_channel_domain(hw->priv); in mt7921_regd_update()
134 struct mt76_connac_pm *pm = &dev->pm; in mt7921_regd_notifier()
136 memcpy(dev->mt76.alpha2, request->alpha2, sizeof(dev->mt76.alpha2)); in mt7921_regd_notifier()
137 dev->mt76.region = request->dfs_region; in mt7921_regd_notifier()
138 dev->country_ie_env = request->country_ie_env; in mt7921_regd_notifier()
140 if (request->initiator == NL80211_REGDOM_SET_BY_USER) { in mt7921_regd_notifier()
141 if (dev->mt76.alpha2[0] == '0' && dev->mt76.alpha2[1] == '0') in mt7921_regd_notifier()
142 wiphy->regulatory_flags &= ~REGULATORY_COUNTRY_IE_IGNORE; in mt7921_regd_notifier()
144 wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE; in mt7921_regd_notifier()
147 if (pm->suspended) in mt7921_regd_notifier()
150 dev->regd_in_progress = true; in mt7921_regd_notifier()
156 dev->regd_in_progress = false; in mt7921_regd_notifier()
157 wake_up(&dev->wait); in mt7921_regd_notifier()
165 /* enable hardware de-agg */ in mt7921_mac_init()
176 return mt76_connac_mcu_set_rts_thresh(&dev->mt76, 0x92b, 0); in mt7921_mac_init()
192 mt76_eeprom_override(&dev->mphy); in __mt7921_init_hardware()
207 set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state); in mt7921_init_hardware()
218 dev_err(dev->mt76.dev, "hardware init failed\n"); in mt7921_init_hardware()
235 mt76_set_stream_caps(&dev->mphy, true); in mt7921_init_work()
236 mt7921_set_stream_he_caps(&dev->phy); in mt7921_init_work()
239 ret = mt76_register_device(&dev->mt76, true, mt76_rates, in mt7921_init_work()
242 dev_err(dev->mt76.dev, "register device failed\n"); in mt7921_init_work()
248 dev_err(dev->mt76.dev, "register debugfs failed\n"); in mt7921_init_work()
252 ret = mt7921_thermal_init(&dev->phy); in mt7921_init_work()
254 dev_err(dev->mt76.dev, "thermal init failed\n"); in mt7921_init_work()
259 dev->hw_init_done = true; in mt7921_init_work()
261 mt76_connac_mcu_set_deep_sleep(&dev->mt76, dev->pm.ds_enable); in mt7921_init_work()
269 dev->phy.dev = dev; in mt7921_register_device()
270 dev->phy.mt76 = &dev->mt76.phy; in mt7921_register_device()
271 dev->mt76.phy.priv = &dev->phy; in mt7921_register_device()
272 dev->mt76.tx_worker.fn = mt792x_tx_worker; in mt7921_register_device()
274 INIT_DELAYED_WORK(&dev->pm.ps_work, mt792x_pm_power_save_work); in mt7921_register_device()
275 INIT_WORK(&dev->pm.wake_work, mt792x_pm_wake_work); in mt7921_register_device()
276 spin_lock_init(&dev->pm.wake.lock); in mt7921_register_device()
277 mutex_init(&dev->pm.mutex); in mt7921_register_device()
278 init_waitqueue_head(&dev->pm.wait); in mt7921_register_device()
279 init_waitqueue_head(&dev->wait); in mt7921_register_device()
280 if (mt76_is_sdio(&dev->mt76)) in mt7921_register_device()
281 init_waitqueue_head(&dev->mt76.sdio.wait); in mt7921_register_device()
282 spin_lock_init(&dev->pm.txq_lock); in mt7921_register_device()
283 INIT_DELAYED_WORK(&dev->mphy.mac_work, mt792x_mac_work); in mt7921_register_device()
284 INIT_DELAYED_WORK(&dev->phy.scan_work, mt7921_scan_work); in mt7921_register_device()
285 INIT_DELAYED_WORK(&dev->coredump.work, mt7921_coredump_work); in mt7921_register_device()
287 INIT_WORK(&dev->ipv6_ns_work, mt7921_set_ipv6_ns_work); in mt7921_register_device()
288 skb_queue_head_init(&dev->ipv6_ns_list); in mt7921_register_device()
290 skb_queue_head_init(&dev->phy.scan_event_list); in mt7921_register_device()
291 skb_queue_head_init(&dev->coredump.msg_list); in mt7921_register_device()
293 INIT_WORK(&dev->reset_work, mt7921_mac_reset_work); in mt7921_register_device()
294 INIT_WORK(&dev->init_work, mt7921_init_work); in mt7921_register_device()
296 INIT_WORK(&dev->phy.roc_work, mt7921_roc_work); in mt7921_register_device()
297 timer_setup(&dev->phy.roc_timer, mt792x_roc_timer, 0); in mt7921_register_device()
298 init_waitqueue_head(&dev->phy.roc_wait); in mt7921_register_device()
300 dev->pm.idle_timeout = MT792x_PM_TIMEOUT; in mt7921_register_device()
301 dev->pm.stats.last_wake_event = jiffies; in mt7921_register_device()
302 dev->pm.stats.last_doze_event = jiffies; in mt7921_register_device()
303 if (!mt76_is_usb(&dev->mt76)) { in mt7921_register_device()
304 dev->pm.enable_user = true; in mt7921_register_device()
305 dev->pm.enable = true; in mt7921_register_device()
306 dev->pm.ds_enable_user = true; in mt7921_register_device()
307 dev->pm.ds_enable = true; in mt7921_register_device()
310 if (!mt76_is_mmio(&dev->mt76)) in mt7921_register_device()
311 hw->extra_tx_headroom += MT_SDIO_TXD_SIZE + MT_SDIO_HDR_SIZE; in mt7921_register_device()
323 hw->wiphy->reg_notifier = mt7921_regd_notifier; in mt7921_register_device()
324 dev->mphy.sband_2g.sband.ht_cap.cap |= in mt7921_register_device()
327 dev->mphy.sband_5g.sband.ht_cap.cap |= in mt7921_register_device()
330 dev->mphy.sband_5g.sband.vht_cap.cap |= in mt7921_register_device()
336 if (is_mt7922(&dev->mt76)) in mt7921_register_device()
337 dev->mphy.sband_5g.sband.vht_cap.cap |= in mt7921_register_device()
341 dev->mphy.hw->wiphy->available_antennas_rx = dev->mphy.chainmask; in mt7921_register_device()
342 dev->mphy.hw->wiphy->available_antennas_tx = dev->mphy.chainmask; in mt7921_register_device()
344 queue_work(system_wq, &dev->init_work); in mt7921_register_device()