Lines Matching refs:wcn

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