Lines Matching refs:mvm

68 void iwl_mvm_tof_init(struct iwl_mvm *mvm)  in iwl_mvm_tof_init()  argument
70 struct iwl_mvm_tof_data *tof_data = &mvm->tof_data; in iwl_mvm_tof_init()
72 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) in iwl_mvm_tof_init()
95 mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID; in iwl_mvm_tof_init()
98 void iwl_mvm_tof_clean(struct iwl_mvm *mvm) in iwl_mvm_tof_clean() argument
100 struct iwl_mvm_tof_data *tof_data = &mvm->tof_data; in iwl_mvm_tof_clean()
102 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) in iwl_mvm_tof_clean()
106 mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID; in iwl_mvm_tof_clean()
119 int iwl_mvm_tof_config_cmd(struct iwl_mvm *mvm) in iwl_mvm_tof_config_cmd() argument
121 struct iwl_tof_config_cmd *cmd = &mvm->tof_data.tof_cfg; in iwl_mvm_tof_config_cmd()
124 lockdep_assert_held(&mvm->mutex); in iwl_mvm_tof_config_cmd()
126 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) in iwl_mvm_tof_config_cmd()
129 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_tof_config_cmd()
133 IWL_DEBUG_INFO(mvm, "ToF is not supported (non bss vif)\n"); in iwl_mvm_tof_config_cmd()
137 mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID; in iwl_mvm_tof_config_cmd()
138 return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD, in iwl_mvm_tof_config_cmd()
143 int iwl_mvm_tof_range_abort_cmd(struct iwl_mvm *mvm, u8 id) in iwl_mvm_tof_range_abort_cmd() argument
150 lockdep_assert_held(&mvm->mutex); in iwl_mvm_tof_range_abort_cmd()
152 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) in iwl_mvm_tof_range_abort_cmd()
155 if (id != mvm->tof_data.active_range_request) { in iwl_mvm_tof_range_abort_cmd()
156 IWL_ERR(mvm, "Invalid range request id %d (active %d)\n", in iwl_mvm_tof_range_abort_cmd()
157 id, mvm->tof_data.active_range_request); in iwl_mvm_tof_range_abort_cmd()
162 mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID; in iwl_mvm_tof_range_abort_cmd()
164 return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD, in iwl_mvm_tof_range_abort_cmd()
170 int iwl_mvm_tof_responder_cmd(struct iwl_mvm *mvm, in iwl_mvm_tof_responder_cmd() argument
173 struct iwl_tof_responder_config_cmd *cmd = &mvm->tof_data.responder_cfg; in iwl_mvm_tof_responder_cmd()
176 lockdep_assert_held(&mvm->mutex); in iwl_mvm_tof_responder_cmd()
178 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) in iwl_mvm_tof_responder_cmd()
183 IWL_ERR(mvm, "Cannot start responder, not in AP mode\n"); in iwl_mvm_tof_responder_cmd()
189 return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD, in iwl_mvm_tof_responder_cmd()
195 int iwl_mvm_tof_range_request_cmd(struct iwl_mvm *mvm, in iwl_mvm_tof_range_request_cmd() argument
200 .len = { sizeof(mvm->tof_data.range_req), }, in iwl_mvm_tof_range_request_cmd()
205 lockdep_assert_held(&mvm->mutex); in iwl_mvm_tof_range_request_cmd()
207 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) in iwl_mvm_tof_range_request_cmd()
211 IWL_ERR(mvm, "Cannot send range request, not STA mode\n"); in iwl_mvm_tof_range_request_cmd()
216 if (mvm->tof_data.active_range_request != in iwl_mvm_tof_range_request_cmd()
218 IWL_ERR(mvm, "Cannot send range req, already active req %d\n", in iwl_mvm_tof_range_request_cmd()
219 mvm->tof_data.active_range_request); in iwl_mvm_tof_range_request_cmd()
223 mvm->tof_data.active_range_request = mvm->tof_data.range_req.request_id; in iwl_mvm_tof_range_request_cmd()
225 cmd.data[0] = &mvm->tof_data.range_req; in iwl_mvm_tof_range_request_cmd()
226 return iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_tof_range_request_cmd()
229 int iwl_mvm_tof_range_request_ext_cmd(struct iwl_mvm *mvm, in iwl_mvm_tof_range_request_ext_cmd() argument
232 lockdep_assert_held(&mvm->mutex); in iwl_mvm_tof_range_request_ext_cmd()
234 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) in iwl_mvm_tof_range_request_ext_cmd()
238 IWL_ERR(mvm, "Cannot send ext range req, not in STA mode\n"); in iwl_mvm_tof_range_request_ext_cmd()
242 return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD, in iwl_mvm_tof_range_request_ext_cmd()
244 0, sizeof(mvm->tof_data.range_req_ext), in iwl_mvm_tof_range_request_ext_cmd()
245 &mvm->tof_data.range_req_ext); in iwl_mvm_tof_range_request_ext_cmd()
248 static int iwl_mvm_tof_range_resp(struct iwl_mvm *mvm, void *data) in iwl_mvm_tof_range_resp() argument
252 if (resp->request_id != mvm->tof_data.active_range_request) { in iwl_mvm_tof_range_resp()
253 IWL_ERR(mvm, "Request id mismatch, got %d, active %d\n", in iwl_mvm_tof_range_resp()
254 resp->request_id, mvm->tof_data.active_range_request); in iwl_mvm_tof_range_resp()
258 memcpy(&mvm->tof_data.range_resp, resp, in iwl_mvm_tof_range_resp()
260 mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID; in iwl_mvm_tof_range_resp()
265 static int iwl_mvm_tof_mcsi_notif(struct iwl_mvm *mvm, void *data) in iwl_mvm_tof_mcsi_notif() argument
269 IWL_DEBUG_INFO(mvm, "MCSI notification, token %d\n", resp->token); in iwl_mvm_tof_mcsi_notif()
273 static int iwl_mvm_tof_nb_report_notif(struct iwl_mvm *mvm, void *data) in iwl_mvm_tof_nb_report_notif() argument
278 IWL_DEBUG_INFO(mvm, "NB report, bssid %pM, token %d, status 0x%x\n", in iwl_mvm_tof_nb_report_notif()
283 void iwl_mvm_tof_resp_handler(struct iwl_mvm *mvm, in iwl_mvm_tof_resp_handler() argument
289 lockdep_assert_held(&mvm->mutex); in iwl_mvm_tof_resp_handler()
293 iwl_mvm_tof_range_resp(mvm, resp->data); in iwl_mvm_tof_resp_handler()
296 iwl_mvm_tof_mcsi_notif(mvm, resp->data); in iwl_mvm_tof_resp_handler()
299 iwl_mvm_tof_nb_report_notif(mvm, resp->data); in iwl_mvm_tof_resp_handler()
302 IWL_ERR(mvm, "Unknown sub-group command 0x%x\n", in iwl_mvm_tof_resp_handler()