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()
248 static int wcn36xx_smd_send_and_wait(struct wcn36xx *wcn, size_t len) in wcn36xx_smd_send_and_wait() argument
252 wcn36xx_dbg_dump(WCN36XX_DBG_SMD_DUMP, "HAL >>> ", wcn->hal_buf, len); in wcn36xx_smd_send_and_wait()
254 init_completion(&wcn->hal_rsp_compl); in wcn36xx_smd_send_and_wait()
256 ret = wcn->ctrl_ops->tx(wcn->hal_buf, len); in wcn36xx_smd_send_and_wait()
261 if (wait_for_completion_timeout(&wcn->hal_rsp_compl, in wcn36xx_smd_send_and_wait()
305 int wcn36xx_smd_load_nv(struct wcn36xx *wcn) in wcn36xx_smd_load_nv() argument
313 if (!wcn->nv) { in wcn36xx_smd_load_nv()
314 ret = request_firmware(&wcn->nv, WLAN_NV_FILE, wcn->dev); in wcn36xx_smd_load_nv()
322 nv_d = (struct nv_data *)wcn->nv->data; in wcn36xx_smd_load_nv()
329 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_load_nv()
332 fw_bytes_left = wcn->nv->size - fm_offset - 4; in wcn36xx_smd_load_nv()
346 memcpy(wcn->hal_buf, &msg_body, sizeof(msg_body)); in wcn36xx_smd_load_nv()
349 memcpy(wcn->hal_buf + sizeof(msg_body), in wcn36xx_smd_load_nv()
353 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_load_nv()
356 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, in wcn36xx_smd_load_nv()
357 wcn->hal_rsp_len); in wcn36xx_smd_load_nv()
369 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_load_nv()
373 static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len) in wcn36xx_smd_start_rsp() argument
385 memcpy(wcn->crm_version, rsp->start_rsp_params.crm_version, in wcn36xx_smd_start_rsp()
387 memcpy(wcn->wlan_version, rsp->start_rsp_params.wlan_version, in wcn36xx_smd_start_rsp()
391 wcn->crm_version[WCN36XX_HAL_VERSION_LENGTH] = '\0'; in wcn36xx_smd_start_rsp()
392 wcn->wlan_version[WCN36XX_HAL_VERSION_LENGTH] = '\0'; in wcn36xx_smd_start_rsp()
394 wcn->fw_revision = rsp->start_rsp_params.version.revision; in wcn36xx_smd_start_rsp()
395 wcn->fw_version = rsp->start_rsp_params.version.version; in wcn36xx_smd_start_rsp()
396 wcn->fw_minor = rsp->start_rsp_params.version.minor; in wcn36xx_smd_start_rsp()
397 wcn->fw_major = rsp->start_rsp_params.version.major; in wcn36xx_smd_start_rsp()
400 wcn->wlan_version, wcn->crm_version); in wcn36xx_smd_start_rsp()
403 wcn->fw_major, wcn->fw_minor, in wcn36xx_smd_start_rsp()
404 wcn->fw_version, wcn->fw_revision, in wcn36xx_smd_start_rsp()
411 int wcn36xx_smd_start(struct wcn36xx *wcn) in wcn36xx_smd_start() argument
418 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start()
424 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_start()
426 body = (struct wcn36xx_hal_mac_start_req_msg *)wcn->hal_buf; in wcn36xx_smd_start()
430 ret = put_cfg_tlv_u32(wcn, &len, wcn36xx_cfg_vals[i].cfg_id, in wcn36xx_smd_start()
441 ret = wcn36xx_smd_send_and_wait(wcn, body->header.len); in wcn36xx_smd_start()
447 ret = wcn36xx_smd_start_rsp(wcn, wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start()
454 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start()
458 int wcn36xx_smd_stop(struct wcn36xx *wcn) in wcn36xx_smd_stop() argument
463 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_stop()
468 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_stop()
470 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_stop()
475 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_stop()
481 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_stop()
485 int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode) in wcn36xx_smd_init_scan() argument
490 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_init_scan()
495 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_init_scan()
499 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_init_scan()
504 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_init_scan()
510 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_init_scan()
514 int wcn36xx_smd_start_scan(struct wcn36xx *wcn) in wcn36xx_smd_start_scan() argument
519 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_start_scan()
522 msg_body.scan_channel = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_smd_start_scan()
524 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_start_scan()
529 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_start_scan()
534 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_start_scan()
540 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_start_scan()
544 int wcn36xx_smd_end_scan(struct wcn36xx *wcn) in wcn36xx_smd_end_scan() argument
549 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_end_scan()
552 msg_body.scan_channel = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_smd_end_scan()
554 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_end_scan()
559 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_end_scan()
564 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_end_scan()
570 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_end_scan()
574 int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, in wcn36xx_smd_finish_scan() argument
580 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_finish_scan()
585 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_finish_scan()
590 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_finish_scan()
595 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_finish_scan()
601 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_finish_scan()
619 int wcn36xx_smd_switch_channel(struct wcn36xx *wcn, in wcn36xx_smd_switch_channel() argument
625 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_switch_channel()
633 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_switch_channel()
635 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_switch_channel()
640 ret = wcn36xx_smd_switch_channel_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_switch_channel()
646 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_switch_channel()
667 int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn) in wcn36xx_smd_update_scan_params() argument
672 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_scan_params()
684 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_update_scan_params()
690 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_update_scan_params()
695 ret = wcn36xx_smd_update_scan_params_rsp(wcn->hal_buf, in wcn36xx_smd_update_scan_params()
696 wcn->hal_rsp_len); in wcn36xx_smd_update_scan_params()
703 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_scan_params()
707 static int wcn36xx_smd_add_sta_self_rsp(struct wcn36xx *wcn, in wcn36xx_smd_add_sta_self_rsp() argument
736 int wcn36xx_smd_add_sta_self(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_add_sta_self() argument
741 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_sta_self()
746 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_sta_self()
752 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_add_sta_self()
757 ret = wcn36xx_smd_add_sta_self_rsp(wcn, in wcn36xx_smd_add_sta_self()
759 wcn->hal_buf, in wcn36xx_smd_add_sta_self()
760 wcn->hal_rsp_len); in wcn36xx_smd_add_sta_self()
766 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_sta_self()
770 int wcn36xx_smd_delete_sta_self(struct wcn36xx *wcn, u8 *addr) in wcn36xx_smd_delete_sta_self() argument
775 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta_self()
780 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_sta_self()
782 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_delete_sta_self()
787 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_sta_self()
794 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta_self()
798 int wcn36xx_smd_delete_sta(struct wcn36xx *wcn, u8 sta_index) in wcn36xx_smd_delete_sta() argument
803 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta()
808 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_sta()
814 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_delete_sta()
819 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_sta()
825 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_sta()
845 int wcn36xx_smd_join(struct wcn36xx *wcn, const u8 *bssid, u8 *vif, u8 ch) in wcn36xx_smd_join() argument
850 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_join()
857 if (conf_is_ht40_minus(&wcn->hw->conf)) in wcn36xx_smd_join()
860 else if (conf_is_ht40_plus(&wcn->hw->conf)) in wcn36xx_smd_join()
870 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_join()
877 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_join()
882 ret = wcn36xx_smd_join_rsp(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_join()
888 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_join()
892 int wcn36xx_smd_set_link_st(struct wcn36xx *wcn, const u8 *bssid, in wcn36xx_smd_set_link_st() argument
899 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_link_st()
906 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_link_st()
912 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_link_st()
917 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_link_st()
923 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_link_st()
927 static void wcn36xx_smd_convert_sta_to_v1(struct wcn36xx *wcn, in wcn36xx_smd_convert_sta_to_v1() argument
949 static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn, in wcn36xx_smd_config_sta_rsp() argument
982 static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn, in wcn36xx_smd_config_sta_v1() argument
990 wcn36xx_smd_convert_sta_to_v1(wcn, &orig->sta_params, in wcn36xx_smd_config_sta_v1()
993 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_config_sta_v1()
1000 return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_config_sta_v1()
1003 int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, in wcn36xx_smd_config_sta() argument
1010 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_config_sta()
1015 wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); in wcn36xx_smd_config_sta()
1017 if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { in wcn36xx_smd_config_sta()
1018 ret = wcn36xx_smd_config_sta_v1(wcn, &msg); in wcn36xx_smd_config_sta()
1020 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_config_sta()
1028 ret = wcn36xx_smd_send_and_wait(wcn, msg.header.len); in wcn36xx_smd_config_sta()
1034 ret = wcn36xx_smd_config_sta_rsp(wcn, in wcn36xx_smd_config_sta()
1036 wcn->hal_buf, in wcn36xx_smd_config_sta()
1037 wcn->hal_rsp_len); in wcn36xx_smd_config_sta()
1043 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_config_sta()
1047 static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, in wcn36xx_smd_config_bss_v1() argument
1136 wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, in wcn36xx_smd_config_bss_v1()
1139 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_config_bss_v1()
1151 return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_config_bss_v1()
1155 static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, in wcn36xx_smd_config_bss_rsp() argument
1197 int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, in wcn36xx_smd_config_bss() argument
1207 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_config_bss()
1242 wcn36xx_smd_set_bss_nw_type(wcn, sta, bss); in wcn36xx_smd_config_bss()
1256 bss->oper_channel = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_smd_config_bss()
1258 if (conf_is_ht40_minus(&wcn->hw->conf)) in wcn36xx_smd_config_bss()
1260 else if (conf_is_ht40_plus(&wcn->hw->conf)) in wcn36xx_smd_config_bss()
1266 wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); in wcn36xx_smd_config_bss()
1287 bss->max_tx_power = WCN36XX_MAX_POWER(wcn); in wcn36xx_smd_config_bss()
1303 if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { in wcn36xx_smd_config_bss()
1304 ret = wcn36xx_smd_config_bss_v1(wcn, &msg); in wcn36xx_smd_config_bss()
1306 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_config_bss()
1308 ret = wcn36xx_smd_send_and_wait(wcn, msg.header.len); in wcn36xx_smd_config_bss()
1314 ret = wcn36xx_smd_config_bss_rsp(wcn, in wcn36xx_smd_config_bss()
1316 wcn->hal_buf, in wcn36xx_smd_config_bss()
1317 wcn->hal_rsp_len); in wcn36xx_smd_config_bss()
1323 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_config_bss()
1327 int wcn36xx_smd_delete_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_delete_bss() argument
1333 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_delete_bss()
1338 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_delete_bss()
1342 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_delete_bss()
1347 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_delete_bss()
1353 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_delete_bss()
1357 int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif, in wcn36xx_smd_send_beacon() argument
1364 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_send_beacon()
1389 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_send_beacon()
1395 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_send_beacon()
1400 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_send_beacon()
1406 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_send_beacon()
1410 int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn, in wcn36xx_smd_update_proberesp_tmpl() argument
1417 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_proberesp_tmpl()
1432 PREPARE_HAL_BUF(wcn->hal_buf, msg); in wcn36xx_smd_update_proberesp_tmpl()
1438 ret = wcn36xx_smd_send_and_wait(wcn, msg.header.len); in wcn36xx_smd_update_proberesp_tmpl()
1443 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_update_proberesp_tmpl()
1450 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_proberesp_tmpl()
1454 int wcn36xx_smd_set_stakey(struct wcn36xx *wcn, in wcn36xx_smd_set_stakey() argument
1464 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_stakey()
1478 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_stakey()
1480 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_stakey()
1485 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_stakey()
1491 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_stakey()
1495 int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn, in wcn36xx_smd_set_bsskey() argument
1504 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_bsskey()
1516 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_bsskey()
1518 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_bsskey()
1523 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_set_bsskey()
1529 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_bsskey()
1533 int wcn36xx_smd_remove_stakey(struct wcn36xx *wcn, in wcn36xx_smd_remove_stakey() argument
1541 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_remove_stakey()
1548 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_remove_stakey()
1550 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_remove_stakey()
1555 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_remove_stakey()
1561 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_remove_stakey()
1565 int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn, in wcn36xx_smd_remove_bsskey() argument
1572 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_remove_bsskey()
1578 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_remove_bsskey()
1580 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_remove_bsskey()
1585 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_remove_bsskey()
1591 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_remove_bsskey()
1595 int wcn36xx_smd_enter_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_enter_bmps() argument
1601 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_enter_bmps()
1608 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_enter_bmps()
1610 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_enter_bmps()
1615 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_enter_bmps()
1621 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_enter_bmps()
1625 int wcn36xx_smd_exit_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif) in wcn36xx_smd_exit_bmps() argument
1631 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_exit_bmps()
1636 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_exit_bmps()
1638 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_exit_bmps()
1643 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_exit_bmps()
1649 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_exit_bmps()
1652 int wcn36xx_smd_set_power_params(struct wcn36xx *wcn, bool ignore_dtim) in wcn36xx_smd_set_power_params() argument
1657 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_set_power_params()
1667 msg_body.listen_interval = WCN36XX_LISTEN_INTERVAL(wcn); in wcn36xx_smd_set_power_params()
1669 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_set_power_params()
1671 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_set_power_params()
1678 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_set_power_params()
1684 int wcn36xx_smd_keep_alive_req(struct wcn36xx *wcn, in wcn36xx_smd_keep_alive_req() argument
1692 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_keep_alive_req()
1707 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_keep_alive_req()
1709 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_keep_alive_req()
1714 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_keep_alive_req()
1720 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_keep_alive_req()
1724 int wcn36xx_smd_dump_cmd_req(struct wcn36xx *wcn, u32 arg1, u32 arg2, in wcn36xx_smd_dump_cmd_req() argument
1730 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_dump_cmd_req()
1739 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_dump_cmd_req()
1741 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_dump_cmd_req()
1746 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_dump_cmd_req()
1752 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_dump_cmd_req()
1800 int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn) in wcn36xx_smd_feature_caps_exchange() argument
1805 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_feature_caps_exchange()
1810 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_feature_caps_exchange()
1812 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_feature_caps_exchange()
1817 if (wcn->hal_rsp_len != sizeof(*rsp)) { in wcn36xx_smd_feature_caps_exchange()
1822 rsp = (struct wcn36xx_hal_feat_caps_msg *) wcn->hal_buf; in wcn36xx_smd_feature_caps_exchange()
1825 wcn->fw_feat_caps[i] = rsp->feat_caps[i]; in wcn36xx_smd_feature_caps_exchange()
1827 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_feature_caps_exchange()
1831 int wcn36xx_smd_add_ba_session(struct wcn36xx *wcn, in wcn36xx_smd_add_ba_session() argument
1841 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_ba_session()
1857 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_ba_session()
1859 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_add_ba_session()
1864 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_add_ba_session()
1870 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_ba_session()
1874 int wcn36xx_smd_add_ba(struct wcn36xx *wcn) in wcn36xx_smd_add_ba() argument
1879 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_add_ba()
1885 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_add_ba()
1887 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_add_ba()
1892 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_add_ba()
1898 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_add_ba()
1902 int wcn36xx_smd_del_ba(struct wcn36xx *wcn, u16 tid, u8 sta_index) in wcn36xx_smd_del_ba() argument
1907 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_del_ba()
1913 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_del_ba()
1915 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_del_ba()
1920 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_del_ba()
1926 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_del_ba()
1930 int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index) in wcn36xx_smd_trigger_ba() argument
1936 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_trigger_ba()
1942 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_trigger_ba()
1945 (wcn->hal_buf + sizeof(msg_body)); in wcn36xx_smd_trigger_ba()
1949 ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); in wcn36xx_smd_trigger_ba()
1954 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_trigger_ba()
1960 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_trigger_ba()
1964 static int wcn36xx_smd_tx_compl_ind(struct wcn36xx *wcn, void *buf, size_t len) in wcn36xx_smd_tx_compl_ind() argument
1973 wcn36xx_dxe_tx_ack_ind(wcn, rsp->status); in wcn36xx_smd_tx_compl_ind()
1978 static int wcn36xx_smd_missed_beacon_ind(struct wcn36xx *wcn, in wcn36xx_smd_missed_beacon_ind() argument
1987 if (wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { in wcn36xx_smd_missed_beacon_ind()
1988 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_missed_beacon_ind()
2004 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_missed_beacon_ind()
2020 static int wcn36xx_smd_delete_sta_context_ind(struct wcn36xx *wcn, in wcn36xx_smd_delete_sta_context_ind() argument
2033 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_smd_delete_sta_context_ind()
2053 int wcn36xx_smd_update_cfg(struct wcn36xx *wcn, u32 cfg_id, u32 value) in wcn36xx_smd_update_cfg() argument
2059 mutex_lock(&wcn->hal_mutex); in wcn36xx_smd_update_cfg()
2062 PREPARE_HAL_BUF(wcn->hal_buf, msg_body); in wcn36xx_smd_update_cfg()
2064 body = (struct wcn36xx_hal_update_cfg_req_msg *) wcn->hal_buf; in wcn36xx_smd_update_cfg()
2067 put_cfg_tlv_u32(wcn, &len, cfg_id, value); in wcn36xx_smd_update_cfg()
2071 ret = wcn36xx_smd_send_and_wait(wcn, body->header.len); in wcn36xx_smd_update_cfg()
2076 ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); in wcn36xx_smd_update_cfg()
2082 mutex_unlock(&wcn->hal_mutex); in wcn36xx_smd_update_cfg()
2085 static void wcn36xx_smd_rsp_process(struct wcn36xx *wcn, void *buf, size_t len) in wcn36xx_smd_rsp_process() argument
2126 memcpy(wcn->hal_buf, buf, len); in wcn36xx_smd_rsp_process()
2127 wcn->hal_rsp_len = len; in wcn36xx_smd_rsp_process()
2128 complete(&wcn->hal_rsp_compl); in wcn36xx_smd_rsp_process()
2150 mutex_lock(&wcn->hal_ind_mutex); in wcn36xx_smd_rsp_process()
2151 list_add_tail(&msg_ind->list, &wcn->hal_ind_queue); in wcn36xx_smd_rsp_process()
2152 queue_work(wcn->hal_ind_wq, &wcn->hal_ind_work); in wcn36xx_smd_rsp_process()
2153 mutex_unlock(&wcn->hal_ind_mutex); in wcn36xx_smd_rsp_process()
2163 struct wcn36xx *wcn = in wcn36xx_ind_smd_work() local
2168 mutex_lock(&wcn->hal_ind_mutex); in wcn36xx_ind_smd_work()
2170 hal_ind_msg = list_first_entry(&wcn->hal_ind_queue, in wcn36xx_ind_smd_work()
2178 wcn36xx_smd_tx_compl_ind(wcn, in wcn36xx_ind_smd_work()
2183 wcn36xx_smd_missed_beacon_ind(wcn, in wcn36xx_ind_smd_work()
2188 wcn36xx_smd_delete_sta_context_ind(wcn, in wcn36xx_ind_smd_work()
2196 list_del(wcn->hal_ind_queue.next); in wcn36xx_ind_smd_work()
2199 mutex_unlock(&wcn->hal_ind_mutex); in wcn36xx_ind_smd_work()
2201 int wcn36xx_smd_open(struct wcn36xx *wcn) in wcn36xx_smd_open() argument
2204 wcn->hal_ind_wq = create_freezable_workqueue("wcn36xx_smd_ind"); in wcn36xx_smd_open()
2205 if (!wcn->hal_ind_wq) { in wcn36xx_smd_open()
2210 INIT_WORK(&wcn->hal_ind_work, wcn36xx_ind_smd_work); in wcn36xx_smd_open()
2211 INIT_LIST_HEAD(&wcn->hal_ind_queue); in wcn36xx_smd_open()
2212 mutex_init(&wcn->hal_ind_mutex); in wcn36xx_smd_open()
2214 ret = wcn->ctrl_ops->open(wcn, wcn36xx_smd_rsp_process); in wcn36xx_smd_open()
2223 destroy_workqueue(wcn->hal_ind_wq); in wcn36xx_smd_open()
2228 void wcn36xx_smd_close(struct wcn36xx *wcn) in wcn36xx_smd_close() argument
2230 wcn->ctrl_ops->close(); in wcn36xx_smd_close()
2231 destroy_workqueue(wcn->hal_ind_wq); in wcn36xx_smd_close()
2232 mutex_destroy(&wcn->hal_ind_mutex); in wcn36xx_smd_close()