Lines Matching defs:rtwdev

23 	struct rtw89_dev *rtwdev = hw->priv;
34 rtw89_debug(rtwdev, RTW89_DBG_TXRX, "ops_tx during offchan\n");
39 ret = rtw89_core_tx_write(rtwdev, vif, sta, skb, &qsel);
41 rtw89_err(rtwdev, "failed to transmit skb: %d\n", ret);
45 rtw89_core_tx_kick_off(rtwdev, qsel);
51 struct rtw89_dev *rtwdev = hw->priv;
54 queue_work(rtwdev->txq_wq, &rtwdev->txq_work);
59 struct rtw89_dev *rtwdev = hw->priv;
62 mutex_lock(&rtwdev->mutex);
63 ret = rtw89_core_start(rtwdev);
64 mutex_unlock(&rtwdev->mutex);
71 struct rtw89_dev *rtwdev = hw->priv;
73 mutex_lock(&rtwdev->mutex);
74 rtw89_core_stop(rtwdev);
75 mutex_unlock(&rtwdev->mutex);
80 struct rtw89_dev *rtwdev = hw->priv;
83 cancel_work_sync(&rtwdev->ips_work);
85 mutex_lock(&rtwdev->mutex);
86 rtw89_leave_ps_mode(rtwdev);
90 rtw89_leave_ips(rtwdev);
93 rtw89_config_entity_chandef(rtwdev, RTW89_SUB_ENTITY_0,
95 rtw89_set_channel(rtwdev);
100 !rtwdev->scanning)
101 rtw89_enter_ips(rtwdev);
103 mutex_unlock(&rtwdev->mutex);
111 struct rtw89_dev *rtwdev = hw->priv;
115 rtw89_debug(rtwdev, RTW89_DBG_STATE, "add vif %pM type %d, p2p %d\n",
118 mutex_lock(&rtwdev->mutex);
120 rtw89_leave_ips_by_hwflags(rtwdev);
122 if (RTW89_CHK_FW_FEATURE(BEACON_FILTER, &rtwdev->fw))
126 rtwvif->rtwdev = rtwdev;
129 list_add_tail(&rtwvif->list, &rtwdev->rtwvifs_list);
132 rtw89_leave_ps_mode(rtwdev);
134 rtw89_traffic_stats_init(rtwdev, &rtwvif->stats);
136 rtwvif->port = rtw89_core_acquire_bit_map(rtwdev->hw_port,
154 ret = rtw89_mac_add_vif(rtwdev, rtwvif);
156 rtw89_core_release_bit_map(rtwdev->hw_port, rtwvif->port);
161 rtw89_core_txq_init(rtwdev, vif->txq);
163 rtw89_btc_ntfy_role_info(rtwdev, rtwvif, NULL, BTC_ROLE_START);
165 rtw89_recalc_lps(rtwdev);
167 mutex_unlock(&rtwdev->mutex);
175 struct rtw89_dev *rtwdev = hw->priv;
178 rtw89_debug(rtwdev, RTW89_DBG_STATE, "remove vif %pM type %d p2p %d\n",
184 mutex_lock(&rtwdev->mutex);
185 rtw89_leave_ps_mode(rtwdev);
186 rtw89_btc_ntfy_role_info(rtwdev, rtwvif, NULL, BTC_ROLE_STOP);
187 rtw89_mac_remove_vif(rtwdev, rtwvif);
188 rtw89_core_release_bit_map(rtwdev->hw_port, rtwvif->port);
190 rtw89_recalc_lps(rtwdev);
191 rtw89_enter_ips_by_hwflags(rtwdev);
193 mutex_unlock(&rtwdev->mutex);
200 struct rtw89_dev *rtwdev = hw->priv;
203 set_bit(RTW89_FLAG_CHANGING_INTERFACE, rtwdev->flags);
205 rtw89_debug(rtwdev, RTW89_DBG_STATE, "change vif %pM (%d)->(%d), p2p (%d)->(%d)\n",
215 rtw89_warn(rtwdev, "failed to change interface %d\n", ret);
217 clear_bit(RTW89_FLAG_CHANGING_INTERFACE, rtwdev->flags);
227 struct rtw89_dev *rtwdev = hw->priv;
228 const struct rtw89_mac_gen_def *mac = rtwdev->chip->mac_def;
231 mutex_lock(&rtwdev->mutex);
232 rtw89_leave_ps_mode(rtwdev);
239 rtwdev->hal.rx_fltr &= ~B_AX_A_MC;
241 rtwdev->hal.rx_fltr |= B_AX_A_MC;
245 rtwdev->hal.rx_fltr |= B_AX_A_CRC32_ERR;
247 rtwdev->hal.rx_fltr &= ~B_AX_A_CRC32_ERR;
251 rtwdev->hal.rx_fltr &= ~B_AX_A_A1_MATCH;
253 rtwdev->hal.rx_fltr |= B_AX_A_A1_MATCH;
257 rtwdev->hal.rx_fltr &= ~B_AX_A_BCN_CHK_EN;
258 rtwdev->hal.rx_fltr &= ~B_AX_A_BC;
259 rtwdev->hal.rx_fltr &= ~B_AX_A_A1_MATCH;
261 rtwdev->hal.rx_fltr |= B_AX_A_BCN_CHK_EN;
262 rtwdev->hal.rx_fltr |= B_AX_A_BC;
263 rtwdev->hal.rx_fltr |= B_AX_A_A1_MATCH;
268 rtwdev->hal.rx_fltr &= ~B_AX_A_BC_CAM_MATCH;
269 rtwdev->hal.rx_fltr &= ~B_AX_A_UC_CAM_MATCH;
271 rtwdev->hal.rx_fltr |= B_AX_A_BC_CAM_MATCH;
272 rtwdev->hal.rx_fltr |= B_AX_A_UC_CAM_MATCH;
276 rx_fltr = rtwdev->hal.rx_fltr;
283 if (rtwdev->scanning) {
289 rtw89_write32_mask(rtwdev,
290 rtw89_mac_reg_by_idx(rtwdev, mac->rx_fltr, RTW89_MAC_0),
293 if (!rtwdev->dbcc_en)
295 rtw89_write32_mask(rtwdev,
296 rtw89_mac_reg_by_idx(rtwdev, mac->rx_fltr, RTW89_MAC_1),
301 mutex_unlock(&rtwdev->mutex);
311 static u8 rtw89_aifsn_to_aifs(struct rtw89_dev *rtwdev,
315 const struct rtw89_chan *chan = rtw89_chan_get(rtwdev,
326 static void ____rtw89_conf_tx_edca(struct rtw89_dev *rtwdev,
337 aifs = rtw89_aifsn_to_aifs(rtwdev, rtwvif, params->aifs);
342 rtw89_fw_h2c_set_edca(rtwdev, rtwvif, ac_to_fw_idx[ac], val);
355 static void ____rtw89_conf_tx_mu_edca(struct rtw89_dev *rtwdev,
360 int gen = rtwdev->chip->chip_gen;
371 aifs = aifsn ? rtw89_aifsn_to_aifs(rtwdev, rtwvif, aifsn) : 0;
377 reg = rtw89_mac_reg_by_idx(rtwdev, ac_to_mu_edca_param[ac][gen], rtwvif->mac_idx);
378 rtw89_write32(rtwdev, reg, val);
380 rtw89_mac_set_hw_muedca_ctrl(rtwdev, rtwvif, true);
383 static void __rtw89_conf_tx(struct rtw89_dev *rtwdev,
386 ____rtw89_conf_tx_edca(rtwdev, rtwvif, ac);
387 ____rtw89_conf_tx_mu_edca(rtwdev, rtwvif, ac);
390 static void rtw89_conf_tx(struct rtw89_dev *rtwdev,
396 __rtw89_conf_tx(rtwdev, rtwvif, ac);
399 static void rtw89_station_mode_sta_assoc(struct rtw89_dev *rtwdev,
409 rtw89_err(rtwdev, "can't find sta to set sta_assoc state\n");
415 rtw89_core_sta_assoc(rtwdev, vif, sta);
421 struct rtw89_dev *rtwdev = hw->priv;
424 mutex_lock(&rtwdev->mutex);
425 rtw89_leave_ps_mode(rtwdev);
429 rtw89_station_mode_sta_assoc(rtwdev, vif);
430 rtw89_phy_set_bss_color(rtwdev, vif);
431 rtw89_chip_cfg_txpwr_ul_tb_offset(rtwdev, vif);
432 rtw89_mac_port_update(rtwdev, rtwvif);
433 rtw89_mac_set_he_obss_narrow_bw_ru(rtwdev, vif);
435 rtw89_queue_chanctx_work(rtwdev);
440 if (rtwdev->scanning)
441 rtw89_hw_scan_abort(rtwdev, rtwdev->scan_info.scanning_vif);
446 rtw89_recalc_lps(rtwdev);
451 mutex_unlock(&rtwdev->mutex);
459 struct rtw89_dev *rtwdev = hw->priv;
462 mutex_lock(&rtwdev->mutex);
463 rtw89_leave_ps_mode(rtwdev);
467 rtw89_cam_bssid_changed(rtwdev, rtwvif);
468 rtw89_fw_h2c_cam(rtwdev, rtwvif, NULL, NULL);
473 rtw89_chip_h2c_update_beacon(rtwdev, rtwvif);
476 rtw89_conf_tx(rtwdev, rtwvif);
479 rtw89_phy_set_bss_color(rtwdev, vif);
482 rtw89_mac_bf_set_gid_table(rtwdev, vif, conf);
485 rtw89_core_update_p2p_ps(rtwdev, vif);
488 rtw89_fw_h2c_set_bcn_fltr_cfg(rtwdev, vif, true);
491 rtw89_reg_6ghz_recalc(rtwdev, rtwvif, true);
493 mutex_unlock(&rtwdev->mutex);
500 struct rtw89_dev *rtwdev = hw->priv;
504 mutex_lock(&rtwdev->mutex);
506 chan = rtw89_chan_get(rtwdev, rtwvif->sub_entity_idx);
508 mutex_unlock(&rtwdev->mutex);
512 if (rtwdev->scanning)
513 rtw89_hw_scan_abort(rtwdev, rtwdev->scan_info.scanning_vif);
516 rtw89_cam_bssid_changed(rtwdev, rtwvif);
517 rtw89_mac_port_update(rtwdev, rtwvif);
518 rtw89_chip_h2c_assoc_cmac_tbl(rtwdev, vif, NULL);
519 rtw89_fw_h2c_role_maintain(rtwdev, rtwvif, NULL, RTW89_ROLE_TYPE_CHANGE);
520 rtw89_fw_h2c_join_info(rtwdev, rtwvif, NULL, true);
521 rtw89_fw_h2c_cam(rtwdev, rtwvif, NULL, NULL);
522 rtw89_chip_rfk_channel(rtwdev);
524 rtw89_queue_chanctx_work(rtwdev);
525 mutex_unlock(&rtwdev->mutex);
534 struct rtw89_dev *rtwdev = hw->priv;
537 mutex_lock(&rtwdev->mutex);
538 rtw89_mac_stop_ap(rtwdev, rtwvif);
539 rtw89_chip_h2c_assoc_cmac_tbl(rtwdev, vif, NULL);
540 rtw89_fw_h2c_join_info(rtwdev, rtwvif, NULL, true);
541 mutex_unlock(&rtwdev->mutex);
547 struct rtw89_dev *rtwdev = hw->priv;
551 ieee80211_queue_work(rtwdev->hw, &rtwvif->update_beacon_work);
561 struct rtw89_dev *rtwdev = hw->priv;
564 mutex_lock(&rtwdev->mutex);
565 rtw89_leave_ps_mode(rtwdev);
567 __rtw89_conf_tx(rtwdev, rtwvif, ac);
568 mutex_unlock(&rtwdev->mutex);
579 struct rtw89_dev *rtwdev = hw->priv;
583 return rtw89_core_sta_add(rtwdev, vif, sta);
589 return rtw89_core_sta_assoc(rtwdev, vif, sta);
594 return rtw89_core_sta_disassoc(rtwdev, vif, sta);
598 return rtw89_core_sta_disconnect(rtwdev, vif, sta);
602 return rtw89_core_sta_remove(rtwdev, vif, sta);
613 struct rtw89_dev *rtwdev = hw->priv;
616 mutex_lock(&rtwdev->mutex);
617 rtw89_leave_ps_mode(rtwdev);
619 mutex_unlock(&rtwdev->mutex);
629 struct rtw89_dev *rtwdev = hw->priv;
632 mutex_lock(&rtwdev->mutex);
633 rtw89_leave_ps_mode(rtwdev);
637 rtw89_btc_ntfy_specific_packet(rtwdev, PACKET_EAPOL_END);
638 ret = rtw89_cam_sec_key_add(rtwdev, vif, sta, key);
640 rtw89_err(rtwdev, "failed to add key to sec cam\n");
645 rtw89_hci_flush_queues(rtwdev, BIT(rtwdev->hw->queues) - 1,
647 rtw89_mac_flush_txq(rtwdev, BIT(rtwdev->hw->queues) - 1, false);
648 ret = rtw89_cam_sec_key_del(rtwdev, vif, sta, key, true);
650 rtw89_err(rtwdev, "failed to remove key from sec cam\n");
657 mutex_unlock(&rtwdev->mutex);
666 struct rtw89_dev *rtwdev = hw->priv;
679 mutex_lock(&rtwdev->mutex);
682 rtw89_chip_h2c_ampdu_cmac_tbl(rtwdev, vif, sta);
683 mutex_unlock(&rtwdev->mutex);
687 mutex_lock(&rtwdev->mutex);
692 rtw89_leave_ps_mode(rtwdev);
693 rtw89_chip_h2c_ampdu_cmac_tbl(rtwdev, vif, sta);
694 mutex_unlock(&rtwdev->mutex);
697 mutex_lock(&rtwdev->mutex);
698 rtw89_chip_h2c_ba_cam(rtwdev, rtwsta, true, params);
699 mutex_unlock(&rtwdev->mutex);
702 mutex_lock(&rtwdev->mutex);
703 rtw89_chip_h2c_ba_cam(rtwdev, rtwsta, false, params);
704 mutex_unlock(&rtwdev->mutex);
716 struct rtw89_dev *rtwdev = hw->priv;
718 mutex_lock(&rtwdev->mutex);
719 rtw89_leave_ps_mode(rtwdev);
720 if (test_bit(RTW89_FLAG_POWERON, rtwdev->flags))
721 rtw89_mac_update_rts_threshold(rtwdev, RTW89_MAC_0);
722 mutex_unlock(&rtwdev->mutex);
739 void __rtw89_drop_packets(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif)
745 rtw89_mac_pkt_drop_vif(rtwdev, rtwvif);
747 rtw89_for_each_rtwvif(rtwdev, rtwvif)
748 rtw89_mac_pkt_drop_vif(rtwdev, rtwvif);
755 struct rtw89_dev *rtwdev = hw->priv;
757 mutex_lock(&rtwdev->mutex);
758 rtw89_leave_lps(rtwdev);
759 rtw89_hci_flush_queues(rtwdev, queues, drop);
761 if (drop && !RTW89_CHK_FW_FEATURE(NO_PACKET_DROP, &rtwdev->fw))
762 __rtw89_drop_packets(rtwdev, vif);
764 rtw89_mac_flush_txq(rtwdev, queues, drop);
766 mutex_unlock(&rtwdev->mutex);
770 struct rtw89_dev *rtwdev;
786 rtw89_phy_ra_updata_sta(br_data->rtwdev, sta, IEEE80211_RC_SUPP_RATES_CHANGED);
789 static void rtw89_ra_mask_info_update(struct rtw89_dev *rtwdev,
793 struct rtw89_iter_bitrate_mask_data br_data = { .rtwdev = rtwdev,
797 ieee80211_iterate_stations_atomic(rtwdev->hw, rtw89_ra_mask_info_update_iter,
805 struct rtw89_dev *rtwdev = hw->priv;
807 mutex_lock(&rtwdev->mutex);
808 rtw89_phy_rate_pattern_vif(rtwdev, vif, mask);
809 rtw89_ra_mask_info_update(rtwdev, vif, mask);
810 mutex_unlock(&rtwdev->mutex);
818 struct rtw89_dev *rtwdev = hw->priv;
819 struct rtw89_hal *hal = &rtwdev->hal;
828 mutex_lock(&rtwdev->mutex);
833 mutex_unlock(&rtwdev->mutex);
841 struct rtw89_dev *rtwdev = hw->priv;
842 struct rtw89_hal *hal = &rtwdev->hal;
854 struct rtw89_dev *rtwdev = hw->priv;
857 mutex_lock(&rtwdev->mutex);
858 rtw89_core_scan_start(rtwdev, rtwvif, mac_addr, false);
859 mutex_unlock(&rtwdev->mutex);
865 struct rtw89_dev *rtwdev = hw->priv;
867 mutex_lock(&rtwdev->mutex);
868 rtw89_core_scan_complete(rtwdev, vif, false);
869 mutex_unlock(&rtwdev->mutex);
875 struct rtw89_dev *rtwdev = hw->priv;
878 rtw89_ser_recfg_done(rtwdev);
884 struct rtw89_dev *rtwdev = hw->priv;
888 if (!RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD, &rtwdev->fw))
891 if (rtwdev->scanning || rtwvif->offchan)
894 mutex_lock(&rtwdev->mutex);
895 rtw89_hw_scan_start(rtwdev, vif, req);
896 ret = rtw89_hw_scan_offload(rtwdev, vif, true);
898 rtw89_hw_scan_abort(rtwdev, vif);
899 rtw89_err(rtwdev, "HW scan failed with status: %d\n", ret);
901 mutex_unlock(&rtwdev->mutex);
909 struct rtw89_dev *rtwdev = hw->priv;
911 if (!RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD, &rtwdev->fw))
914 if (!rtwdev->scanning)
917 mutex_lock(&rtwdev->mutex);
918 rtw89_hw_scan_abort(rtwdev, vif);
919 mutex_unlock(&rtwdev->mutex);
926 struct rtw89_dev *rtwdev = hw->priv;
928 rtw89_phy_ra_updata_sta(rtwdev, sta, changed);
934 struct rtw89_dev *rtwdev = hw->priv;
937 mutex_lock(&rtwdev->mutex);
938 ret = rtw89_chanctx_ops_add(rtwdev, ctx);
939 mutex_unlock(&rtwdev->mutex);
947 struct rtw89_dev *rtwdev = hw->priv;
949 mutex_lock(&rtwdev->mutex);
950 rtw89_chanctx_ops_remove(rtwdev, ctx);
951 mutex_unlock(&rtwdev->mutex);
958 struct rtw89_dev *rtwdev = hw->priv;
960 mutex_lock(&rtwdev->mutex);
961 rtw89_chanctx_ops_change(rtwdev, ctx, changed);
962 mutex_unlock(&rtwdev->mutex);
970 struct rtw89_dev *rtwdev = hw->priv;
974 mutex_lock(&rtwdev->mutex);
975 ret = rtw89_chanctx_ops_assign_vif(rtwdev, rtwvif, ctx);
976 mutex_unlock(&rtwdev->mutex);
986 struct rtw89_dev *rtwdev = hw->priv;
989 mutex_lock(&rtwdev->mutex);
990 rtw89_chanctx_ops_unassign_vif(rtwdev, rtwvif, ctx);
991 mutex_unlock(&rtwdev->mutex);
1000 struct rtw89_dev *rtwdev = hw->priv;
1007 mutex_lock(&rtwdev->mutex);
1010 mutex_unlock(&rtwdev->mutex);
1014 if (rtwdev->scanning)
1015 rtw89_hw_scan_abort(rtwdev, rtwdev->scan_info.scanning_vif);
1026 rtw89_roc_start(rtwdev, rtwvif);
1028 mutex_unlock(&rtwdev->mutex);
1036 struct rtw89_dev *rtwdev = hw->priv;
1044 mutex_lock(&rtwdev->mutex);
1045 rtw89_roc_end(rtwdev, rtwvif);
1046 mutex_unlock(&rtwdev->mutex);
1055 struct rtw89_dev *rtwdev = rtwsta->rtwvif->rtwdev;
1057 rtw89_core_set_tid_config(rtwdev, sta, tid_config);
1065 struct rtw89_dev *rtwdev = hw->priv;
1067 mutex_lock(&rtwdev->mutex);
1069 rtw89_core_set_tid_config(rtwdev, sta, tid_config);
1071 ieee80211_iterate_stations_atomic(rtwdev->hw,
1074 mutex_unlock(&rtwdev->mutex);
1083 struct rtw89_dev *rtwdev = hw->priv;
1086 set_bit(RTW89_FLAG_FORBIDDEN_TRACK_WROK, rtwdev->flags);
1087 cancel_delayed_work_sync(&rtwdev->track_work);
1089 mutex_lock(&rtwdev->mutex);
1090 ret = rtw89_wow_suspend(rtwdev, wowlan);
1091 mutex_unlock(&rtwdev->mutex);
1094 rtw89_warn(rtwdev, "failed to suspend for wow %d\n", ret);
1095 clear_bit(RTW89_FLAG_FORBIDDEN_TRACK_WROK, rtwdev->flags);
1104 struct rtw89_dev *rtwdev = hw->priv;
1107 mutex_lock(&rtwdev->mutex);
1108 ret = rtw89_wow_resume(rtwdev);
1110 rtw89_warn(rtwdev, "failed to resume for wow %d\n", ret);
1111 mutex_unlock(&rtwdev->mutex);
1113 clear_bit(RTW89_FLAG_FORBIDDEN_TRACK_WROK, rtwdev->flags);
1114 ieee80211_queue_delayed_work(rtwdev->hw, &rtwdev->track_work,
1122 struct rtw89_dev *rtwdev = hw->priv;
1124 device_set_wakeup_enable(rtwdev->dev, enabled);
1131 struct rtw89_dev *rtwdev = hw->priv;
1132 struct rtw89_wow_param *rtw_wow = &rtwdev->wow;
1137 rtw89_warn(rtwdev, "kek or kck length over fw limit\n");
1141 mutex_lock(&rtwdev->mutex);
1146 mutex_unlock(&rtwdev->mutex);