Lines Matching +full:smd +full:- +full:channels
23 #include "smd.h"
143 WCN36XX_CFG_VAL(ASD_TRIGGER_THRESHOLD, -60),
187 return -ENOMEM; in put_cfg_tlv_u32()
190 entry = (struct wcn36xx_hal_cfg *) (wcn->hal_buf + *len); in put_cfg_tlv_u32()
191 entry->id = id; in put_cfg_tlv_u32()
192 entry->len = sizeof(u32); in put_cfg_tlv_u32()
193 entry->pad_bytes = 0; in put_cfg_tlv_u32()
194 entry->reserve = 0; in put_cfg_tlv_u32()
209 bss_params->nw_type = WCN36XX_HAL_11A_NW_TYPE; in wcn36xx_smd_set_bss_nw_type()
210 else if (sta && sta->ht_cap.ht_supported) in wcn36xx_smd_set_bss_nw_type()
211 bss_params->nw_type = WCN36XX_HAL_11N_NW_TYPE; in wcn36xx_smd_set_bss_nw_type()
212 else if (sta && (sta->supp_rates[NL80211_BAND_2GHZ] & 0x7f)) in wcn36xx_smd_set_bss_nw_type()
213 bss_params->nw_type = WCN36XX_HAL_11G_NW_TYPE; in wcn36xx_smd_set_bss_nw_type()
215 bss_params->nw_type = WCN36XX_HAL_11B_NW_TYPE; in wcn36xx_smd_set_bss_nw_type()
227 if (sta && sta->ht_cap.ht_supported) { in wcn36xx_smd_set_bss_ht_params()
228 unsigned long caps = sta->ht_cap.cap; in wcn36xx_smd_set_bss_ht_params()
229 bss_params->ht = sta->ht_cap.ht_supported; in wcn36xx_smd_set_bss_ht_params()
230 bss_params->tx_channel_width_set = is_cap_supported(caps, in wcn36xx_smd_set_bss_ht_params()
232 bss_params->lsig_tx_op_protection_full_support = in wcn36xx_smd_set_bss_ht_params()
236 bss_params->ht_oper_mode = vif->bss_conf.ht_operation_mode; in wcn36xx_smd_set_bss_ht_params()
237 bss_params->lln_non_gf_coexist = in wcn36xx_smd_set_bss_ht_params()
238 !!(vif->bss_conf.ht_operation_mode & in wcn36xx_smd_set_bss_ht_params()
241 bss_params->dual_cts_protection = 0; in wcn36xx_smd_set_bss_ht_params()
243 bss_params->ht20_coexist = 0; in wcn36xx_smd_set_bss_ht_params()
252 if (sta && sta->vht_cap.vht_supported) in wcn36xx_smd_set_bss_vht_params()
253 bss->vht_capable = 1; in wcn36xx_smd_set_bss_vht_params()
259 if (sta->ht_cap.ht_supported) { in wcn36xx_smd_set_sta_ht_params()
260 unsigned long caps = sta->ht_cap.cap; in wcn36xx_smd_set_sta_ht_params()
261 sta_params->ht_capable = sta->ht_cap.ht_supported; in wcn36xx_smd_set_sta_ht_params()
262 sta_params->tx_channel_width_set = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
264 sta_params->lsig_txop_protection = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
267 sta_params->max_ampdu_size = sta->ht_cap.ampdu_factor; in wcn36xx_smd_set_sta_ht_params()
268 sta_params->max_ampdu_density = sta->ht_cap.ampdu_density; in wcn36xx_smd_set_sta_ht_params()
269 sta_params->max_amsdu_size = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
271 sta_params->sgi_20Mhz = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
273 sta_params->sgi_40mhz = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
275 sta_params->green_field_capable = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
277 sta_params->delayed_ba_support = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
279 sta_params->dsss_cck_mode_40mhz = is_cap_supported(caps, in wcn36xx_smd_set_sta_ht_params()
288 if (sta->vht_cap.vht_supported) { in wcn36xx_smd_set_sta_vht_params()
289 unsigned long caps = sta->vht_cap.cap; in wcn36xx_smd_set_sta_vht_params()
291 sta_params->vht_capable = sta->vht_cap.vht_supported; in wcn36xx_smd_set_sta_vht_params()
292 sta_params->vht_ldpc_enabled = in wcn36xx_smd_set_sta_vht_params()
294 if (get_feat_caps(wcn->fw_feat_caps, MU_MIMO)) { in wcn36xx_smd_set_sta_vht_params()
295 sta_params->vht_tx_mu_beamformee_capable = in wcn36xx_smd_set_sta_vht_params()
297 if (sta_params->vht_tx_mu_beamformee_capable) in wcn36xx_smd_set_sta_vht_params()
298 sta_params->vht_tx_bf_enabled = 1; in wcn36xx_smd_set_sta_vht_params()
300 sta_params->vht_tx_mu_beamformee_capable = 0; in wcn36xx_smd_set_sta_vht_params()
302 sta_params->vht_tx_channel_width_set = 0; in wcn36xx_smd_set_sta_vht_params()
309 if (sta->ht_cap.ht_supported) { in wcn36xx_smd_set_sta_ht_ldpc_params()
310 sta_params->ht_ldpc_enabled = in wcn36xx_smd_set_sta_ht_ldpc_params()
311 is_cap_supported(sta->ht_cap.cap, IEEE80211_HT_CAP_LDPC_CODING); in wcn36xx_smd_set_sta_ht_ldpc_params()
318 sta_params->ht_capable = 1; in wcn36xx_smd_set_sta_default_ht_params()
319 sta_params->tx_channel_width_set = 1; in wcn36xx_smd_set_sta_default_ht_params()
320 sta_params->lsig_txop_protection = 1; in wcn36xx_smd_set_sta_default_ht_params()
321 sta_params->max_ampdu_size = 3; in wcn36xx_smd_set_sta_default_ht_params()
322 sta_params->max_ampdu_density = 5; in wcn36xx_smd_set_sta_default_ht_params()
323 sta_params->max_amsdu_size = 0; in wcn36xx_smd_set_sta_default_ht_params()
324 sta_params->sgi_20Mhz = 1; in wcn36xx_smd_set_sta_default_ht_params()
325 sta_params->sgi_40mhz = 1; in wcn36xx_smd_set_sta_default_ht_params()
326 sta_params->green_field_capable = 1; in wcn36xx_smd_set_sta_default_ht_params()
327 sta_params->delayed_ba_support = 0; in wcn36xx_smd_set_sta_default_ht_params()
328 sta_params->dsss_cck_mode_40mhz = 1; in wcn36xx_smd_set_sta_default_ht_params()
334 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_set_sta_default_vht_params()
335 sta_params->vht_capable = 1; in wcn36xx_smd_set_sta_default_vht_params()
336 sta_params->vht_tx_mu_beamformee_capable = 1; in wcn36xx_smd_set_sta_default_vht_params()
338 sta_params->vht_capable = 0; in wcn36xx_smd_set_sta_default_vht_params()
339 sta_params->vht_tx_mu_beamformee_capable = 0; in wcn36xx_smd_set_sta_default_vht_params()
342 sta_params->vht_ldpc_enabled = 0; in wcn36xx_smd_set_sta_default_vht_params()
343 sta_params->vht_tx_channel_width_set = 0; in wcn36xx_smd_set_sta_default_vht_params()
344 sta_params->vht_tx_bf_enabled = 0; in wcn36xx_smd_set_sta_default_vht_params()
350 if (wcn->rf_id == RF_IRIS_WCN3680) in wcn36xx_smd_set_sta_default_ht_ldpc_params()
351 sta_params->ht_ldpc_enabled = 1; in wcn36xx_smd_set_sta_default_ht_ldpc_params()
353 sta_params->ht_ldpc_enabled = 0; in wcn36xx_smd_set_sta_default_ht_ldpc_params()
363 if (vif->type == NL80211_IFTYPE_ADHOC || in wcn36xx_smd_set_sta_params()
364 vif->type == NL80211_IFTYPE_AP || in wcn36xx_smd_set_sta_params()
365 vif->type == NL80211_IFTYPE_MESH_POINT) { in wcn36xx_smd_set_sta_params()
366 sta_params->type = 1; in wcn36xx_smd_set_sta_params()
367 sta_params->sta_index = WCN36XX_HAL_STA_INVALID_IDX; in wcn36xx_smd_set_sta_params()
369 sta_params->type = 0; in wcn36xx_smd_set_sta_params()
370 sta_params->sta_index = vif_priv->self_sta_index; in wcn36xx_smd_set_sta_params()
373 sta_params->listen_interval = WCN36XX_LISTEN_INTERVAL(wcn); in wcn36xx_smd_set_sta_params()
380 if (NL80211_IFTYPE_STATION == vif->type) in wcn36xx_smd_set_sta_params()
381 memcpy(&sta_params->mac, vif->addr, ETH_ALEN); in wcn36xx_smd_set_sta_params()
383 memcpy(&sta_params->bssid, vif->addr, ETH_ALEN); in wcn36xx_smd_set_sta_params()
385 sta_params->encrypt_type = vif_priv->encrypt_type; in wcn36xx_smd_set_sta_params()
386 sta_params->short_preamble_supported = true; in wcn36xx_smd_set_sta_params()
388 sta_params->rifs_mode = 0; in wcn36xx_smd_set_sta_params()
389 sta_params->rmf = 0; in wcn36xx_smd_set_sta_params()
390 sta_params->action = 0; in wcn36xx_smd_set_sta_params()
391 sta_params->uapsd = 0; in wcn36xx_smd_set_sta_params()
392 sta_params->mimo_ps = WCN36XX_HAL_HT_MIMO_PS_STATIC; in wcn36xx_smd_set_sta_params()
393 sta_params->max_ampdu_duration = 0; in wcn36xx_smd_set_sta_params()
394 sta_params->bssid_index = vif_priv->bss_index; in wcn36xx_smd_set_sta_params()
395 sta_params->p2p = 0; in wcn36xx_smd_set_sta_params()
399 if (NL80211_IFTYPE_STATION == vif->type) in wcn36xx_smd_set_sta_params()
400 memcpy(&sta_params->bssid, sta->addr, ETH_ALEN); in wcn36xx_smd_set_sta_params()
402 memcpy(&sta_params->mac, sta->addr, ETH_ALEN); in wcn36xx_smd_set_sta_params()
403 sta_params->wmm_enabled = sta->wme; in wcn36xx_smd_set_sta_params()
404 sta_params->max_sp_len = sta->max_sp; in wcn36xx_smd_set_sta_params()
405 sta_params->aid = sta_priv->aid; in wcn36xx_smd_set_sta_params()
407 memcpy(&sta_params->supported_rates, &sta_priv->supported_rates, in wcn36xx_smd_set_sta_params()
411 &sta_params->supported_rates); in wcn36xx_smd_set_sta_params()
421 (struct wcn36xx_hal_msg_header *)wcn->hal_buf; in wcn36xx_smd_send_and_wait()
422 u16 req_type = hdr->msg_type; in wcn36xx_smd_send_and_wait()
424 wcn36xx_dbg_dump(WCN36XX_DBG_SMD_DUMP, "HAL >>> ", wcn->hal_buf, len); in wcn36xx_smd_send_and_wait()
426 init_completion(&wcn->hal_rsp_compl); in wcn36xx_smd_send_and_wait()
428 ret = rpmsg_send(wcn->smd_channel, wcn->hal_buf, len); in wcn36xx_smd_send_and_wait()
433 if (wait_for_completion_timeout(&wcn->hal_rsp_compl, in wcn36xx_smd_send_and_wait()
435 wcn36xx_err("Timeout! No SMD response to req %d in %dms\n", in wcn36xx_smd_send_and_wait()
437 ret = -ETIME; in wcn36xx_smd_send_and_wait()
441 "SMD command (req %d, rsp %d) completed in %dms\n", in wcn36xx_smd_send_and_wait()
442 req_type, hdr->msg_type, in wcn36xx_smd_send_and_wait()
443 jiffies_to_msecs(jiffies - start)); in wcn36xx_smd_send_and_wait()
465 p_msg_body->header.msg_type = WCN36XX_HAL_PROCESS_PTT_REQ; \
466 p_msg_body->header.msg_version = WCN36XX_HAL_MSG_VERSION0; \
467 p_msg_body->header.len = sizeof(*p_msg_body) + ppt_msg_len; \
478 memcpy(send_buf, p_msg_body, p_msg_body->header.len); \
487 return -EIO; in wcn36xx_smd_rsp_status_check()
492 if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) in wcn36xx_smd_rsp_status_check()
493 return rsp->status; in wcn36xx_smd_rsp_status_check()
506 if (!wcn->nv) { in wcn36xx_smd_load_nv()
507 ret = request_firmware(&wcn->nv, wcn->nv_file, wcn->dev); in wcn36xx_smd_load_nv()
510 wcn->nv_file, ret); in wcn36xx_smd_load_nv()
515 nv_d = (struct nv_data *)wcn->nv->data; in wcn36xx_smd_load_nv()
522 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_load_nv()
525 fw_bytes_left = wcn->nv->size - fm_offset - 4; in wcn36xx_smd_load_nv()
539 memcpy(wcn->hal_buf, &msg_body, sizeof(msg_body)); in wcn36xx_smd_load_nv()
542 memcpy(wcn->hal_buf + sizeof(msg_body), in wcn36xx_smd_load_nv()
543 &nv_d->table + fm_offset, in wcn36xx_smd_load_nv()
549 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, in wcn36xx_smd_load_nv()
550 wcn->hal_rsp_len); in wcn36xx_smd_load_nv()
562 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_load_nv()
571 return -EIO; in wcn36xx_smd_start_rsp()
575 if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->start_rsp_params.status) in wcn36xx_smd_start_rsp()
576 return -EIO; in wcn36xx_smd_start_rsp()
578 memcpy(wcn->crm_version, rsp->start_rsp_params.crm_version, in wcn36xx_smd_start_rsp()
580 memcpy(wcn->wlan_version, rsp->start_rsp_params.wlan_version, in wcn36xx_smd_start_rsp()
584 wcn->crm_version[WCN36XX_HAL_VERSION_LENGTH] = '\0'; in wcn36xx_smd_start_rsp()
585 wcn->wlan_version[WCN36XX_HAL_VERSION_LENGTH] = '\0'; in wcn36xx_smd_start_rsp()
587 wcn->fw_revision = rsp->start_rsp_params.version.revision; in wcn36xx_smd_start_rsp()
588 wcn->fw_version = rsp->start_rsp_params.version.version; in wcn36xx_smd_start_rsp()
589 wcn->fw_minor = rsp->start_rsp_params.version.minor; in wcn36xx_smd_start_rsp()
590 wcn->fw_major = rsp->start_rsp_params.version.major; in wcn36xx_smd_start_rsp()
592 if (wcn->first_boot) { in wcn36xx_smd_start_rsp()
593 wcn->first_boot = false; in wcn36xx_smd_start_rsp()
595 wcn->wlan_version, wcn->crm_version); in wcn36xx_smd_start_rsp()
598 wcn->fw_major, wcn->fw_minor, in wcn36xx_smd_start_rsp()
599 wcn->fw_version, wcn->fw_revision, in wcn36xx_smd_start_rsp()
600 rsp->start_rsp_params.stations, in wcn36xx_smd_start_rsp()
601 rsp->start_rsp_params.bssids); in wcn36xx_smd_start_rsp()
615 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start()
621 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_start()
623 body = (struct wcn36xx_hal_mac_start_req_msg *)wcn->hal_buf; in wcn36xx_smd_start()
624 len = body->header.len; in wcn36xx_smd_start()
626 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_start()
640 body->header.len = len; in wcn36xx_smd_start()
641 body->params.len = len - sizeof(*body); in wcn36xx_smd_start()
646 ret = wcn36xx_smd_send_and_wait(wcn, body->header.len); in wcn36xx_smd_start()
652 ret = wcn36xx_smd_start_rsp(wcn, wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start()
659 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start()
668 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_stop()
673 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_stop()
680 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_stop()
686 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_stop()
697 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_init_scan()
701 if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX) { in wcn36xx_smd_init_scan()
705 msg_body.scan_entry.bss_index[0] = vif_priv->bss_index; in wcn36xx_smd_init_scan()
709 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_init_scan()
718 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_init_scan()
724 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_init_scan()
733 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start_scan()
738 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_start_scan()
748 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start_scan()
754 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start_scan()
763 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_end_scan()
768 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_end_scan()
778 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_end_scan()
784 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_end_scan()
796 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_finish_scan()
801 if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX) { in wcn36xx_smd_finish_scan()
805 msg_body.scan_entry.bss_index[0] = vif_priv->bss_index; in wcn36xx_smd_finish_scan()
809 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_finish_scan()
819 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_finish_scan()
825 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_finish_scan()
836 if (req->ie_len > WCN36XX_MAX_SCAN_IE_LEN) in wcn36xx_smd_start_hw_scan()
837 return -EINVAL; in wcn36xx_smd_start_hw_scan()
839 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start_hw_scan()
842 ret = -ENOMEM; in wcn36xx_smd_start_hw_scan()
848 msg_body->scan_type = WCN36XX_HAL_SCAN_TYPE_ACTIVE; in wcn36xx_smd_start_hw_scan()
849 msg_body->min_ch_time = 30; in wcn36xx_smd_start_hw_scan()
850 msg_body->max_ch_time = 100; in wcn36xx_smd_start_hw_scan()
851 msg_body->scan_hidden = 1; in wcn36xx_smd_start_hw_scan()
852 memcpy(msg_body->mac, vif->addr, ETH_ALEN); in wcn36xx_smd_start_hw_scan()
853 msg_body->bss_type = vif_priv->bss_type; in wcn36xx_smd_start_hw_scan()
854 msg_body->p2p_search = vif->p2p; in wcn36xx_smd_start_hw_scan()
856 msg_body->num_ssid = min_t(u8, req->n_ssids, ARRAY_SIZE(msg_body->ssids)); in wcn36xx_smd_start_hw_scan()
857 for (i = 0; i < msg_body->num_ssid; i++) { in wcn36xx_smd_start_hw_scan()
858 msg_body->ssids[i].length = min_t(u8, req->ssids[i].ssid_len, in wcn36xx_smd_start_hw_scan()
859 sizeof(msg_body->ssids[i].ssid)); in wcn36xx_smd_start_hw_scan()
860 memcpy(msg_body->ssids[i].ssid, req->ssids[i].ssid, in wcn36xx_smd_start_hw_scan()
861 msg_body->ssids[i].length); in wcn36xx_smd_start_hw_scan()
864 msg_body->num_channel = min_t(u8, req->n_channels, in wcn36xx_smd_start_hw_scan()
865 sizeof(msg_body->channels)); in wcn36xx_smd_start_hw_scan()
866 for (i = 0; i < msg_body->num_channel; i++) { in wcn36xx_smd_start_hw_scan()
867 msg_body->channels[i] = in wcn36xx_smd_start_hw_scan()
868 HW_VALUE_CHANNEL(req->channels[i]->hw_value); in wcn36xx_smd_start_hw_scan()
871 msg_body->header.len -= WCN36XX_MAX_SCAN_IE_LEN; in wcn36xx_smd_start_hw_scan()
873 if (req->ie_len > 0) { in wcn36xx_smd_start_hw_scan()
874 msg_body->ie_len = req->ie_len; in wcn36xx_smd_start_hw_scan()
875 msg_body->header.len += req->ie_len; in wcn36xx_smd_start_hw_scan()
876 memcpy(msg_body->ie, req->ie, req->ie_len); in wcn36xx_smd_start_hw_scan()
879 PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); in wcn36xx_smd_start_hw_scan()
882 "hal start hw-scan (channels: %u; ssids: %u; p2p: %s)\n", in wcn36xx_smd_start_hw_scan()
883 msg_body->num_channel, msg_body->num_ssid, in wcn36xx_smd_start_hw_scan()
884 msg_body->p2p_search ? "yes" : "no"); in wcn36xx_smd_start_hw_scan()
886 ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); in wcn36xx_smd_start_hw_scan()
891 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start_hw_scan()
899 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start_hw_scan()
908 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_stop_hw_scan()
910 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_stop_hw_scan()
912 wcn36xx_dbg(WCN36XX_DBG_HAL, "hal stop hw-scan\n"); in wcn36xx_smd_stop_hw_scan()
919 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_stop_hw_scan()
926 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_stop_hw_scan()
940 rsp->channel_number, rsp->status); in wcn36xx_smd_switch_channel_rsp()
950 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_switch_channel()
956 memcpy(msg_body.self_sta_mac_addr, vif->addr, ETH_ALEN); in wcn36xx_smd_switch_channel()
958 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_switch_channel()
965 ret = wcn36xx_smd_switch_channel_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_switch_channel()
971 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_switch_channel()
988 rsp->header.len); in wcn36xx_smd_process_ptt_msg_rsp()
989 wcn36xx_dbg_dump(WCN36XX_DBG_HAL_DUMP, "HAL_PTT_MSG_RSP:", rsp->ptt_msg, in wcn36xx_smd_process_ptt_msg_rsp()
990 rsp->header.len - sizeof(rsp->ptt_msg_resp_status)); in wcn36xx_smd_process_ptt_msg_rsp()
992 if (rsp->header.len > 0) { in wcn36xx_smd_process_ptt_msg_rsp()
993 *p_ptt_rsp_msg = kmemdup(rsp->ptt_msg, rsp->header.len, in wcn36xx_smd_process_ptt_msg_rsp()
996 return -ENOMEM; in wcn36xx_smd_process_ptt_msg_rsp()
1008 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_process_ptt_msg()
1013 ret = -ENOMEM; in wcn36xx_smd_process_ptt_msg()
1018 memcpy(&p_msg_body->ptt_msg, ptt_msg, len); in wcn36xx_smd_process_ptt_msg()
1020 PREPARE_HAL_PTT_MSG_BUF(wcn->hal_buf, p_msg_body); in wcn36xx_smd_process_ptt_msg()
1022 ret = wcn36xx_smd_send_and_wait(wcn, p_msg_body->header.len); in wcn36xx_smd_process_ptt_msg()
1027 ret = wcn36xx_smd_process_ptt_msg_rsp(wcn->hal_buf, wcn->hal_rsp_len, in wcn36xx_smd_process_ptt_msg()
1036 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_process_ptt_msg()
1047 rsp->status &= (~(WCN36XX_FW_MSG_PNO_VERSION_MASK)); in wcn36xx_smd_update_scan_params_rsp()
1049 if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) { in wcn36xx_smd_update_scan_params_rsp()
1051 return rsp->status; in wcn36xx_smd_update_scan_params_rsp()
1058 u8 *channels, size_t channel_count) in wcn36xx_smd_update_scan_params() argument
1063 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_scan_params()
1070 memcpy(msg_body.channels, channels, channel_count); in wcn36xx_smd_update_scan_params()
1077 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_update_scan_params()
1088 ret = wcn36xx_smd_update_scan_params_rsp(wcn->hal_buf, in wcn36xx_smd_update_scan_params()
1089 wcn->hal_rsp_len); in wcn36xx_smd_update_scan_params()
1096 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_scan_params()
1109 return -EINVAL; in wcn36xx_smd_add_sta_self_rsp()
1113 if (rsp->status != WCN36XX_FW_MSG_RESULT_SUCCESS) { in wcn36xx_smd_add_sta_self_rsp()
1115 rsp->status); in wcn36xx_smd_add_sta_self_rsp()
1116 return rsp->status; in wcn36xx_smd_add_sta_self_rsp()
1121 rsp->status, rsp->self_sta_index, rsp->dpu_index); in wcn36xx_smd_add_sta_self_rsp()
1123 vif_priv->self_sta_index = rsp->self_sta_index; in wcn36xx_smd_add_sta_self_rsp()
1124 vif_priv->self_dpu_desc_index = rsp->dpu_index; in wcn36xx_smd_add_sta_self_rsp()
1134 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_sta_self()
1137 memcpy(&msg_body.self_addr, vif->addr, ETH_ALEN); in wcn36xx_smd_add_sta_self()
1139 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_sta_self()
1152 wcn->hal_buf, in wcn36xx_smd_add_sta_self()
1153 wcn->hal_rsp_len); in wcn36xx_smd_add_sta_self()
1159 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_sta_self()
1168 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta_self()
1173 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_sta_self()
1180 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_sta_self()
1187 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta_self()
1196 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta()
1201 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_sta()
1212 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_sta()
1218 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta()
1227 return -EIO; in wcn36xx_smd_join_rsp()
1233 rsp->status, rsp->tx_mgmt_power); in wcn36xx_smd_join_rsp()
1243 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_join()
1250 if (conf_is_ht40_minus(&wcn->hw->conf)) in wcn36xx_smd_join()
1253 else if (conf_is_ht40_plus(&wcn->hw->conf)) in wcn36xx_smd_join()
1263 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_join()
1275 ret = wcn36xx_smd_join_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_join()
1281 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_join()
1292 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_link_st()
1299 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_link_st()
1310 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_link_st()
1316 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_link_st()
1325 memcpy(&v1->bssid, orig->bssid, ETH_ALEN); in wcn36xx_smd_convert_sta_to_v1()
1326 memcpy(&v1->mac, orig->mac, ETH_ALEN); in wcn36xx_smd_convert_sta_to_v1()
1327 v1->aid = orig->aid; in wcn36xx_smd_convert_sta_to_v1()
1328 v1->type = orig->type; in wcn36xx_smd_convert_sta_to_v1()
1329 v1->short_preamble_supported = orig->short_preamble_supported; in wcn36xx_smd_convert_sta_to_v1()
1330 v1->listen_interval = orig->listen_interval; in wcn36xx_smd_convert_sta_to_v1()
1331 v1->wmm_enabled = orig->wmm_enabled; in wcn36xx_smd_convert_sta_to_v1()
1332 v1->ht_capable = orig->ht_capable; in wcn36xx_smd_convert_sta_to_v1()
1333 v1->tx_channel_width_set = orig->tx_channel_width_set; in wcn36xx_smd_convert_sta_to_v1()
1334 v1->rifs_mode = orig->rifs_mode; in wcn36xx_smd_convert_sta_to_v1()
1335 v1->lsig_txop_protection = orig->lsig_txop_protection; in wcn36xx_smd_convert_sta_to_v1()
1336 v1->max_ampdu_size = orig->max_ampdu_size; in wcn36xx_smd_convert_sta_to_v1()
1337 v1->max_ampdu_density = orig->max_ampdu_density; in wcn36xx_smd_convert_sta_to_v1()
1338 v1->sgi_40mhz = orig->sgi_40mhz; in wcn36xx_smd_convert_sta_to_v1()
1339 v1->sgi_20Mhz = orig->sgi_20Mhz; in wcn36xx_smd_convert_sta_to_v1()
1340 v1->rmf = orig->rmf; in wcn36xx_smd_convert_sta_to_v1()
1341 v1->encrypt_type = orig->encrypt_type; in wcn36xx_smd_convert_sta_to_v1()
1342 v1->action = orig->action; in wcn36xx_smd_convert_sta_to_v1()
1343 v1->uapsd = orig->uapsd; in wcn36xx_smd_convert_sta_to_v1()
1344 v1->max_sp_len = orig->max_sp_len; in wcn36xx_smd_convert_sta_to_v1()
1345 v1->green_field_capable = orig->green_field_capable; in wcn36xx_smd_convert_sta_to_v1()
1346 v1->mimo_ps = orig->mimo_ps; in wcn36xx_smd_convert_sta_to_v1()
1347 v1->delayed_ba_support = orig->delayed_ba_support; in wcn36xx_smd_convert_sta_to_v1()
1348 v1->max_ampdu_duration = orig->max_ampdu_duration; in wcn36xx_smd_convert_sta_to_v1()
1349 v1->dsss_cck_mode_40mhz = orig->dsss_cck_mode_40mhz; in wcn36xx_smd_convert_sta_to_v1()
1350 memcpy(&v1->supported_rates, &orig->supported_rates, in wcn36xx_smd_convert_sta_to_v1()
1351 sizeof(orig->supported_rates)); in wcn36xx_smd_convert_sta_to_v1()
1352 v1->sta_index = orig->sta_index; in wcn36xx_smd_convert_sta_to_v1()
1353 v1->bssid_index = orig->bssid_index; in wcn36xx_smd_convert_sta_to_v1()
1354 v1->p2p = orig->p2p; in wcn36xx_smd_convert_sta_to_v1()
1373 memcpy(&sta_par->supported_rates, &sta_priv->supported_rates, in wcn36xx_smd_set_sta_params_v1()
1374 sizeof(sta_par->supported_rates)); in wcn36xx_smd_set_sta_params_v1()
1376 wcn36xx_set_default_rates_v1(&sta_par->supported_rates); in wcn36xx_smd_set_sta_params_v1()
1392 return -EINVAL; in wcn36xx_smd_config_sta_rsp()
1395 params = &rsp->params; in wcn36xx_smd_config_sta_rsp()
1397 if (params->status != WCN36XX_FW_MSG_RESULT_SUCCESS) { in wcn36xx_smd_config_sta_rsp()
1399 params->status); in wcn36xx_smd_config_sta_rsp()
1400 return -EIO; in wcn36xx_smd_config_sta_rsp()
1403 sta_priv->sta_index = params->sta_index; in wcn36xx_smd_config_sta_rsp()
1404 sta_priv->dpu_desc_index = params->dpu_index; in wcn36xx_smd_config_sta_rsp()
1405 sta_priv->ucast_dpu_sign = params->uc_ucast_sig; in wcn36xx_smd_config_sta_rsp()
1409 params->status, params->sta_index, params->bssid_index, in wcn36xx_smd_config_sta_rsp()
1410 params->uc_ucast_sig, params->p2p); in wcn36xx_smd_config_sta_rsp()
1422 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_config_sta_v1()
1426 msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT; in wcn36xx_smd_config_sta_v1()
1433 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_config_sta_v1()
1437 sta_params->action, sta_params->sta_index, sta_params->bssid_index, in wcn36xx_smd_config_sta_v1()
1438 sta_params->bssid, sta_params->type, sta_params->mac, sta_params->aid); in wcn36xx_smd_config_sta_v1()
1456 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_config_sta_v0()
1460 sta_params->action, sta_params->sta_index, in wcn36xx_smd_config_sta_v0()
1461 sta_params->bssid_index, sta_params->bssid, in wcn36xx_smd_config_sta_v0()
1462 sta_params->type, sta_params->mac, sta_params->aid); in wcn36xx_smd_config_sta_v0()
1472 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_config_sta()
1485 wcn->hal_buf, in wcn36xx_smd_config_sta()
1486 wcn->hal_rsp_len); in wcn36xx_smd_config_sta()
1492 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_config_sta()
1507 memcpy(&bss->bssid, bssid, ETH_ALEN); in wcn36xx_smd_set_bss_params()
1509 memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN); in wcn36xx_smd_set_bss_params()
1511 if (vif->type == NL80211_IFTYPE_STATION) { in wcn36xx_smd_set_bss_params()
1512 bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE; in wcn36xx_smd_set_bss_params()
1515 bss->oper_mode = 1; in wcn36xx_smd_set_bss_params()
1516 bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE; in wcn36xx_smd_set_bss_params()
1517 } else if (vif->type == NL80211_IFTYPE_AP || in wcn36xx_smd_set_bss_params()
1518 vif->type == NL80211_IFTYPE_MESH_POINT) { in wcn36xx_smd_set_bss_params()
1519 bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE; in wcn36xx_smd_set_bss_params()
1522 bss->oper_mode = 0; in wcn36xx_smd_set_bss_params()
1523 bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE; in wcn36xx_smd_set_bss_params()
1524 } else if (vif->type == NL80211_IFTYPE_ADHOC) { in wcn36xx_smd_set_bss_params()
1525 bss->bss_type = WCN36XX_HAL_IBSS_MODE; in wcn36xx_smd_set_bss_params()
1528 bss->oper_mode = 1; in wcn36xx_smd_set_bss_params()
1530 wcn36xx_warn("Unknown type for bss config: %d\n", vif->type); in wcn36xx_smd_set_bss_params()
1533 if (vif->type == NL80211_IFTYPE_STATION) in wcn36xx_smd_set_bss_params()
1536 bss->nw_type = WCN36XX_HAL_11N_NW_TYPE; in wcn36xx_smd_set_bss_params()
1538 bss->short_slot_time_supported = vif->bss_conf.use_short_slot; in wcn36xx_smd_set_bss_params()
1539 bss->lla_coexist = 0; in wcn36xx_smd_set_bss_params()
1540 bss->llb_coexist = 0; in wcn36xx_smd_set_bss_params()
1541 bss->llg_coexist = 0; in wcn36xx_smd_set_bss_params()
1542 bss->rifs_mode = 0; in wcn36xx_smd_set_bss_params()
1543 bss->beacon_interval = vif->bss_conf.beacon_int; in wcn36xx_smd_set_bss_params()
1544 bss->dtim_period = vif_priv->dtim_period; in wcn36xx_smd_set_bss_params()
1548 bss->oper_channel = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_smd_set_bss_params()
1550 if (conf_is_ht40_minus(&wcn->hw->conf)) in wcn36xx_smd_set_bss_params()
1551 bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW; in wcn36xx_smd_set_bss_params()
1552 else if (conf_is_ht40_plus(&wcn->hw->conf)) in wcn36xx_smd_set_bss_params()
1553 bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE; in wcn36xx_smd_set_bss_params()
1555 bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE; in wcn36xx_smd_set_bss_params()
1557 bss->reserved = 0; in wcn36xx_smd_set_bss_params()
1559 /* wcn->ssid is only valid in AP and IBSS mode */ in wcn36xx_smd_set_bss_params()
1560 bss->ssid.length = vif_priv->ssid.length; in wcn36xx_smd_set_bss_params()
1561 memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length); in wcn36xx_smd_set_bss_params()
1563 bss->obss_prot_enabled = 0; in wcn36xx_smd_set_bss_params()
1564 bss->rmf = 0; in wcn36xx_smd_set_bss_params()
1565 bss->max_probe_resp_retry_limit = 0; in wcn36xx_smd_set_bss_params()
1566 bss->hidden_ssid = vif->bss_conf.hidden_ssid; in wcn36xx_smd_set_bss_params()
1567 bss->proxy_probe_resp = 0; in wcn36xx_smd_set_bss_params()
1568 bss->edca_params_valid = 0; in wcn36xx_smd_set_bss_params()
1572 bss->ext_set_sta_key_param_valid = 0; in wcn36xx_smd_set_bss_params()
1576 bss->spectrum_mgt_enable = 0; in wcn36xx_smd_set_bss_params()
1577 bss->tx_mgmt_power = 0; in wcn36xx_smd_set_bss_params()
1578 bss->max_tx_power = WCN36XX_MAX_POWER(wcn); in wcn36xx_smd_set_bss_params()
1579 bss->action = update; in wcn36xx_smd_set_bss_params()
1581 vif_priv->bss_type = bss->bss_type; in wcn36xx_smd_set_bss_params()
1599 return -ENOMEM; in wcn36xx_smd_config_bss_v1()
1601 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_config_bss_v1()
1605 msg_body->header.len -= WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT; in wcn36xx_smd_config_bss_v1()
1608 bss = &msg_body->bss_params; in wcn36xx_smd_config_bss_v1()
1609 sta = &bss->sta; in wcn36xx_smd_config_bss_v1()
1616 memcpy(bss->bssid, &bss_v0.bssid, ETH_ALEN); in wcn36xx_smd_config_bss_v1()
1617 memcpy(bss->self_mac_addr, &bss_v0.self_mac_addr, ETH_ALEN); in wcn36xx_smd_config_bss_v1()
1619 bss->bss_type = bss_v0.bss_type; in wcn36xx_smd_config_bss_v1()
1620 bss->oper_mode = bss_v0.oper_mode; in wcn36xx_smd_config_bss_v1()
1621 bss->nw_type = bss_v0.nw_type; in wcn36xx_smd_config_bss_v1()
1623 bss->short_slot_time_supported = in wcn36xx_smd_config_bss_v1()
1625 bss->lla_coexist = bss_v0.lla_coexist; in wcn36xx_smd_config_bss_v1()
1626 bss->llb_coexist = bss_v0.llb_coexist; in wcn36xx_smd_config_bss_v1()
1627 bss->llg_coexist = bss_v0.llg_coexist; in wcn36xx_smd_config_bss_v1()
1628 bss->ht20_coexist = bss_v0.ht20_coexist; in wcn36xx_smd_config_bss_v1()
1629 bss->lln_non_gf_coexist = bss_v0.lln_non_gf_coexist; in wcn36xx_smd_config_bss_v1()
1631 bss->lsig_tx_op_protection_full_support = in wcn36xx_smd_config_bss_v1()
1633 bss->rifs_mode = bss_v0.rifs_mode; in wcn36xx_smd_config_bss_v1()
1634 bss->beacon_interval = bss_v0.beacon_interval; in wcn36xx_smd_config_bss_v1()
1635 bss->dtim_period = bss_v0.dtim_period; in wcn36xx_smd_config_bss_v1()
1636 bss->tx_channel_width_set = bss_v0.tx_channel_width_set; in wcn36xx_smd_config_bss_v1()
1637 bss->oper_channel = bss_v0.oper_channel; in wcn36xx_smd_config_bss_v1()
1639 if (wcn->hw->conf.chandef.width == NL80211_CHAN_WIDTH_80) { in wcn36xx_smd_config_bss_v1()
1640 chandef = &wcn->hw->conf.chandef; in wcn36xx_smd_config_bss_v1()
1641 bss->ext_channel = HW_VALUE_PHY(chandef->chan->hw_value); in wcn36xx_smd_config_bss_v1()
1643 bss->ext_channel = bss_v0.ext_channel; in wcn36xx_smd_config_bss_v1()
1646 bss->reserved = bss_v0.reserved; in wcn36xx_smd_config_bss_v1()
1648 memcpy(&bss->ssid, &bss_v0.ssid, in wcn36xx_smd_config_bss_v1()
1651 bss->action = bss_v0.action; in wcn36xx_smd_config_bss_v1()
1652 bss->rateset = bss_v0.rateset; in wcn36xx_smd_config_bss_v1()
1653 bss->ht = bss_v0.ht; in wcn36xx_smd_config_bss_v1()
1654 bss->obss_prot_enabled = bss_v0.obss_prot_enabled; in wcn36xx_smd_config_bss_v1()
1655 bss->rmf = bss_v0.rmf; in wcn36xx_smd_config_bss_v1()
1656 bss->ht_oper_mode = bss_v0.ht_oper_mode; in wcn36xx_smd_config_bss_v1()
1657 bss->dual_cts_protection = bss_v0.dual_cts_protection; in wcn36xx_smd_config_bss_v1()
1659 bss->max_probe_resp_retry_limit = in wcn36xx_smd_config_bss_v1()
1661 bss->hidden_ssid = bss_v0.hidden_ssid; in wcn36xx_smd_config_bss_v1()
1662 bss->proxy_probe_resp = bss_v0.proxy_probe_resp; in wcn36xx_smd_config_bss_v1()
1663 bss->edca_params_valid = bss_v0.edca_params_valid; in wcn36xx_smd_config_bss_v1()
1665 memcpy(&bss->acbe, &bss_v0.acbe, in wcn36xx_smd_config_bss_v1()
1667 memcpy(&bss->acbk, &bss_v0.acbk, in wcn36xx_smd_config_bss_v1()
1669 memcpy(&bss->acvi, &bss_v0.acvi, in wcn36xx_smd_config_bss_v1()
1671 memcpy(&bss->acvo, &bss_v0.acvo, in wcn36xx_smd_config_bss_v1()
1674 bss->ext_set_sta_key_param_valid = in wcn36xx_smd_config_bss_v1()
1677 memcpy(&bss->ext_set_sta_key_param, in wcn36xx_smd_config_bss_v1()
1681 bss->wcn36xx_hal_persona = bss_v0.wcn36xx_hal_persona; in wcn36xx_smd_config_bss_v1()
1682 bss->spectrum_mgt_enable = bss_v0.spectrum_mgt_enable; in wcn36xx_smd_config_bss_v1()
1683 bss->tx_mgmt_power = bss_v0.tx_mgmt_power; in wcn36xx_smd_config_bss_v1()
1684 bss->max_tx_power = bss_v0.max_tx_power; in wcn36xx_smd_config_bss_v1()
1688 PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); in wcn36xx_smd_config_bss_v1()
1692 bss->bssid, bss->self_mac_addr, bss->bss_type, in wcn36xx_smd_config_bss_v1()
1693 bss->oper_mode, bss->nw_type); in wcn36xx_smd_config_bss_v1()
1696 "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n", in wcn36xx_smd_config_bss_v1()
1697 sta->bssid, sta->action, sta->sta_index, in wcn36xx_smd_config_bss_v1()
1698 sta->bssid_index, sta->aid, sta->type, sta->mac); in wcn36xx_smd_config_bss_v1()
1700 ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); in wcn36xx_smd_config_bss_v1()
1719 return -ENOMEM; in wcn36xx_smd_config_bss_v0()
1723 bss = &msg->bss_params; in wcn36xx_smd_config_bss_v0()
1724 sta_params = &bss->sta; in wcn36xx_smd_config_bss_v0()
1729 PREPARE_HAL_BUF(wcn->hal_buf, (*msg)); in wcn36xx_smd_config_bss_v0()
1733 bss->bssid, bss->self_mac_addr, bss->bss_type, in wcn36xx_smd_config_bss_v0()
1734 bss->oper_mode, bss->nw_type); in wcn36xx_smd_config_bss_v0()
1737 "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n", in wcn36xx_smd_config_bss_v0()
1738 sta_params->bssid, sta_params->action, in wcn36xx_smd_config_bss_v0()
1739 sta_params->sta_index, sta_params->bssid_index, in wcn36xx_smd_config_bss_v0()
1740 sta_params->aid, sta_params->type, in wcn36xx_smd_config_bss_v0()
1741 sta_params->mac); in wcn36xx_smd_config_bss_v0()
1743 ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len); in wcn36xx_smd_config_bss_v0()
1760 return -EINVAL; in wcn36xx_smd_config_bss_rsp()
1763 params = &rsp->bss_rsp_params; in wcn36xx_smd_config_bss_rsp()
1765 if (params->status != WCN36XX_FW_MSG_RESULT_SUCCESS) { in wcn36xx_smd_config_bss_rsp()
1767 params->status); in wcn36xx_smd_config_bss_rsp()
1768 return -EIO; in wcn36xx_smd_config_bss_rsp()
1775 params->status, params->bss_index, params->dpu_desc_index, in wcn36xx_smd_config_bss_rsp()
1776 params->bss_sta_index, params->bss_self_sta_index, in wcn36xx_smd_config_bss_rsp()
1777 params->bss_bcast_sta_idx, params->mac, in wcn36xx_smd_config_bss_rsp()
1778 params->tx_mgmt_power, params->ucast_dpu_signature); in wcn36xx_smd_config_bss_rsp()
1780 vif_priv->bss_index = params->bss_index; in wcn36xx_smd_config_bss_rsp()
1784 sta_priv->bss_sta_index = params->bss_sta_index; in wcn36xx_smd_config_bss_rsp()
1785 sta_priv->bss_dpu_desc_index = params->dpu_desc_index; in wcn36xx_smd_config_bss_rsp()
1788 vif_priv->self_ucast_dpu_sign = params->ucast_dpu_signature; in wcn36xx_smd_config_bss_rsp()
1799 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_config_bss()
1813 wcn->hal_buf, in wcn36xx_smd_config_bss()
1814 wcn->hal_rsp_len); in wcn36xx_smd_config_bss()
1819 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_config_bss()
1829 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_bss()
1831 if (vif_priv->bss_index == WCN36XX_HAL_BSS_INVALID_IDX) in wcn36xx_smd_delete_bss()
1836 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_delete_bss()
1838 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_bss()
1847 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_bss()
1853 vif_priv->bss_index = WCN36XX_HAL_BSS_INVALID_IDX; in wcn36xx_smd_delete_bss()
1855 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_bss()
1866 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_send_beacon()
1869 pvm_len = skb_beacon->data[tim_off + 1] - 3; in wcn36xx_smd_send_beacon()
1870 pad = TIM_MIN_PVM_SIZE - pvm_len; in wcn36xx_smd_send_beacon()
1873 if (vif->type == NL80211_IFTYPE_MESH_POINT) in wcn36xx_smd_send_beacon()
1876 msg_body.beacon_length = skb_beacon->len + pad; in wcn36xx_smd_send_beacon()
1883 ret = -ENOMEM; in wcn36xx_smd_send_beacon()
1886 memcpy(msg_body.beacon, skb_beacon->data, skb_beacon->len); in wcn36xx_smd_send_beacon()
1887 memcpy(msg_body.bssid, vif->addr, ETH_ALEN); in wcn36xx_smd_send_beacon()
1900 skb_beacon->len - (tim_off + 5 + pvm_len)); in wcn36xx_smd_send_beacon()
1906 if (vif->type == NL80211_IFTYPE_MESH_POINT) in wcn36xx_smd_send_beacon()
1912 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_send_beacon()
1923 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_send_beacon()
1929 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_send_beacon()
1940 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_proberesp_tmpl()
1943 if (skb->len > BEACON_TEMPLATE_SIZE) { in wcn36xx_smd_update_proberesp_tmpl()
1945 skb->len); in wcn36xx_smd_update_proberesp_tmpl()
1946 ret = -E2BIG; in wcn36xx_smd_update_proberesp_tmpl()
1950 msg.probe_resp_template_len = skb->len; in wcn36xx_smd_update_proberesp_tmpl()
1951 memcpy(&msg.probe_resp_template, skb->data, skb->len); in wcn36xx_smd_update_proberesp_tmpl()
1953 memcpy(msg.bssid, vif->addr, ETH_ALEN); in wcn36xx_smd_update_proberesp_tmpl()
1955 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_update_proberesp_tmpl()
1966 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_update_proberesp_tmpl()
1973 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_proberesp_tmpl()
1987 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_stakey()
2009 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_stakey()
2016 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_stakey()
2022 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_stakey()
2036 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_bsskey()
2048 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_bsskey()
2055 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_bsskey()
2061 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_bsskey()
2073 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_remove_stakey()
2080 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_remove_stakey()
2087 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_remove_stakey()
2093 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_remove_stakey()
2105 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_remove_bsskey()
2111 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_remove_bsskey()
2118 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_remove_bsskey()
2124 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_remove_bsskey()
2134 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_enter_bmps()
2137 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_enter_bmps()
2138 msg_body.tbtt = vif->bss_conf.sync_tsf; in wcn36xx_smd_enter_bmps()
2139 msg_body.dtim_period = vif_priv->dtim_period; in wcn36xx_smd_enter_bmps()
2141 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_enter_bmps()
2148 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_enter_bmps()
2154 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_enter_bmps()
2164 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_exit_bmps()
2167 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_exit_bmps()
2170 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_exit_bmps()
2177 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_exit_bmps()
2183 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_exit_bmps()
2192 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_power_params()
2204 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_power_params()
2213 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_power_params()
2228 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_keep_alive_req()
2232 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_keep_alive_req()
2239 ret = -EINVAL; in wcn36xx_smd_keep_alive_req()
2243 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_keep_alive_req()
2250 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_keep_alive_req()
2256 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_keep_alive_req()
2266 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_dump_cmd_req()
2275 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_dump_cmd_req()
2282 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_dump_cmd_req()
2288 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_dump_cmd_req()
2312 return -EINVAL; in get_feat_caps()
2340 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_feature_caps_exchange()
2344 if (wcn->rf_id == RF_IRIS_WCN3680) in wcn36xx_smd_feature_caps_exchange()
2347 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_feature_caps_exchange()
2354 if (wcn->hal_rsp_len != sizeof(*rsp)) { in wcn36xx_smd_feature_caps_exchange()
2359 rsp = (struct wcn36xx_hal_feat_caps_msg *) wcn->hal_buf; in wcn36xx_smd_feature_caps_exchange()
2362 wcn->fw_feat_caps[i] = rsp->feat_caps[i]; in wcn36xx_smd_feature_caps_exchange()
2364 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_feature_caps_exchange()
2373 return -EINVAL; in wcn36xx_smd_add_ba_session_rsp()
2376 if (rsp->status != WCN36XX_FW_MSG_RESULT_SUCCESS) in wcn36xx_smd_add_ba_session_rsp()
2377 return rsp->status; in wcn36xx_smd_add_ba_session_rsp()
2379 *session = rsp->ba_session_id; in wcn36xx_smd_add_ba_session_rsp()
2395 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_ba_session()
2399 memcpy(&msg_body.mac_addr, sta->addr, ETH_ALEN); in wcn36xx_smd_add_ba_session()
2411 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_ba_session()
2418 ret = wcn36xx_smd_add_ba_session_rsp(wcn->hal_buf, wcn->hal_rsp_len, in wcn36xx_smd_add_ba_session()
2427 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_ba_session()
2436 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_ba()
2442 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_ba()
2449 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_add_ba()
2455 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_ba()
2464 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_del_ba()
2470 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_del_ba()
2477 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_del_ba()
2483 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_del_ba()
2492 return -EINVAL; in wcn36xx_smd_trigger_ba_rsp()
2495 return rsp->status; in wcn36xx_smd_trigger_ba_rsp()
2504 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_trigger_ba()
2510 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_trigger_ba()
2513 (wcn->hal_buf + sizeof(msg_body)); in wcn36xx_smd_trigger_ba()
2514 candidate->sta_index = sta_index; in wcn36xx_smd_trigger_ba()
2515 candidate->tid_bitmap = 1 << tid; in wcn36xx_smd_trigger_ba()
2522 ret = wcn36xx_smd_trigger_ba_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_trigger_ba()
2528 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_trigger_ba()
2538 return -EIO; in wcn36xx_smd_tx_compl_ind()
2541 wcn36xx_dxe_tx_ack_ind(wcn, rsp->status); in wcn36xx_smd_tx_compl_ind()
2553 return -EIO; in wcn36xx_smd_hw_scan_ind()
2556 wcn36xx_dbg(WCN36XX_DBG_HAL, "scan indication (type %x)\n", rsp->type); in wcn36xx_smd_hw_scan_ind()
2558 switch (rsp->type) { in wcn36xx_smd_hw_scan_ind()
2564 mutex_lock(&wcn->scan_lock); in wcn36xx_smd_hw_scan_ind()
2565 wcn->scan_req = NULL; in wcn36xx_smd_hw_scan_ind()
2566 if (wcn->scan_aborted) in wcn36xx_smd_hw_scan_ind()
2568 mutex_unlock(&wcn->scan_lock); in wcn36xx_smd_hw_scan_ind()
2569 ieee80211_scan_completed(wcn->hw, &scan_info); in wcn36xx_smd_hw_scan_ind()
2577 wcn36xx_warn("Unknown scan indication type %x\n", rsp->type); in wcn36xx_smd_hw_scan_ind()
2593 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_missed_beacon_ind()
2595 tmp->bss_index); in wcn36xx_smd_missed_beacon_ind()
2604 return -EIO; in wcn36xx_smd_missed_beacon_ind()
2607 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_missed_beacon_ind()
2608 if (tmp->bss_index == rsp->bss_index) { in wcn36xx_smd_missed_beacon_ind()
2610 rsp->bss_index); in wcn36xx_smd_missed_beacon_ind()
2617 wcn36xx_warn("BSS index %d not found\n", rsp->bss_index); in wcn36xx_smd_missed_beacon_ind()
2618 return -ENOENT; in wcn36xx_smd_missed_beacon_ind()
2631 return -EIO; in wcn36xx_smd_delete_sta_context_ind()
2635 rsp->addr2, rsp->sta_id); in wcn36xx_smd_delete_sta_context_ind()
2637 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_delete_sta_context_ind()
2639 sta = ieee80211_find_sta(wcn36xx_priv_to_vif(tmp), rsp->addr2); in wcn36xx_smd_delete_sta_context_ind()
2648 rsp->addr2, in wcn36xx_smd_delete_sta_context_ind()
2649 rsp->sta_id); in wcn36xx_smd_delete_sta_context_ind()
2650 return -ENOENT; in wcn36xx_smd_delete_sta_context_ind()
2662 return -EIO; in wcn36xx_smd_print_reg_info_ind()
2667 rsp->scenario, rsp->reason); in wcn36xx_smd_print_reg_info_ind()
2669 for (i = 0; i < rsp->count; i++) { in wcn36xx_smd_print_reg_info_ind()
2671 rsp->regs[i].addr, rsp->regs[i].value); in wcn36xx_smd_print_reg_info_ind()
2683 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_cfg()
2686 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_update_cfg()
2688 body = (struct wcn36xx_hal_update_cfg_req_msg *) wcn->hal_buf; in wcn36xx_smd_update_cfg()
2692 body->header.len = len; in wcn36xx_smd_update_cfg()
2693 body->len = len - sizeof(*body); in wcn36xx_smd_update_cfg()
2695 ret = wcn36xx_smd_send_and_wait(wcn, body->header.len); in wcn36xx_smd_update_cfg()
2700 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_update_cfg()
2706 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_cfg()
2718 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_mc_list()
2721 wcn->hal_buf; in wcn36xx_smd_set_mc_list()
2726 memcpy(&msg_body->mc_addr_list, fp, in wcn36xx_smd_set_mc_list()
2727 sizeof(msg_body->mc_addr_list)); in wcn36xx_smd_set_mc_list()
2729 msg_body->mc_addr_list.mc_addr_count = 0; in wcn36xx_smd_set_mc_list()
2731 msg_body->mc_addr_list.bss_index = vif_priv->bss_index; in wcn36xx_smd_set_mc_list()
2733 ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); in wcn36xx_smd_set_mc_list()
2738 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_mc_list()
2744 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_mc_list()
2755 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_arp_offload()
2764 &vif->bss_conf.arp_addr_list[0], sizeof(__be32)); in wcn36xx_smd_arp_offload()
2766 msg_body.ns_offload_params.bss_index = vif_priv->bss_index; in wcn36xx_smd_arp_offload()
2768 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_arp_offload()
2775 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_arp_offload()
2781 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_arp_offload()
2795 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_ipv6_ns_offload()
2801 ho_params->offload_type = WCN36XX_HAL_IPV6_NS_OFFLOAD; in wcn36xx_smd_ipv6_ns_offload()
2803 ho_params->enable = in wcn36xx_smd_ipv6_ns_offload()
2805 if (vif_priv->num_target_ipv6_addrs) { in wcn36xx_smd_ipv6_ns_offload()
2806 memcpy(&ho_params->u, in wcn36xx_smd_ipv6_ns_offload()
2807 &vif_priv->target_ipv6_addrs[0].in6_u, in wcn36xx_smd_ipv6_ns_offload()
2809 memcpy(&ns_params->target_ipv6_addr1, in wcn36xx_smd_ipv6_ns_offload()
2810 &vif_priv->target_ipv6_addrs[0].in6_u, in wcn36xx_smd_ipv6_ns_offload()
2812 ns_params->target_ipv6_addr1_valid = 1; in wcn36xx_smd_ipv6_ns_offload()
2814 if (vif_priv->num_target_ipv6_addrs > 1) { in wcn36xx_smd_ipv6_ns_offload()
2815 memcpy(&ns_params->target_ipv6_addr2, in wcn36xx_smd_ipv6_ns_offload()
2816 &vif_priv->target_ipv6_addrs[1].in6_u, in wcn36xx_smd_ipv6_ns_offload()
2818 ns_params->target_ipv6_addr2_valid = 1; in wcn36xx_smd_ipv6_ns_offload()
2821 memcpy(&ns_params->self_addr, vif->addr, ETH_ALEN); in wcn36xx_smd_ipv6_ns_offload()
2822 ns_params->bss_index = vif_priv->bss_index; in wcn36xx_smd_ipv6_ns_offload()
2824 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_ipv6_ns_offload()
2831 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_ipv6_ns_offload()
2837 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_ipv6_ns_offload()
2855 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_gtk_offload()
2860 memcpy(&msg_body.kek, vif_priv->rekey_data.kek, NL80211_KEK_LEN); in wcn36xx_smd_gtk_offload()
2861 memcpy(&msg_body.kck, vif_priv->rekey_data.kck, NL80211_KCK_LEN); in wcn36xx_smd_gtk_offload()
2863 le64_to_cpu(vif_priv->rekey_data.replay_ctr); in wcn36xx_smd_gtk_offload()
2864 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_gtk_offload()
2869 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_gtk_offload()
2876 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_gtk_offload()
2882 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_gtk_offload()
2893 if (wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len)) in wcn36xx_smd_gtk_offload_get_info_rsp()
2894 return -EIO; in wcn36xx_smd_gtk_offload_get_info_rsp()
2896 rsp = (struct wcn36xx_hal_gtk_offload_get_info_rsp_msg *)wcn->hal_buf; in wcn36xx_smd_gtk_offload_get_info_rsp()
2898 if (rsp->bss_index != vif_priv->bss_index) { in wcn36xx_smd_gtk_offload_get_info_rsp()
2900 rsp->bss_index); in wcn36xx_smd_gtk_offload_get_info_rsp()
2901 return -ENOENT; in wcn36xx_smd_gtk_offload_get_info_rsp()
2904 if (vif_priv->rekey_data.replay_ctr != cpu_to_le64(rsp->key_replay_counter)) { in wcn36xx_smd_gtk_offload_get_info_rsp()
2905 replay_ctr = cpu_to_be64(rsp->key_replay_counter); in wcn36xx_smd_gtk_offload_get_info_rsp()
2906 vif_priv->rekey_data.replay_ctr = in wcn36xx_smd_gtk_offload_get_info_rsp()
2907 cpu_to_le64(rsp->key_replay_counter); in wcn36xx_smd_gtk_offload_get_info_rsp()
2908 ieee80211_gtk_rekey_notify(vif, vif->bss_conf.bssid, in wcn36xx_smd_gtk_offload_get_info_rsp()
2912 rsp->key_replay_counter); in wcn36xx_smd_gtk_offload_get_info_rsp()
2919 rsp->status, rsp->last_rekey_status, in wcn36xx_smd_gtk_offload_get_info_rsp()
2920 rsp->key_replay_counter, rsp->total_rekey_count, in wcn36xx_smd_gtk_offload_get_info_rsp()
2921 rsp->gtk_rekey_count, rsp->igtk_rekey_count, in wcn36xx_smd_gtk_offload_get_info_rsp()
2922 rsp->bss_index); in wcn36xx_smd_gtk_offload_get_info_rsp()
2934 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_gtk_offload_get_info()
2938 msg_body.bss_index = vif_priv->bss_index; in wcn36xx_smd_gtk_offload_get_info()
2940 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_gtk_offload_get_info()
2947 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_gtk_offload_get_info()
2954 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_gtk_offload_get_info()
2963 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_wlan_host_suspend_ind()
2968 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_wlan_host_suspend_ind()
2970 ret = rpmsg_send(wcn->smd_channel, wcn->hal_buf, msg_body.header.len); in wcn36xx_smd_wlan_host_suspend_ind()
2972 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_wlan_host_suspend_ind()
2983 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_host_resume()
2988 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_host_resume()
2995 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_host_resume()
3001 rsp = (struct wcn36xx_hal_host_resume_rsp_msg *)wcn->hal_buf; in wcn36xx_smd_host_resume()
3002 if (rsp->status) in wcn36xx_smd_host_resume()
3003 wcn36xx_warn("wlan_host_resume status=%d\n", rsp->status); in wcn36xx_smd_host_resume()
3006 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_host_resume()
3016 struct wcn36xx *wcn = hw->priv; in wcn36xx_smd_rsp_process()
3018 wcn36xx_dbg_dump(WCN36XX_DBG_SMD_DUMP, "SMD <<< ", buf, len); in wcn36xx_smd_rsp_process()
3020 switch (msg_header->msg_type) { in wcn36xx_smd_rsp_process()
3063 memcpy(wcn->hal_buf, buf, len); in wcn36xx_smd_rsp_process()
3064 wcn->hal_rsp_len = len; in wcn36xx_smd_rsp_process()
3065 complete(&wcn->hal_rsp_compl); in wcn36xx_smd_rsp_process()
3079 msg_header->msg_type); in wcn36xx_smd_rsp_process()
3080 return -ENOMEM; in wcn36xx_smd_rsp_process()
3083 msg_ind->msg_len = len; in wcn36xx_smd_rsp_process()
3084 memcpy(msg_ind->msg, buf, len); in wcn36xx_smd_rsp_process()
3086 spin_lock(&wcn->hal_ind_lock); in wcn36xx_smd_rsp_process()
3087 list_add_tail(&msg_ind->list, &wcn->hal_ind_queue); in wcn36xx_smd_rsp_process()
3088 queue_work(wcn->hal_ind_wq, &wcn->hal_ind_work); in wcn36xx_smd_rsp_process()
3089 spin_unlock(&wcn->hal_ind_lock); in wcn36xx_smd_rsp_process()
3094 msg_header->msg_type); in wcn36xx_smd_rsp_process()
3110 spin_lock_irqsave(&wcn->hal_ind_lock, flags); in wcn36xx_ind_smd_work()
3112 if (list_empty(&wcn->hal_ind_queue)) { in wcn36xx_ind_smd_work()
3113 spin_unlock_irqrestore(&wcn->hal_ind_lock, flags); in wcn36xx_ind_smd_work()
3117 hal_ind_msg = list_first_entry(&wcn->hal_ind_queue, in wcn36xx_ind_smd_work()
3120 list_del(&hal_ind_msg->list); in wcn36xx_ind_smd_work()
3121 spin_unlock_irqrestore(&wcn->hal_ind_lock, flags); in wcn36xx_ind_smd_work()
3123 msg_header = (struct wcn36xx_hal_msg_header *)hal_ind_msg->msg; in wcn36xx_ind_smd_work()
3125 switch (msg_header->msg_type) { in wcn36xx_ind_smd_work()
3132 hal_ind_msg->msg, in wcn36xx_ind_smd_work()
3133 hal_ind_msg->msg_len); in wcn36xx_ind_smd_work()
3137 hal_ind_msg->msg, in wcn36xx_ind_smd_work()
3138 hal_ind_msg->msg_len); in wcn36xx_ind_smd_work()
3142 hal_ind_msg->msg, in wcn36xx_ind_smd_work()
3143 hal_ind_msg->msg_len); in wcn36xx_ind_smd_work()
3147 hal_ind_msg->msg, in wcn36xx_ind_smd_work()
3148 hal_ind_msg->msg_len); in wcn36xx_ind_smd_work()
3151 wcn36xx_smd_hw_scan_ind(wcn, hal_ind_msg->msg, in wcn36xx_ind_smd_work()
3152 hal_ind_msg->msg_len); in wcn36xx_ind_smd_work()
3156 msg_header->msg_type); in wcn36xx_ind_smd_work()
3165 wcn->hal_ind_wq = create_freezable_workqueue("wcn36xx_smd_ind"); in wcn36xx_smd_open()
3166 if (!wcn->hal_ind_wq) in wcn36xx_smd_open()
3167 return -ENOMEM; in wcn36xx_smd_open()
3169 INIT_WORK(&wcn->hal_ind_work, wcn36xx_ind_smd_work); in wcn36xx_smd_open()
3170 INIT_LIST_HEAD(&wcn->hal_ind_queue); in wcn36xx_smd_open()
3171 spin_lock_init(&wcn->hal_ind_lock); in wcn36xx_smd_open()
3180 cancel_work_sync(&wcn->hal_ind_work); in wcn36xx_smd_close()
3181 destroy_workqueue(wcn->hal_ind_wq); in wcn36xx_smd_close()
3183 list_for_each_entry_safe(msg, tmp, &wcn->hal_ind_queue, list) in wcn36xx_smd_close()