Lines Matching refs:mt76

12 	switch (mt76_chip(&(_dev)->mt76)) {			\
63 enum nl80211_band band = msta->vif->phy->mt76->chandef.chan->band;
104 if (is_mt7915(&dev->mt76) && nss > 1 &&
140 if (is_mt7915(&dev->mt76) && nss > 1 &&
192 struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76);
222 return mt76_mcu_send_msg(&dev->mt76, cmd, &req, sizeof(req), false);
237 struct mt76_phy *mphy = &dev->mt76.phy;
245 if ((c->band_idx && !dev->phy.mt76->band_idx) &&
246 dev->mt76.phys[MT_BAND1])
247 mphy = dev->mt76.phys[MT_BAND1];
257 struct mt76_phy *mphy = &dev->mt76.phy;
268 if ((t->ctrl.band_idx && !dev->phy.mt76->band_idx) &&
269 dev->mt76.phys[MT_BAND1])
270 mphy = dev->mt76.phys[MT_BAND1];
279 struct mt76_phy *mphy = &dev->mt76.phy;
287 if ((r->band_idx && !dev->phy.mt76->band_idx) &&
288 dev->mt76.phys[MT_BAND1])
289 mphy = dev->mt76.phys[MT_BAND1];
340 struct mt76_phy *mphy = &dev->mt76.phy;
348 if ((b->band_idx && !dev->phy.mt76->band_idx) &&
349 dev->mt76.phys[MT_BAND1])
350 mphy = dev->mt76.phys[MT_BAND1];
415 mt76_mcu_rx_event(&dev->mt76, skb);
484 struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
503 struct mt76_phy *mphy = phy->mt76;
517 int max_nss = hweight8(phy->mt76->antenna_mask);
549 cap = mt76_connac_get_he_phy_cap(phy->mt76, vif);
588 struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
609 u32 idx = mvif->mt76.omac_idx - REPEATER_BSSID_START;
627 .band = phy->mt76->band_idx,
637 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MUAR_UPDATE), &req,
648 if (mvif->mt76.omac_idx >= REPEATER_BSSID_START) {
653 skb = __mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mvif->mt76, NULL,
662 mt76_connac_mcu_bss_basic_tlv(skb, vif, NULL, phy->mt76,
677 if (mvif->mt76.omac_idx >= EXT_BSSID_START &&
678 mvif->mt76.omac_idx < REPEATER_BSSID_START)
679 mt76_connac_mcu_bss_ext_tlv(skb, &mvif->mt76);
682 return mt76_mcu_skb_send_msg(&dev->mt76, skb,
697 return mt76_connac_mcu_sta_ba(&dev->mt76, &mvif->mt76, params,
709 return mt76_connac_mcu_sta_ba(&dev->mt76, &mvif->mt76, params,
877 if (!is_mt7915(&dev->mt76))
970 if (!is_mt7915(&dev->mt76)) {
1000 wtbl_hdr = mt76_connac_mcu_alloc_wtbl_req(&dev->mt76, &msta->wcid,
1006 mt76_connac_mcu_wtbl_generic_tlv(&dev->mt76, skb, vif, sta, tlv,
1010 mt76_connac_mcu_wtbl_ht_tlv(&dev->mt76, skb, sta, tlv,
1022 int sts = hweight16(phy->mt76->chainmask);
1085 bf->nrow = hweight8(phy->mt76->chainmask) - 1;
1095 struct ieee80211_sta_vht_cap *vc = &phy->mt76->sband_5g.sband.vht_cap;
1098 u8 tx_ant = hweight8(phy->mt76->chainmask) - 1;
1134 mt76_connac_get_he_phy_cap(phy->mt76, vif);
1193 int tx_ant = hweight8(phy->mt76->chainmask) - 1;
1262 int tx_ant = hweight8(phy->mt76->chainmask) - 1;
1319 skb = mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mvif->mt76,
1348 return mt76_mcu_skb_send_msg(&dev->mt76, skb,
1362 skb = mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mvif->mt76,
1369 wtbl_hdr = mt76_connac_mcu_alloc_wtbl_req(&dev->mt76, &msta->wcid,
1376 ret = mt76_mcu_skb_send_msg(&dev->mt76, skb,
1390 struct mt76_phy *mphy = mvif->phy->mt76;
1403 struct cfg80211_chan_def *chandef = &mvif->phy->mt76->chandef;
1492 struct mt76_phy *mphy = mvif->phy->mt76;
1598 skb = mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mvif->mt76,
1615 ret = mt76_mcu_skb_send_msg(&dev->mt76, skb,
1644 .val = cpu_to_le32(mvif->mt76.idx % 16),
1651 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_DRR_CTRL), &req,
1665 skb = mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mvif->mt76,
1671 mt76_connac_mcu_sta_basic_tlv(&dev->mt76, skb, vif, sta, enable,
1672 !rcu_access_pointer(dev->mt76.wcid[msta->wcid.idx]));
1711 ret = mt76_connac_mcu_sta_wed_update(&dev->mt76, skb);
1715 return mt76_mcu_skb_send_msg(&dev->mt76, skb,
1722 struct mtk_wed_device *wed = &dev->mt76.mmio.wed;
1759 .omac_idx = mvif->mt76.omac_idx,
1760 .band_idx = mvif->mt76.band_idx,
1768 .band_idx = mvif->mt76.band_idx,
1772 if (mvif->mt76.omac_idx >= REPEATER_BSSID_START)
1776 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(DEV_INFO_UPDATE),
1860 struct mt76_wcid *wcid = &dev->mt76.global_wcid;
1884 mt7915_mac_write_txwi(&dev->mt76, (__le32 *)buf, skb, wcid, 0, NULL,
1898 struct cfg80211_chan_def *chandef = &mvif->phy->mt76->chandef;
1900 struct mt76_wcid *wcid = &dev->mt76.global_wcid;
1913 rskb = __mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mvif->mt76, NULL,
1945 dev_err(dev->mt76.dev, "inband discovery size limit exceed\n");
1963 mt7915_mac_write_txwi(&dev->mt76, (__le32 *)buf, skb, wcid, 0, NULL,
1969 return mt76_mcu_skb_send_msg(&phy->dev->mt76, rskb,
1990 rskb = __mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mvif->mt76,
2009 dev_err(dev->mt76.dev, "Bcn size limit exceed\n");
2024 return mt76_mcu_skb_send_msg(&phy->dev->mt76, rskb,
2033 dev_err(dev->mt76.dev, "Timeout for driver own\n");
2052 dev_err(dev->mt76.dev, "Timeout for initializing firmware\n");
2065 mt76_connac_mcu_restart(&dev->mt76);
2068 dev_err(dev->mt76.dev,
2074 ret = mt76_connac2_load_patch(&dev->mt76, fw_name_var(dev, ROM_PATCH));
2078 ret = mt76_connac2_load_ram(&dev->mt76, fw_name_var(dev, FIRMWARE_WM),
2087 mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_FWDL], false);
2089 dev_dbg(dev->mt76.dev, "Firmware init done\n");
2104 return mt76_mcu_send_msg(&dev->mt76, MCU_WA_EXT_CMD(FW_LOG_2_HOST),
2107 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(FW_LOG_2_HOST), &data,
2125 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(FW_DBG_CTRL), &data,
2139 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MURU_CTRL), &data,
2155 .band_idx = phy->mt76->band_idx,
2158 ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_EXT_CMD(MURU_CTRL),
2214 return mt76_mcu_send_msg(&dev->mt76, MCU_WA_EXT_CMD(MWDS_SUPPORT), &req,
2229 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MURU_CTRL), &req,
2261 ret = mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(RX_AIRTIME_CTRL), &req,
2270 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(RX_AIRTIME_CTRL), &req,
2294 return mt76_mcu_send_msg(&dev->mt76, MCU_WA_PARAM_CMD(SET), &req,
2312 ret = mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(RED_ENABLE), &req,
2353 if ((mtk_wed_device_active(&dev->mt76.mmio.wed) &&
2354 is_mt7915(&dev->mt76)) ||
2355 !mtk_wed_get_rx_capa(&dev->mt76.mmio.wed))
2371 return mt7915_mcu_set_red(dev, mtk_wed_device_active(&dev->mt76.mmio.wed));
2382 dev->mt76.mcu_ops = &mt7915_mcu_ops;
2389 mt76_connac_mcu_restart(&dev->mt76);
2391 dev_err(dev->mt76.dev, "Failed to exit mcu\n");
2400 skb_queue_purge(&dev->mt76.mcu.res_q);
2420 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(RX_HDR_TRANS),
2449 ret = mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(RX_HDR_TRANS),
2457 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MAC_INIT_CTRL),
2468 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(EDCA_UPDATE), req,
2488 e->queue = ac + mvif->mt76.wmm_idx * MT76_CONNAC_MAX_WMM_SETS;
2517 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_RDD_TH), &req,
2548 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_RDD_TH), &req,
2600 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_RDD_TH), &req,
2610 struct mt76_phy *mphy = phy->mt76;
2632 req.band_idx = phy->mt76->band_idx;
2640 req.band_idx = phy->mt76->band_idx;
2655 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(OFFCH_SCAN_CTRL),
2666 err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_STOP, MT_RX_SEL2,
2680 switch (dev->mt76.region) {
2693 return mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_START, MT_RX_SEL2,
2705 struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
2707 u8 band = phy->mt76->band_idx;
2729 .tx_path_num = hweight16(phy->mt76->chainmask),
2730 .rx_path = phy->mt76->chainmask >> (dev->chainshift * band),
2736 if (phy->mt76->test.tx_antenna_mask &&
2737 mt76_testmode_enabled(phy->mt76)) {
2738 req.tx_path_num = fls(phy->mt76->test.tx_antenna_mask);
2739 req.rx_path = phy->mt76->test.tx_antenna_mask;
2743 if (mt76_connac_spe_idx(phy->mt76->antenna_mask))
2744 req.tx_path_num = fls(phy->mt76->antenna_mask);
2746 if (phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR)
2748 else if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL ||
2749 phy->mt76->hw->conf.flags & IEEE80211_CONF_IDLE)
2751 else if (!cfg80211_reg_can_beacon(phy->mt76->hw->wiphy, chandef,
2766 return mt76_mcu_send_msg(&dev->mt76, cmd, &req, sizeof(req), true);
2777 u8 *eep = (u8 *)dev->mt76.eeprom.data;
2790 skb = mt76_mcu_msg_alloc(&dev->mt76, NULL,
2802 ret = mt76_mcu_skb_send_msg(&dev->mt76, skb,
2821 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(EFUSE_BUFFER_MODE),
2836 ret = mt76_mcu_send_and_get_msg(&dev->mt76,
2843 buf = dev->mt76.eeprom.data + le32_to_cpu(res->addr);
2863 ret = mt76_mcu_send_and_get_msg(&dev->mt76,
2891 skb = mt76_mcu_msg_alloc(&dev->mt76, NULL, sizeof(req) + len);
2900 return mt76_mcu_skb_send_msg(&dev->mt76, skb, cmd, false);
2905 u8 idx = 0, *cal = dev->cal, *eep = dev->mt76.eeprom.data;
2907 u32 offs = is_mt7915(&dev->mt76) ? MT_EE_DO_PRE_CAL : MT_EE_DO_PRE_CAL_V2;
3002 if (!is_mt7915(&dev->mt76)) {
3003 if (is_mt7981(&dev->mt76)) {
3040 struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
3042 u32 offs = is_mt7915(&dev->mt76) ? MT_EE_DO_PRE_CAL : MT_EE_DO_PRE_CAL_V2;
3044 u8 *cal = dev->cal, *eep = dev->mt76.eeprom.data;
3045 u8 dpd_mask, cal_num = is_mt7915(&dev->mt76) ? 2 : 3;
3091 struct mt76_channel_state *state = phy->mt76->chan_state;
3101 if (is_mt7915(&dev->mt76)) {
3125 req[i].band = cpu_to_le32(phy->mt76->band_idx);
3129 ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_EXT_CMD(GET_MIB_INFO),
3138 cc_tx = is_mt7915(&dev->mt76) ? __res_u64(1) - __res_u64(4) : __res_u64(1);
3171 .band_idx = phy->mt76->band_idx,
3174 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(THERMAL_CTRL), &req,
3182 .band_idx = phy->mt76->band_idx,
3193 ret = mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(THERMAL_PROT),
3213 .band_idx = phy->mt76->band_idx,
3221 ret = mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(THERMAL_PROT),
3234 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(THERMAL_PROT),
3248 .band_idx = phy->mt76->band_idx,
3252 return mt76_mcu_send_msg(&dev->mt76,
3263 struct mt76_phy *mphy = phy->mt76;
3273 .band_idx = phy->mt76->band_idx,
3315 return mt76_mcu_send_msg(&dev->mt76,
3323 struct mt76_phy *mphy = phy->mt76;
3327 .band_idx = phy->mt76->band_idx,
3359 return mt76_mcu_send_msg(&dev->mt76,
3376 .band_idx = phy->mt76->band_idx,
3382 ret = mt76_mcu_send_and_get_msg(&dev->mt76,
3415 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(ATE_CTRL), &req,
3429 .band_idx = phy->mt76->band_idx,
3433 return mt76_mcu_send_msg(&dev->mt76,
3451 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_SER_TRIGGER),
3500 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(TXBF_ACTION), &req,
3511 .band_idx = phy->mt76->band_idx,
3515 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_SPR), &req,
3542 .band_idx = phy->mt76->band_idx,
3569 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_SPR), &req,
3579 u8 omac = mvif->mt76.omac_idx;
3591 .band_idx = phy->mt76->band_idx,
3609 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_SPR), &req,
3630 .band_idx = phy->mt76->band_idx,
3647 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_SPR), &req,
3697 struct mt76_phy *mphy = phy->mt76;
3704 .band = mvif->mt76.band_idx,
3713 ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_EXT_CMD(PHY_STAT_INFO),
3735 rate->mcs = mt76_get_rate(&dev->mt76, sband, rate->mcs, cck);
3805 skb = __mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mvif->mt76,
3816 return mt76_mcu_skb_send_msg(&dev->mt76, skb,
3848 .own_mac_idx = mvif->mt76.omac_idx,
3852 .bss_idx = mvif->mt76.idx,
3866 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(TWT_AGRT_UPDATE),
3895 if (is_mt7915(&dev->mt76)) {
3904 ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_WA_PARAM_CMD(QUERY),
3909 if (!is_mt7915(&dev->mt76))
3915 if (is_mt7915(&dev->mt76))
3925 wcid = rcu_dereference(dev->mt76.wcid[wlan_idx]);
3953 return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(RF_REG_ACCESS),
3956 ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_EXT_QUERY(RF_REG_ACCESS),