Lines Matching refs:wcn

79 static int put_cfg_tlv_u32(struct wcn36xx *wcn, size_t *len, u32 id, u32 value)  in put_cfg_tlv_u32()  argument
89 entry = (struct wcn36xx_hal_cfg *) (wcn->hal_buf + *len); in put_cfg_tlv_u32()
103 static void wcn36xx_smd_set_bss_nw_type(struct wcn36xx *wcn, in wcn36xx_smd_set_bss_nw_type() argument
107 if (IEEE80211_BAND_5GHZ == WCN36XX_BAND(wcn)) in wcn36xx_smd_set_bss_nw_type()
189 static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn, in wcn36xx_smd_set_sta_params() argument
206 sta_params->listen_interval = WCN36XX_LISTEN_INTERVAL(wcn); in wcn36xx_smd_set_sta_params()
220 !(WCN36XX_FLAGS(wcn) & in wcn36xx_smd_set_sta_params()
250 static int wcn36xx_smd_send_and_wait(struct wcn36xx *wcn, size_t len) in wcn36xx_smd_send_and_wait() argument
254 wcn36xx_dbg_dump(WCN36XX_DBG_SMD_DUMP, "HAL >>> ", wcn->hal_buf, len); in wcn36xx_smd_send_and_wait()
256 init_completion(&wcn->hal_rsp_compl); in wcn36xx_smd_send_and_wait()
258 ret = wcn->ctrl_ops->tx(wcn->hal_buf, len); in wcn36xx_smd_send_and_wait()
263 if (wait_for_completion_timeout(&wcn->hal_rsp_compl, in wcn36xx_smd_send_and_wait()
307 int wcn36xx_smd_load_nv(struct wcn36xx *wcn) in wcn36xx_smd_load_nv() argument
315 if (!wcn->nv) { in wcn36xx_smd_load_nv()
316 ret = request_firmware(&wcn->nv, WLAN_NV_FILE, wcn->dev); in wcn36xx_smd_load_nv()
324 nv_d = (struct nv_data *)wcn->nv->data; in wcn36xx_smd_load_nv()
331 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_load_nv()
334 fw_bytes_left = wcn->nv->size - fm_offset - 4; in wcn36xx_smd_load_nv()
348 memcpy(wcn->hal_buf, &msg_body, sizeof(msg_body)); in wcn36xx_smd_load_nv()
351 memcpy(wcn->hal_buf + sizeof(msg_body), in wcn36xx_smd_load_nv()
355 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_load_nv()
358 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, in wcn36xx_smd_load_nv()
359 wcn->hal_rsp_len); in wcn36xx_smd_load_nv()
371 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_load_nv()
375 static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len) in wcn36xx_smd_start_rsp() argument
387 memcpy(wcn->crm_version, rsp->start_rsp_params.crm_version, in wcn36xx_smd_start_rsp()
389 memcpy(wcn->wlan_version, rsp->start_rsp_params.wlan_version, in wcn36xx_smd_start_rsp()
393 wcn->crm_version[WCN36XX_HAL_VERSION_LENGTH] = '\0'; in wcn36xx_smd_start_rsp()
394 wcn->wlan_version[WCN36XX_HAL_VERSION_LENGTH] = '\0'; in wcn36xx_smd_start_rsp()
396 wcn->fw_revision = rsp->start_rsp_params.version.revision; in wcn36xx_smd_start_rsp()
397 wcn->fw_version = rsp->start_rsp_params.version.version; in wcn36xx_smd_start_rsp()
398 wcn->fw_minor = rsp->start_rsp_params.version.minor; in wcn36xx_smd_start_rsp()
399 wcn->fw_major = rsp->start_rsp_params.version.major; in wcn36xx_smd_start_rsp()
402 wcn->wlan_version, wcn->crm_version); in wcn36xx_smd_start_rsp()
405 wcn->fw_major, wcn->fw_minor, in wcn36xx_smd_start_rsp()
406 wcn->fw_version, wcn->fw_revision, in wcn36xx_smd_start_rsp()
413 int wcn36xx_smd_start(struct wcn36xx *wcn) in wcn36xx_smd_start() argument
420 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start()
426 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_start()
428 body = (struct wcn36xx_hal_mac_start_req_msg *)wcn->hal_buf; in wcn36xx_smd_start()
432 ret = put_cfg_tlv_u32(wcn, &len, wcn36xx_cfg_vals[i].cfg_id, in wcn36xx_smd_start()
443 ret = wcn36xx_smd_send_and_wait(wcn, body->header.len); in wcn36xx_smd_start()
449 ret = wcn36xx_smd_start_rsp(wcn, wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start()
456 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start()
460 int wcn36xx_smd_stop(struct wcn36xx *wcn) in wcn36xx_smd_stop() argument
465 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_stop()
470 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_stop()
472 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_stop()
477 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_stop()
483 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_stop()
487 int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode) in wcn36xx_smd_init_scan() argument
492 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_init_scan()
497 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_init_scan()
501 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_init_scan()
506 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_init_scan()
512 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_init_scan()
516 int wcn36xx_smd_start_scan(struct wcn36xx *wcn) in wcn36xx_smd_start_scan() argument
521 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start_scan()
524 msg_body.scan_channel = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_smd_start_scan()
526 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_start_scan()
531 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_start_scan()
536 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start_scan()
542 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start_scan()
546 int wcn36xx_smd_end_scan(struct wcn36xx *wcn) in wcn36xx_smd_end_scan() argument
551 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_end_scan()
554 msg_body.scan_channel = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_smd_end_scan()
556 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_end_scan()
561 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_end_scan()
566 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_end_scan()
572 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_end_scan()
576 int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, in wcn36xx_smd_finish_scan() argument
582 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_finish_scan()
587 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_finish_scan()
592 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_finish_scan()
597 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_finish_scan()
603 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_finish_scan()
621 int wcn36xx_smd_switch_channel(struct wcn36xx *wcn, in wcn36xx_smd_switch_channel() argument
627 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_switch_channel()
635 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_switch_channel()
637 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_switch_channel()
642 ret = wcn36xx_smd_switch_channel_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_switch_channel()
648 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_switch_channel()
669 int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn) in wcn36xx_smd_update_scan_params() argument
674 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_scan_params()
686 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_update_scan_params()
692 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_update_scan_params()
697 ret = wcn36xx_smd_update_scan_params_rsp(wcn->hal_buf, in wcn36xx_smd_update_scan_params()
698 wcn->hal_rsp_len); in wcn36xx_smd_update_scan_params()
705 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_scan_params()
709 static int wcn36xx_smd_add_sta_self_rsp(struct wcn36xx *wcn, in wcn36xx_smd_add_sta_self_rsp() argument
738 int wcn36xx_smd_add_sta_self(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_add_sta_self() argument
743 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_sta_self()
748 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_sta_self()
754 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_add_sta_self()
759 ret = wcn36xx_smd_add_sta_self_rsp(wcn, in wcn36xx_smd_add_sta_self()
761 wcn->hal_buf, in wcn36xx_smd_add_sta_self()
762 wcn->hal_rsp_len); in wcn36xx_smd_add_sta_self()
768 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_sta_self()
772 int wcn36xx_smd_delete_sta_self(struct wcn36xx *wcn, u8 *addr) in wcn36xx_smd_delete_sta_self() argument
777 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta_self()
782 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_sta_self()
784 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_delete_sta_self()
789 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_sta_self()
796 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta_self()
800 int wcn36xx_smd_delete_sta(struct wcn36xx *wcn, u8 sta_index) in wcn36xx_smd_delete_sta() argument
805 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta()
810 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_sta()
816 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_delete_sta()
821 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_sta()
827 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta()
847 int wcn36xx_smd_join(struct wcn36xx *wcn, const u8 *bssid, u8 *vif, u8 ch) in wcn36xx_smd_join() argument
852 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_join()
859 if (conf_is_ht40_minus(&wcn->hw->conf)) in wcn36xx_smd_join()
862 else if (conf_is_ht40_plus(&wcn->hw->conf)) in wcn36xx_smd_join()
872 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_join()
879 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_join()
884 ret = wcn36xx_smd_join_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_join()
890 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_join()
894 int wcn36xx_smd_set_link_st(struct wcn36xx *wcn, const u8 *bssid, in wcn36xx_smd_set_link_st() argument
901 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_link_st()
908 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_link_st()
914 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_link_st()
919 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_link_st()
925 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_link_st()
929 static void wcn36xx_smd_convert_sta_to_v1(struct wcn36xx *wcn, in wcn36xx_smd_convert_sta_to_v1() argument
951 static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn, in wcn36xx_smd_config_sta_rsp() argument
984 static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn, in wcn36xx_smd_config_sta_v1() argument
992 wcn36xx_smd_convert_sta_to_v1(wcn, &orig->sta_params, in wcn36xx_smd_config_sta_v1()
995 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_config_sta_v1()
1002 return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_config_sta_v1()
1005 int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, in wcn36xx_smd_config_sta() argument
1012 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_config_sta()
1017 wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); in wcn36xx_smd_config_sta()
1019 if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { in wcn36xx_smd_config_sta()
1020 ret = wcn36xx_smd_config_sta_v1(wcn, &msg); in wcn36xx_smd_config_sta()
1022 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_config_sta()
1030 ret = wcn36xx_smd_send_and_wait(wcn, msg.header.len); in wcn36xx_smd_config_sta()
1036 ret = wcn36xx_smd_config_sta_rsp(wcn, in wcn36xx_smd_config_sta()
1038 wcn->hal_buf, in wcn36xx_smd_config_sta()
1039 wcn->hal_rsp_len); in wcn36xx_smd_config_sta()
1045 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_config_sta()
1049 static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, in wcn36xx_smd_config_bss_v1() argument
1138 wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, in wcn36xx_smd_config_bss_v1()
1141 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_config_bss_v1()
1153 return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_config_bss_v1()
1157 static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, in wcn36xx_smd_config_bss_rsp() argument
1199 int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, in wcn36xx_smd_config_bss() argument
1209 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_config_bss()
1244 wcn36xx_smd_set_bss_nw_type(wcn, sta, bss); in wcn36xx_smd_config_bss()
1258 bss->oper_channel = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_smd_config_bss()
1260 if (conf_is_ht40_minus(&wcn->hw->conf)) in wcn36xx_smd_config_bss()
1262 else if (conf_is_ht40_plus(&wcn->hw->conf)) in wcn36xx_smd_config_bss()
1268 wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); in wcn36xx_smd_config_bss()
1289 bss->max_tx_power = WCN36XX_MAX_POWER(wcn); in wcn36xx_smd_config_bss()
1305 if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { in wcn36xx_smd_config_bss()
1306 ret = wcn36xx_smd_config_bss_v1(wcn, &msg); in wcn36xx_smd_config_bss()
1308 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_config_bss()
1310 ret = wcn36xx_smd_send_and_wait(wcn, msg.header.len); in wcn36xx_smd_config_bss()
1316 ret = wcn36xx_smd_config_bss_rsp(wcn, in wcn36xx_smd_config_bss()
1318 wcn->hal_buf, in wcn36xx_smd_config_bss()
1319 wcn->hal_rsp_len); in wcn36xx_smd_config_bss()
1325 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_config_bss()
1329 int wcn36xx_smd_delete_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_delete_bss() argument
1335 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_bss()
1340 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_bss()
1344 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_delete_bss()
1349 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_bss()
1355 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_bss()
1359 int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif, in wcn36xx_smd_send_beacon() argument
1366 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_send_beacon()
1391 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_send_beacon()
1397 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_send_beacon()
1402 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_send_beacon()
1408 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_send_beacon()
1412 int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn, in wcn36xx_smd_update_proberesp_tmpl() argument
1419 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_proberesp_tmpl()
1434 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_update_proberesp_tmpl()
1440 ret = wcn36xx_smd_send_and_wait(wcn, msg.header.len); in wcn36xx_smd_update_proberesp_tmpl()
1445 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_update_proberesp_tmpl()
1452 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_proberesp_tmpl()
1456 int wcn36xx_smd_set_stakey(struct wcn36xx *wcn, in wcn36xx_smd_set_stakey() argument
1466 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_stakey()
1480 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_stakey()
1482 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_stakey()
1487 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_stakey()
1493 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_stakey()
1497 int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn, in wcn36xx_smd_set_bsskey() argument
1506 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_bsskey()
1518 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_bsskey()
1520 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_bsskey()
1525 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_bsskey()
1531 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_bsskey()
1535 int wcn36xx_smd_remove_stakey(struct wcn36xx *wcn, in wcn36xx_smd_remove_stakey() argument
1543 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_remove_stakey()
1550 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_remove_stakey()
1552 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_remove_stakey()
1557 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_remove_stakey()
1563 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_remove_stakey()
1567 int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn, in wcn36xx_smd_remove_bsskey() argument
1574 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_remove_bsskey()
1580 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_remove_bsskey()
1582 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_remove_bsskey()
1587 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_remove_bsskey()
1593 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_remove_bsskey()
1597 int wcn36xx_smd_enter_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_enter_bmps() argument
1603 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_enter_bmps()
1610 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_enter_bmps()
1612 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_enter_bmps()
1617 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_enter_bmps()
1623 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_enter_bmps()
1627 int wcn36xx_smd_exit_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_exit_bmps() argument
1633 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_exit_bmps()
1638 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_exit_bmps()
1640 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_exit_bmps()
1645 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_exit_bmps()
1651 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_exit_bmps()
1654 int wcn36xx_smd_set_power_params(struct wcn36xx *wcn, bool ignore_dtim) in wcn36xx_smd_set_power_params() argument
1659 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_power_params()
1669 msg_body.listen_interval = WCN36XX_LISTEN_INTERVAL(wcn); in wcn36xx_smd_set_power_params()
1671 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_power_params()
1673 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_power_params()
1680 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_power_params()
1686 int wcn36xx_smd_keep_alive_req(struct wcn36xx *wcn, in wcn36xx_smd_keep_alive_req() argument
1694 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_keep_alive_req()
1709 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_keep_alive_req()
1711 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_keep_alive_req()
1716 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_keep_alive_req()
1722 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_keep_alive_req()
1726 int wcn36xx_smd_dump_cmd_req(struct wcn36xx *wcn, u32 arg1, u32 arg2, in wcn36xx_smd_dump_cmd_req() argument
1732 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_dump_cmd_req()
1741 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_dump_cmd_req()
1743 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_dump_cmd_req()
1748 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_dump_cmd_req()
1754 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_dump_cmd_req()
1802 int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn) in wcn36xx_smd_feature_caps_exchange() argument
1807 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_feature_caps_exchange()
1812 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_feature_caps_exchange()
1814 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_feature_caps_exchange()
1819 if (wcn->hal_rsp_len != sizeof(*rsp)) { in wcn36xx_smd_feature_caps_exchange()
1824 rsp = (struct wcn36xx_hal_feat_caps_msg *) wcn->hal_buf; in wcn36xx_smd_feature_caps_exchange()
1827 wcn->fw_feat_caps[i] = rsp->feat_caps[i]; in wcn36xx_smd_feature_caps_exchange()
1829 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_feature_caps_exchange()
1833 int wcn36xx_smd_add_ba_session(struct wcn36xx *wcn, in wcn36xx_smd_add_ba_session() argument
1843 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_ba_session()
1859 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_ba_session()
1861 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_add_ba_session()
1866 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_add_ba_session()
1872 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_ba_session()
1876 int wcn36xx_smd_add_ba(struct wcn36xx *wcn) in wcn36xx_smd_add_ba() argument
1881 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_ba()
1887 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_ba()
1889 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_add_ba()
1894 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_add_ba()
1900 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_ba()
1904 int wcn36xx_smd_del_ba(struct wcn36xx *wcn, u16 tid, u8 sta_index) in wcn36xx_smd_del_ba() argument
1909 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_del_ba()
1915 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_del_ba()
1917 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_del_ba()
1922 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_del_ba()
1928 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_del_ba()
1932 int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index) in wcn36xx_smd_trigger_ba() argument
1938 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_trigger_ba()
1944 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_trigger_ba()
1947 (wcn->hal_buf + sizeof(msg_body)); in wcn36xx_smd_trigger_ba()
1951 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_trigger_ba()
1956 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_trigger_ba()
1962 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_trigger_ba()
1966 static int wcn36xx_smd_tx_compl_ind(struct wcn36xx *wcn, void *buf, size_t len) in wcn36xx_smd_tx_compl_ind() argument
1975 wcn36xx_dxe_tx_ack_ind(wcn, rsp->status); in wcn36xx_smd_tx_compl_ind()
1980 static int wcn36xx_smd_missed_beacon_ind(struct wcn36xx *wcn, in wcn36xx_smd_missed_beacon_ind() argument
1989 if (wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { in wcn36xx_smd_missed_beacon_ind()
1990 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_missed_beacon_ind()
2006 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_missed_beacon_ind()
2022 static int wcn36xx_smd_delete_sta_context_ind(struct wcn36xx *wcn, in wcn36xx_smd_delete_sta_context_ind() argument
2035 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_delete_sta_context_ind()
2055 int wcn36xx_smd_update_cfg(struct wcn36xx *wcn, u32 cfg_id, u32 value) in wcn36xx_smd_update_cfg() argument
2061 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_cfg()
2064 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_update_cfg()
2066 body = (struct wcn36xx_hal_update_cfg_req_msg *) wcn->hal_buf; in wcn36xx_smd_update_cfg()
2069 put_cfg_tlv_u32(wcn, &len, cfg_id, value); in wcn36xx_smd_update_cfg()
2073 ret = wcn36xx_smd_send_and_wait(wcn, body->header.len); in wcn36xx_smd_update_cfg()
2078 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_update_cfg()
2084 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_cfg()
2087 static void wcn36xx_smd_rsp_process(struct wcn36xx *wcn, void *buf, size_t len) in wcn36xx_smd_rsp_process() argument
2128 memcpy(wcn->hal_buf, buf, len); in wcn36xx_smd_rsp_process()
2129 wcn->hal_rsp_len = len; in wcn36xx_smd_rsp_process()
2130 complete(&wcn->hal_rsp_compl); in wcn36xx_smd_rsp_process()
2152 mutex_lock(&wcn->hal_ind_mutex); in wcn36xx_smd_rsp_process()
2153 list_add_tail(&msg_ind->list, &wcn->hal_ind_queue); in wcn36xx_smd_rsp_process()
2154 queue_work(wcn->hal_ind_wq, &wcn->hal_ind_work); in wcn36xx_smd_rsp_process()
2155 mutex_unlock(&wcn->hal_ind_mutex); in wcn36xx_smd_rsp_process()
2165 struct wcn36xx *wcn = in wcn36xx_ind_smd_work() local
2170 mutex_lock(&wcn->hal_ind_mutex); in wcn36xx_ind_smd_work()
2172 hal_ind_msg = list_first_entry(&wcn->hal_ind_queue, in wcn36xx_ind_smd_work()
2180 wcn36xx_smd_tx_compl_ind(wcn, in wcn36xx_ind_smd_work()
2185 wcn36xx_smd_missed_beacon_ind(wcn, in wcn36xx_ind_smd_work()
2190 wcn36xx_smd_delete_sta_context_ind(wcn, in wcn36xx_ind_smd_work()
2198 list_del(wcn->hal_ind_queue.next); in wcn36xx_ind_smd_work()
2201 mutex_unlock(&wcn->hal_ind_mutex); in wcn36xx_ind_smd_work()
2203 int wcn36xx_smd_open(struct wcn36xx *wcn) in wcn36xx_smd_open() argument
2206 wcn->hal_ind_wq = create_freezable_workqueue("wcn36xx_smd_ind"); in wcn36xx_smd_open()
2207 if (!wcn->hal_ind_wq) { in wcn36xx_smd_open()
2212 INIT_WORK(&wcn->hal_ind_work, wcn36xx_ind_smd_work); in wcn36xx_smd_open()
2213 INIT_LIST_HEAD(&wcn->hal_ind_queue); in wcn36xx_smd_open()
2214 mutex_init(&wcn->hal_ind_mutex); in wcn36xx_smd_open()
2216 ret = wcn->ctrl_ops->open(wcn, wcn36xx_smd_rsp_process); in wcn36xx_smd_open()
2225 destroy_workqueue(wcn->hal_ind_wq); in wcn36xx_smd_open()
2230 void wcn36xx_smd_close(struct wcn36xx *wcn) in wcn36xx_smd_close() argument
2232 wcn->ctrl_ops->close(); in wcn36xx_smd_close()
2233 destroy_workqueue(wcn->hal_ind_wq); in wcn36xx_smd_close()
2234 mutex_destroy(&wcn->hal_ind_mutex); in wcn36xx_smd_close()