Lines Matching +full:rpmsg +full:- +full:out

13  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
24 #include <linux/rpmsg.h>
190 return NL80211_IFTYPE_STATION == vif->type ? in get_sta_index()
191 sta_priv->bss_sta_index : in get_sta_index()
192 sta_priv->sta_index; in get_sta_index()
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()
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()
283 struct wcn36xx *wcn = hw->priv; in wcn36xx_stop()
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()
312 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_change_ps()
314 if (enable && !wcn->sw_scan) { in wcn36xx_change_ps()
315 if (vif->cfg.ps) /* ps allowed ? */ in wcn36xx_change_ps()
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()
336 for (j = 0; j < band->n_channels; j++) { in wcn36xx_change_opchannel()
337 if (HW_VALUE_CHANNEL(band->channels[j].hw_value) == ch) { in wcn36xx_change_opchannel()
338 channel = &band->channels[j]; 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()
366 struct wcn36xx *wcn = hw->priv; in wcn36xx_config()
371 mutex_lock(&wcn->conf_mutex); 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()
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()
401 wcn->sw_scan_vif); in wcn36xx_config()
403 mutex_unlock(&wcn->conf_mutex); in wcn36xx_config()
404 return -EIO; in wcn36xx_config()
414 wcn36xx_change_ps(wcn, hw->conf.flags & IEEE80211_CONF_PS); in wcn36xx_config()
417 if (hw->conf.flags & IEEE80211_CONF_IDLE) in wcn36xx_config()
423 mutex_unlock(&wcn->conf_mutex); in wcn36xx_config()
433 struct wcn36xx *wcn = hw->priv; in wcn36xx_configure_filter()
439 mutex_lock(&wcn->conf_mutex); in wcn36xx_configure_filter()
444 list_for_each_entry(tmp, &wcn->vif_list, list) { in wcn36xx_configure_filter()
450 else if (NL80211_IFTYPE_STATION == vif->type && tmp->sta_assoc) in wcn36xx_configure_filter()
454 mutex_unlock(&wcn->conf_mutex); in wcn36xx_configure_filter()
467 wcn36xx_err("Out of memory setting filters.\n"); in wcn36xx_prepare_multicast()
471 fp->mc_addr_count = 0; in wcn36xx_prepare_multicast()
476 memcpy(fp->mc_addr[fp->mc_addr_count], in wcn36xx_prepare_multicast()
477 ha->addr, ETH_ALEN); in wcn36xx_prepare_multicast()
478 fp->mc_addr_count++; in wcn36xx_prepare_multicast()
489 struct wcn36xx *wcn = hw->priv; in wcn36xx_tx()
492 if (control->sta) in wcn36xx_tx()
493 sta_priv = wcn36xx_sta_to_priv(control->sta); in wcn36xx_tx()
496 ieee80211_free_txskb(wcn->hw, skb); in wcn36xx_tx()
504 struct wcn36xx *wcn = hw->priv; in wcn36xx_set_key()
512 cmd, key_conf->cipher, key_conf->keyidx, in wcn36xx_set_key()
513 key_conf->keylen, key_conf->flags); in wcn36xx_set_key()
515 key_conf->key, in wcn36xx_set_key()
516 key_conf->keylen); in wcn36xx_set_key()
518 mutex_lock(&wcn->conf_mutex); in wcn36xx_set_key()
520 switch (key_conf->cipher) { in wcn36xx_set_key()
522 vif_priv->encrypt_type = WCN36XX_HAL_ED_WEP40; in wcn36xx_set_key()
525 vif_priv->encrypt_type = WCN36XX_HAL_ED_WEP104; in wcn36xx_set_key()
528 vif_priv->encrypt_type = WCN36XX_HAL_ED_CCMP; in wcn36xx_set_key()
531 vif_priv->encrypt_type = WCN36XX_HAL_ED_TKIP; in wcn36xx_set_key()
535 key_conf->cipher); in wcn36xx_set_key()
536 ret = -EOPNOTSUPP; in wcn36xx_set_key()
537 goto out; in wcn36xx_set_key()
542 if (WCN36XX_HAL_ED_TKIP == vif_priv->encrypt_type) { in wcn36xx_set_key()
545 * Temporal Key (16 b) - TX MIC (8 b) - RX MIC (8 b) in wcn36xx_set_key()
548 * Temporal Key (16 b) - RX MIC (8 b) - TX MIC (8 b) in wcn36xx_set_key()
550 memcpy(key, key_conf->key, 16); in wcn36xx_set_key()
551 memcpy(key + 16, key_conf->key + 24, 8); in wcn36xx_set_key()
552 memcpy(key + 24, key_conf->key + 16, 8); in wcn36xx_set_key()
554 memcpy(key, key_conf->key, key_conf->keylen); in wcn36xx_set_key()
557 if (IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags) { in wcn36xx_set_key()
558 sta_priv->is_data_encrypted = true; in wcn36xx_set_key()
560 if (NL80211_IFTYPE_STATION == vif->type) { in wcn36xx_set_key()
564 sta->addr, in wcn36xx_set_key()
570 vif_priv->encrypt_type, in wcn36xx_set_key()
571 key_conf->keyidx, in wcn36xx_set_key()
572 key_conf->keylen, in wcn36xx_set_key()
577 vif_priv->encrypt_type, in wcn36xx_set_key()
578 vif_priv->bss_index, in wcn36xx_set_key()
579 key_conf->keyidx, in wcn36xx_set_key()
580 key_conf->keylen, in wcn36xx_set_key()
583 if ((WLAN_CIPHER_SUITE_WEP40 == key_conf->cipher) || in wcn36xx_set_key()
584 (WLAN_CIPHER_SUITE_WEP104 == key_conf->cipher)) { in wcn36xx_set_key()
586 &vif_priv->sta_list, list) { in wcn36xx_set_key()
587 sta_priv->is_data_encrypted = true; in wcn36xx_set_key()
589 vif_priv->encrypt_type, in wcn36xx_set_key()
590 key_conf->keyidx, in wcn36xx_set_key()
591 key_conf->keylen, in wcn36xx_set_key()
599 if (!(IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags)) { in wcn36xx_set_key()
600 if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX) in wcn36xx_set_key()
602 vif_priv->encrypt_type, in wcn36xx_set_key()
603 vif_priv->bss_index, in wcn36xx_set_key()
604 key_conf->keyidx); in wcn36xx_set_key()
606 vif_priv->encrypt_type = WCN36XX_HAL_ED_NONE; in wcn36xx_set_key()
608 sta_priv->is_data_encrypted = false; in wcn36xx_set_key()
610 if (sta_priv->aid) in wcn36xx_set_key()
612 vif_priv->encrypt_type, in wcn36xx_set_key()
613 key_conf->keyidx, in wcn36xx_set_key()
619 ret = -EOPNOTSUPP; in wcn36xx_set_key()
620 goto out; in wcn36xx_set_key()
623 out: in wcn36xx_set_key()
624 mutex_unlock(&wcn->conf_mutex); in wcn36xx_set_key()
633 struct wcn36xx *wcn = hw->priv; in wcn36xx_hw_scan()
635 if (!wcn36xx_firmware_get_feat_caps(wcn->fw_feat_caps, SCAN_OFFLOAD)) { in wcn36xx_hw_scan()
643 if (hw_req->req.n_channels > 48) { in wcn36xx_hw_scan()
645 hw_req->req.n_channels); 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()
652 return -EBUSY; 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()
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()
684 struct wcn36xx *wcn = hw->priv; in wcn36xx_sw_scan_start()
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()
692 if (vif_priv->sta_assoc) 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()
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()
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()
722 u32 rates = sta->deflink.supp_rates[band]; in wcn36xx_update_allowed_rates()
724 memset(&sta_priv->supported_rates, 0, in wcn36xx_update_allowed_rates()
725 sizeof(sta_priv->supported_rates)); in wcn36xx_update_allowed_rates()
726 sta_priv->supported_rates.op_rate_mode = STA_11n; in wcn36xx_update_allowed_rates()
728 size = ARRAY_SIZE(sta_priv->supported_rates.dsss_rates); in wcn36xx_update_allowed_rates()
729 rates_table = sta_priv->supported_rates.dsss_rates; in wcn36xx_update_allowed_rates()
739 size = ARRAY_SIZE(sta_priv->supported_rates.ofdm_rates); in wcn36xx_update_allowed_rates()
740 rates_table = sta_priv->supported_rates.ofdm_rates; in wcn36xx_update_allowed_rates()
748 if (sta->deflink.ht_cap.ht_supported) { in wcn36xx_update_allowed_rates()
749 BUILD_BUG_ON(sizeof(sta->deflink.ht_cap.mcs.rx_mask) > in wcn36xx_update_allowed_rates()
750 sizeof(sta_priv->supported_rates.supported_mcs_set)); in wcn36xx_update_allowed_rates()
751 memcpy(sta_priv->supported_rates.supported_mcs_set, in wcn36xx_update_allowed_rates()
752 sta->deflink.ht_cap.mcs.rx_mask, in wcn36xx_update_allowed_rates()
753 sizeof(sta->deflink.ht_cap.mcs.rx_mask)); in wcn36xx_update_allowed_rates()
756 if (sta->deflink.vht_cap.vht_supported) { in wcn36xx_update_allowed_rates()
757 sta_priv->supported_rates.op_rate_mode = STA_11ac; in wcn36xx_update_allowed_rates()
758 sta_priv->supported_rates.vht_rx_mcs_map = in wcn36xx_update_allowed_rates()
759 le16_to_cpu(sta->deflink.vht_cap.vht_mcs.rx_mcs_map); in wcn36xx_update_allowed_rates()
760 sta_priv->supported_rates.vht_tx_mcs_map = in wcn36xx_update_allowed_rates()
761 le16_to_cpu(sta->deflink.vht_cap.vht_mcs.tx_mcs_map); in wcn36xx_update_allowed_rates()
784 rates->op_rate_mode = STA_11n; in wcn36xx_set_default_rates()
785 memcpy(rates->dsss_rates, dsss_rates, in wcn36xx_set_default_rates()
787 memcpy(rates->ofdm_rates, ofdm_rates, in wcn36xx_set_default_rates()
789 rates->supported_mcs_set[0] = 0xFF; in wcn36xx_set_default_rates()
794 rates->op_rate_mode = STA_11ac; in wcn36xx_set_default_rates_v1()
795 rates->vht_rx_mcs_map = IEEE80211_VHT_MCS_SUPPORT_0_9; in wcn36xx_set_default_rates_v1()
796 rates->vht_tx_mcs_map = IEEE80211_VHT_MCS_SUPPORT_0_9; in wcn36xx_set_default_rates_v1()
804 struct wcn36xx *wcn = hw->priv; in wcn36xx_bss_info_changed()
813 mutex_lock(&wcn->conf_mutex); in wcn36xx_bss_info_changed()
818 bss_conf->dtim_period); in wcn36xx_bss_info_changed()
820 vif_priv->dtim_period = bss_conf->dtim_period; in wcn36xx_bss_info_changed()
825 bss_conf->bssid); in wcn36xx_bss_info_changed()
827 if (!is_zero_ether_addr(bss_conf->bssid)) { in wcn36xx_bss_info_changed()
828 vif_priv->is_joining = true; in wcn36xx_bss_info_changed()
829 vif_priv->bss_index = WCN36XX_HAL_BSS_INVALID_IDX; 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()
835 bss_conf->bssid, false); in wcn36xx_bss_info_changed()
837 vif_priv->is_joining = false; in wcn36xx_bss_info_changed()
839 wcn36xx_smd_set_link_st(wcn, bss_conf->bssid, vif->addr, in wcn36xx_bss_info_changed()
841 vif_priv->encrypt_type = WCN36XX_HAL_ED_NONE; in wcn36xx_bss_info_changed()
849 vif->cfg.ssid, vif->cfg.ssid_len); in wcn36xx_bss_info_changed()
851 vif_priv->ssid.length = vif->cfg.ssid_len; in wcn36xx_bss_info_changed()
852 memcpy(&vif_priv->ssid.ssid, in wcn36xx_bss_info_changed()
853 vif->cfg.ssid, in wcn36xx_bss_info_changed()
854 vif->cfg.ssid_len); in wcn36xx_bss_info_changed()
858 vif_priv->is_joining = false; in wcn36xx_bss_info_changed()
859 if (vif->cfg.assoc) { in wcn36xx_bss_info_changed()
865 bss_conf->bssid, in wcn36xx_bss_info_changed()
866 vif->addr, in wcn36xx_bss_info_changed()
867 vif->cfg.aid); in wcn36xx_bss_info_changed()
869 vif_priv->sta_assoc = true; in wcn36xx_bss_info_changed()
877 sta = ieee80211_find_sta(vif, bss_conf->bssid); in wcn36xx_bss_info_changed()
880 bss_conf->bssid); in wcn36xx_bss_info_changed()
881 goto out; in wcn36xx_bss_info_changed()
887 wcn36xx_smd_set_link_st(wcn, bss_conf->bssid, in wcn36xx_bss_info_changed()
888 vif->addr, in wcn36xx_bss_info_changed()
891 bss_conf->bssid, in wcn36xx_bss_info_changed()
893 sta_priv->aid = vif->cfg.aid; in wcn36xx_bss_info_changed()
899 if (vif->type == NL80211_IFTYPE_STATION) in wcn36xx_bss_info_changed()
905 bss_conf->bssid, in wcn36xx_bss_info_changed()
906 vif->addr, in wcn36xx_bss_info_changed()
907 vif->cfg.aid); in wcn36xx_bss_info_changed()
908 vif_priv->sta_assoc = false; in wcn36xx_bss_info_changed()
910 bss_conf->bssid, in wcn36xx_bss_info_changed()
911 vif->addr, in wcn36xx_bss_info_changed()
921 goto out; in wcn36xx_bss_info_changed()
932 bss_conf->enable_beacon); in wcn36xx_bss_info_changed()
934 if (bss_conf->enable_beacon) { in wcn36xx_bss_info_changed()
935 vif_priv->dtim_period = bss_conf->dtim_period; in wcn36xx_bss_info_changed()
936 vif_priv->bss_index = WCN36XX_HAL_BSS_INVALID_IDX; in wcn36xx_bss_info_changed()
938 vif->addr, false); in wcn36xx_bss_info_changed()
943 goto out; in wcn36xx_bss_info_changed()
948 if (vif->type == NL80211_IFTYPE_ADHOC || in wcn36xx_bss_info_changed()
949 vif->type == NL80211_IFTYPE_MESH_POINT) in wcn36xx_bss_info_changed()
954 wcn36xx_smd_set_link_st(wcn, vif->addr, vif->addr, in wcn36xx_bss_info_changed()
958 wcn36xx_smd_set_link_st(wcn, vif->addr, vif->addr, in wcn36xx_bss_info_changed()
962 out: 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()
973 mutex_lock(&wcn->conf_mutex); 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()
987 mutex_lock(&wcn->conf_mutex); in wcn36xx_remove_interface()
989 list_del(&vif_priv->list); 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()
1002 vif, vif->type); in wcn36xx_add_interface()
1004 if (!(NL80211_IFTYPE_STATION == vif->type || in wcn36xx_add_interface()
1005 NL80211_IFTYPE_AP == vif->type || in wcn36xx_add_interface()
1006 NL80211_IFTYPE_ADHOC == vif->type || in wcn36xx_add_interface()
1007 NL80211_IFTYPE_MESH_POINT == vif->type)) { in wcn36xx_add_interface()
1009 vif->type); in wcn36xx_add_interface()
1010 return -EOPNOTSUPP; in wcn36xx_add_interface()
1013 mutex_lock(&wcn->conf_mutex); in wcn36xx_add_interface()
1015 vif_priv->bss_index = WCN36XX_HAL_BSS_INVALID_IDX; in wcn36xx_add_interface()
1016 INIT_LIST_HEAD(&vif_priv->sta_list); in wcn36xx_add_interface()
1017 list_add(&vif_priv->list, &wcn->vif_list); in wcn36xx_add_interface()
1020 mutex_unlock(&wcn->conf_mutex); in wcn36xx_add_interface()
1028 struct wcn36xx *wcn = hw->priv; in wcn36xx_sta_add()
1032 vif, sta->addr); in wcn36xx_sta_add()
1034 mutex_lock(&wcn->conf_mutex); in wcn36xx_sta_add()
1036 spin_lock_init(&sta_priv->ampdu_lock); in wcn36xx_sta_add()
1037 sta_priv->vif = vif_priv; in wcn36xx_sta_add()
1038 list_add(&sta_priv->list, &vif_priv->sta_list); in wcn36xx_sta_add()
1044 if (NL80211_IFTYPE_STATION != vif->type) { in wcn36xx_sta_add()
1046 sta_priv->aid = sta->aid; in wcn36xx_sta_add()
1050 mutex_unlock(&wcn->conf_mutex); in wcn36xx_sta_add()
1059 struct wcn36xx *wcn = hw->priv; in wcn36xx_sta_remove()
1063 vif, sta->addr, sta_priv->sta_index); in wcn36xx_sta_remove()
1065 mutex_lock(&wcn->conf_mutex); in wcn36xx_sta_remove()
1067 list_del(&sta_priv->list); in wcn36xx_sta_remove()
1068 wcn36xx_smd_delete_sta(wcn, sta_priv->sta_index); in wcn36xx_sta_remove()
1069 sta_priv->vif = NULL; in wcn36xx_sta_remove()
1071 mutex_unlock(&wcn->conf_mutex); in wcn36xx_sta_remove()
1083 list_for_each_entry(vif_priv, &wcn->vif_list, list) { in wcn36xx_get_first_assoc_vif()
1084 if (vif_priv->sta_assoc) { in wcn36xx_get_first_assoc_vif()
1094 struct wcn36xx *wcn = hw->priv; in wcn36xx_suspend()
1100 mutex_lock(&wcn->conf_mutex); in wcn36xx_suspend()
1106 goto out; in wcn36xx_suspend()
1109 goto out; in wcn36xx_suspend()
1112 goto out; in wcn36xx_suspend()
1115 goto out; in wcn36xx_suspend()
1122 disable_irq(wcn->tx_irq); in wcn36xx_suspend()
1123 disable_irq(wcn->rx_irq); in wcn36xx_suspend()
1125 out: in wcn36xx_suspend()
1126 mutex_unlock(&wcn->conf_mutex); in wcn36xx_suspend()
1132 struct wcn36xx *wcn = hw->priv; in wcn36xx_resume()
1137 mutex_lock(&wcn->conf_mutex); 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()
1163 mutex_lock(&wcn->conf_mutex); in wcn36xx_set_rekey_data()
1165 memcpy(vif_priv->rekey_data.kek, data->kek, NL80211_KEK_LEN); in wcn36xx_set_rekey_data()
1166 memcpy(vif_priv->rekey_data.kck, data->kck, NL80211_KCK_LEN); in wcn36xx_set_rekey_data()
1167 vif_priv->rekey_data.replay_ctr = in wcn36xx_set_rekey_data()
1168 cpu_to_le64(be64_to_cpup((__be64 *)data->replay_ctr)); in wcn36xx_set_rekey_data()
1169 vif_priv->rekey_data.valid = true; 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()
1181 struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(params->sta); in wcn36xx_ampdu_action()
1182 struct ieee80211_sta *sta = params->sta; in wcn36xx_ampdu_action()
1183 enum ieee80211_ampdu_mlme_action action = params->action; in wcn36xx_ampdu_action()
1184 u16 tid = params->tid; in wcn36xx_ampdu_action()
1185 u16 *ssn = &params->ssn; in wcn36xx_ampdu_action()
1192 mutex_lock(&wcn->conf_mutex); in wcn36xx_ampdu_action()
1196 sta_priv->tid = tid; in wcn36xx_ampdu_action()
1201 goto out; in wcn36xx_ampdu_action()
1209 spin_lock_bh(&sta_priv->ampdu_lock); in wcn36xx_ampdu_action()
1210 sta_priv->ampdu_state[tid] = WCN36XX_AMPDU_START; in wcn36xx_ampdu_action()
1211 spin_unlock_bh(&sta_priv->ampdu_lock); in wcn36xx_ampdu_action()
1216 wcn36xx_dbg(WCN36XX_DBG_MAC, "mac ampdu fw-ssn = %u\n", *ssn); in wcn36xx_ampdu_action()
1223 goto out; in wcn36xx_ampdu_action()
1228 spin_lock_bh(&sta_priv->ampdu_lock); in wcn36xx_ampdu_action()
1229 sta_priv->ampdu_state[tid] = WCN36XX_AMPDU_OPERATIONAL; in wcn36xx_ampdu_action()
1230 spin_unlock_bh(&sta_priv->ampdu_lock); in wcn36xx_ampdu_action()
1236 spin_lock_bh(&sta_priv->ampdu_lock); in wcn36xx_ampdu_action()
1237 sta_priv->ampdu_state[tid] = WCN36XX_AMPDU_NONE; in wcn36xx_ampdu_action()
1238 spin_unlock_bh(&sta_priv->ampdu_lock); in wcn36xx_ampdu_action()
1241 ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); in wcn36xx_ampdu_action()
1247 out: in wcn36xx_ampdu_action()
1248 mutex_unlock(&wcn->conf_mutex); in wcn36xx_ampdu_action()
1262 memset(vif_priv->tentative_addrs, 0, sizeof(vif_priv->tentative_addrs)); in wcn36xx_ipv6_addr_change()
1264 read_lock_bh(&idev->lock); in wcn36xx_ipv6_addr_change()
1265 list_for_each_entry(ifa, &idev->addr_list, if_list) { in wcn36xx_ipv6_addr_change()
1266 vif_priv->target_ipv6_addrs[idx] = ifa->addr; in wcn36xx_ipv6_addr_change()
1267 if (ifa->flags & IFA_F_TENTATIVE) in wcn36xx_ipv6_addr_change()
1268 __set_bit(idx, vif_priv->tentative_addrs); in wcn36xx_ipv6_addr_change()
1272 wcn36xx_dbg(WCN36XX_DBG_MAC, "%pI6 %s\n", &ifa->addr, in wcn36xx_ipv6_addr_change()
1273 (ifa->flags & IFA_F_TENTATIVE) ? "tentative" : NULL); in wcn36xx_ipv6_addr_change()
1275 read_unlock_bh(&idev->lock); in wcn36xx_ipv6_addr_change()
1277 vif_priv->num_target_ipv6_addrs = idx; in wcn36xx_ipv6_addr_change()
1284 struct wcn36xx *wcn = hw->priv; in wcn36xx_flush()
1294 struct wcn36xx *wcn = hw->priv; in wcn36xx_get_survey()
1300 sband = wcn->hw->wiphy->bands[NL80211_BAND_2GHZ]; in wcn36xx_get_survey()
1302 if (band_idx >= sband->n_channels) { in wcn36xx_get_survey()
1303 band_idx -= sband->n_channels; in wcn36xx_get_survey()
1304 sband = wcn->hw->wiphy->bands[NL80211_BAND_5GHZ]; in wcn36xx_get_survey()
1307 if (!sband || band_idx >= sband->n_channels) in wcn36xx_get_survey()
1308 return -ENOENT; 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()
1313 survey->channel = &sband->channels[band_idx]; in wcn36xx_get_survey()
1314 survey->noise = chan_survey->rssi - chan_survey->snr; in wcn36xx_get_survey()
1315 survey->filled = 0; in wcn36xx_get_survey()
1317 if (chan_survey->rssi > -100 && chan_survey->rssi < 0) in wcn36xx_get_survey()
1318 survey->filled |= SURVEY_INFO_NOISE_DBM; in wcn36xx_get_survey()
1320 if (survey->channel == wcn->channel) in wcn36xx_get_survey()
1321 survey->filled |= SURVEY_INFO_IN_USE; in wcn36xx_get_survey()
1323 spin_unlock_irqrestore(&wcn->survey_lock, flags); in wcn36xx_get_survey()
1327 HW_VALUE_CHANNEL(survey->channel->hw_value), in wcn36xx_get_survey()
1328 chan_survey->rssi, chan_survey->snr, survey->noise, in wcn36xx_get_survey()
1329 survey->filled, survey->channel->center_freq); in wcn36xx_get_survey()
1341 wcn = hw->priv; in wcn36xx_sta_statistics()
1391 vht_cap->vht_supported = true; in wcn36xx_set_ieee80211_vht_caps()
1393 vht_cap->cap = (IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 | in wcn36xx_set_ieee80211_vht_caps()
1401 vht_cap->vht_mcs.rx_mcs_map = in wcn36xx_set_ieee80211_vht_caps()
1411 vht_cap->vht_mcs.rx_highest = cpu_to_le16(433); in wcn36xx_set_ieee80211_vht_caps()
1412 vht_cap->vht_mcs.tx_highest = vht_cap->vht_mcs.rx_highest; in wcn36xx_set_ieee80211_vht_caps()
1414 vht_cap->vht_mcs.tx_mcs_map = vht_cap->vht_mcs.rx_mcs_map; in wcn36xx_set_ieee80211_vht_caps()
1426 ieee80211_hw_set(wcn->hw, TIMING_BEACON_ONLY); in wcn36xx_init_ieee80211()
1427 ieee80211_hw_set(wcn->hw, AMPDU_AGGREGATION); in wcn36xx_init_ieee80211()
1428 ieee80211_hw_set(wcn->hw, SUPPORTS_PS); in wcn36xx_init_ieee80211()
1429 ieee80211_hw_set(wcn->hw, SIGNAL_DBM); in wcn36xx_init_ieee80211()
1430 ieee80211_hw_set(wcn->hw, HAS_RATE_CONTROL); in wcn36xx_init_ieee80211()
1431 ieee80211_hw_set(wcn->hw, SINGLE_SCAN_ON_ALL_BANDS); in wcn36xx_init_ieee80211()
1432 ieee80211_hw_set(wcn->hw, REPORTS_TX_ACK_STATUS); in wcn36xx_init_ieee80211()
1434 wcn->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | in wcn36xx_init_ieee80211()
1439 wcn->hw->wiphy->bands[NL80211_BAND_2GHZ] = &wcn_band_2ghz; in wcn36xx_init_ieee80211()
1440 if (wcn->rf_id != RF_IRIS_WCN3620) in wcn36xx_init_ieee80211()
1441 wcn->hw->wiphy->bands[NL80211_BAND_5GHZ] = &wcn_band_5ghz; in wcn36xx_init_ieee80211()
1443 if (wcn->rf_id == RF_IRIS_WCN3680) in wcn36xx_init_ieee80211()
1446 wcn->hw->wiphy->max_scan_ssids = WCN36XX_MAX_SCAN_SSIDS; in wcn36xx_init_ieee80211()
1447 wcn->hw->wiphy->max_scan_ie_len = WCN36XX_MAX_SCAN_IE_LEN; in wcn36xx_init_ieee80211()
1449 wcn->hw->wiphy->cipher_suites = cipher_suites; in wcn36xx_init_ieee80211()
1450 wcn->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); in wcn36xx_init_ieee80211()
1453 wcn->hw->wiphy->wowlan = &wowlan_support; in wcn36xx_init_ieee80211()
1456 wcn->hw->max_listen_interval = 200; in wcn36xx_init_ieee80211()
1458 wcn->hw->queues = 4; in wcn36xx_init_ieee80211()
1460 SET_IEEE80211_DEV(wcn->hw, wcn->dev); in wcn36xx_init_ieee80211()
1462 wcn->hw->sta_data_size = sizeof(struct wcn36xx_sta); in wcn36xx_init_ieee80211()
1463 wcn->hw->vif_data_size = sizeof(struct wcn36xx_vif); in wcn36xx_init_ieee80211()
1465 wiphy_ext_feature_set(wcn->hw->wiphy, in wcn36xx_init_ieee80211()
1483 wcn->tx_irq = ret; in wcn36xx_platform_get_resources()
1489 wcn->rx_irq = ret; in wcn36xx_platform_get_resources()
1492 wcn->tx_enable_state = qcom_smem_state_get(&pdev->dev, in wcn36xx_platform_get_resources()
1493 "tx-enable", &wcn->tx_enable_state_bit); in wcn36xx_platform_get_resources()
1494 if (IS_ERR(wcn->tx_enable_state)) { in wcn36xx_platform_get_resources()
1495 wcn36xx_err("failed to get tx-enable state\n"); in wcn36xx_platform_get_resources()
1496 return PTR_ERR(wcn->tx_enable_state); in wcn36xx_platform_get_resources()
1500 wcn->tx_rings_empty_state = qcom_smem_state_get(&pdev->dev, in wcn36xx_platform_get_resources()
1501 "tx-rings-empty", &wcn->tx_rings_empty_state_bit); in wcn36xx_platform_get_resources()
1502 if (IS_ERR(wcn->tx_rings_empty_state)) { in wcn36xx_platform_get_resources()
1503 wcn36xx_err("failed to get tx-rings-empty state\n"); in wcn36xx_platform_get_resources()
1504 return PTR_ERR(wcn->tx_rings_empty_state); in wcn36xx_platform_get_resources()
1507 mmio_node = of_parse_phandle(pdev->dev.parent->of_node, "qcom,mmio", 0); in wcn36xx_platform_get_resources()
1510 return -EINVAL; in wcn36xx_platform_get_resources()
1513 wcn->is_pronto = !!of_device_is_compatible(mmio_node, "qcom,pronto"); in wcn36xx_platform_get_resources()
1514 wcn->is_pronto_v3 = !!of_device_is_compatible(mmio_node, "qcom,pronto-v3-pil"); in wcn36xx_platform_get_resources()
1517 index = of_property_match_string(mmio_node, "reg-names", "ccu"); in wcn36xx_platform_get_resources()
1518 wcn->ccu_base = of_iomap(mmio_node, index); in wcn36xx_platform_get_resources()
1519 if (!wcn->ccu_base) { in wcn36xx_platform_get_resources()
1521 ret = -ENOMEM; in wcn36xx_platform_get_resources()
1526 index = of_property_match_string(mmio_node, "reg-names", "dxe"); in wcn36xx_platform_get_resources()
1527 wcn->dxe_base = of_iomap(mmio_node, index); in wcn36xx_platform_get_resources()
1528 if (!wcn->dxe_base) { in wcn36xx_platform_get_resources()
1530 ret = -ENOMEM; in wcn36xx_platform_get_resources()
1538 wcn->rf_id = RF_IRIS_WCN3620; in wcn36xx_platform_get_resources()
1541 wcn->rf_id = RF_IRIS_WCN3660; in wcn36xx_platform_get_resources()
1543 wcn->rf_id = RF_IRIS_WCN3680; in wcn36xx_platform_get_resources()
1551 iounmap(wcn->ccu_base); in wcn36xx_platform_get_resources()
1568 wcnss = dev_get_drvdata(pdev->dev.parent); in wcn36xx_probe()
1573 ret = -ENOMEM; in wcn36xx_probe()
1577 wcn = hw->priv; in wcn36xx_probe()
1578 wcn->hw = hw; in wcn36xx_probe()
1579 wcn->dev = &pdev->dev; in wcn36xx_probe()
1580 wcn->first_boot = true; in wcn36xx_probe()
1581 mutex_init(&wcn->conf_mutex); in wcn36xx_probe()
1582 mutex_init(&wcn->hal_mutex); in wcn36xx_probe()
1583 mutex_init(&wcn->scan_lock); in wcn36xx_probe()
1584 __skb_queue_head_init(&wcn->amsdu); in wcn36xx_probe()
1586 wcn->hal_buf = devm_kmalloc(wcn->dev, WCN36XX_HAL_BUF_SIZE, GFP_KERNEL); in wcn36xx_probe()
1587 if (!wcn->hal_buf) { in wcn36xx_probe()
1588 ret = -ENOMEM; in wcn36xx_probe()
1593 wcn->chan_survey = devm_kmalloc(wcn->dev, n_channels, GFP_KERNEL); in wcn36xx_probe()
1594 if (!wcn->chan_survey) { in wcn36xx_probe()
1595 ret = -ENOMEM; in wcn36xx_probe()
1599 ret = dma_set_mask_and_coherent(wcn->dev, DMA_BIT_MASK(32)); in wcn36xx_probe()
1605 wcn->nv_file = WLAN_NV_FILE; in wcn36xx_probe()
1606 ret = of_property_read_string(wcn->dev->parent->of_node, "firmware-name", &wcn->nv_file); in wcn36xx_probe()
1607 if (ret < 0 && ret != -EINVAL) { in wcn36xx_probe()
1608 wcn36xx_err("failed to read \"firmware-name\" property: %d\n", ret); in wcn36xx_probe()
1612 wcn->smd_channel = qcom_wcnss_open_channel(wcnss, "WLAN_CTRL", wcn36xx_smd_rsp_process, hw); in wcn36xx_probe()
1613 if (IS_ERR(wcn->smd_channel)) { in wcn36xx_probe()
1615 ret = PTR_ERR(wcn->smd_channel); in wcn36xx_probe()
1619 addr = of_get_property(pdev->dev.of_node, "local-mac-address", &ret); in wcn36xx_probe()
1621 wcn36xx_err("invalid local-mac-address\n"); in wcn36xx_probe()
1622 ret = -EINVAL; in wcn36xx_probe()
1626 SET_IEEE80211_PERM_ADDR(wcn->hw, addr); in wcn36xx_probe()
1634 ret = ieee80211_register_hw(wcn->hw); in wcn36xx_probe()
1641 iounmap(wcn->ccu_base); in wcn36xx_probe()
1642 iounmap(wcn->dxe_base); in wcn36xx_probe()
1644 rpmsg_destroy_ept(wcn->smd_channel); in wcn36xx_probe()
1654 struct wcn36xx *wcn = hw->priv; in wcn36xx_remove()
1657 release_firmware(wcn->nv); in wcn36xx_remove()
1661 qcom_smem_state_put(wcn->tx_enable_state); in wcn36xx_remove()
1662 qcom_smem_state_put(wcn->tx_rings_empty_state); in wcn36xx_remove()
1664 rpmsg_destroy_ept(wcn->smd_channel); in wcn36xx_remove()
1666 iounmap(wcn->dxe_base); in wcn36xx_remove()
1667 iounmap(wcn->ccu_base); in wcn36xx_remove()
1669 __skb_queue_purge(&wcn->amsdu); in wcn36xx_remove()
1671 mutex_destroy(&wcn->hal_mutex); in wcn36xx_remove()
1676 { .compatible = "qcom,wcnss-wlan" },