Lines Matching refs:wcn

195 static void wcn36xx_feat_caps_info(struct wcn36xx *wcn)  in wcn36xx_feat_caps_info()  argument
200 if (wcn36xx_firmware_get_feat_caps(wcn->fw_feat_caps, i)) { in wcn36xx_feat_caps_info()
209 struct wcn36xx *wcn = hw->priv; in wcn36xx_start() local
215 ret = wcn36xx_smd_open(wcn); in wcn36xx_start()
222 ret = wcn36xx_dxe_allocate_mem_pools(wcn); in wcn36xx_start()
228 ret = wcn36xx_dxe_alloc_ctl_blks(wcn); in wcn36xx_start()
234 ret = wcn36xx_smd_load_nv(wcn); in wcn36xx_start()
240 ret = wcn36xx_smd_start(wcn); in wcn36xx_start()
246 if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { in wcn36xx_start()
247 ret = wcn36xx_smd_feature_caps_exchange(wcn); in wcn36xx_start()
251 wcn36xx_feat_caps_info(wcn); in wcn36xx_start()
255 ret = wcn36xx_dxe_init(wcn); in wcn36xx_start()
261 wcn36xx_debugfs_init(wcn); in wcn36xx_start()
263 INIT_LIST_HEAD(&wcn->vif_list); in wcn36xx_start()
264 spin_lock_init(&wcn->dxe_lock); in wcn36xx_start()
265 spin_lock_init(&wcn->survey_lock); in wcn36xx_start()
270 wcn36xx_smd_stop(wcn); in wcn36xx_start()
272 wcn36xx_dxe_free_ctl_blks(wcn); in wcn36xx_start()
274 wcn36xx_dxe_free_mem_pools(wcn); in wcn36xx_start()
276 wcn36xx_smd_close(wcn); in wcn36xx_start()
283 struct wcn36xx *wcn = hw->priv; in wcn36xx_stop() local
287 mutex_lock(&wcn->scan_lock); in wcn36xx_stop()
288 if (wcn->scan_req) { in wcn36xx_stop()
293 ieee80211_scan_completed(wcn->hw, &scan_info); in wcn36xx_stop()
295 wcn->scan_req = NULL; in wcn36xx_stop()
296 mutex_unlock(&wcn->scan_lock); in wcn36xx_stop()
298 wcn36xx_debugfs_exit(wcn); in wcn36xx_stop()
299 wcn36xx_smd_stop(wcn); in wcn36xx_stop()
300 wcn36xx_dxe_deinit(wcn); in wcn36xx_stop()
301 wcn36xx_smd_close(wcn); in wcn36xx_stop()
303 wcn36xx_dxe_free_mem_pools(wcn); in wcn36xx_stop()
304 wcn36xx_dxe_free_ctl_blks(wcn); in wcn36xx_stop()
307 static void wcn36xx_change_ps(struct wcn36xx *wcn, bool enable) in wcn36xx_change_ps() argument
312 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_change_ps()
314 if (enable && !wcn->sw_scan) { in wcn36xx_change_ps()
316 wcn36xx_pmc_enter_bmps_state(wcn, vif); in wcn36xx_change_ps()
318 wcn36xx_pmc_exit_bmps_state(wcn, vif); in wcn36xx_change_ps()
323 static void wcn36xx_change_opchannel(struct wcn36xx *wcn, int ch) in wcn36xx_change_opchannel() argument
332 for (i = 0; i < ARRAY_SIZE(wcn->hw->wiphy->bands); i++) { in wcn36xx_change_opchannel()
333 band = wcn->hw->wiphy->bands[i]; in wcn36xx_change_opchannel()
351 spin_lock_irqsave(&wcn->survey_lock, flags); in wcn36xx_change_opchannel()
352 wcn->band = band; in wcn36xx_change_opchannel()
353 wcn->channel = channel; in wcn36xx_change_opchannel()
354 spin_unlock_irqrestore(&wcn->survey_lock, flags); in wcn36xx_change_opchannel()
356 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_change_opchannel()
358 wcn36xx_smd_switch_channel(wcn, vif, ch); in wcn36xx_change_opchannel()
366 struct wcn36xx *wcn = hw->priv; in wcn36xx_config() local
371 mutex_lock(&wcn->conf_mutex); in wcn36xx_config()
374 int ch = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_config()
378 if (wcn->sw_scan_opchannel == ch && wcn->sw_scan_channel) { in wcn36xx_config()
383 if (wcn->sw_scan_channel) in wcn36xx_config()
384 wcn36xx_smd_end_scan(wcn, wcn->sw_scan_channel); in wcn36xx_config()
385 if (wcn->sw_scan_init) { in wcn36xx_config()
386 wcn36xx_smd_finish_scan(wcn, HAL_SYS_MODE_SCAN, in wcn36xx_config()
387 wcn->sw_scan_vif); in wcn36xx_config()
389 } else if (wcn->sw_scan) { in wcn36xx_config()
393 if (wcn->sw_scan_channel) in wcn36xx_config()
394 wcn36xx_smd_end_scan(wcn, wcn->sw_scan_channel); in wcn36xx_config()
395 if (!wcn->sw_scan_init) { in wcn36xx_config()
399 ret = wcn36xx_smd_init_scan(wcn, in wcn36xx_config()
401 wcn->sw_scan_vif); in wcn36xx_config()
403 mutex_unlock(&wcn->conf_mutex); in wcn36xx_config()
407 wcn36xx_smd_start_scan(wcn, ch); in wcn36xx_config()
409 wcn36xx_change_opchannel(wcn, ch); in wcn36xx_config()
414 wcn36xx_change_ps(wcn, hw->conf.flags & IEEE80211_CONF_PS); in wcn36xx_config()
418 wcn36xx_smd_enter_imps(wcn); in wcn36xx_config()
420 wcn36xx_smd_exit_imps(wcn); in wcn36xx_config()
423 mutex_unlock(&wcn->conf_mutex); in wcn36xx_config()
433 struct wcn36xx *wcn = hw->priv; in wcn36xx_configure_filter() local
439 mutex_lock(&wcn->conf_mutex); in wcn36xx_configure_filter()
444 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_configure_filter()
449 wcn36xx_smd_set_mc_list(wcn, vif, NULL); in wcn36xx_configure_filter()
451 wcn36xx_smd_set_mc_list(wcn, vif, fp); in wcn36xx_configure_filter()
454 mutex_unlock(&wcn->conf_mutex); in wcn36xx_configure_filter()
489 struct wcn36xx *wcn = hw->priv; in wcn36xx_tx() local
495 if (wcn36xx_start_tx(wcn, sta_priv, skb)) in wcn36xx_tx()
496 ieee80211_free_txskb(wcn->hw, skb); in wcn36xx_tx()
504 struct wcn36xx *wcn = hw->priv; in wcn36xx_set_key() local
518 mutex_lock(&wcn->conf_mutex); in wcn36xx_set_key()
561 wcn36xx_smd_config_bss(wcn, in wcn36xx_set_key()
566 wcn36xx_smd_config_sta(wcn, vif, sta); in wcn36xx_set_key()
569 wcn36xx_smd_set_stakey(wcn, in wcn36xx_set_key()
576 wcn36xx_smd_set_bsskey(wcn, in wcn36xx_set_key()
588 wcn36xx_smd_set_stakey(wcn, in wcn36xx_set_key()
601 wcn36xx_smd_remove_bsskey(wcn, in wcn36xx_set_key()
611 wcn36xx_smd_remove_stakey(wcn, in wcn36xx_set_key()
624 mutex_unlock(&wcn->conf_mutex); in wcn36xx_set_key()
633 struct wcn36xx *wcn = hw->priv; in wcn36xx_hw_scan() local
635 if (!wcn36xx_firmware_get_feat_caps(wcn->fw_feat_caps, SCAN_OFFLOAD)) { in wcn36xx_hw_scan()
649 mutex_lock(&wcn->scan_lock); in wcn36xx_hw_scan()
650 if (wcn->scan_req) { in wcn36xx_hw_scan()
651 mutex_unlock(&wcn->scan_lock); in wcn36xx_hw_scan()
655 wcn->scan_aborted = false; in wcn36xx_hw_scan()
656 wcn->scan_req = &hw_req->req; in wcn36xx_hw_scan()
658 mutex_unlock(&wcn->scan_lock); in wcn36xx_hw_scan()
660 wcn36xx_smd_update_channel_list(wcn, &hw_req->req); in wcn36xx_hw_scan()
661 return wcn36xx_smd_start_hw_scan(wcn, vif, &hw_req->req); in wcn36xx_hw_scan()
667 struct wcn36xx *wcn = hw->priv; in wcn36xx_cancel_hw_scan() local
669 mutex_lock(&wcn->scan_lock); in wcn36xx_cancel_hw_scan()
670 wcn->scan_aborted = true; in wcn36xx_cancel_hw_scan()
671 mutex_unlock(&wcn->scan_lock); in wcn36xx_cancel_hw_scan()
673 if (wcn36xx_firmware_get_feat_caps(wcn->fw_feat_caps, SCAN_OFFLOAD)) { in wcn36xx_cancel_hw_scan()
676 wcn36xx_smd_stop_hw_scan(wcn); in wcn36xx_cancel_hw_scan()
684 struct wcn36xx *wcn = hw->priv; in wcn36xx_sw_scan_start() local
689 wcn->sw_scan = true; in wcn36xx_sw_scan_start()
690 wcn->sw_scan_vif = vif; in wcn36xx_sw_scan_start()
691 wcn->sw_scan_channel = 0; in wcn36xx_sw_scan_start()
693 wcn->sw_scan_opchannel = WCN36XX_HW_CHANNEL(wcn); in wcn36xx_sw_scan_start()
695 wcn->sw_scan_opchannel = 0; in wcn36xx_sw_scan_start()
701 struct wcn36xx *wcn = hw->priv; in wcn36xx_sw_scan_complete() local
706 if (wcn->sw_scan_channel) in wcn36xx_sw_scan_complete()
707 wcn36xx_smd_end_scan(wcn, wcn->sw_scan_channel); in wcn36xx_sw_scan_complete()
708 if (wcn->sw_scan_init) { in wcn36xx_sw_scan_complete()
709 wcn36xx_smd_finish_scan(wcn, HAL_SYS_MODE_SCAN, in wcn36xx_sw_scan_complete()
710 wcn->sw_scan_vif); in wcn36xx_sw_scan_complete()
712 wcn->sw_scan = false; in wcn36xx_sw_scan_complete()
713 wcn->sw_scan_opchannel = 0; in wcn36xx_sw_scan_complete()
804 struct wcn36xx *wcn = hw->priv; in wcn36xx_bss_info_changed() local
813 mutex_lock(&wcn->conf_mutex); in wcn36xx_bss_info_changed()
830 wcn36xx_smd_set_link_st(wcn, bss_conf->bssid, vif->addr, in wcn36xx_bss_info_changed()
832 wcn36xx_smd_join(wcn, bss_conf->bssid, in wcn36xx_bss_info_changed()
833 vif->addr, WCN36XX_HW_CHANNEL(wcn)); in wcn36xx_bss_info_changed()
834 wcn36xx_smd_config_bss(wcn, vif, NULL, in wcn36xx_bss_info_changed()
838 wcn36xx_smd_delete_bss(wcn, vif); in wcn36xx_bss_info_changed()
839 wcn36xx_smd_set_link_st(wcn, bss_conf->bssid, vif->addr, in wcn36xx_bss_info_changed()
885 wcn36xx_update_allowed_rates(sta, WCN36XX_BAND(wcn)); in wcn36xx_bss_info_changed()
887 wcn36xx_smd_set_link_st(wcn, bss_conf->bssid, in wcn36xx_bss_info_changed()
890 wcn36xx_smd_config_bss(wcn, vif, sta, in wcn36xx_bss_info_changed()
898 wcn36xx_smd_config_sta(wcn, vif, sta); in wcn36xx_bss_info_changed()
900 wcn36xx_smd_add_beacon_filter(wcn, vif); in wcn36xx_bss_info_changed()
901 wcn36xx_enable_keep_alive_null_packet(wcn, vif); in wcn36xx_bss_info_changed()
909 wcn36xx_smd_set_link_st(wcn, in wcn36xx_bss_info_changed()
924 wcn36xx_smd_update_proberesp_tmpl(wcn, vif, skb); in wcn36xx_bss_info_changed()
937 wcn36xx_smd_config_bss(wcn, vif, NULL, in wcn36xx_bss_info_changed()
945 wcn36xx_smd_send_beacon(wcn, vif, skb, tim_off, 0); in wcn36xx_bss_info_changed()
954 wcn36xx_smd_set_link_st(wcn, vif->addr, vif->addr, in wcn36xx_bss_info_changed()
957 wcn36xx_smd_delete_bss(wcn, vif); in wcn36xx_bss_info_changed()
958 wcn36xx_smd_set_link_st(wcn, vif->addr, vif->addr, in wcn36xx_bss_info_changed()
964 mutex_unlock(&wcn->conf_mutex); in wcn36xx_bss_info_changed()
970 struct wcn36xx *wcn = hw->priv; in wcn36xx_set_rts_threshold() local
973 mutex_lock(&wcn->conf_mutex); in wcn36xx_set_rts_threshold()
974 wcn36xx_smd_update_cfg(wcn, WCN36XX_HAL_CFG_RTS_THRESHOLD, value); in wcn36xx_set_rts_threshold()
975 mutex_unlock(&wcn->conf_mutex); in wcn36xx_set_rts_threshold()
983 struct wcn36xx *wcn = hw->priv; in wcn36xx_remove_interface() local
987 mutex_lock(&wcn->conf_mutex); in wcn36xx_remove_interface()
990 wcn36xx_smd_delete_sta_self(wcn, vif->addr); in wcn36xx_remove_interface()
992 mutex_unlock(&wcn->conf_mutex); in wcn36xx_remove_interface()
998 struct wcn36xx *wcn = hw->priv; in wcn36xx_add_interface() local
1013 mutex_lock(&wcn->conf_mutex); in wcn36xx_add_interface()
1017 list_add(&vif_priv->list, &wcn->vif_list); in wcn36xx_add_interface()
1018 wcn36xx_smd_add_sta_self(wcn, vif); in wcn36xx_add_interface()
1020 mutex_unlock(&wcn->conf_mutex); in wcn36xx_add_interface()
1028 struct wcn36xx *wcn = hw->priv; in wcn36xx_sta_add() local
1034 mutex_lock(&wcn->conf_mutex); in wcn36xx_sta_add()
1045 wcn36xx_update_allowed_rates(sta, WCN36XX_BAND(wcn)); in wcn36xx_sta_add()
1047 wcn36xx_smd_config_sta(wcn, vif, sta); in wcn36xx_sta_add()
1050 mutex_unlock(&wcn->conf_mutex); in wcn36xx_sta_add()
1059 struct wcn36xx *wcn = hw->priv; in wcn36xx_sta_remove() local
1065 mutex_lock(&wcn->conf_mutex); in wcn36xx_sta_remove()
1068 wcn36xx_smd_delete_sta(wcn, sta_priv->sta_index); in wcn36xx_sta_remove()
1071 mutex_unlock(&wcn->conf_mutex); in wcn36xx_sta_remove()
1078 static struct ieee80211_vif *wcn36xx_get_first_assoc_vif(struct wcn36xx *wcn) in wcn36xx_get_first_assoc_vif() argument
1083 list_for_each_entry(vif_priv, &wcn->vif_list, list) { in wcn36xx_get_first_assoc_vif()
1094 struct wcn36xx *wcn = hw->priv; in wcn36xx_suspend() local
1100 mutex_lock(&wcn->conf_mutex); in wcn36xx_suspend()
1102 vif = wcn36xx_get_first_assoc_vif(wcn); in wcn36xx_suspend()
1104 ret = wcn36xx_smd_arp_offload(wcn, vif, true); in wcn36xx_suspend()
1107 ret = wcn36xx_smd_ipv6_ns_offload(wcn, vif, true); in wcn36xx_suspend()
1110 ret = wcn36xx_smd_gtk_offload(wcn, vif, true); in wcn36xx_suspend()
1113 ret = wcn36xx_smd_set_power_params(wcn, true); in wcn36xx_suspend()
1116 ret = wcn36xx_smd_wlan_host_suspend_ind(wcn); in wcn36xx_suspend()
1122 disable_irq(wcn->tx_irq); in wcn36xx_suspend()
1123 disable_irq(wcn->rx_irq); in wcn36xx_suspend()
1126 mutex_unlock(&wcn->conf_mutex); in wcn36xx_suspend()
1132 struct wcn36xx *wcn = hw->priv; in wcn36xx_resume() local
1137 mutex_lock(&wcn->conf_mutex); in wcn36xx_resume()
1138 vif = wcn36xx_get_first_assoc_vif(wcn); in wcn36xx_resume()
1140 wcn36xx_smd_host_resume(wcn); in wcn36xx_resume()
1141 wcn36xx_smd_set_power_params(wcn, false); in wcn36xx_resume()
1142 wcn36xx_smd_gtk_offload_get_info(wcn, vif); in wcn36xx_resume()
1143 wcn36xx_smd_gtk_offload(wcn, vif, false); in wcn36xx_resume()
1144 wcn36xx_smd_ipv6_ns_offload(wcn, vif, false); in wcn36xx_resume()
1145 wcn36xx_smd_arp_offload(wcn, vif, false); in wcn36xx_resume()
1148 enable_irq(wcn->tx_irq); in wcn36xx_resume()
1149 enable_irq(wcn->rx_irq); in wcn36xx_resume()
1151 mutex_unlock(&wcn->conf_mutex); in wcn36xx_resume()
1160 struct wcn36xx *wcn = hw->priv; in wcn36xx_set_rekey_data() local
1163 mutex_lock(&wcn->conf_mutex); in wcn36xx_set_rekey_data()
1171 mutex_unlock(&wcn->conf_mutex); in wcn36xx_set_rekey_data()
1180 struct wcn36xx *wcn = hw->priv; in wcn36xx_ampdu_action() local
1192 mutex_lock(&wcn->conf_mutex); in wcn36xx_ampdu_action()
1197 session = wcn36xx_smd_add_ba_session(wcn, sta, tid, ssn, 0, in wcn36xx_ampdu_action()
1203 wcn36xx_smd_add_ba(wcn, session); in wcn36xx_ampdu_action()
1206 wcn36xx_smd_del_ba(wcn, tid, 0, get_sta_index(vif, sta_priv)); in wcn36xx_ampdu_action()
1215 wcn36xx_smd_trigger_ba(wcn, get_sta_index(vif, sta_priv), tid, ssn); in wcn36xx_ampdu_action()
1219 session = wcn36xx_smd_add_ba_session(wcn, sta, tid, ssn, 1, in wcn36xx_ampdu_action()
1240 wcn36xx_smd_del_ba(wcn, tid, 1, get_sta_index(vif, sta_priv)); in wcn36xx_ampdu_action()
1248 mutex_unlock(&wcn->conf_mutex); in wcn36xx_ampdu_action()
1284 struct wcn36xx *wcn = hw->priv; in wcn36xx_flush() local
1286 if (wcn36xx_dxe_tx_flush(wcn)) { in wcn36xx_flush()
1294 struct wcn36xx *wcn = hw->priv; in wcn36xx_get_survey() local
1300 sband = wcn->hw->wiphy->bands[NL80211_BAND_2GHZ]; in wcn36xx_get_survey()
1304 sband = wcn->hw->wiphy->bands[NL80211_BAND_5GHZ]; in wcn36xx_get_survey()
1310 spin_lock_irqsave(&wcn->survey_lock, flags); in wcn36xx_get_survey()
1312 chan_survey = &wcn->chan_survey[idx]; in wcn36xx_get_survey()
1320 if (survey->channel == wcn->channel) in wcn36xx_get_survey()
1323 spin_unlock_irqrestore(&wcn->survey_lock, flags); in wcn36xx_get_survey()
1337 struct wcn36xx *wcn; in wcn36xx_sta_statistics() local
1341 wcn = hw->priv; in wcn36xx_sta_statistics()
1343 status = wcn36xx_smd_get_stats(wcn, sta_index, HAL_GLOBAL_CLASS_A_STATS_INFO, sinfo); in wcn36xx_sta_statistics()
1413 static int wcn36xx_init_ieee80211(struct wcn36xx *wcn) in wcn36xx_init_ieee80211() argument
1422 ieee80211_hw_set(wcn->hw, TIMING_BEACON_ONLY); in wcn36xx_init_ieee80211()
1423 ieee80211_hw_set(wcn->hw, AMPDU_AGGREGATION); in wcn36xx_init_ieee80211()
1424 ieee80211_hw_set(wcn->hw, SUPPORTS_PS); in wcn36xx_init_ieee80211()
1425 ieee80211_hw_set(wcn->hw, SIGNAL_DBM); in wcn36xx_init_ieee80211()
1426 ieee80211_hw_set(wcn->hw, HAS_RATE_CONTROL); in wcn36xx_init_ieee80211()
1427 ieee80211_hw_set(wcn->hw, SINGLE_SCAN_ON_ALL_BANDS); in wcn36xx_init_ieee80211()
1428 ieee80211_hw_set(wcn->hw, REPORTS_TX_ACK_STATUS); in wcn36xx_init_ieee80211()
1430 wcn->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | in wcn36xx_init_ieee80211()
1435 wcn->hw->wiphy->bands[NL80211_BAND_2GHZ] = &wcn_band_2ghz; in wcn36xx_init_ieee80211()
1436 if (wcn->rf_id != RF_IRIS_WCN3620) in wcn36xx_init_ieee80211()
1437 wcn->hw->wiphy->bands[NL80211_BAND_5GHZ] = &wcn_band_5ghz; in wcn36xx_init_ieee80211()
1439 if (wcn->rf_id == RF_IRIS_WCN3680) in wcn36xx_init_ieee80211()
1442 wcn->hw->wiphy->max_scan_ssids = WCN36XX_MAX_SCAN_SSIDS; in wcn36xx_init_ieee80211()
1443 wcn->hw->wiphy->max_scan_ie_len = WCN36XX_MAX_SCAN_IE_LEN; in wcn36xx_init_ieee80211()
1445 wcn->hw->wiphy->cipher_suites = cipher_suites; in wcn36xx_init_ieee80211()
1446 wcn->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); in wcn36xx_init_ieee80211()
1449 wcn->hw->wiphy->wowlan = &wowlan_support; in wcn36xx_init_ieee80211()
1452 wcn->hw->max_listen_interval = 200; in wcn36xx_init_ieee80211()
1454 wcn->hw->queues = 4; in wcn36xx_init_ieee80211()
1456 SET_IEEE80211_DEV(wcn->hw, wcn->dev); in wcn36xx_init_ieee80211()
1458 wcn->hw->sta_data_size = sizeof(struct wcn36xx_sta); in wcn36xx_init_ieee80211()
1459 wcn->hw->vif_data_size = sizeof(struct wcn36xx_vif); in wcn36xx_init_ieee80211()
1461 wiphy_ext_feature_set(wcn->hw->wiphy, in wcn36xx_init_ieee80211()
1467 static int wcn36xx_platform_get_resources(struct wcn36xx *wcn, in wcn36xx_platform_get_resources() argument
1479 wcn->tx_irq = ret; in wcn36xx_platform_get_resources()
1485 wcn->rx_irq = ret; in wcn36xx_platform_get_resources()
1488 wcn->tx_enable_state = qcom_smem_state_get(&pdev->dev, in wcn36xx_platform_get_resources()
1489 "tx-enable", &wcn->tx_enable_state_bit); in wcn36xx_platform_get_resources()
1490 if (IS_ERR(wcn->tx_enable_state)) { in wcn36xx_platform_get_resources()
1492 return PTR_ERR(wcn->tx_enable_state); in wcn36xx_platform_get_resources()
1496 wcn->tx_rings_empty_state = qcom_smem_state_get(&pdev->dev, in wcn36xx_platform_get_resources()
1497 "tx-rings-empty", &wcn->tx_rings_empty_state_bit); in wcn36xx_platform_get_resources()
1498 if (IS_ERR(wcn->tx_rings_empty_state)) { in wcn36xx_platform_get_resources()
1500 return PTR_ERR(wcn->tx_rings_empty_state); in wcn36xx_platform_get_resources()
1509 wcn->is_pronto = !!of_device_is_compatible(mmio_node, "qcom,pronto"); in wcn36xx_platform_get_resources()
1510 wcn->is_pronto_v3 = !!of_device_is_compatible(mmio_node, "qcom,pronto-v3-pil"); in wcn36xx_platform_get_resources()
1514 wcn->ccu_base = of_iomap(mmio_node, index); in wcn36xx_platform_get_resources()
1515 if (!wcn->ccu_base) { in wcn36xx_platform_get_resources()
1523 wcn->dxe_base = of_iomap(mmio_node, index); in wcn36xx_platform_get_resources()
1524 if (!wcn->dxe_base) { in wcn36xx_platform_get_resources()
1534 wcn->rf_id = RF_IRIS_WCN3620; in wcn36xx_platform_get_resources()
1537 wcn->rf_id = RF_IRIS_WCN3660; in wcn36xx_platform_get_resources()
1539 wcn->rf_id = RF_IRIS_WCN3680; in wcn36xx_platform_get_resources()
1547 iounmap(wcn->ccu_base); in wcn36xx_platform_get_resources()
1556 struct wcn36xx *wcn; in wcn36xx_probe() local
1573 wcn = hw->priv; in wcn36xx_probe()
1574 wcn->hw = hw; in wcn36xx_probe()
1575 wcn->dev = &pdev->dev; in wcn36xx_probe()
1576 wcn->first_boot = true; in wcn36xx_probe()
1577 mutex_init(&wcn->conf_mutex); in wcn36xx_probe()
1578 mutex_init(&wcn->hal_mutex); in wcn36xx_probe()
1579 mutex_init(&wcn->scan_lock); in wcn36xx_probe()
1580 __skb_queue_head_init(&wcn->amsdu); in wcn36xx_probe()
1582 wcn->hal_buf = devm_kmalloc(wcn->dev, WCN36XX_HAL_BUF_SIZE, GFP_KERNEL); in wcn36xx_probe()
1583 if (!wcn->hal_buf) { in wcn36xx_probe()
1589 wcn->chan_survey = devm_kmalloc(wcn->dev, n_channels, GFP_KERNEL); in wcn36xx_probe()
1590 if (!wcn->chan_survey) { in wcn36xx_probe()
1595 ret = dma_set_mask_and_coherent(wcn->dev, DMA_BIT_MASK(32)); in wcn36xx_probe()
1601 wcn->nv_file = WLAN_NV_FILE; in wcn36xx_probe()
1602 ret = of_property_read_string(wcn->dev->parent->of_node, "firmware-name", &wcn->nv_file); in wcn36xx_probe()
1608 wcn->smd_channel = qcom_wcnss_open_channel(wcnss, "WLAN_CTRL", wcn36xx_smd_rsp_process, hw); in wcn36xx_probe()
1609 if (IS_ERR(wcn->smd_channel)) { in wcn36xx_probe()
1611 ret = PTR_ERR(wcn->smd_channel); in wcn36xx_probe()
1622 SET_IEEE80211_PERM_ADDR(wcn->hw, addr); in wcn36xx_probe()
1625 ret = wcn36xx_platform_get_resources(wcn, pdev); in wcn36xx_probe()
1629 wcn36xx_init_ieee80211(wcn); in wcn36xx_probe()
1630 ret = ieee80211_register_hw(wcn->hw); in wcn36xx_probe()
1637 iounmap(wcn->ccu_base); in wcn36xx_probe()
1638 iounmap(wcn->dxe_base); in wcn36xx_probe()
1640 rpmsg_destroy_ept(wcn->smd_channel); in wcn36xx_probe()
1650 struct wcn36xx *wcn = hw->priv; in wcn36xx_remove() local
1653 release_firmware(wcn->nv); in wcn36xx_remove()
1657 qcom_smem_state_put(wcn->tx_enable_state); in wcn36xx_remove()
1658 qcom_smem_state_put(wcn->tx_rings_empty_state); in wcn36xx_remove()
1660 rpmsg_destroy_ept(wcn->smd_channel); in wcn36xx_remove()
1662 iounmap(wcn->dxe_base); in wcn36xx_remove()
1663 iounmap(wcn->ccu_base); in wcn36xx_remove()
1665 __skb_queue_purge(&wcn->amsdu); in wcn36xx_remove()
1667 mutex_destroy(&wcn->hal_mutex); in wcn36xx_remove()