Lines Matching +full:rpmsg +full:- +full:out
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
23 #include <linux/rpmsg.h>
145 WCN36XX_CFG_VAL(ASD_TRIGGER_THRESHOLD, -60),
189 return -ENOMEM; in put_cfg_tlv_u32()
192 entry = (struct wcn36xx_hal_cfg *) (wcn->hal_buf + *len); in put_cfg_tlv_u32()
193 entry->id = id; in put_cfg_tlv_u32()
194 entry->len = sizeof(u32); in put_cfg_tlv_u32()
195 entry->pad_bytes = 0; in put_cfg_tlv_u32()
196 entry->reserve = 0; in put_cfg_tlv_u32()
211 bss_params->nw_type = WCN36XX_HAL_11A_NW_TYPE; in wcn36xx_smd_set_bss_nw_type()
212 else if (sta && sta->deflink.ht_cap.ht_supported) in wcn36xx_smd_set_bss_nw_type()
213 bss_params->nw_type = WCN36XX_HAL_11N_NW_TYPE; in wcn36xx_smd_set_bss_nw_type()
214 else if (sta && (sta->deflink.supp_rates[NL80211_BAND_2GHZ] & 0x7f)) in wcn36xx_smd_set_bss_nw_type()
215 bss_params->nw_type = WCN36XX_HAL_11G_NW_TYPE; in wcn36xx_smd_set_bss_nw_type()
217 bss_params->nw_type = WCN36XX_HAL_11B_NW_TYPE; in wcn36xx_smd_set_bss_nw_type()
229 if (sta && sta->deflink.ht_cap.ht_supported) { in wcn36xx_smd_set_bss_ht_params()
230 unsigned long caps = sta->deflink.ht_cap.cap; in wcn36xx_smd_set_bss_ht_params()
232 bss_params->ht = sta->deflink.ht_cap.ht_supported; in wcn36xx_smd_set_bss_ht_params()
233 bss_params->tx_channel_width_set = is_cap_supported(caps, in wcn36xx_smd_set_bss_ht_params()
235 bss_params->lsig_tx_op_protection_full_support = in wcn36xx_smd_set_bss_ht_params()
239 bss_params->ht_oper_mode = vif->bss_conf.ht_operation_mode; in wcn36xx_smd_set_bss_ht_params()
240 bss_params->lln_non_gf_coexist = in wcn36xx_smd_set_bss_ht_params()
241 !!(vif->bss_conf.ht_operation_mode & in wcn36xx_smd_set_bss_ht_params()
244 bss_params->dual_cts_protection = 0; in wcn36xx_smd_set_bss_ht_params()
246 bss_params->ht20_coexist = 0; in wcn36xx_smd_set_bss_ht_params()
255 if (sta && sta->deflink.vht_cap.vht_supported) in wcn36xx_smd_set_bss_vht_params()
256 bss->vht_capable = 1; in wcn36xx_smd_set_bss_vht_params()
262 if (sta->deflink.ht_cap.ht_supported) { in wcn36xx_smd_set_sta_ht_params()
263 unsigned long caps = sta->deflink.ht_cap.cap; in wcn36xx_smd_set_sta_ht_params()
265 sta_params->ht_capable = sta->deflink.ht_cap.ht_supported; in wcn36xx_smd_set_sta_ht_params()
266 sta_params->tx_channel_width_set = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
268 sta_params->lsig_txop_protection = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
271 sta_params->max_ampdu_size = sta->deflink.ht_cap.ampdu_factor; in wcn36xx_smd_set_sta_ht_params()
272 sta_params->max_ampdu_density = sta->deflink.ht_cap.ampdu_density; in wcn36xx_smd_set_sta_ht_params()
274 sta_params->max_amsdu_size = !is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
276 sta_params->sgi_20Mhz = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
278 sta_params->sgi_40mhz = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
280 sta_params->green_field_capable = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
282 sta_params->delayed_ba_support = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
284 sta_params->dsss_cck_mode_40mhz = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
293 if (sta->deflink.vht_cap.vht_supported) { in wcn36xx_smd_set_sta_vht_params()
294 unsigned long caps = sta->deflink.vht_cap.cap; in wcn36xx_smd_set_sta_vht_params()
296 sta_params->vht_capable = sta->deflink.vht_cap.vht_supported; in wcn36xx_smd_set_sta_vht_params()
297 sta_params->vht_ldpc_enabled = in wcn36xx_smd_set_sta_vht_params()
299 if (wcn36xx_firmware_get_feat_caps(wcn->fw_feat_caps, MU_MIMO)) { in wcn36xx_smd_set_sta_vht_params()
300 sta_params->vht_tx_mu_beamformee_capable = in wcn36xx_smd_set_sta_vht_params()
302 if (sta_params->vht_tx_mu_beamformee_capable) in wcn36xx_smd_set_sta_vht_params()
303 sta_params->vht_tx_bf_enabled = 1; in wcn36xx_smd_set_sta_vht_params()
305 sta_params->vht_tx_mu_beamformee_capable = 0; in wcn36xx_smd_set_sta_vht_params()
307 sta_params->vht_tx_channel_width_set = 0; in wcn36xx_smd_set_sta_vht_params()
314 if (sta->deflink.ht_cap.ht_supported) { in wcn36xx_smd_set_sta_ht_ldpc_params()
315 sta_params->ht_ldpc_enabled = in wcn36xx_smd_set_sta_ht_ldpc_params()
316 is_cap_supported(sta->deflink.ht_cap.cap, in wcn36xx_smd_set_sta_ht_ldpc_params()
324 sta_params->ht_capable = 1; in wcn36xx_smd_set_sta_default_ht_params()
325 sta_params->tx_channel_width_set = 1; in wcn36xx_smd_set_sta_default_ht_params()
326 sta_params->lsig_txop_protection = 1; in wcn36xx_smd_set_sta_default_ht_params()
327 sta_params->max_ampdu_size = 3; in wcn36xx_smd_set_sta_default_ht_params()
328 sta_params->max_ampdu_density = 5; in wcn36xx_smd_set_sta_default_ht_params()
329 sta_params->max_amsdu_size = 0; in wcn36xx_smd_set_sta_default_ht_params()
330 sta_params->sgi_20Mhz = 1; in wcn36xx_smd_set_sta_default_ht_params()
331 sta_params->sgi_40mhz = 1; in wcn36xx_smd_set_sta_default_ht_params()
332 sta_params->green_field_capable = 1; in wcn36xx_smd_set_sta_default_ht_params()
333 sta_params->delayed_ba_support = 0; in wcn36xx_smd_set_sta_default_ht_params()
334 sta_params->dsss_cck_mode_40mhz = 1; in wcn36xx_smd_set_sta_default_ht_params()
340 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_set_sta_default_vht_params()
341 sta_params->vht_capable = 1; in wcn36xx_smd_set_sta_default_vht_params()
342 sta_params->vht_tx_mu_beamformee_capable = 1; in wcn36xx_smd_set_sta_default_vht_params()
344 sta_params->vht_capable = 0; in wcn36xx_smd_set_sta_default_vht_params()
345 sta_params->vht_tx_mu_beamformee_capable = 0; in wcn36xx_smd_set_sta_default_vht_params()
348 sta_params->vht_ldpc_enabled = 0; in wcn36xx_smd_set_sta_default_vht_params()
349 sta_params->vht_tx_channel_width_set = 0; in wcn36xx_smd_set_sta_default_vht_params()
350 sta_params->vht_tx_bf_enabled = 0; in wcn36xx_smd_set_sta_default_vht_params()
356 if (wcn->rf_id == RF_IRIS_WCN3680) in wcn36xx_smd_set_sta_default_ht_ldpc_params()
357 sta_params->ht_ldpc_enabled = 1; in wcn36xx_smd_set_sta_default_ht_ldpc_params()
359 sta_params->ht_ldpc_enabled = 0; in wcn36xx_smd_set_sta_default_ht_ldpc_params()
369 if (vif->type == NL80211_IFTYPE_ADHOC || in wcn36xx_smd_set_sta_params()
370 vif->type == NL80211_IFTYPE_AP || in wcn36xx_smd_set_sta_params()
371 vif->type == NL80211_IFTYPE_MESH_POINT) { in wcn36xx_smd_set_sta_params()
372 sta_params->type = 1; in wcn36xx_smd_set_sta_params()
373 sta_params->sta_index = WCN36XX_HAL_STA_INVALID_IDX; in wcn36xx_smd_set_sta_params()
375 sta_params->type = 0; in wcn36xx_smd_set_sta_params()
376 sta_params->sta_index = vif_priv->self_sta_index; in wcn36xx_smd_set_sta_params()
379 sta_params->listen_interval = WCN36XX_LISTEN_INTERVAL(wcn); in wcn36xx_smd_set_sta_params()
386 if (NL80211_IFTYPE_STATION == vif->type) in wcn36xx_smd_set_sta_params()
387 memcpy(&sta_params->mac, vif->addr, ETH_ALEN); in wcn36xx_smd_set_sta_params()
389 memcpy(&sta_params->bssid, vif->addr, ETH_ALEN); in wcn36xx_smd_set_sta_params()
391 sta_params->encrypt_type = vif_priv->encrypt_type; in wcn36xx_smd_set_sta_params()
392 sta_params->short_preamble_supported = true; in wcn36xx_smd_set_sta_params()
394 sta_params->rifs_mode = 0; in wcn36xx_smd_set_sta_params()
395 sta_params->rmf = 0; in wcn36xx_smd_set_sta_params()
396 sta_params->action = 0; in wcn36xx_smd_set_sta_params()
397 sta_params->uapsd = 0; in wcn36xx_smd_set_sta_params()
398 sta_params->mimo_ps = WCN36XX_HAL_HT_MIMO_PS_STATIC; in wcn36xx_smd_set_sta_params()
399 sta_params->max_ampdu_duration = 0; in wcn36xx_smd_set_sta_params()
400 sta_params->bssid_index = vif_priv->bss_index; in wcn36xx_smd_set_sta_params()
401 sta_params->p2p = 0; in wcn36xx_smd_set_sta_params()
405 if (NL80211_IFTYPE_STATION == vif->type) in wcn36xx_smd_set_sta_params()
406 memcpy(&sta_params->bssid, sta->addr, ETH_ALEN); in wcn36xx_smd_set_sta_params()
408 memcpy(&sta_params->mac, sta->addr, ETH_ALEN); in wcn36xx_smd_set_sta_params()
409 sta_params->wmm_enabled = sta->wme; in wcn36xx_smd_set_sta_params()
410 sta_params->max_sp_len = sta->max_sp; in wcn36xx_smd_set_sta_params()
411 sta_params->aid = sta_priv->aid; in wcn36xx_smd_set_sta_params()
413 memcpy(&sta_params->supported_rates, &sta_priv->supported_rates, in wcn36xx_smd_set_sta_params()
417 &sta_params->supported_rates); in wcn36xx_smd_set_sta_params()
427 (struct wcn36xx_hal_msg_header *)wcn->hal_buf; in wcn36xx_smd_send_and_wait()
428 u16 req_type = hdr->msg_type; in wcn36xx_smd_send_and_wait()
430 wcn36xx_dbg_dump(WCN36XX_DBG_SMD_DUMP, "HAL >>> ", wcn->hal_buf, len); in wcn36xx_smd_send_and_wait()
432 init_completion(&wcn->hal_rsp_compl); in wcn36xx_smd_send_and_wait()
434 ret = rpmsg_send(wcn->smd_channel, wcn->hal_buf, len); in wcn36xx_smd_send_and_wait()
437 goto out; in wcn36xx_smd_send_and_wait()
439 if (wait_for_completion_timeout(&wcn->hal_rsp_compl, in wcn36xx_smd_send_and_wait()
443 ret = -ETIME; in wcn36xx_smd_send_and_wait()
444 goto out; in wcn36xx_smd_send_and_wait()
448 req_type, hdr->msg_type, in wcn36xx_smd_send_and_wait()
449 jiffies_to_msecs(jiffies - start)); in wcn36xx_smd_send_and_wait()
450 out: in wcn36xx_smd_send_and_wait()
471 p_msg_body->header.msg_type = WCN36XX_HAL_PROCESS_PTT_REQ; \
472 p_msg_body->header.msg_version = WCN36XX_HAL_MSG_VERSION0; \
473 p_msg_body->header.len = sizeof(*p_msg_body) + ppt_msg_len; \
484 memcpy(send_buf, p_msg_body, p_msg_body->header.len); \
493 return -EIO; in wcn36xx_smd_rsp_status_check()
498 if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) in wcn36xx_smd_rsp_status_check()
499 return rsp->status; in wcn36xx_smd_rsp_status_check()
512 if (!wcn->nv) { in wcn36xx_smd_load_nv()
513 ret = request_firmware(&wcn->nv, wcn->nv_file, wcn->dev); in wcn36xx_smd_load_nv()
516 wcn->nv_file, ret); in wcn36xx_smd_load_nv()
517 goto out; in wcn36xx_smd_load_nv()
521 nv_d = (struct nv_data *)wcn->nv->data; in wcn36xx_smd_load_nv()
528 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_load_nv()
531 fw_bytes_left = wcn->nv->size - fm_offset - 4; in wcn36xx_smd_load_nv()
545 memcpy(wcn->hal_buf, &msg_body, sizeof(msg_body)); in wcn36xx_smd_load_nv()
548 memcpy(wcn->hal_buf + sizeof(msg_body), in wcn36xx_smd_load_nv()
549 &nv_d->table + fm_offset, in wcn36xx_smd_load_nv()
555 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, in wcn36xx_smd_load_nv()
556 wcn->hal_rsp_len); in wcn36xx_smd_load_nv()
568 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_load_nv()
569 out: return ret; in wcn36xx_smd_load_nv()
577 return -EIO; in wcn36xx_smd_start_rsp()
581 if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->start_rsp_params.status) in wcn36xx_smd_start_rsp()
582 return -EIO; in wcn36xx_smd_start_rsp()
584 memcpy(wcn->crm_version, rsp->start_rsp_params.crm_version, in wcn36xx_smd_start_rsp()
586 memcpy(wcn->wlan_version, rsp->start_rsp_params.wlan_version, in wcn36xx_smd_start_rsp()
590 wcn->crm_version[WCN36XX_HAL_VERSION_LENGTH] = '\0'; in wcn36xx_smd_start_rsp()
591 wcn->wlan_version[WCN36XX_HAL_VERSION_LENGTH] = '\0'; in wcn36xx_smd_start_rsp()
593 wcn->fw_revision = rsp->start_rsp_params.version.revision; in wcn36xx_smd_start_rsp()
594 wcn->fw_version = rsp->start_rsp_params.version.version; in wcn36xx_smd_start_rsp()
595 wcn->fw_minor = rsp->start_rsp_params.version.minor; in wcn36xx_smd_start_rsp()
596 wcn->fw_major = rsp->start_rsp_params.version.major; in wcn36xx_smd_start_rsp()
598 if (wcn->first_boot) { in wcn36xx_smd_start_rsp()
599 wcn->first_boot = false; in wcn36xx_smd_start_rsp()
601 wcn->wlan_version, wcn->crm_version); in wcn36xx_smd_start_rsp()
604 wcn->fw_major, wcn->fw_minor, in wcn36xx_smd_start_rsp()
605 wcn->fw_version, wcn->fw_revision, in wcn36xx_smd_start_rsp()
606 rsp->start_rsp_params.stations, in wcn36xx_smd_start_rsp()
607 rsp->start_rsp_params.bssids); in wcn36xx_smd_start_rsp()
621 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start()
627 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_start()
629 body = (struct wcn36xx_hal_mac_start_req_msg *)wcn->hal_buf; in wcn36xx_smd_start()
630 len = body->header.len; in wcn36xx_smd_start()
632 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_start()
644 goto out; in wcn36xx_smd_start()
646 body->header.len = len; in wcn36xx_smd_start()
647 body->params.len = len - sizeof(*body); in wcn36xx_smd_start()
652 ret = wcn36xx_smd_send_and_wait(wcn, body->header.len); in wcn36xx_smd_start()
655 goto out; in wcn36xx_smd_start()
658 ret = wcn36xx_smd_start_rsp(wcn, wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start()
661 goto out; in wcn36xx_smd_start()
664 out: in wcn36xx_smd_start()
665 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start()
674 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_stop()
679 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_stop()
684 goto out; in wcn36xx_smd_stop()
686 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_stop()
689 goto out; in wcn36xx_smd_stop()
691 out: in wcn36xx_smd_stop()
692 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_stop()
703 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_init_scan()
707 if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX) { in wcn36xx_smd_init_scan()
711 msg_body.scan_entry.bss_index[0] = vif_priv->bss_index; in wcn36xx_smd_init_scan()
715 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_init_scan()
722 goto out; in wcn36xx_smd_init_scan()
724 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_init_scan()
727 goto out; in wcn36xx_smd_init_scan()
729 wcn->sw_scan_init = true; in wcn36xx_smd_init_scan()
730 out: in wcn36xx_smd_init_scan()
731 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_init_scan()
740 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start_scan()
745 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_start_scan()
753 goto out; in wcn36xx_smd_start_scan()
755 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start_scan()
758 goto out; in wcn36xx_smd_start_scan()
760 wcn->sw_scan_channel = scan_channel; in wcn36xx_smd_start_scan()
761 out: in wcn36xx_smd_start_scan()
762 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start_scan()
771 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_end_scan()
776 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_end_scan()
784 goto out; in wcn36xx_smd_end_scan()
786 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_end_scan()
789 goto out; in wcn36xx_smd_end_scan()
791 wcn->sw_scan_channel = 0; in wcn36xx_smd_end_scan()
792 out: in wcn36xx_smd_end_scan()
793 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_end_scan()
805 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_finish_scan()
810 if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX) { in wcn36xx_smd_finish_scan()
814 msg_body.scan_entry.bss_index[0] = vif_priv->bss_index; in wcn36xx_smd_finish_scan()
818 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_finish_scan()
826 goto out; in wcn36xx_smd_finish_scan()
828 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_finish_scan()
831 goto out; in wcn36xx_smd_finish_scan()
833 wcn->sw_scan_init = false; in wcn36xx_smd_finish_scan()
834 out: in wcn36xx_smd_finish_scan()
835 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_finish_scan()
846 if (req->ie_len > WCN36XX_MAX_SCAN_IE_LEN) in wcn36xx_smd_start_hw_scan()
847 return -EINVAL; in wcn36xx_smd_start_hw_scan()
849 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start_hw_scan()
852 ret = -ENOMEM; in wcn36xx_smd_start_hw_scan()
853 goto out; in wcn36xx_smd_start_hw_scan()
858 msg_body->scan_type = WCN36XX_HAL_SCAN_TYPE_ACTIVE; in wcn36xx_smd_start_hw_scan()
859 msg_body->min_ch_time = 30; in wcn36xx_smd_start_hw_scan()
860 msg_body->max_ch_time = 100; in wcn36xx_smd_start_hw_scan()
861 msg_body->scan_hidden = 1; in wcn36xx_smd_start_hw_scan()
862 memcpy(msg_body->mac, vif->addr, ETH_ALEN); in wcn36xx_smd_start_hw_scan()
863 msg_body->bss_type = vif_priv->bss_type; in wcn36xx_smd_start_hw_scan()
864 msg_body->p2p_search = vif->p2p; in wcn36xx_smd_start_hw_scan()
866 msg_body->num_ssid = min_t(u8, req->n_ssids, ARRAY_SIZE(msg_body->ssids)); in wcn36xx_smd_start_hw_scan()
867 for (i = 0; i < msg_body->num_ssid; i++) { in wcn36xx_smd_start_hw_scan()
868 msg_body->ssids[i].length = min_t(u8, req->ssids[i].ssid_len, in wcn36xx_smd_start_hw_scan()
869 sizeof(msg_body->ssids[i].ssid)); in wcn36xx_smd_start_hw_scan()
870 memcpy(msg_body->ssids[i].ssid, req->ssids[i].ssid, in wcn36xx_smd_start_hw_scan()
871 msg_body->ssids[i].length); in wcn36xx_smd_start_hw_scan()
874 msg_body->num_channel = min_t(u8, req->n_channels, in wcn36xx_smd_start_hw_scan()
875 sizeof(msg_body->channels)); in wcn36xx_smd_start_hw_scan()
876 for (i = 0; i < msg_body->num_channel; i++) { in wcn36xx_smd_start_hw_scan()
877 msg_body->channels[i] = in wcn36xx_smd_start_hw_scan()
878 HW_VALUE_CHANNEL(req->channels[i]->hw_value); in wcn36xx_smd_start_hw_scan()
881 msg_body->header.len -= WCN36XX_MAX_SCAN_IE_LEN; in wcn36xx_smd_start_hw_scan()
883 if (req->ie_len > 0) { in wcn36xx_smd_start_hw_scan()
884 msg_body->ie_len = req->ie_len; in wcn36xx_smd_start_hw_scan()
885 msg_body->header.len += req->ie_len; in wcn36xx_smd_start_hw_scan()
886 memcpy(msg_body->ie, req->ie, req->ie_len); in wcn36xx_smd_start_hw_scan()
889 PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); in wcn36xx_smd_start_hw_scan()
892 "hal start hw-scan (channels: %u; ssids: %u; p2p: %s)\n", in wcn36xx_smd_start_hw_scan()
893 msg_body->num_channel, msg_body->num_ssid, in wcn36xx_smd_start_hw_scan()
894 msg_body->p2p_search ? "yes" : "no"); in wcn36xx_smd_start_hw_scan()
896 ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); in wcn36xx_smd_start_hw_scan()
899 goto out; in wcn36xx_smd_start_hw_scan()
901 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start_hw_scan()
905 goto out; in wcn36xx_smd_start_hw_scan()
907 out: in wcn36xx_smd_start_hw_scan()
909 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start_hw_scan()
918 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_stop_hw_scan()
920 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_stop_hw_scan()
922 wcn36xx_dbg(WCN36XX_DBG_HAL, "hal stop hw-scan\n"); in wcn36xx_smd_stop_hw_scan()
927 goto out; in wcn36xx_smd_stop_hw_scan()
929 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_stop_hw_scan()
933 goto out; in wcn36xx_smd_stop_hw_scan()
935 out: in wcn36xx_smd_stop_hw_scan()
936 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_stop_hw_scan()
947 return -ENOMEM; in wcn36xx_smd_update_channel_list()
951 msg_body->num_channel = min_t(u8, req->n_channels, ARRAY_SIZE(msg_body->channels)); in wcn36xx_smd_update_channel_list()
952 for (i = 0; i < msg_body->num_channel; i++) { in wcn36xx_smd_update_channel_list()
953 struct wcn36xx_hal_channel_param *param = &msg_body->channels[i]; in wcn36xx_smd_update_channel_list()
957 param->mhz = req->channels[i]->center_freq; in wcn36xx_smd_update_channel_list()
958 param->band_center_freq1 = req->channels[i]->center_freq; in wcn36xx_smd_update_channel_list()
959 param->band_center_freq2 = 0; in wcn36xx_smd_update_channel_list()
961 if (req->channels[i]->flags & IEEE80211_CHAN_NO_IR) in wcn36xx_smd_update_channel_list()
962 param->channel_info |= WCN36XX_HAL_CHAN_INFO_FLAG_PASSIVE; in wcn36xx_smd_update_channel_list()
964 if (req->channels[i]->flags & IEEE80211_CHAN_RADAR) in wcn36xx_smd_update_channel_list()
965 param->channel_info |= WCN36XX_HAL_CHAN_INFO_FLAG_DFS; in wcn36xx_smd_update_channel_list()
967 if (req->channels[i]->band == NL80211_BAND_5GHZ) { in wcn36xx_smd_update_channel_list()
968 param->channel_info |= WCN36XX_HAL_CHAN_INFO_FLAG_HT; in wcn36xx_smd_update_channel_list()
969 param->channel_info |= WCN36XX_HAL_CHAN_INFO_FLAG_VHT; in wcn36xx_smd_update_channel_list()
970 param->channel_info |= WCN36XX_HAL_CHAN_INFO_PHY_11A; in wcn36xx_smd_update_channel_list()
972 param->channel_info |= WCN36XX_HAL_CHAN_INFO_PHY_11BG; in wcn36xx_smd_update_channel_list()
975 if (min_power > req->channels[i]->max_power) in wcn36xx_smd_update_channel_list()
976 min_power = req->channels[i]->max_power; in wcn36xx_smd_update_channel_list()
978 if (req->channels[i]->max_antenna_gain) in wcn36xx_smd_update_channel_list()
979 ant_gain = req->channels[i]->max_antenna_gain; in wcn36xx_smd_update_channel_list()
981 u32p_replace_bits(¶m->reg_info_1, min_power, in wcn36xx_smd_update_channel_list()
983 u32p_replace_bits(¶m->reg_info_1, req->channels[i]->max_power, in wcn36xx_smd_update_channel_list()
985 u32p_replace_bits(¶m->reg_info_1, req->channels[i]->max_reg_power, in wcn36xx_smd_update_channel_list()
987 u32p_replace_bits(¶m->reg_info_1, 0, in wcn36xx_smd_update_channel_list()
989 u32p_replace_bits(¶m->reg_info_2, ant_gain, in wcn36xx_smd_update_channel_list()
994 __func__, param->mhz, param->channel_info, param->reg_info_1, in wcn36xx_smd_update_channel_list()
995 param->reg_info_2); in wcn36xx_smd_update_channel_list()
998 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_channel_list()
1000 PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); in wcn36xx_smd_update_channel_list()
1002 ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); in wcn36xx_smd_update_channel_list()
1005 goto out; in wcn36xx_smd_update_channel_list()
1008 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_update_channel_list()
1011 goto out; in wcn36xx_smd_update_channel_list()
1014 out: in wcn36xx_smd_update_channel_list()
1016 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_channel_list()
1030 rsp->channel_number, rsp->status); in wcn36xx_smd_switch_channel_rsp()
1040 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_switch_channel()
1046 memcpy(msg_body.self_sta_mac_addr, vif->addr, ETH_ALEN); in wcn36xx_smd_switch_channel()
1048 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_switch_channel()
1053 goto out; in wcn36xx_smd_switch_channel()
1055 ret = wcn36xx_smd_switch_channel_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_switch_channel()
1058 goto out; in wcn36xx_smd_switch_channel()
1060 out: in wcn36xx_smd_switch_channel()
1061 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_switch_channel()
1078 rsp->header.len); in wcn36xx_smd_process_ptt_msg_rsp()
1079 wcn36xx_dbg_dump(WCN36XX_DBG_HAL_DUMP, "HAL_PTT_MSG_RSP:", rsp->ptt_msg, in wcn36xx_smd_process_ptt_msg_rsp()
1080 rsp->header.len - sizeof(rsp->ptt_msg_resp_status)); in wcn36xx_smd_process_ptt_msg_rsp()
1082 if (rsp->header.len > 0) { in wcn36xx_smd_process_ptt_msg_rsp()
1083 *p_ptt_rsp_msg = kmemdup(rsp->ptt_msg, rsp->header.len, in wcn36xx_smd_process_ptt_msg_rsp()
1086 return -ENOMEM; in wcn36xx_smd_process_ptt_msg_rsp()
1098 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_process_ptt_msg()
1103 ret = -ENOMEM; in wcn36xx_smd_process_ptt_msg()
1108 memcpy(&p_msg_body->ptt_msg, ptt_msg, len); in wcn36xx_smd_process_ptt_msg()
1110 PREPARE_HAL_PTT_MSG_BUF(wcn->hal_buf, p_msg_body); in wcn36xx_smd_process_ptt_msg()
1112 ret = wcn36xx_smd_send_and_wait(wcn, p_msg_body->header.len); in wcn36xx_smd_process_ptt_msg()
1115 goto out; in wcn36xx_smd_process_ptt_msg()
1117 ret = wcn36xx_smd_process_ptt_msg_rsp(wcn->hal_buf, wcn->hal_rsp_len, in wcn36xx_smd_process_ptt_msg()
1121 goto out; in wcn36xx_smd_process_ptt_msg()
1123 out: in wcn36xx_smd_process_ptt_msg()
1126 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_process_ptt_msg()
1137 rsp->status &= (~(WCN36XX_FW_MSG_PNO_VERSION_MASK)); in wcn36xx_smd_update_scan_params_rsp()
1139 if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) { in wcn36xx_smd_update_scan_params_rsp()
1141 return rsp->status; in wcn36xx_smd_update_scan_params_rsp()
1153 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_scan_params()
1167 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_update_scan_params()
1176 goto out; in wcn36xx_smd_update_scan_params()
1178 ret = wcn36xx_smd_update_scan_params_rsp(wcn->hal_buf, in wcn36xx_smd_update_scan_params()
1179 wcn->hal_rsp_len); in wcn36xx_smd_update_scan_params()
1183 goto out; in wcn36xx_smd_update_scan_params()
1185 out: in wcn36xx_smd_update_scan_params()
1186 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_scan_params()
1199 return -EINVAL; in wcn36xx_smd_add_sta_self_rsp()
1203 if (rsp->status != WCN36XX_FW_MSG_RESULT_SUCCESS) { in wcn36xx_smd_add_sta_self_rsp()
1205 rsp->status); in wcn36xx_smd_add_sta_self_rsp()
1206 return rsp->status; in wcn36xx_smd_add_sta_self_rsp()
1211 rsp->status, rsp->self_sta_index, rsp->dpu_index); in wcn36xx_smd_add_sta_self_rsp()
1213 vif_priv->self_sta_index = rsp->self_sta_index; in wcn36xx_smd_add_sta_self_rsp()
1214 vif_priv->self_dpu_desc_index = rsp->dpu_index; in wcn36xx_smd_add_sta_self_rsp()
1224 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_sta_self()
1227 memcpy(&msg_body.self_addr, vif->addr, ETH_ALEN); in wcn36xx_smd_add_sta_self()
1229 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_sta_self()
1238 goto out; in wcn36xx_smd_add_sta_self()
1242 wcn->hal_buf, in wcn36xx_smd_add_sta_self()
1243 wcn->hal_rsp_len); in wcn36xx_smd_add_sta_self()
1246 goto out; in wcn36xx_smd_add_sta_self()
1248 out: in wcn36xx_smd_add_sta_self()
1249 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_sta_self()
1258 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta_self()
1263 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_sta_self()
1268 goto out; in wcn36xx_smd_delete_sta_self()
1270 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_sta_self()
1274 goto out; in wcn36xx_smd_delete_sta_self()
1276 out: in wcn36xx_smd_delete_sta_self()
1277 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta_self()
1286 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta()
1291 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_sta()
1300 goto out; in wcn36xx_smd_delete_sta()
1302 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_sta()
1305 goto out; in wcn36xx_smd_delete_sta()
1307 out: in wcn36xx_smd_delete_sta()
1308 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta()
1317 return -EIO; in wcn36xx_smd_join_rsp()
1323 rsp->status, rsp->tx_mgmt_power); in wcn36xx_smd_join_rsp()
1333 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_join()
1340 if (conf_is_ht40_minus(&wcn->hw->conf)) in wcn36xx_smd_join()
1343 else if (conf_is_ht40_plus(&wcn->hw->conf)) in wcn36xx_smd_join()
1353 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_join()
1363 goto out; in wcn36xx_smd_join()
1365 ret = wcn36xx_smd_join_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_join()
1368 goto out; in wcn36xx_smd_join()
1370 out: in wcn36xx_smd_join()
1371 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_join()
1382 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_link_st()
1389 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_link_st()
1398 goto out; in wcn36xx_smd_set_link_st()
1400 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_link_st()
1403 goto out; in wcn36xx_smd_set_link_st()
1405 out: in wcn36xx_smd_set_link_st()
1406 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_link_st()
1415 memcpy(&v1->bssid, orig->bssid, ETH_ALEN); in wcn36xx_smd_convert_sta_to_v1()
1416 memcpy(&v1->mac, orig->mac, ETH_ALEN); in wcn36xx_smd_convert_sta_to_v1()
1417 v1->aid = orig->aid; in wcn36xx_smd_convert_sta_to_v1()
1418 v1->type = orig->type; in wcn36xx_smd_convert_sta_to_v1()
1419 v1->short_preamble_supported = orig->short_preamble_supported; in wcn36xx_smd_convert_sta_to_v1()
1420 v1->listen_interval = orig->listen_interval; in wcn36xx_smd_convert_sta_to_v1()
1421 v1->wmm_enabled = orig->wmm_enabled; in wcn36xx_smd_convert_sta_to_v1()
1422 v1->ht_capable = orig->ht_capable; in wcn36xx_smd_convert_sta_to_v1()
1423 v1->tx_channel_width_set = orig->tx_channel_width_set; in wcn36xx_smd_convert_sta_to_v1()
1424 v1->rifs_mode = orig->rifs_mode; in wcn36xx_smd_convert_sta_to_v1()
1425 v1->lsig_txop_protection = orig->lsig_txop_protection; in wcn36xx_smd_convert_sta_to_v1()
1426 v1->max_ampdu_size = orig->max_ampdu_size; in wcn36xx_smd_convert_sta_to_v1()
1427 v1->max_ampdu_density = orig->max_ampdu_density; in wcn36xx_smd_convert_sta_to_v1()
1428 v1->sgi_40mhz = orig->sgi_40mhz; in wcn36xx_smd_convert_sta_to_v1()
1429 v1->sgi_20Mhz = orig->sgi_20Mhz; in wcn36xx_smd_convert_sta_to_v1()
1430 v1->rmf = orig->rmf; in wcn36xx_smd_convert_sta_to_v1()
1431 v1->encrypt_type = orig->encrypt_type; in wcn36xx_smd_convert_sta_to_v1()
1432 v1->action = orig->action; in wcn36xx_smd_convert_sta_to_v1()
1433 v1->uapsd = orig->uapsd; in wcn36xx_smd_convert_sta_to_v1()
1434 v1->max_sp_len = orig->max_sp_len; in wcn36xx_smd_convert_sta_to_v1()
1435 v1->green_field_capable = orig->green_field_capable; in wcn36xx_smd_convert_sta_to_v1()
1436 v1->mimo_ps = orig->mimo_ps; in wcn36xx_smd_convert_sta_to_v1()
1437 v1->delayed_ba_support = orig->delayed_ba_support; in wcn36xx_smd_convert_sta_to_v1()
1438 v1->max_ampdu_duration = orig->max_ampdu_duration; in wcn36xx_smd_convert_sta_to_v1()
1439 v1->dsss_cck_mode_40mhz = orig->dsss_cck_mode_40mhz; in wcn36xx_smd_convert_sta_to_v1()
1440 memcpy(&v1->supported_rates, &orig->supported_rates, in wcn36xx_smd_convert_sta_to_v1()
1441 sizeof(orig->supported_rates)); in wcn36xx_smd_convert_sta_to_v1()
1442 v1->sta_index = orig->sta_index; in wcn36xx_smd_convert_sta_to_v1()
1443 v1->bssid_index = orig->bssid_index; in wcn36xx_smd_convert_sta_to_v1()
1444 v1->p2p = orig->p2p; in wcn36xx_smd_convert_sta_to_v1()
1463 memcpy(&sta_par->supported_rates, &sta_priv->supported_rates, in wcn36xx_smd_set_sta_params_v1()
1464 sizeof(sta_par->supported_rates)); in wcn36xx_smd_set_sta_params_v1()
1466 wcn36xx_set_default_rates_v1(&sta_par->supported_rates); in wcn36xx_smd_set_sta_params_v1()
1482 return -EINVAL; in wcn36xx_smd_config_sta_rsp()
1485 params = &rsp->params; in wcn36xx_smd_config_sta_rsp()
1487 if (params->status != WCN36XX_FW_MSG_RESULT_SUCCESS) { in wcn36xx_smd_config_sta_rsp()
1489 params->status); in wcn36xx_smd_config_sta_rsp()
1490 return -EIO; in wcn36xx_smd_config_sta_rsp()
1493 sta_priv->sta_index = params->sta_index; in wcn36xx_smd_config_sta_rsp()
1494 sta_priv->dpu_desc_index = params->dpu_index; in wcn36xx_smd_config_sta_rsp()
1495 sta_priv->ucast_dpu_sign = params->uc_ucast_sig; in wcn36xx_smd_config_sta_rsp()
1499 params->status, params->sta_index, params->bssid_index, in wcn36xx_smd_config_sta_rsp()
1500 params->uc_ucast_sig, params->p2p); in wcn36xx_smd_config_sta_rsp()
1512 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_config_sta_v1()
1516 msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT; in wcn36xx_smd_config_sta_v1()
1523 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_config_sta_v1()
1527 sta_params->action, sta_params->sta_index, sta_params->bssid_index, in wcn36xx_smd_config_sta_v1()
1528 sta_params->bssid, sta_params->type, sta_params->mac, sta_params->aid); in wcn36xx_smd_config_sta_v1()
1546 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_config_sta_v0()
1550 sta_params->action, sta_params->sta_index, in wcn36xx_smd_config_sta_v0()
1551 sta_params->bssid_index, sta_params->bssid, in wcn36xx_smd_config_sta_v0()
1552 sta_params->type, sta_params->mac, sta_params->aid); in wcn36xx_smd_config_sta_v0()
1562 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_config_sta()
1571 goto out; in wcn36xx_smd_config_sta()
1575 wcn->hal_buf, in wcn36xx_smd_config_sta()
1576 wcn->hal_rsp_len); in wcn36xx_smd_config_sta()
1579 goto out; in wcn36xx_smd_config_sta()
1581 out: in wcn36xx_smd_config_sta()
1582 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_config_sta()
1597 memcpy(&bss->bssid, bssid, ETH_ALEN); in wcn36xx_smd_set_bss_params()
1599 memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN); in wcn36xx_smd_set_bss_params()
1601 if (vif->type == NL80211_IFTYPE_STATION) { in wcn36xx_smd_set_bss_params()
1602 bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE; in wcn36xx_smd_set_bss_params()
1605 bss->oper_mode = 1; in wcn36xx_smd_set_bss_params()
1606 bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE; in wcn36xx_smd_set_bss_params()
1607 } else if (vif->type == NL80211_IFTYPE_AP || in wcn36xx_smd_set_bss_params()
1608 vif->type == NL80211_IFTYPE_MESH_POINT) { in wcn36xx_smd_set_bss_params()
1609 bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE; in wcn36xx_smd_set_bss_params()
1612 bss->oper_mode = 0; in wcn36xx_smd_set_bss_params()
1613 bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE; in wcn36xx_smd_set_bss_params()
1614 } else if (vif->type == NL80211_IFTYPE_ADHOC) { in wcn36xx_smd_set_bss_params()
1615 bss->bss_type = WCN36XX_HAL_IBSS_MODE; in wcn36xx_smd_set_bss_params()
1618 bss->oper_mode = 1; in wcn36xx_smd_set_bss_params()
1620 wcn36xx_warn("Unknown type for bss config: %d\n", vif->type); in wcn36xx_smd_set_bss_params()
1623 if (vif->type == NL80211_IFTYPE_STATION) in wcn36xx_smd_set_bss_params()
1626 bss->nw_type = WCN36XX_HAL_11N_NW_TYPE; in wcn36xx_smd_set_bss_params()
1628 bss->short_slot_time_supported = vif->bss_conf.use_short_slot; in wcn36xx_smd_set_bss_params()
1629 bss->lla_coexist = 0; in wcn36xx_smd_set_bss_params()
1630 bss->llb_coexist = 0; in wcn36xx_smd_set_bss_params()
1631 bss->llg_coexist = 0; in wcn36xx_smd_set_bss_params()
1632 bss->rifs_mode = 0; in wcn36xx_smd_set_bss_params()
1633 bss->beacon_interval = vif->bss_conf.beacon_int; in wcn36xx_smd_set_bss_params()
1634 bss->dtim_period = vif_priv->dtim_period; in wcn36xx_smd_set_bss_params()
1638 bss->oper_channel = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_smd_set_bss_params()
1640 if (conf_is_ht40_minus(&wcn->hw->conf)) in wcn36xx_smd_set_bss_params()
1641 bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW; in wcn36xx_smd_set_bss_params()
1642 else if (conf_is_ht40_plus(&wcn->hw->conf)) in wcn36xx_smd_set_bss_params()
1643 bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE; in wcn36xx_smd_set_bss_params()
1645 bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE; in wcn36xx_smd_set_bss_params()
1647 bss->reserved = 0; in wcn36xx_smd_set_bss_params()
1649 /* wcn->ssid is only valid in AP and IBSS mode */ in wcn36xx_smd_set_bss_params()
1650 bss->ssid.length = vif_priv->ssid.length; in wcn36xx_smd_set_bss_params()
1651 memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length); in wcn36xx_smd_set_bss_params()
1653 bss->obss_prot_enabled = 0; in wcn36xx_smd_set_bss_params()
1654 bss->rmf = 0; in wcn36xx_smd_set_bss_params()
1655 bss->max_probe_resp_retry_limit = 0; in wcn36xx_smd_set_bss_params()
1656 bss->hidden_ssid = vif->bss_conf.hidden_ssid; in wcn36xx_smd_set_bss_params()
1657 bss->proxy_probe_resp = 0; in wcn36xx_smd_set_bss_params()
1658 bss->edca_params_valid = 0; in wcn36xx_smd_set_bss_params()
1662 bss->ext_set_sta_key_param_valid = 0; in wcn36xx_smd_set_bss_params()
1666 bss->spectrum_mgt_enable = 0; in wcn36xx_smd_set_bss_params()
1667 bss->tx_mgmt_power = 0; in wcn36xx_smd_set_bss_params()
1668 bss->max_tx_power = WCN36XX_MAX_POWER(wcn); in wcn36xx_smd_set_bss_params()
1669 bss->action = update; in wcn36xx_smd_set_bss_params()
1671 vif_priv->bss_type = bss->bss_type; in wcn36xx_smd_set_bss_params()
1689 return -ENOMEM; in wcn36xx_smd_config_bss_v1()
1691 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_config_bss_v1()
1695 msg_body->header.len -= WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT; in wcn36xx_smd_config_bss_v1()
1698 bss = &msg_body->bss_params; in wcn36xx_smd_config_bss_v1()
1699 sta = &bss->sta; in wcn36xx_smd_config_bss_v1()
1706 memcpy(bss->bssid, &bss_v0.bssid, ETH_ALEN); in wcn36xx_smd_config_bss_v1()
1707 memcpy(bss->self_mac_addr, &bss_v0.self_mac_addr, ETH_ALEN); in wcn36xx_smd_config_bss_v1()
1709 bss->bss_type = bss_v0.bss_type; in wcn36xx_smd_config_bss_v1()
1710 bss->oper_mode = bss_v0.oper_mode; in wcn36xx_smd_config_bss_v1()
1711 bss->nw_type = bss_v0.nw_type; in wcn36xx_smd_config_bss_v1()
1713 bss->short_slot_time_supported = in wcn36xx_smd_config_bss_v1()
1715 bss->lla_coexist = bss_v0.lla_coexist; in wcn36xx_smd_config_bss_v1()
1716 bss->llb_coexist = bss_v0.llb_coexist; in wcn36xx_smd_config_bss_v1()
1717 bss->llg_coexist = bss_v0.llg_coexist; in wcn36xx_smd_config_bss_v1()
1718 bss->ht20_coexist = bss_v0.ht20_coexist; in wcn36xx_smd_config_bss_v1()
1719 bss->lln_non_gf_coexist = bss_v0.lln_non_gf_coexist; in wcn36xx_smd_config_bss_v1()
1721 bss->lsig_tx_op_protection_full_support = in wcn36xx_smd_config_bss_v1()
1723 bss->rifs_mode = bss_v0.rifs_mode; in wcn36xx_smd_config_bss_v1()
1724 bss->beacon_interval = bss_v0.beacon_interval; in wcn36xx_smd_config_bss_v1()
1725 bss->dtim_period = bss_v0.dtim_period; in wcn36xx_smd_config_bss_v1()
1726 bss->tx_channel_width_set = bss_v0.tx_channel_width_set; in wcn36xx_smd_config_bss_v1()
1727 bss->oper_channel = bss_v0.oper_channel; in wcn36xx_smd_config_bss_v1()
1729 if (wcn->hw->conf.chandef.width == NL80211_CHAN_WIDTH_80) { in wcn36xx_smd_config_bss_v1()
1730 chandef = &wcn->hw->conf.chandef; in wcn36xx_smd_config_bss_v1()
1731 bss->ext_channel = HW_VALUE_PHY(chandef->chan->hw_value); in wcn36xx_smd_config_bss_v1()
1733 bss->ext_channel = bss_v0.ext_channel; in wcn36xx_smd_config_bss_v1()
1736 bss->reserved = bss_v0.reserved; in wcn36xx_smd_config_bss_v1()
1738 memcpy(&bss->ssid, &bss_v0.ssid, in wcn36xx_smd_config_bss_v1()
1741 bss->action = bss_v0.action; in wcn36xx_smd_config_bss_v1()
1742 bss->rateset = bss_v0.rateset; in wcn36xx_smd_config_bss_v1()
1743 bss->ht = bss_v0.ht; in wcn36xx_smd_config_bss_v1()
1744 bss->obss_prot_enabled = bss_v0.obss_prot_enabled; in wcn36xx_smd_config_bss_v1()
1745 bss->rmf = bss_v0.rmf; in wcn36xx_smd_config_bss_v1()
1746 bss->ht_oper_mode = bss_v0.ht_oper_mode; in wcn36xx_smd_config_bss_v1()
1747 bss->dual_cts_protection = bss_v0.dual_cts_protection; in wcn36xx_smd_config_bss_v1()
1749 bss->max_probe_resp_retry_limit = in wcn36xx_smd_config_bss_v1()
1751 bss->hidden_ssid = bss_v0.hidden_ssid; in wcn36xx_smd_config_bss_v1()
1752 bss->proxy_probe_resp = bss_v0.proxy_probe_resp; in wcn36xx_smd_config_bss_v1()
1753 bss->edca_params_valid = bss_v0.edca_params_valid; in wcn36xx_smd_config_bss_v1()
1755 memcpy(&bss->acbe, &bss_v0.acbe, in wcn36xx_smd_config_bss_v1()
1757 memcpy(&bss->acbk, &bss_v0.acbk, in wcn36xx_smd_config_bss_v1()
1759 memcpy(&bss->acvi, &bss_v0.acvi, in wcn36xx_smd_config_bss_v1()
1761 memcpy(&bss->acvo, &bss_v0.acvo, in wcn36xx_smd_config_bss_v1()
1764 bss->ext_set_sta_key_param_valid = in wcn36xx_smd_config_bss_v1()
1767 memcpy(&bss->ext_set_sta_key_param, in wcn36xx_smd_config_bss_v1()
1771 bss->wcn36xx_hal_persona = bss_v0.wcn36xx_hal_persona; in wcn36xx_smd_config_bss_v1()
1772 bss->spectrum_mgt_enable = bss_v0.spectrum_mgt_enable; in wcn36xx_smd_config_bss_v1()
1773 bss->tx_mgmt_power = bss_v0.tx_mgmt_power; in wcn36xx_smd_config_bss_v1()
1774 bss->max_tx_power = bss_v0.max_tx_power; in wcn36xx_smd_config_bss_v1()
1778 PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); in wcn36xx_smd_config_bss_v1()
1782 bss->bssid, bss->self_mac_addr, bss->bss_type, in wcn36xx_smd_config_bss_v1()
1783 bss->oper_mode, bss->nw_type); in wcn36xx_smd_config_bss_v1()
1786 "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n", in wcn36xx_smd_config_bss_v1()
1787 sta->bssid, sta->action, sta->sta_index, in wcn36xx_smd_config_bss_v1()
1788 sta->bssid_index, sta->aid, sta->type, sta->mac); in wcn36xx_smd_config_bss_v1()
1790 ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); in wcn36xx_smd_config_bss_v1()
1809 return -ENOMEM; in wcn36xx_smd_config_bss_v0()
1813 bss = &msg->bss_params; in wcn36xx_smd_config_bss_v0()
1814 sta_params = &bss->sta; in wcn36xx_smd_config_bss_v0()
1819 PREPARE_HAL_BUF(wcn->hal_buf, (*msg)); in wcn36xx_smd_config_bss_v0()
1823 bss->bssid, bss->self_mac_addr, bss->bss_type, in wcn36xx_smd_config_bss_v0()
1824 bss->oper_mode, bss->nw_type); in wcn36xx_smd_config_bss_v0()
1827 "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n", in wcn36xx_smd_config_bss_v0()
1828 sta_params->bssid, sta_params->action, in wcn36xx_smd_config_bss_v0()
1829 sta_params->sta_index, sta_params->bssid_index, in wcn36xx_smd_config_bss_v0()
1830 sta_params->aid, sta_params->type, in wcn36xx_smd_config_bss_v0()
1831 sta_params->mac); in wcn36xx_smd_config_bss_v0()
1833 ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len); in wcn36xx_smd_config_bss_v0()
1850 return -EINVAL; in wcn36xx_smd_config_bss_rsp()
1853 params = &rsp->bss_rsp_params; in wcn36xx_smd_config_bss_rsp()
1855 if (params->status != WCN36XX_FW_MSG_RESULT_SUCCESS) { in wcn36xx_smd_config_bss_rsp()
1857 params->status); in wcn36xx_smd_config_bss_rsp()
1858 return -EIO; in wcn36xx_smd_config_bss_rsp()
1865 params->status, params->bss_index, params->dpu_desc_index, in wcn36xx_smd_config_bss_rsp()
1866 params->bss_sta_index, params->bss_self_sta_index, in wcn36xx_smd_config_bss_rsp()
1867 params->bss_bcast_sta_idx, params->mac, in wcn36xx_smd_config_bss_rsp()
1868 params->tx_mgmt_power, params->ucast_dpu_signature); in wcn36xx_smd_config_bss_rsp()
1870 vif_priv->bss_index = params->bss_index; in wcn36xx_smd_config_bss_rsp()
1874 sta_priv->bss_sta_index = params->bss_sta_index; in wcn36xx_smd_config_bss_rsp()
1875 sta_priv->bss_dpu_desc_index = params->dpu_desc_index; in wcn36xx_smd_config_bss_rsp()
1878 vif_priv->self_ucast_dpu_sign = params->ucast_dpu_signature; in wcn36xx_smd_config_bss_rsp()
1889 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_config_bss()
1898 goto out; in wcn36xx_smd_config_bss()
1903 wcn->hal_buf, in wcn36xx_smd_config_bss()
1904 wcn->hal_rsp_len); in wcn36xx_smd_config_bss()
1908 out: in wcn36xx_smd_config_bss()
1909 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_config_bss()
1919 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_bss()
1921 if (vif_priv->bss_index == WCN36XX_HAL_BSS_INVALID_IDX) in wcn36xx_smd_delete_bss()
1922 goto out; in wcn36xx_smd_delete_bss()
1926 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_delete_bss()
1928 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_bss()
1935 goto out; in wcn36xx_smd_delete_bss()
1937 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_bss()
1940 goto out; in wcn36xx_smd_delete_bss()
1943 vif_priv->bss_index = WCN36XX_HAL_BSS_INVALID_IDX; in wcn36xx_smd_delete_bss()
1944 out: in wcn36xx_smd_delete_bss()
1945 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_bss()
1956 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_send_beacon()
1959 pvm_len = skb_beacon->data[tim_off + 1] - 3; in wcn36xx_smd_send_beacon()
1960 pad = TIM_MIN_PVM_SIZE - pvm_len; in wcn36xx_smd_send_beacon()
1963 if (vif->type == NL80211_IFTYPE_MESH_POINT) in wcn36xx_smd_send_beacon()
1966 msg_body.beacon_length = skb_beacon->len + pad; in wcn36xx_smd_send_beacon()
1967 /* TODO need to find out why + 6 is needed */ in wcn36xx_smd_send_beacon()
1973 ret = -ENOMEM; in wcn36xx_smd_send_beacon()
1974 goto out; in wcn36xx_smd_send_beacon()
1976 memcpy(msg_body.beacon, skb_beacon->data, skb_beacon->len); in wcn36xx_smd_send_beacon()
1977 memcpy(msg_body.bssid, vif->addr, ETH_ALEN); in wcn36xx_smd_send_beacon()
1990 skb_beacon->len - (tim_off + 5 + pvm_len)); in wcn36xx_smd_send_beacon()
1995 /* TODO need to find out why this is needed? */ in wcn36xx_smd_send_beacon()
1996 if (vif->type == NL80211_IFTYPE_MESH_POINT) in wcn36xx_smd_send_beacon()
2002 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_send_beacon()
2011 goto out; in wcn36xx_smd_send_beacon()
2013 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_send_beacon()
2016 goto out; in wcn36xx_smd_send_beacon()
2018 out: in wcn36xx_smd_send_beacon()
2019 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_send_beacon()
2030 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_proberesp_tmpl()
2033 if (skb->len > BEACON_TEMPLATE_SIZE) { in wcn36xx_smd_update_proberesp_tmpl()
2035 skb->len); in wcn36xx_smd_update_proberesp_tmpl()
2036 ret = -E2BIG; in wcn36xx_smd_update_proberesp_tmpl()
2037 goto out; in wcn36xx_smd_update_proberesp_tmpl()
2040 msg.probe_resp_template_len = skb->len; in wcn36xx_smd_update_proberesp_tmpl()
2041 memcpy(&msg.probe_resp_template, skb->data, skb->len); in wcn36xx_smd_update_proberesp_tmpl()
2043 memcpy(msg.bssid, vif->addr, ETH_ALEN); in wcn36xx_smd_update_proberesp_tmpl()
2045 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_update_proberesp_tmpl()
2054 goto out; in wcn36xx_smd_update_proberesp_tmpl()
2056 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_update_proberesp_tmpl()
2060 goto out; in wcn36xx_smd_update_proberesp_tmpl()
2062 out: in wcn36xx_smd_update_proberesp_tmpl()
2063 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_proberesp_tmpl()
2077 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_stakey()
2099 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_stakey()
2104 goto out; in wcn36xx_smd_set_stakey()
2106 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_stakey()
2109 goto out; in wcn36xx_smd_set_stakey()
2111 out: in wcn36xx_smd_set_stakey()
2112 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_stakey()
2126 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_bsskey()
2138 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_bsskey()
2143 goto out; in wcn36xx_smd_set_bsskey()
2145 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_bsskey()
2148 goto out; in wcn36xx_smd_set_bsskey()
2150 out: in wcn36xx_smd_set_bsskey()
2151 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_bsskey()
2163 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_remove_stakey()
2170 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_remove_stakey()
2175 goto out; in wcn36xx_smd_remove_stakey()
2177 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_remove_stakey()
2180 goto out; in wcn36xx_smd_remove_stakey()
2182 out: in wcn36xx_smd_remove_stakey()
2183 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_remove_stakey()
2195 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_remove_bsskey()
2201 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_remove_bsskey()
2206 goto out; in wcn36xx_smd_remove_bsskey()
2208 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_remove_bsskey()
2211 goto out; in wcn36xx_smd_remove_bsskey()
2213 out: in wcn36xx_smd_remove_bsskey()
2214 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_remove_bsskey()
2224 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_enter_bmps()
2227 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_enter_bmps()
2228 msg_body.tbtt = vif->bss_conf.sync_tsf; in wcn36xx_smd_enter_bmps()
2229 msg_body.dtim_period = vif_priv->dtim_period; in wcn36xx_smd_enter_bmps()
2231 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_enter_bmps()
2236 goto out; in wcn36xx_smd_enter_bmps()
2238 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_enter_bmps()
2241 goto out; in wcn36xx_smd_enter_bmps()
2243 out: in wcn36xx_smd_enter_bmps()
2244 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_enter_bmps()
2254 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_exit_bmps()
2257 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_exit_bmps()
2260 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_exit_bmps()
2265 goto out; in wcn36xx_smd_exit_bmps()
2267 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_exit_bmps()
2270 goto out; in wcn36xx_smd_exit_bmps()
2272 out: in wcn36xx_smd_exit_bmps()
2273 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_exit_bmps()
2282 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_enter_imps()
2285 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_enter_imps()
2290 goto out; in wcn36xx_smd_enter_imps()
2292 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_enter_imps()
2295 goto out; in wcn36xx_smd_enter_imps()
2299 out: in wcn36xx_smd_enter_imps()
2300 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_enter_imps()
2309 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_exit_imps()
2312 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_exit_imps()
2317 goto out; in wcn36xx_smd_exit_imps()
2319 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_exit_imps()
2322 goto out; in wcn36xx_smd_exit_imps()
2325 out: in wcn36xx_smd_exit_imps()
2326 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_exit_imps()
2335 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_power_params()
2347 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_power_params()
2352 goto out; in wcn36xx_smd_set_power_params()
2355 out: in wcn36xx_smd_set_power_params()
2356 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_power_params()
2371 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_keep_alive_req()
2375 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_keep_alive_req()
2382 ret = -EINVAL; in wcn36xx_smd_keep_alive_req()
2383 goto out; in wcn36xx_smd_keep_alive_req()
2386 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_keep_alive_req()
2391 goto out; in wcn36xx_smd_keep_alive_req()
2393 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_keep_alive_req()
2396 goto out; in wcn36xx_smd_keep_alive_req()
2398 out: in wcn36xx_smd_keep_alive_req()
2399 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_keep_alive_req()
2409 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_dump_cmd_req()
2418 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_dump_cmd_req()
2423 goto out; in wcn36xx_smd_dump_cmd_req()
2425 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_dump_cmd_req()
2428 goto out; in wcn36xx_smd_dump_cmd_req()
2430 out: in wcn36xx_smd_dump_cmd_req()
2431 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_dump_cmd_req()
2440 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_feature_caps_exchange()
2444 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_feature_caps_exchange()
2451 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_feature_caps_exchange()
2456 goto out; in wcn36xx_smd_feature_caps_exchange()
2458 if (wcn->hal_rsp_len != sizeof(*rsp)) { in wcn36xx_smd_feature_caps_exchange()
2460 goto out; in wcn36xx_smd_feature_caps_exchange()
2463 rsp = (struct wcn36xx_hal_feat_caps_msg *) wcn->hal_buf; in wcn36xx_smd_feature_caps_exchange()
2466 wcn->fw_feat_caps[i] = rsp->feat_caps[i]; in wcn36xx_smd_feature_caps_exchange()
2467 out: in wcn36xx_smd_feature_caps_exchange()
2468 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_feature_caps_exchange()
2477 return -EINVAL; in wcn36xx_smd_add_ba_session_rsp()
2480 if (rsp->status != WCN36XX_FW_MSG_RESULT_SUCCESS) in wcn36xx_smd_add_ba_session_rsp()
2481 return rsp->status; in wcn36xx_smd_add_ba_session_rsp()
2483 *session = rsp->ba_session_id; in wcn36xx_smd_add_ba_session_rsp()
2499 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_ba_session()
2503 memcpy(&msg_body.mac_addr, sta->addr, ETH_ALEN); in wcn36xx_smd_add_ba_session()
2515 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_ba_session()
2520 goto out; in wcn36xx_smd_add_ba_session()
2522 ret = wcn36xx_smd_add_ba_session_rsp(wcn->hal_buf, wcn->hal_rsp_len, in wcn36xx_smd_add_ba_session()
2526 ret = -EINVAL; in wcn36xx_smd_add_ba_session()
2527 goto out; in wcn36xx_smd_add_ba_session()
2531 out: in wcn36xx_smd_add_ba_session()
2532 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_ba_session()
2541 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_ba()
2547 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_ba()
2552 goto out; in wcn36xx_smd_add_ba()
2554 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_add_ba()
2557 goto out; in wcn36xx_smd_add_ba()
2559 out: in wcn36xx_smd_add_ba()
2560 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_ba()
2569 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_del_ba()
2575 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_del_ba()
2580 goto out; in wcn36xx_smd_del_ba()
2582 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_del_ba()
2585 goto out; in wcn36xx_smd_del_ba()
2587 out: in wcn36xx_smd_del_ba()
2588 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_del_ba()
2603 return -EINVAL; in wcn36xx_smd_get_stats()
2606 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_get_stats()
2612 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_get_stats()
2617 goto out; in wcn36xx_smd_get_stats()
2620 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_get_stats()
2623 goto out; in wcn36xx_smd_get_stats()
2626 rsp = (struct wcn36xx_hal_stats_rsp_msg *)wcn->hal_buf; in wcn36xx_smd_get_stats()
2627 rsp_body = (wcn->hal_buf + sizeof(struct wcn36xx_hal_stats_rsp_msg)); in wcn36xx_smd_get_stats()
2629 if (rsp->stats_mask != stats_mask) { in wcn36xx_smd_get_stats()
2631 rsp->stats_mask, stats_mask); in wcn36xx_smd_get_stats()
2632 goto out; in wcn36xx_smd_get_stats()
2635 if (rsp->stats_mask & HAL_GLOBAL_CLASS_A_STATS_INFO) { in wcn36xx_smd_get_stats()
2638 wcn36xx_process_tx_rate(stats_info, &sinfo->txrate); in wcn36xx_smd_get_stats()
2639 sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE); in wcn36xx_smd_get_stats()
2642 out: in wcn36xx_smd_get_stats()
2643 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_get_stats()
2655 return -EINVAL; in wcn36xx_smd_trigger_ba_rsp()
2659 if (rsp->candidate_cnt < 1) in wcn36xx_smd_trigger_ba_rsp()
2660 return rsp->status ? rsp->status : -EINVAL; in wcn36xx_smd_trigger_ba_rsp()
2665 ba_info[i] = candidate->ba_info[i]; in wcn36xx_smd_trigger_ba_rsp()
2668 return rsp->status; in wcn36xx_smd_trigger_ba_rsp()
2679 return -EINVAL; in wcn36xx_smd_trigger_ba()
2681 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_trigger_ba()
2687 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_trigger_ba()
2690 (wcn->hal_buf + sizeof(msg_body)); in wcn36xx_smd_trigger_ba()
2691 candidate->sta_index = sta_index; in wcn36xx_smd_trigger_ba()
2692 candidate->tid_bitmap = 1 << tid; in wcn36xx_smd_trigger_ba()
2697 goto out; in wcn36xx_smd_trigger_ba()
2699 ret = wcn36xx_smd_trigger_ba_rsp(wcn->hal_buf, wcn->hal_rsp_len, ba_info); in wcn36xx_smd_trigger_ba()
2702 goto out; in wcn36xx_smd_trigger_ba()
2704 out: in wcn36xx_smd_trigger_ba()
2705 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_trigger_ba()
2719 return -EIO; in wcn36xx_smd_tx_compl_ind()
2722 wcn36xx_dxe_tx_ack_ind(wcn, rsp->status); in wcn36xx_smd_tx_compl_ind()
2734 return -EIO; in wcn36xx_smd_hw_scan_ind()
2737 wcn36xx_dbg(WCN36XX_DBG_HAL, "scan indication (type %x)\n", rsp->type); in wcn36xx_smd_hw_scan_ind()
2739 switch (rsp->type) { in wcn36xx_smd_hw_scan_ind()
2745 mutex_lock(&wcn->scan_lock); in wcn36xx_smd_hw_scan_ind()
2746 wcn->scan_req = NULL; in wcn36xx_smd_hw_scan_ind()
2747 if (wcn->scan_aborted) in wcn36xx_smd_hw_scan_ind()
2749 mutex_unlock(&wcn->scan_lock); in wcn36xx_smd_hw_scan_ind()
2750 ieee80211_scan_completed(wcn->hw, &scan_info); in wcn36xx_smd_hw_scan_ind()
2758 wcn36xx_warn("Unknown scan indication type %x\n", rsp->type); in wcn36xx_smd_hw_scan_ind()
2774 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_missed_beacon_ind()
2776 tmp->bss_index); in wcn36xx_smd_missed_beacon_ind()
2785 return -EIO; in wcn36xx_smd_missed_beacon_ind()
2788 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_missed_beacon_ind()
2789 if (tmp->bss_index == rsp->bss_index) { in wcn36xx_smd_missed_beacon_ind()
2791 rsp->bss_index); in wcn36xx_smd_missed_beacon_ind()
2798 wcn36xx_warn("BSS index %d not found\n", rsp->bss_index); in wcn36xx_smd_missed_beacon_ind()
2799 return -ENOENT; in wcn36xx_smd_missed_beacon_ind()
2815 return -EIO; in wcn36xx_smd_delete_sta_context_ind()
2820 rsp->addr2, rsp->sta_id, rsp->reason_code); in wcn36xx_smd_delete_sta_context_ind()
2822 list_for_each_entry(vif_priv, &wcn->vif_list, list) { in wcn36xx_smd_delete_sta_context_ind()
2826 if (vif->type == NL80211_IFTYPE_STATION) { in wcn36xx_smd_delete_sta_context_ind()
2830 bss_conf = &vif->bss_conf; in wcn36xx_smd_delete_sta_context_ind()
2831 if (vif_priv->sta_assoc && in wcn36xx_smd_delete_sta_context_ind()
2832 !memcmp(bss_conf->bssid, rsp->addr2, ETH_ALEN)) { in wcn36xx_smd_delete_sta_context_ind()
2836 vif_priv->bss_index); in wcn36xx_smd_delete_sta_context_ind()
2840 sta = ieee80211_find_sta(vif, rsp->addr2); in wcn36xx_smd_delete_sta_context_ind()
2852 wcn36xx_warn("BSS or STA with addr %pM not found\n", rsp->addr2); in wcn36xx_smd_delete_sta_context_ind()
2853 return -ENOENT; in wcn36xx_smd_delete_sta_context_ind()
2865 return -EIO; in wcn36xx_smd_print_reg_info_ind()
2870 rsp->scenario, rsp->reason); in wcn36xx_smd_print_reg_info_ind()
2872 for (i = 0; i < rsp->count; i++) { in wcn36xx_smd_print_reg_info_ind()
2874 rsp->regs[i].addr, rsp->regs[i].value); in wcn36xx_smd_print_reg_info_ind()
2886 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_cfg()
2889 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_update_cfg()
2891 body = (struct wcn36xx_hal_update_cfg_req_msg *) wcn->hal_buf; in wcn36xx_smd_update_cfg()
2895 body->header.len = len; in wcn36xx_smd_update_cfg()
2896 body->len = len - sizeof(*body); in wcn36xx_smd_update_cfg()
2898 ret = wcn36xx_smd_send_and_wait(wcn, body->header.len); in wcn36xx_smd_update_cfg()
2901 goto out; in wcn36xx_smd_update_cfg()
2903 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_update_cfg()
2906 goto out; in wcn36xx_smd_update_cfg()
2908 out: in wcn36xx_smd_update_cfg()
2909 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_cfg()
2921 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_mc_list()
2924 wcn->hal_buf; in wcn36xx_smd_set_mc_list()
2929 memcpy(&msg_body->mc_addr_list, fp, in wcn36xx_smd_set_mc_list()
2930 sizeof(msg_body->mc_addr_list)); in wcn36xx_smd_set_mc_list()
2932 msg_body->mc_addr_list.mc_addr_count = 0; in wcn36xx_smd_set_mc_list()
2934 msg_body->mc_addr_list.bss_index = vif_priv->bss_index; in wcn36xx_smd_set_mc_list()
2936 ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); in wcn36xx_smd_set_mc_list()
2939 goto out; in wcn36xx_smd_set_mc_list()
2941 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_mc_list()
2944 goto out; in wcn36xx_smd_set_mc_list()
2946 out: in wcn36xx_smd_set_mc_list()
2947 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_mc_list()
2958 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_arp_offload()
2967 &vif->cfg.arp_addr_list[0], sizeof(__be32)); in wcn36xx_smd_arp_offload()
2969 msg_body.ns_offload_params.bss_index = vif_priv->bss_index; in wcn36xx_smd_arp_offload()
2971 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_arp_offload()
2976 goto out; in wcn36xx_smd_arp_offload()
2978 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_arp_offload()
2981 goto out; in wcn36xx_smd_arp_offload()
2983 out: in wcn36xx_smd_arp_offload()
2984 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_arp_offload()
2998 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_ipv6_ns_offload()
3004 ho_params->offload_type = WCN36XX_HAL_IPV6_NS_OFFLOAD; in wcn36xx_smd_ipv6_ns_offload()
3006 ho_params->enable = in wcn36xx_smd_ipv6_ns_offload()
3008 if (vif_priv->num_target_ipv6_addrs) { in wcn36xx_smd_ipv6_ns_offload()
3009 memcpy(&ho_params->u, in wcn36xx_smd_ipv6_ns_offload()
3010 &vif_priv->target_ipv6_addrs[0].in6_u, in wcn36xx_smd_ipv6_ns_offload()
3012 memcpy(&ns_params->target_ipv6_addr1, in wcn36xx_smd_ipv6_ns_offload()
3013 &vif_priv->target_ipv6_addrs[0].in6_u, in wcn36xx_smd_ipv6_ns_offload()
3015 ns_params->target_ipv6_addr1_valid = 1; in wcn36xx_smd_ipv6_ns_offload()
3017 if (vif_priv->num_target_ipv6_addrs > 1) { in wcn36xx_smd_ipv6_ns_offload()
3018 memcpy(&ns_params->target_ipv6_addr2, in wcn36xx_smd_ipv6_ns_offload()
3019 &vif_priv->target_ipv6_addrs[1].in6_u, in wcn36xx_smd_ipv6_ns_offload()
3021 ns_params->target_ipv6_addr2_valid = 1; in wcn36xx_smd_ipv6_ns_offload()
3024 memcpy(&ns_params->self_addr, vif->addr, ETH_ALEN); in wcn36xx_smd_ipv6_ns_offload()
3025 ns_params->bss_index = vif_priv->bss_index; in wcn36xx_smd_ipv6_ns_offload()
3027 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_ipv6_ns_offload()
3032 goto out; in wcn36xx_smd_ipv6_ns_offload()
3034 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_ipv6_ns_offload()
3037 goto out; in wcn36xx_smd_ipv6_ns_offload()
3039 out: in wcn36xx_smd_ipv6_ns_offload()
3040 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_ipv6_ns_offload()
3058 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_gtk_offload()
3063 memcpy(&msg_body.kek, vif_priv->rekey_data.kek, NL80211_KEK_LEN); in wcn36xx_smd_gtk_offload()
3064 memcpy(&msg_body.kck, vif_priv->rekey_data.kck, NL80211_KCK_LEN); in wcn36xx_smd_gtk_offload()
3066 le64_to_cpu(vif_priv->rekey_data.replay_ctr); in wcn36xx_smd_gtk_offload()
3067 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_gtk_offload()
3072 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_gtk_offload()
3077 goto out; in wcn36xx_smd_gtk_offload()
3079 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_gtk_offload()
3082 goto out; in wcn36xx_smd_gtk_offload()
3084 out: in wcn36xx_smd_gtk_offload()
3085 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_gtk_offload()
3096 if (wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len)) in wcn36xx_smd_gtk_offload_get_info_rsp()
3097 return -EIO; in wcn36xx_smd_gtk_offload_get_info_rsp()
3099 rsp = (struct wcn36xx_hal_gtk_offload_get_info_rsp_msg *)wcn->hal_buf; in wcn36xx_smd_gtk_offload_get_info_rsp()
3101 if (rsp->bss_index != vif_priv->bss_index) { in wcn36xx_smd_gtk_offload_get_info_rsp()
3103 rsp->bss_index); in wcn36xx_smd_gtk_offload_get_info_rsp()
3104 return -ENOENT; in wcn36xx_smd_gtk_offload_get_info_rsp()
3107 if (vif_priv->rekey_data.replay_ctr != cpu_to_le64(rsp->key_replay_counter)) { in wcn36xx_smd_gtk_offload_get_info_rsp()
3108 replay_ctr = cpu_to_be64(rsp->key_replay_counter); in wcn36xx_smd_gtk_offload_get_info_rsp()
3109 vif_priv->rekey_data.replay_ctr = in wcn36xx_smd_gtk_offload_get_info_rsp()
3110 cpu_to_le64(rsp->key_replay_counter); in wcn36xx_smd_gtk_offload_get_info_rsp()
3111 ieee80211_gtk_rekey_notify(vif, vif->bss_conf.bssid, in wcn36xx_smd_gtk_offload_get_info_rsp()
3115 rsp->key_replay_counter); in wcn36xx_smd_gtk_offload_get_info_rsp()
3122 rsp->status, rsp->last_rekey_status, in wcn36xx_smd_gtk_offload_get_info_rsp()
3123 rsp->key_replay_counter, rsp->total_rekey_count, in wcn36xx_smd_gtk_offload_get_info_rsp()
3124 rsp->gtk_rekey_count, rsp->igtk_rekey_count, in wcn36xx_smd_gtk_offload_get_info_rsp()
3125 rsp->bss_index); in wcn36xx_smd_gtk_offload_get_info_rsp()
3137 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_gtk_offload_get_info()
3141 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_gtk_offload_get_info()
3143 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_gtk_offload_get_info()
3148 goto out; in wcn36xx_smd_gtk_offload_get_info()
3150 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_gtk_offload_get_info()
3153 goto out; in wcn36xx_smd_gtk_offload_get_info()
3156 out: in wcn36xx_smd_gtk_offload_get_info()
3157 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_gtk_offload_get_info()
3166 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_wlan_host_suspend_ind()
3171 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_wlan_host_suspend_ind()
3173 ret = rpmsg_send(wcn->smd_channel, wcn->hal_buf, msg_body.header.len); in wcn36xx_smd_wlan_host_suspend_ind()
3175 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_wlan_host_suspend_ind()
3186 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_host_resume()
3191 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_host_resume()
3196 goto out; in wcn36xx_smd_host_resume()
3198 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_host_resume()
3201 goto out; in wcn36xx_smd_host_resume()
3204 rsp = (struct wcn36xx_hal_host_resume_rsp_msg *)wcn->hal_buf; in wcn36xx_smd_host_resume()
3205 if (rsp->status) in wcn36xx_smd_host_resume()
3206 wcn36xx_warn("wlan_host_resume status=%d\n", rsp->status); in wcn36xx_smd_host_resume()
3208 out: in wcn36xx_smd_host_resume()
3209 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_host_resume()
3262 if (!wcn36xx_firmware_get_feat_caps(wcn->fw_feat_caps, BCN_FILTER)) in wcn36xx_smd_add_beacon_filter()
3263 return -EOPNOTSUPP; in wcn36xx_smd_add_beacon_filter()
3265 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_beacon_filter()
3268 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_beacon_filter()
3270 body = (struct wcn36xx_hal_add_bcn_filter_req_msg *)wcn->hal_buf; in wcn36xx_smd_add_beacon_filter()
3271 body->capability_info = vif->bss_conf.assoc_capability; in wcn36xx_smd_add_beacon_filter()
3272 body->capability_mask = WCN36XX_FILTER_CAPABILITY_MASK; in wcn36xx_smd_add_beacon_filter()
3273 body->beacon_interval = vif->bss_conf.beacon_int; in wcn36xx_smd_add_beacon_filter()
3274 body->ie_num = ARRAY_SIZE(bcn_filter_ies); in wcn36xx_smd_add_beacon_filter()
3275 body->bss_index = vif_priv->bss_index; in wcn36xx_smd_add_beacon_filter()
3277 payload = ((u8 *)body) + body->header.len; in wcn36xx_smd_add_beacon_filter()
3281 body->header.len += payload_size; in wcn36xx_smd_add_beacon_filter()
3283 ret = wcn36xx_smd_send_and_wait(wcn, body->header.len); in wcn36xx_smd_add_beacon_filter()
3286 goto out; in wcn36xx_smd_add_beacon_filter()
3289 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_add_beacon_filter()
3292 goto out; in wcn36xx_smd_add_beacon_filter()
3294 out: in wcn36xx_smd_add_beacon_filter()
3295 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_beacon_filter()
3304 struct wcn36xx *wcn = hw->priv; in wcn36xx_smd_rsp_process()
3308 switch (msg_header->msg_type) { in wcn36xx_smd_rsp_process()
3356 memcpy(wcn->hal_buf, buf, len); in wcn36xx_smd_rsp_process()
3357 wcn->hal_rsp_len = len; in wcn36xx_smd_rsp_process()
3358 complete(&wcn->hal_rsp_compl); in wcn36xx_smd_rsp_process()
3371 wcn36xx_err("Run out of memory while handling SMD_EVENT (%d)\n", in wcn36xx_smd_rsp_process()
3372 msg_header->msg_type); in wcn36xx_smd_rsp_process()
3373 return -ENOMEM; in wcn36xx_smd_rsp_process()
3376 msg_ind->msg_len = len; in wcn36xx_smd_rsp_process()
3377 memcpy(msg_ind->msg, buf, len); in wcn36xx_smd_rsp_process()
3379 spin_lock(&wcn->hal_ind_lock); in wcn36xx_smd_rsp_process()
3380 list_add_tail(&msg_ind->list, &wcn->hal_ind_queue); in wcn36xx_smd_rsp_process()
3381 queue_work(wcn->hal_ind_wq, &wcn->hal_ind_work); in wcn36xx_smd_rsp_process()
3382 spin_unlock(&wcn->hal_ind_lock); in wcn36xx_smd_rsp_process()
3387 msg_header->msg_type); in wcn36xx_smd_rsp_process()
3403 spin_lock_irqsave(&wcn->hal_ind_lock, flags); in wcn36xx_ind_smd_work()
3405 if (list_empty(&wcn->hal_ind_queue)) { in wcn36xx_ind_smd_work()
3406 spin_unlock_irqrestore(&wcn->hal_ind_lock, flags); in wcn36xx_ind_smd_work()
3410 hal_ind_msg = list_first_entry(&wcn->hal_ind_queue, in wcn36xx_ind_smd_work()
3413 list_del(&hal_ind_msg->list); in wcn36xx_ind_smd_work()
3414 spin_unlock_irqrestore(&wcn->hal_ind_lock, flags); in wcn36xx_ind_smd_work()
3416 msg_header = (struct wcn36xx_hal_msg_header *)hal_ind_msg->msg; in wcn36xx_ind_smd_work()
3418 switch (msg_header->msg_type) { in wcn36xx_ind_smd_work()
3425 hal_ind_msg->msg, in wcn36xx_ind_smd_work()
3426 hal_ind_msg->msg_len); in wcn36xx_ind_smd_work()
3430 hal_ind_msg->msg, in wcn36xx_ind_smd_work()
3431 hal_ind_msg->msg_len); in wcn36xx_ind_smd_work()
3435 hal_ind_msg->msg, in wcn36xx_ind_smd_work()
3436 hal_ind_msg->msg_len); in wcn36xx_ind_smd_work()
3440 hal_ind_msg->msg, in wcn36xx_ind_smd_work()
3441 hal_ind_msg->msg_len); in wcn36xx_ind_smd_work()
3444 wcn36xx_smd_hw_scan_ind(wcn, hal_ind_msg->msg, in wcn36xx_ind_smd_work()
3445 hal_ind_msg->msg_len); in wcn36xx_ind_smd_work()
3449 msg_header->msg_type); in wcn36xx_ind_smd_work()
3458 wcn->hal_ind_wq = create_freezable_workqueue("wcn36xx_smd_ind"); in wcn36xx_smd_open()
3459 if (!wcn->hal_ind_wq) in wcn36xx_smd_open()
3460 return -ENOMEM; in wcn36xx_smd_open()
3462 INIT_WORK(&wcn->hal_ind_work, wcn36xx_ind_smd_work); in wcn36xx_smd_open()
3463 INIT_LIST_HEAD(&wcn->hal_ind_queue); in wcn36xx_smd_open()
3464 spin_lock_init(&wcn->hal_ind_lock); in wcn36xx_smd_open()
3473 cancel_work_sync(&wcn->hal_ind_work); in wcn36xx_smd_close()
3474 destroy_workqueue(wcn->hal_ind_wq); in wcn36xx_smd_close()
3476 list_for_each_entry_safe(msg, tmp, &wcn->hal_ind_queue, list) in wcn36xx_smd_close()