Lines Matching full:wcn
179 static int put_cfg_tlv_u32(struct wcn36xx *wcn, size_t *len, u32 id, u32 value) in put_cfg_tlv_u32() argument
189 entry = (struct wcn36xx_hal_cfg *) (wcn->hal_buf + *len); in put_cfg_tlv_u32()
203 static void wcn36xx_smd_set_bss_nw_type(struct wcn36xx *wcn, in wcn36xx_smd_set_bss_nw_type() argument
207 if (NL80211_BAND_5GHZ == WCN36XX_BAND(wcn)) in wcn36xx_smd_set_bss_nw_type()
283 static void wcn36xx_smd_set_sta_vht_params(struct wcn36xx *wcn, in wcn36xx_smd_set_sta_vht_params() argument
293 if (get_feat_caps(wcn->fw_feat_caps, MU_MIMO)) { in wcn36xx_smd_set_sta_vht_params()
330 static void wcn36xx_smd_set_sta_default_vht_params(struct wcn36xx *wcn, in wcn36xx_smd_set_sta_default_vht_params() argument
333 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_set_sta_default_vht_params()
346 static void wcn36xx_smd_set_sta_default_ht_ldpc_params(struct wcn36xx *wcn, in wcn36xx_smd_set_sta_default_ht_ldpc_params() argument
349 if (wcn->rf_id == RF_IRIS_WCN3680) in wcn36xx_smd_set_sta_default_ht_ldpc_params()
355 static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn, in wcn36xx_smd_set_sta_params() argument
372 sta_params->listen_interval = WCN36XX_LISTEN_INTERVAL(wcn); in wcn36xx_smd_set_sta_params()
415 static int wcn36xx_smd_send_and_wait(struct wcn36xx *wcn, size_t len) in wcn36xx_smd_send_and_wait() argument
420 (struct wcn36xx_hal_msg_header *)wcn->hal_buf; in wcn36xx_smd_send_and_wait()
423 wcn36xx_dbg_dump(WCN36XX_DBG_SMD_DUMP, "HAL >>> ", wcn->hal_buf, len); in wcn36xx_smd_send_and_wait()
425 init_completion(&wcn->hal_rsp_compl); in wcn36xx_smd_send_and_wait()
427 ret = rpmsg_send(wcn->smd_channel, wcn->hal_buf, len); in wcn36xx_smd_send_and_wait()
432 if (wait_for_completion_timeout(&wcn->hal_rsp_compl, in wcn36xx_smd_send_and_wait()
508 int wcn36xx_smd_load_nv(struct wcn36xx *wcn) in wcn36xx_smd_load_nv() argument
516 if (!wcn->nv) { in wcn36xx_smd_load_nv()
517 ret = request_firmware(&wcn->nv, WLAN_NV_FILE, wcn->dev); in wcn36xx_smd_load_nv()
525 nv_d = (struct nv_data *)wcn->nv->data; in wcn36xx_smd_load_nv()
532 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_load_nv()
535 fw_bytes_left = wcn->nv->size - fm_offset - 4; in wcn36xx_smd_load_nv()
549 memcpy(wcn->hal_buf, &msg_body, sizeof(msg_body)); in wcn36xx_smd_load_nv()
552 memcpy(wcn->hal_buf + sizeof(msg_body), in wcn36xx_smd_load_nv()
556 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_load_nv()
559 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, in wcn36xx_smd_load_nv()
560 wcn->hal_rsp_len); in wcn36xx_smd_load_nv()
572 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_load_nv()
576 static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len) in wcn36xx_smd_start_rsp() argument
588 memcpy(wcn->crm_version, rsp->start_rsp_params.crm_version, in wcn36xx_smd_start_rsp()
590 memcpy(wcn->wlan_version, rsp->start_rsp_params.wlan_version, in wcn36xx_smd_start_rsp()
594 wcn->crm_version[WCN36XX_HAL_VERSION_LENGTH] = '\0'; in wcn36xx_smd_start_rsp()
595 wcn->wlan_version[WCN36XX_HAL_VERSION_LENGTH] = '\0'; in wcn36xx_smd_start_rsp()
597 wcn->fw_revision = rsp->start_rsp_params.version.revision; in wcn36xx_smd_start_rsp()
598 wcn->fw_version = rsp->start_rsp_params.version.version; in wcn36xx_smd_start_rsp()
599 wcn->fw_minor = rsp->start_rsp_params.version.minor; in wcn36xx_smd_start_rsp()
600 wcn->fw_major = rsp->start_rsp_params.version.major; in wcn36xx_smd_start_rsp()
602 if (wcn->first_boot) { in wcn36xx_smd_start_rsp()
603 wcn->first_boot = false; in wcn36xx_smd_start_rsp()
605 wcn->wlan_version, wcn->crm_version); in wcn36xx_smd_start_rsp()
608 wcn->fw_major, wcn->fw_minor, in wcn36xx_smd_start_rsp()
609 wcn->fw_version, wcn->fw_revision, in wcn36xx_smd_start_rsp()
616 int wcn36xx_smd_start(struct wcn36xx *wcn) in wcn36xx_smd_start() argument
625 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start()
631 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_start()
633 body = (struct wcn36xx_hal_mac_start_req_msg *)wcn->hal_buf; in wcn36xx_smd_start()
636 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_start()
645 ret = put_cfg_tlv_u32(wcn, &len, cfg_vals[i].cfg_id, in wcn36xx_smd_start()
656 ret = wcn36xx_smd_send_and_wait(wcn, body->header.len); in wcn36xx_smd_start()
662 ret = wcn36xx_smd_start_rsp(wcn, wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start()
669 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start()
673 int wcn36xx_smd_stop(struct wcn36xx *wcn) in wcn36xx_smd_stop() argument
678 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_stop()
683 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_stop()
685 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_stop()
690 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_stop()
696 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_stop()
700 int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode, in wcn36xx_smd_init_scan() argument
707 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_init_scan()
719 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_init_scan()
723 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_init_scan()
728 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_init_scan()
733 wcn->sw_scan_init = true; in wcn36xx_smd_init_scan()
735 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_init_scan()
739 int wcn36xx_smd_start_scan(struct wcn36xx *wcn, u8 scan_channel) in wcn36xx_smd_start_scan() argument
744 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start_scan()
749 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_start_scan()
754 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_start_scan()
759 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start_scan()
764 wcn->sw_scan_channel = scan_channel; in wcn36xx_smd_start_scan()
766 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start_scan()
770 int wcn36xx_smd_end_scan(struct wcn36xx *wcn, u8 scan_channel) in wcn36xx_smd_end_scan() argument
775 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_end_scan()
780 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_end_scan()
785 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_end_scan()
790 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_end_scan()
795 wcn->sw_scan_channel = 0; in wcn36xx_smd_end_scan()
797 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_end_scan()
801 int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, in wcn36xx_smd_finish_scan() argument
809 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_finish_scan()
813 msg_body.oper_channel = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_smd_finish_scan()
822 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_finish_scan()
827 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_finish_scan()
832 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_finish_scan()
837 wcn->sw_scan_init = false; in wcn36xx_smd_finish_scan()
839 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_finish_scan()
843 int wcn36xx_smd_start_hw_scan(struct wcn36xx *wcn, struct ieee80211_vif *vif, in wcn36xx_smd_start_hw_scan() argument
853 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start_hw_scan()
893 PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); in wcn36xx_smd_start_hw_scan()
900 ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); in wcn36xx_smd_start_hw_scan()
905 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start_hw_scan()
913 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start_hw_scan()
917 int wcn36xx_smd_stop_hw_scan(struct wcn36xx *wcn) in wcn36xx_smd_stop_hw_scan() argument
922 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_stop_hw_scan()
924 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_stop_hw_scan()
928 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_stop_hw_scan()
933 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_stop_hw_scan()
940 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_stop_hw_scan()
958 int wcn36xx_smd_switch_channel(struct wcn36xx *wcn, in wcn36xx_smd_switch_channel() argument
964 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_switch_channel()
972 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_switch_channel()
974 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_switch_channel()
979 ret = wcn36xx_smd_switch_channel_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_switch_channel()
985 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_switch_channel()
1015 int wcn36xx_smd_process_ptt_msg(struct wcn36xx *wcn, in wcn36xx_smd_process_ptt_msg() argument
1022 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_process_ptt_msg()
1034 PREPARE_HAL_PTT_MSG_BUF(wcn->hal_buf, p_msg_body); in wcn36xx_smd_process_ptt_msg()
1036 ret = wcn36xx_smd_send_and_wait(wcn, p_msg_body->header.len); in wcn36xx_smd_process_ptt_msg()
1041 ret = wcn36xx_smd_process_ptt_msg_rsp(wcn->hal_buf, wcn->hal_rsp_len, in wcn36xx_smd_process_ptt_msg()
1050 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_process_ptt_msg()
1071 int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn, in wcn36xx_smd_update_scan_params() argument
1077 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_scan_params()
1091 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_update_scan_params()
1097 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_update_scan_params()
1102 ret = wcn36xx_smd_update_scan_params_rsp(wcn->hal_buf, in wcn36xx_smd_update_scan_params()
1103 wcn->hal_rsp_len); in wcn36xx_smd_update_scan_params()
1110 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_scan_params()
1114 static int wcn36xx_smd_add_sta_self_rsp(struct wcn36xx *wcn, in wcn36xx_smd_add_sta_self_rsp() argument
1143 int wcn36xx_smd_add_sta_self(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_add_sta_self() argument
1148 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_sta_self()
1153 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_sta_self()
1159 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_add_sta_self()
1164 ret = wcn36xx_smd_add_sta_self_rsp(wcn, in wcn36xx_smd_add_sta_self()
1166 wcn->hal_buf, in wcn36xx_smd_add_sta_self()
1167 wcn->hal_rsp_len); in wcn36xx_smd_add_sta_self()
1173 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_sta_self()
1177 int wcn36xx_smd_delete_sta_self(struct wcn36xx *wcn, u8 *addr) in wcn36xx_smd_delete_sta_self() argument
1182 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta_self()
1187 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_sta_self()
1189 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_delete_sta_self()
1194 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_sta_self()
1201 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta_self()
1205 int wcn36xx_smd_delete_sta(struct wcn36xx *wcn, u8 sta_index) in wcn36xx_smd_delete_sta() argument
1210 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta()
1215 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_sta()
1221 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_delete_sta()
1226 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_sta()
1232 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta()
1252 int wcn36xx_smd_join(struct wcn36xx *wcn, const u8 *bssid, u8 *vif, u8 ch) in wcn36xx_smd_join() argument
1257 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_join()
1264 if (conf_is_ht40_minus(&wcn->hw->conf)) in wcn36xx_smd_join()
1267 else if (conf_is_ht40_plus(&wcn->hw->conf)) in wcn36xx_smd_join()
1277 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_join()
1284 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_join()
1289 ret = wcn36xx_smd_join_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_join()
1295 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_join()
1299 int wcn36xx_smd_set_link_st(struct wcn36xx *wcn, const u8 *bssid, in wcn36xx_smd_set_link_st() argument
1306 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_link_st()
1313 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_link_st()
1319 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_link_st()
1324 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_link_st()
1330 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_link_st()
1334 static void wcn36xx_smd_convert_sta_to_v1(struct wcn36xx *wcn, in wcn36xx_smd_convert_sta_to_v1() argument
1372 wcn36xx_smd_set_sta_params_v1(struct wcn36xx *wcn, in wcn36xx_smd_set_sta_params_v1() argument
1380 wcn36xx_smd_set_sta_params(wcn, vif, sta, &sta_par_v0); in wcn36xx_smd_set_sta_params_v1()
1381 wcn36xx_smd_convert_sta_to_v1(wcn, &sta_par_v0, sta_par); in wcn36xx_smd_set_sta_params_v1()
1385 wcn36xx_smd_set_sta_vht_params(wcn, sta, sta_par); in wcn36xx_smd_set_sta_params_v1()
1391 wcn36xx_smd_set_sta_default_vht_params(wcn, sta_par); in wcn36xx_smd_set_sta_params_v1()
1392 wcn36xx_smd_set_sta_default_ht_ldpc_params(wcn, sta_par); in wcn36xx_smd_set_sta_params_v1()
1396 static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn, in wcn36xx_smd_config_sta_rsp() argument
1429 static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn, in wcn36xx_smd_config_sta_v1() argument
1436 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_config_sta_v1()
1445 wcn36xx_smd_set_sta_params_v1(wcn, vif, sta, sta_params); in wcn36xx_smd_config_sta_v1()
1447 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_config_sta_v1()
1454 return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_config_sta_v1()
1457 static int wcn36xx_smd_config_sta_v0(struct wcn36xx *wcn, in wcn36xx_smd_config_sta_v0() argument
1468 wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); in wcn36xx_smd_config_sta_v0()
1470 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_config_sta_v0()
1478 return wcn36xx_smd_send_and_wait(wcn, msg.header.len); in wcn36xx_smd_config_sta_v0()
1481 int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, in wcn36xx_smd_config_sta() argument
1486 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_config_sta()
1488 if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) in wcn36xx_smd_config_sta()
1489 ret = wcn36xx_smd_config_sta_v1(wcn, vif, sta); in wcn36xx_smd_config_sta()
1491 ret = wcn36xx_smd_config_sta_v0(wcn, vif, sta); in wcn36xx_smd_config_sta()
1497 ret = wcn36xx_smd_config_sta_rsp(wcn, in wcn36xx_smd_config_sta()
1499 wcn->hal_buf, in wcn36xx_smd_config_sta()
1500 wcn->hal_rsp_len); in wcn36xx_smd_config_sta()
1506 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_config_sta()
1510 static void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn, in wcn36xx_smd_set_bss_params() argument
1548 wcn36xx_smd_set_bss_nw_type(wcn, sta, bss); in wcn36xx_smd_set_bss_params()
1562 bss->oper_channel = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_smd_set_bss_params()
1564 if (conf_is_ht40_minus(&wcn->hw->conf)) in wcn36xx_smd_set_bss_params()
1566 else if (conf_is_ht40_plus(&wcn->hw->conf)) in wcn36xx_smd_set_bss_params()
1573 /* wcn->ssid is only valid in AP and IBSS mode */ in wcn36xx_smd_set_bss_params()
1592 bss->max_tx_power = WCN36XX_MAX_POWER(wcn); in wcn36xx_smd_set_bss_params()
1598 static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, in wcn36xx_smd_config_bss_v1() argument
1615 if (wcn->rf_id == RF_IRIS_WCN3680) { in wcn36xx_smd_config_bss_v1()
1626 wcn36xx_smd_set_bss_params(wcn, vif, sta_80211, bssid, update, &bss_v0); in wcn36xx_smd_config_bss_v1()
1627 wcn36xx_smd_set_sta_params_v1(wcn, vif, sta_80211, sta); in wcn36xx_smd_config_bss_v1()
1653 if (wcn->hw->conf.chandef.width == NL80211_CHAN_WIDTH_80) { in wcn36xx_smd_config_bss_v1()
1654 chandef = &wcn->hw->conf.chandef; in wcn36xx_smd_config_bss_v1()
1702 PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); in wcn36xx_smd_config_bss_v1()
1714 ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); in wcn36xx_smd_config_bss_v1()
1720 static int wcn36xx_smd_config_bss_v0(struct wcn36xx *wcn, in wcn36xx_smd_config_bss_v0() argument
1740 wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss); in wcn36xx_smd_config_bss_v0()
1741 wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); in wcn36xx_smd_config_bss_v0()
1743 PREPARE_HAL_BUF(wcn->hal_buf, (*msg)); in wcn36xx_smd_config_bss_v0()
1757 ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len); in wcn36xx_smd_config_bss_v0()
1763 static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, in wcn36xx_smd_config_bss_rsp() argument
1807 int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, in wcn36xx_smd_config_bss() argument
1813 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_config_bss()
1815 if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) in wcn36xx_smd_config_bss()
1816 ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update); in wcn36xx_smd_config_bss()
1818 ret = wcn36xx_smd_config_bss_v0(wcn, vif, sta, bssid, update); in wcn36xx_smd_config_bss()
1824 ret = wcn36xx_smd_config_bss_rsp(wcn, in wcn36xx_smd_config_bss()
1827 wcn->hal_buf, in wcn36xx_smd_config_bss()
1828 wcn->hal_rsp_len); in wcn36xx_smd_config_bss()
1833 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_config_bss()
1837 int wcn36xx_smd_delete_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_delete_bss() argument
1843 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_bss()
1852 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_bss()
1856 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_delete_bss()
1861 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_bss()
1869 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_bss()
1873 int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif, in wcn36xx_smd_send_beacon() argument
1880 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_send_beacon()
1926 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_send_beacon()
1932 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_send_beacon()
1937 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_send_beacon()
1943 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_send_beacon()
1947 int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn, in wcn36xx_smd_update_proberesp_tmpl() argument
1954 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_proberesp_tmpl()
1969 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_update_proberesp_tmpl()
1975 ret = wcn36xx_smd_send_and_wait(wcn, msg.header.len); in wcn36xx_smd_update_proberesp_tmpl()
1980 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_update_proberesp_tmpl()
1987 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_proberesp_tmpl()
1991 int wcn36xx_smd_set_stakey(struct wcn36xx *wcn, in wcn36xx_smd_set_stakey() argument
2001 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_stakey()
2023 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_stakey()
2025 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_stakey()
2030 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_stakey()
2036 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_stakey()
2040 int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn, in wcn36xx_smd_set_bsskey() argument
2050 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_bsskey()
2062 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_bsskey()
2064 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_bsskey()
2069 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_bsskey()
2075 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_bsskey()
2079 int wcn36xx_smd_remove_stakey(struct wcn36xx *wcn, in wcn36xx_smd_remove_stakey() argument
2087 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_remove_stakey()
2094 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_remove_stakey()
2096 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_remove_stakey()
2101 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_remove_stakey()
2107 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_remove_stakey()
2111 int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn, in wcn36xx_smd_remove_bsskey() argument
2119 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_remove_bsskey()
2125 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_remove_bsskey()
2127 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_remove_bsskey()
2132 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_remove_bsskey()
2138 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_remove_bsskey()
2142 int wcn36xx_smd_enter_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_enter_bmps() argument
2148 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_enter_bmps()
2155 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_enter_bmps()
2157 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_enter_bmps()
2162 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_enter_bmps()
2168 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_enter_bmps()
2172 int wcn36xx_smd_exit_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_exit_bmps() argument
2178 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_exit_bmps()
2183 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_exit_bmps()
2185 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_exit_bmps()
2190 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_exit_bmps()
2196 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_exit_bmps()
2200 int wcn36xx_smd_set_power_params(struct wcn36xx *wcn, bool ignore_dtim) in wcn36xx_smd_set_power_params() argument
2205 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_power_params()
2215 msg_body.listen_interval = WCN36XX_LISTEN_INTERVAL(wcn); in wcn36xx_smd_set_power_params()
2217 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_power_params()
2219 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_power_params()
2226 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_power_params()
2233 int wcn36xx_smd_keep_alive_req(struct wcn36xx *wcn, in wcn36xx_smd_keep_alive_req() argument
2241 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_keep_alive_req()
2256 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_keep_alive_req()
2258 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_keep_alive_req()
2263 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_keep_alive_req()
2269 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_keep_alive_req()
2273 int wcn36xx_smd_dump_cmd_req(struct wcn36xx *wcn, u32 arg1, u32 arg2, in wcn36xx_smd_dump_cmd_req() argument
2279 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_dump_cmd_req()
2288 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_dump_cmd_req()
2290 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_dump_cmd_req()
2295 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_dump_cmd_req()
2301 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_dump_cmd_req()
2348 int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn) in wcn36xx_smd_feature_caps_exchange() argument
2353 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_feature_caps_exchange()
2357 if (wcn->rf_id == RF_IRIS_WCN3680) in wcn36xx_smd_feature_caps_exchange()
2360 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_feature_caps_exchange()
2362 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_feature_caps_exchange()
2367 if (wcn->hal_rsp_len != sizeof(*rsp)) { in wcn36xx_smd_feature_caps_exchange()
2372 rsp = (struct wcn36xx_hal_feat_caps_msg *) wcn->hal_buf; in wcn36xx_smd_feature_caps_exchange()
2375 wcn->fw_feat_caps[i] = rsp->feat_caps[i]; in wcn36xx_smd_feature_caps_exchange()
2377 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_feature_caps_exchange()
2397 int wcn36xx_smd_add_ba_session(struct wcn36xx *wcn, in wcn36xx_smd_add_ba_session() argument
2408 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_ba_session()
2424 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_ba_session()
2426 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_add_ba_session()
2431 ret = wcn36xx_smd_add_ba_session_rsp(wcn->hal_buf, wcn->hal_rsp_len, in wcn36xx_smd_add_ba_session()
2440 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_ba_session()
2444 int wcn36xx_smd_add_ba(struct wcn36xx *wcn, u8 session_id) in wcn36xx_smd_add_ba() argument
2449 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_ba()
2455 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_ba()
2457 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_add_ba()
2462 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_add_ba()
2468 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_ba()
2472 int wcn36xx_smd_del_ba(struct wcn36xx *wcn, u16 tid, u8 sta_index) in wcn36xx_smd_del_ba() argument
2477 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_del_ba()
2483 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_del_ba()
2485 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_del_ba()
2490 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_del_ba()
2496 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_del_ba()
2511 int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index, u16 tid, u8 session_id) in wcn36xx_smd_trigger_ba() argument
2517 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_trigger_ba()
2523 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_trigger_ba()
2526 (wcn->hal_buf + sizeof(msg_body)); in wcn36xx_smd_trigger_ba()
2530 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_trigger_ba()
2535 ret = wcn36xx_smd_trigger_ba_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_trigger_ba()
2541 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_trigger_ba()
2545 static int wcn36xx_smd_tx_compl_ind(struct wcn36xx *wcn, void *buf, size_t len) in wcn36xx_smd_tx_compl_ind() argument
2554 wcn36xx_dxe_tx_ack_ind(wcn, rsp->status); in wcn36xx_smd_tx_compl_ind()
2559 static int wcn36xx_smd_hw_scan_ind(struct wcn36xx *wcn, void *buf, size_t len) in wcn36xx_smd_hw_scan_ind() argument
2577 mutex_lock(&wcn->scan_lock); in wcn36xx_smd_hw_scan_ind()
2578 wcn->scan_req = NULL; in wcn36xx_smd_hw_scan_ind()
2579 if (wcn->scan_aborted) in wcn36xx_smd_hw_scan_ind()
2581 mutex_unlock(&wcn->scan_lock); in wcn36xx_smd_hw_scan_ind()
2582 ieee80211_scan_completed(wcn->hw, &scan_info); in wcn36xx_smd_hw_scan_ind()
2596 static int wcn36xx_smd_missed_beacon_ind(struct wcn36xx *wcn, in wcn36xx_smd_missed_beacon_ind() argument
2605 if (wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { in wcn36xx_smd_missed_beacon_ind()
2606 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_missed_beacon_ind()
2620 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_missed_beacon_ind()
2634 static int wcn36xx_smd_delete_sta_context_ind(struct wcn36xx *wcn, in wcn36xx_smd_delete_sta_context_ind() argument
2654 list_for_each_entry(vif_priv, &wcn->vif_list, list) { in wcn36xx_smd_delete_sta_context_ind()
2688 static int wcn36xx_smd_print_reg_info_ind(struct wcn36xx *wcn, in wcn36xx_smd_print_reg_info_ind() argument
2712 int wcn36xx_smd_update_cfg(struct wcn36xx *wcn, u32 cfg_id, u32 value) in wcn36xx_smd_update_cfg() argument
2718 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_cfg()
2721 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_update_cfg()
2723 body = (struct wcn36xx_hal_update_cfg_req_msg *) wcn->hal_buf; in wcn36xx_smd_update_cfg()
2726 put_cfg_tlv_u32(wcn, &len, cfg_id, value); in wcn36xx_smd_update_cfg()
2730 ret = wcn36xx_smd_send_and_wait(wcn, body->header.len); in wcn36xx_smd_update_cfg()
2735 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_update_cfg()
2741 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_cfg()
2745 int wcn36xx_smd_set_mc_list(struct wcn36xx *wcn, in wcn36xx_smd_set_mc_list() argument
2753 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_mc_list()
2756 wcn->hal_buf; in wcn36xx_smd_set_mc_list()
2769 ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); in wcn36xx_smd_set_mc_list()
2774 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_mc_list()
2780 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_mc_list()
2789 struct wcn36xx *wcn = hw->priv; in wcn36xx_smd_rsp_process() local
2832 memcpy(wcn->hal_buf, buf, len); in wcn36xx_smd_rsp_process()
2833 wcn->hal_rsp_len = len; in wcn36xx_smd_rsp_process()
2834 complete(&wcn->hal_rsp_compl); in wcn36xx_smd_rsp_process()
2855 spin_lock(&wcn->hal_ind_lock); in wcn36xx_smd_rsp_process()
2856 list_add_tail(&msg_ind->list, &wcn->hal_ind_queue); in wcn36xx_smd_rsp_process()
2857 queue_work(wcn->hal_ind_wq, &wcn->hal_ind_work); in wcn36xx_smd_rsp_process()
2858 spin_unlock(&wcn->hal_ind_lock); in wcn36xx_smd_rsp_process()
2871 struct wcn36xx *wcn = in wcn36xx_ind_smd_work() local
2879 spin_lock_irqsave(&wcn->hal_ind_lock, flags); in wcn36xx_ind_smd_work()
2881 if (list_empty(&wcn->hal_ind_queue)) { in wcn36xx_ind_smd_work()
2882 spin_unlock_irqrestore(&wcn->hal_ind_lock, flags); in wcn36xx_ind_smd_work()
2886 hal_ind_msg = list_first_entry(&wcn->hal_ind_queue, in wcn36xx_ind_smd_work()
2890 spin_unlock_irqrestore(&wcn->hal_ind_lock, flags); in wcn36xx_ind_smd_work()
2900 wcn36xx_smd_tx_compl_ind(wcn, in wcn36xx_ind_smd_work()
2905 wcn36xx_smd_missed_beacon_ind(wcn, in wcn36xx_ind_smd_work()
2910 wcn36xx_smd_delete_sta_context_ind(wcn, in wcn36xx_ind_smd_work()
2915 wcn36xx_smd_print_reg_info_ind(wcn, in wcn36xx_ind_smd_work()
2920 wcn36xx_smd_hw_scan_ind(wcn, hal_ind_msg->msg, in wcn36xx_ind_smd_work()
2932 int wcn36xx_smd_open(struct wcn36xx *wcn) in wcn36xx_smd_open() argument
2934 wcn->hal_ind_wq = create_freezable_workqueue("wcn36xx_smd_ind"); in wcn36xx_smd_open()
2935 if (!wcn->hal_ind_wq) in wcn36xx_smd_open()
2938 INIT_WORK(&wcn->hal_ind_work, wcn36xx_ind_smd_work); in wcn36xx_smd_open()
2939 INIT_LIST_HEAD(&wcn->hal_ind_queue); in wcn36xx_smd_open()
2940 spin_lock_init(&wcn->hal_ind_lock); in wcn36xx_smd_open()
2945 void wcn36xx_smd_close(struct wcn36xx *wcn) in wcn36xx_smd_close() argument
2949 cancel_work_sync(&wcn->hal_ind_work); in wcn36xx_smd_close()
2950 destroy_workqueue(wcn->hal_ind_wq); in wcn36xx_smd_close()
2952 list_for_each_entry_safe(msg, tmp, &wcn->hal_ind_queue, list) in wcn36xx_smd_close()