Lines Matching refs:vif
145 static bool __ath6kl_cfg80211_sscan_stop(struct ath6kl_vif *vif) in __ath6kl_cfg80211_sscan_stop() argument
147 struct ath6kl *ar = vif->ar; in __ath6kl_cfg80211_sscan_stop()
149 if (!test_and_clear_bit(SCHED_SCANNING, &vif->flags)) in __ath6kl_cfg80211_sscan_stop()
152 del_timer_sync(&vif->sched_scan_timer); in __ath6kl_cfg80211_sscan_stop()
157 ath6kl_wmi_enable_sched_scan_cmd(ar->wmi, vif->fw_vif_idx, false); in __ath6kl_cfg80211_sscan_stop()
162 static void ath6kl_cfg80211_sscan_disable(struct ath6kl_vif *vif) in ath6kl_cfg80211_sscan_disable() argument
164 struct ath6kl *ar = vif->ar; in ath6kl_cfg80211_sscan_disable()
167 stopped = __ath6kl_cfg80211_sscan_stop(vif); in ath6kl_cfg80211_sscan_disable()
175 static int ath6kl_set_wpa_version(struct ath6kl_vif *vif, in ath6kl_set_wpa_version() argument
181 vif->auth_mode = NONE_AUTH; in ath6kl_set_wpa_version()
183 vif->auth_mode = WPA2_AUTH; in ath6kl_set_wpa_version()
185 vif->auth_mode = WPA_AUTH; in ath6kl_set_wpa_version()
194 static int ath6kl_set_auth_type(struct ath6kl_vif *vif, in ath6kl_set_auth_type() argument
201 vif->dot11_auth_mode = OPEN_AUTH; in ath6kl_set_auth_type()
204 vif->dot11_auth_mode = SHARED_AUTH; in ath6kl_set_auth_type()
207 vif->dot11_auth_mode = LEAP_AUTH; in ath6kl_set_auth_type()
211 vif->dot11_auth_mode = OPEN_AUTH | SHARED_AUTH; in ath6kl_set_auth_type()
222 static int ath6kl_set_cipher(struct ath6kl_vif *vif, u32 cipher, bool ucast) in ath6kl_set_cipher() argument
224 u8 *ar_cipher = ucast ? &vif->prwise_crypto : &vif->grp_crypto; in ath6kl_set_cipher()
225 u8 *ar_cipher_len = ucast ? &vif->prwise_crypto_len : in ath6kl_set_cipher()
226 &vif->grp_crypto_len; in ath6kl_set_cipher()
265 static void ath6kl_set_key_mgmt(struct ath6kl_vif *vif, u32 key_mgmt) in ath6kl_set_key_mgmt() argument
270 if (vif->auth_mode == WPA_AUTH) in ath6kl_set_key_mgmt()
271 vif->auth_mode = WPA_PSK_AUTH; in ath6kl_set_key_mgmt()
272 else if (vif->auth_mode == WPA2_AUTH) in ath6kl_set_key_mgmt()
273 vif->auth_mode = WPA2_PSK_AUTH; in ath6kl_set_key_mgmt()
275 if (vif->auth_mode == WPA_AUTH) in ath6kl_set_key_mgmt()
276 vif->auth_mode = WPA_AUTH_CCKM; in ath6kl_set_key_mgmt()
277 else if (vif->auth_mode == WPA2_AUTH) in ath6kl_set_key_mgmt()
278 vif->auth_mode = WPA2_AUTH_CCKM; in ath6kl_set_key_mgmt()
280 vif->auth_mode = NONE_AUTH; in ath6kl_set_key_mgmt()
284 static bool ath6kl_cfg80211_ready(struct ath6kl_vif *vif) in ath6kl_cfg80211_ready() argument
286 struct ath6kl *ar = vif->ar; in ath6kl_cfg80211_ready()
293 if (!test_bit(WLAN_ENABLED, &vif->flags)) { in ath6kl_cfg80211_ready()
321 static int ath6kl_set_assoc_req_ies(struct ath6kl_vif *vif, const u8 *ies, in ath6kl_set_assoc_req_ies() argument
324 struct ath6kl *ar = vif->ar; in ath6kl_set_assoc_req_ies()
361 ret = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_set_assoc_req_ies()
429 static void ath6kl_cfg80211_sta_bmiss_enhance(struct ath6kl_vif *vif, in ath6kl_cfg80211_sta_bmiss_enhance() argument
434 if (WARN_ON(!test_bit(WMI_READY, &vif->ar->flag))) in ath6kl_cfg80211_sta_bmiss_enhance()
437 if (vif->nw_type != INFRA_NETWORK) in ath6kl_cfg80211_sta_bmiss_enhance()
441 vif->ar->fw_capabilities)) in ath6kl_cfg80211_sta_bmiss_enhance()
447 err = ath6kl_wmi_sta_bmiss_enhance_cmd(vif->ar->wmi, in ath6kl_cfg80211_sta_bmiss_enhance()
448 vif->fw_vif_idx, enable); in ath6kl_cfg80211_sta_bmiss_enhance()
458 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_cfg80211_connect() local
463 ath6kl_cfg80211_sscan_disable(vif); in ath6kl_cfg80211_connect()
465 vif->sme_state = SME_CONNECTING; in ath6kl_cfg80211_connect()
467 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_connect()
507 status = ath6kl_set_assoc_req_ies(vif, sme->ie, sme->ie_len); in ath6kl_cfg80211_connect()
516 if (test_bit(CONNECTED, &vif->flags) && in ath6kl_cfg80211_connect()
517 vif->ssid_len == sme->ssid_len && in ath6kl_cfg80211_connect()
518 !memcmp(vif->ssid, sme->ssid, vif->ssid_len)) { in ath6kl_cfg80211_connect()
519 vif->reconnect_flag = true; in ath6kl_cfg80211_connect()
520 status = ath6kl_wmi_reconnect_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_connect()
521 vif->req_bssid, in ath6kl_cfg80211_connect()
522 vif->ch_hint); in ath6kl_cfg80211_connect()
530 } else if (vif->ssid_len == sme->ssid_len && in ath6kl_cfg80211_connect()
531 !memcmp(vif->ssid, sme->ssid, vif->ssid_len)) { in ath6kl_cfg80211_connect()
532 ath6kl_disconnect(vif); in ath6kl_cfg80211_connect()
535 memset(vif->ssid, 0, sizeof(vif->ssid)); in ath6kl_cfg80211_connect()
536 vif->ssid_len = sme->ssid_len; in ath6kl_cfg80211_connect()
537 memcpy(vif->ssid, sme->ssid, sme->ssid_len); in ath6kl_cfg80211_connect()
540 vif->ch_hint = sme->channel->center_freq; in ath6kl_cfg80211_connect()
542 memset(vif->req_bssid, 0, sizeof(vif->req_bssid)); in ath6kl_cfg80211_connect()
544 memcpy(vif->req_bssid, sme->bssid, sizeof(vif->req_bssid)); in ath6kl_cfg80211_connect()
546 ath6kl_set_wpa_version(vif, sme->crypto.wpa_versions); in ath6kl_cfg80211_connect()
548 status = ath6kl_set_auth_type(vif, sme->auth_type); in ath6kl_cfg80211_connect()
555 ath6kl_set_cipher(vif, sme->crypto.ciphers_pairwise[0], true); in ath6kl_cfg80211_connect()
557 ath6kl_set_cipher(vif, 0, true); in ath6kl_cfg80211_connect()
559 ath6kl_set_cipher(vif, sme->crypto.cipher_group, false); in ath6kl_cfg80211_connect()
562 ath6kl_set_key_mgmt(vif, sme->crypto.akm_suites[0]); in ath6kl_cfg80211_connect()
565 (vif->auth_mode == NONE_AUTH) && in ath6kl_cfg80211_connect()
566 (vif->prwise_crypto == WEP_CRYPT)) { in ath6kl_cfg80211_connect()
576 key = &vif->keys[sme->key_idx]; in ath6kl_cfg80211_connect()
579 key->cipher = vif->prwise_crypto; in ath6kl_cfg80211_connect()
580 vif->def_txkey_index = sme->key_idx; in ath6kl_cfg80211_connect()
582 ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx, sme->key_idx, in ath6kl_cfg80211_connect()
583 vif->prwise_crypto, in ath6kl_cfg80211_connect()
592 clear_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags); in ath6kl_cfg80211_connect()
593 if (ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_connect()
601 vif->nw_type = vif->next_mode; in ath6kl_cfg80211_connect()
604 ath6kl_cfg80211_sta_bmiss_enhance(vif, true); in ath6kl_cfg80211_connect()
606 if (vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT) in ath6kl_cfg80211_connect()
614 vif->auth_mode, vif->dot11_auth_mode, vif->prwise_crypto, in ath6kl_cfg80211_connect()
615 vif->prwise_crypto_len, vif->grp_crypto, in ath6kl_cfg80211_connect()
616 vif->grp_crypto_len, vif->ch_hint); in ath6kl_cfg80211_connect()
618 vif->reconnect_flag = 0; in ath6kl_cfg80211_connect()
620 if (vif->nw_type == INFRA_NETWORK) { in ath6kl_cfg80211_connect()
621 interval = max_t(u16, vif->listen_intvl_t, in ath6kl_cfg80211_connect()
623 status = ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_connect()
633 status = ath6kl_wmi_connect_cmd(ar->wmi, vif->fw_vif_idx, vif->nw_type, in ath6kl_cfg80211_connect()
634 vif->dot11_auth_mode, vif->auth_mode, in ath6kl_cfg80211_connect()
635 vif->prwise_crypto, in ath6kl_cfg80211_connect()
636 vif->prwise_crypto_len, in ath6kl_cfg80211_connect()
637 vif->grp_crypto, vif->grp_crypto_len, in ath6kl_cfg80211_connect()
638 vif->ssid_len, vif->ssid, in ath6kl_cfg80211_connect()
639 vif->req_bssid, vif->ch_hint, in ath6kl_cfg80211_connect()
650 ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0, 0, in ath6kl_cfg80211_connect()
656 memset(vif->ssid, 0, sizeof(vif->ssid)); in ath6kl_cfg80211_connect()
657 vif->ssid_len = 0; in ath6kl_cfg80211_connect()
666 ((vif->auth_mode == WPA_PSK_AUTH) || in ath6kl_cfg80211_connect()
667 (vif->auth_mode == WPA2_PSK_AUTH))) { in ath6kl_cfg80211_connect()
668 mod_timer(&vif->disconnect_timer, in ath6kl_cfg80211_connect()
673 set_bit(CONNECT_PEND, &vif->flags); in ath6kl_cfg80211_connect()
679 ath6kl_add_bss_if_needed(struct ath6kl_vif *vif, in ath6kl_add_bss_if_needed() argument
686 struct ath6kl *ar = vif->ar; in ath6kl_add_bss_if_needed()
701 vif->ssid, vif->ssid_len, in ath6kl_add_bss_if_needed()
712 ie = kmalloc(2 + vif->ssid_len + beacon_ie_len, GFP_KERNEL); in ath6kl_add_bss_if_needed()
716 ie[1] = vif->ssid_len; in ath6kl_add_bss_if_needed()
717 memcpy(ie + 2, vif->ssid, vif->ssid_len); in ath6kl_add_bss_if_needed()
718 memcpy(ie + 2 + vif->ssid_len, beacon_ie, beacon_ie_len); in ath6kl_add_bss_if_needed()
722 ie, 2 + vif->ssid_len + beacon_ie_len, in ath6kl_add_bss_if_needed()
735 void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel, in ath6kl_cfg80211_connect_event() argument
743 struct ath6kl *ar = vif->ar; in ath6kl_cfg80211_connect_event()
763 vif->assoc_bss_beacon_int = beacon_intvl; in ath6kl_cfg80211_connect_event()
764 clear_bit(DTIM_PERIOD_AVAIL, &vif->flags); in ath6kl_cfg80211_connect_event()
767 if (vif->wdev.iftype != NL80211_IFTYPE_ADHOC) { in ath6kl_cfg80211_connect_event()
775 if (vif->wdev.iftype != NL80211_IFTYPE_STATION && in ath6kl_cfg80211_connect_event()
776 vif->wdev.iftype != NL80211_IFTYPE_P2P_CLIENT) { in ath6kl_cfg80211_connect_event()
785 bss = ath6kl_add_bss_if_needed(vif, nw_type, bssid, chan, in ath6kl_cfg80211_connect_event()
795 cfg80211_ibss_joined(vif->ndev, bssid, chan, GFP_KERNEL); in ath6kl_cfg80211_connect_event()
800 if (vif->sme_state == SME_CONNECTING) { in ath6kl_cfg80211_connect_event()
802 vif->sme_state = SME_CONNECTED; in ath6kl_cfg80211_connect_event()
803 cfg80211_connect_result(vif->ndev, bssid, in ath6kl_cfg80211_connect_event()
808 } else if (vif->sme_state == SME_CONNECTED) { in ath6kl_cfg80211_connect_event()
817 cfg80211_roamed(vif->ndev, &roam_info, GFP_KERNEL); in ath6kl_cfg80211_connect_event()
825 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_cfg80211_disconnect() local
830 ath6kl_cfg80211_sscan_disable(vif); in ath6kl_cfg80211_disconnect()
832 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_disconnect()
845 vif->reconnect_flag = 0; in ath6kl_cfg80211_disconnect()
846 ath6kl_disconnect(vif); in ath6kl_cfg80211_disconnect()
847 memset(vif->ssid, 0, sizeof(vif->ssid)); in ath6kl_cfg80211_disconnect()
848 vif->ssid_len = 0; in ath6kl_cfg80211_disconnect()
851 memset(vif->req_bssid, 0, sizeof(vif->req_bssid)); in ath6kl_cfg80211_disconnect()
858 void ath6kl_cfg80211_disconnect_event(struct ath6kl_vif *vif, u8 reason, in ath6kl_cfg80211_disconnect_event() argument
862 struct ath6kl *ar = vif->ar; in ath6kl_cfg80211_disconnect_event()
864 if (vif->scan_req) { in ath6kl_cfg80211_disconnect_event()
869 cfg80211_scan_done(vif->scan_req, &info); in ath6kl_cfg80211_disconnect_event()
870 vif->scan_req = NULL; in ath6kl_cfg80211_disconnect_event()
873 if (vif->nw_type & ADHOC_NETWORK) { in ath6kl_cfg80211_disconnect_event()
874 if (vif->wdev.iftype != NL80211_IFTYPE_ADHOC) in ath6kl_cfg80211_disconnect_event()
880 if (vif->nw_type & INFRA_NETWORK) { in ath6kl_cfg80211_disconnect_event()
881 if (vif->wdev.iftype != NL80211_IFTYPE_STATION && in ath6kl_cfg80211_disconnect_event()
882 vif->wdev.iftype != NL80211_IFTYPE_P2P_CLIENT) { in ath6kl_cfg80211_disconnect_event()
889 clear_bit(CONNECT_PEND, &vif->flags); in ath6kl_cfg80211_disconnect_event()
891 if (vif->sme_state == SME_CONNECTING) { in ath6kl_cfg80211_disconnect_event()
892 cfg80211_connect_result(vif->ndev, in ath6kl_cfg80211_disconnect_event()
897 } else if (vif->sme_state == SME_CONNECTED) { in ath6kl_cfg80211_disconnect_event()
898 cfg80211_disconnected(vif->ndev, proto_reason, in ath6kl_cfg80211_disconnect_event()
902 vif->sme_state = SME_DISCONNECTED; in ath6kl_cfg80211_disconnect_event()
913 ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx); in ath6kl_cfg80211_disconnect_event()
917 struct ath6kl_vif *vif, in ath6kl_set_probed_ssids() argument
979 ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, i, in ath6kl_set_probed_ssids()
987 ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, i, in ath6kl_set_probed_ssids()
997 struct ath6kl_vif *vif = ath6kl_vif_from_wdev(request->wdev); in ath6kl_cfg80211_scan() local
998 struct ath6kl *ar = ath6kl_priv(vif->ndev); in ath6kl_cfg80211_scan()
1004 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_scan()
1007 ath6kl_cfg80211_sscan_disable(vif); in ath6kl_cfg80211_scan()
1010 clear_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags); in ath6kl_cfg80211_scan()
1011 ret = ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_scan()
1019 ret = ath6kl_set_probed_ssids(ar, vif, request->ssids, in ath6kl_cfg80211_scan()
1025 ret = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_scan()
1054 if (test_bit(CONNECTED, &vif->flags)) in ath6kl_cfg80211_scan()
1057 vif->scan_req = request; in ath6kl_cfg80211_scan()
1059 ret = ath6kl_wmi_beginscan_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_scan()
1068 vif->scan_req = NULL; in ath6kl_cfg80211_scan()
1076 void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted) in ath6kl_cfg80211_scan_complete_event() argument
1078 struct ath6kl *ar = vif->ar; in ath6kl_cfg80211_scan_complete_event()
1087 if (!vif->scan_req) in ath6kl_cfg80211_scan_complete_event()
1093 if (vif->scan_req->n_ssids && vif->scan_req->ssids[0].ssid_len) { in ath6kl_cfg80211_scan_complete_event()
1094 for (i = 0; i < vif->scan_req->n_ssids; i++) { in ath6kl_cfg80211_scan_complete_event()
1095 ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_scan_complete_event()
1102 cfg80211_scan_done(vif->scan_req, &info); in ath6kl_cfg80211_scan_complete_event()
1103 vif->scan_req = NULL; in ath6kl_cfg80211_scan_complete_event()
1106 void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq, in ath6kl_cfg80211_ch_switch_notify() argument
1113 vif->nw_type, freq, mode); in ath6kl_cfg80211_ch_switch_notify()
1116 ieee80211_get_channel(vif->ar->wiphy, freq), in ath6kl_cfg80211_ch_switch_notify()
1121 mutex_lock(&vif->wdev.mtx); in ath6kl_cfg80211_ch_switch_notify()
1122 cfg80211_ch_switch_notify(vif->ndev, &chandef, 0, 0); in ath6kl_cfg80211_ch_switch_notify()
1123 mutex_unlock(&vif->wdev.mtx); in ath6kl_cfg80211_ch_switch_notify()
1132 struct ath6kl_vif *vif = netdev_priv(ndev); in ath6kl_cfg80211_add_key() local
1138 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_add_key()
1144 return ath6kl_wmi_add_krk_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_add_key()
1155 key = &vif->keys[key_index]; in ath6kl_cfg80211_add_key()
1200 if (((vif->auth_mode == WPA_PSK_AUTH) || in ath6kl_cfg80211_add_key()
1201 (vif->auth_mode == WPA2_PSK_AUTH)) && in ath6kl_cfg80211_add_key()
1203 del_timer(&vif->disconnect_timer); in ath6kl_cfg80211_add_key()
1210 if (vif->nw_type == AP_NETWORK && !pairwise && in ath6kl_cfg80211_add_key()
1218 if (!test_bit(CONNECTED, &vif->flags)) { in ath6kl_cfg80211_add_key()
1229 if (vif->next_mode == AP_NETWORK && key_type == WEP_CRYPT && in ath6kl_cfg80211_add_key()
1230 !test_bit(CONNECTED, &vif->flags)) { in ath6kl_cfg80211_add_key()
1238 vif->wep_key_list[key_index].key_len = key->key_len; in ath6kl_cfg80211_add_key()
1239 memcpy(vif->wep_key_list[key_index].key, key->key, in ath6kl_cfg80211_add_key()
1244 return ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx, key_index, in ath6kl_cfg80211_add_key()
1256 struct ath6kl_vif *vif = netdev_priv(ndev); in ath6kl_cfg80211_del_key() local
1260 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_del_key()
1270 if (!vif->keys[key_index].key_len) { in ath6kl_cfg80211_del_key()
1276 vif->keys[key_index].key_len = 0; in ath6kl_cfg80211_del_key()
1278 return ath6kl_wmi_deletekey_cmd(ar->wmi, vif->fw_vif_idx, key_index); in ath6kl_cfg80211_del_key()
1287 struct ath6kl_vif *vif = netdev_priv(ndev); in ath6kl_cfg80211_get_key() local
1293 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_get_key()
1303 key = &vif->keys[key_index]; in ath6kl_cfg80211_get_key()
1322 struct ath6kl_vif *vif = netdev_priv(ndev); in ath6kl_cfg80211_set_default_key() local
1329 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_set_default_key()
1339 if (!vif->keys[key_index].key_len) { in ath6kl_cfg80211_set_default_key()
1345 vif->def_txkey_index = key_index; in ath6kl_cfg80211_set_default_key()
1346 key = &vif->keys[vif->def_txkey_index]; in ath6kl_cfg80211_set_default_key()
1348 if (vif->prwise_crypto == WEP_CRYPT) in ath6kl_cfg80211_set_default_key()
1351 key_type = vif->prwise_crypto; in ath6kl_cfg80211_set_default_key()
1353 key_type = vif->grp_crypto; in ath6kl_cfg80211_set_default_key()
1355 if (vif->next_mode == AP_NETWORK && !test_bit(CONNECTED, &vif->flags)) in ath6kl_cfg80211_set_default_key()
1358 return ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_set_default_key()
1359 vif->def_txkey_index, in ath6kl_cfg80211_set_default_key()
1367 void ath6kl_cfg80211_tkip_micerr_event(struct ath6kl_vif *vif, u8 keyid, in ath6kl_cfg80211_tkip_micerr_event() argument
1373 cfg80211_michael_mic_failure(vif->ndev, vif->bssid, in ath6kl_cfg80211_tkip_micerr_event()
1382 struct ath6kl_vif *vif; in ath6kl_cfg80211_set_wiphy_params() local
1388 vif = ath6kl_vif_first(ar); in ath6kl_cfg80211_set_wiphy_params()
1389 if (!vif) in ath6kl_cfg80211_set_wiphy_params()
1392 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_set_wiphy_params()
1412 struct ath6kl_vif *vif; in ath6kl_cfg80211_set_txpower() local
1418 vif = ath6kl_vif_first(ar); in ath6kl_cfg80211_set_txpower()
1419 if (!vif) in ath6kl_cfg80211_set_txpower()
1422 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_set_txpower()
1437 ath6kl_wmi_set_tx_pwr_cmd(ar->wmi, vif->fw_vif_idx, dbm); in ath6kl_cfg80211_set_txpower()
1447 struct ath6kl_vif *vif; in ath6kl_cfg80211_get_txpower() local
1449 vif = ath6kl_vif_first(ar); in ath6kl_cfg80211_get_txpower()
1450 if (!vif) in ath6kl_cfg80211_get_txpower()
1453 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_get_txpower()
1456 if (test_bit(CONNECTED, &vif->flags)) { in ath6kl_cfg80211_get_txpower()
1459 if (ath6kl_wmi_get_tx_pwr_cmd(ar->wmi, vif->fw_vif_idx) != 0) { in ath6kl_cfg80211_get_txpower()
1483 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_cfg80211_set_power_mgmt() local
1488 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_set_power_mgmt()
1499 if (ath6kl_wmi_powermode_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_set_power_mgmt()
1541 struct ath6kl_vif *vif = netdev_priv(wdev->netdev); in ath6kl_cfg80211_del_iface() local
1544 list_del(&vif->list); in ath6kl_cfg80211_del_iface()
1547 ath6kl_cfg80211_vif_stop(vif, test_bit(WMI_READY, &ar->flag)); in ath6kl_cfg80211_del_iface()
1550 ath6kl_cfg80211_vif_cleanup(vif); in ath6kl_cfg80211_del_iface()
1561 struct ath6kl_vif *vif = netdev_priv(ndev); in ath6kl_cfg80211_change_iface() local
1572 vif->ar->fw_capabilities) && in ath6kl_cfg80211_change_iface()
1575 if (vif->ar->vif_max == 1) { in ath6kl_cfg80211_change_iface()
1576 if (vif->fw_vif_idx != 0) in ath6kl_cfg80211_change_iface()
1582 for (i = vif->ar->max_norm_iface; i < vif->ar->vif_max; i++) { in ath6kl_cfg80211_change_iface()
1583 if (i == vif->fw_vif_idx) in ath6kl_cfg80211_change_iface()
1587 if (i == vif->ar->vif_max) { in ath6kl_cfg80211_change_iface()
1594 ath6kl_cfg80211_sta_bmiss_enhance(vif, false); in ath6kl_cfg80211_change_iface()
1600 vif->next_mode = INFRA_NETWORK; in ath6kl_cfg80211_change_iface()
1603 vif->next_mode = ADHOC_NETWORK; in ath6kl_cfg80211_change_iface()
1607 vif->next_mode = AP_NETWORK; in ath6kl_cfg80211_change_iface()
1614 vif->wdev.iftype = type; in ath6kl_cfg80211_change_iface()
1624 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_cfg80211_join_ibss() local
1627 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_join_ibss()
1630 vif->ssid_len = ibss_param->ssid_len; in ath6kl_cfg80211_join_ibss()
1631 memcpy(vif->ssid, ibss_param->ssid, vif->ssid_len); in ath6kl_cfg80211_join_ibss()
1634 vif->ch_hint = ibss_param->chandef.chan->center_freq; in ath6kl_cfg80211_join_ibss()
1646 memset(vif->req_bssid, 0, sizeof(vif->req_bssid)); in ath6kl_cfg80211_join_ibss()
1648 memcpy(vif->req_bssid, ibss_param->bssid, in ath6kl_cfg80211_join_ibss()
1649 sizeof(vif->req_bssid)); in ath6kl_cfg80211_join_ibss()
1651 ath6kl_set_wpa_version(vif, 0); in ath6kl_cfg80211_join_ibss()
1653 status = ath6kl_set_auth_type(vif, NL80211_AUTHTYPE_OPEN_SYSTEM); in ath6kl_cfg80211_join_ibss()
1658 ath6kl_set_cipher(vif, WLAN_CIPHER_SUITE_WEP40, true); in ath6kl_cfg80211_join_ibss()
1659 ath6kl_set_cipher(vif, WLAN_CIPHER_SUITE_WEP40, false); in ath6kl_cfg80211_join_ibss()
1661 ath6kl_set_cipher(vif, 0, true); in ath6kl_cfg80211_join_ibss()
1662 ath6kl_set_cipher(vif, 0, false); in ath6kl_cfg80211_join_ibss()
1665 vif->nw_type = vif->next_mode; in ath6kl_cfg80211_join_ibss()
1672 vif->auth_mode, vif->dot11_auth_mode, vif->prwise_crypto, in ath6kl_cfg80211_join_ibss()
1673 vif->prwise_crypto_len, vif->grp_crypto, in ath6kl_cfg80211_join_ibss()
1674 vif->grp_crypto_len, vif->ch_hint); in ath6kl_cfg80211_join_ibss()
1676 status = ath6kl_wmi_connect_cmd(ar->wmi, vif->fw_vif_idx, vif->nw_type, in ath6kl_cfg80211_join_ibss()
1677 vif->dot11_auth_mode, vif->auth_mode, in ath6kl_cfg80211_join_ibss()
1678 vif->prwise_crypto, in ath6kl_cfg80211_join_ibss()
1679 vif->prwise_crypto_len, in ath6kl_cfg80211_join_ibss()
1680 vif->grp_crypto, vif->grp_crypto_len, in ath6kl_cfg80211_join_ibss()
1681 vif->ssid_len, vif->ssid, in ath6kl_cfg80211_join_ibss()
1682 vif->req_bssid, vif->ch_hint, in ath6kl_cfg80211_join_ibss()
1684 set_bit(CONNECT_PEND, &vif->flags); in ath6kl_cfg80211_join_ibss()
1692 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_cfg80211_leave_ibss() local
1694 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_cfg80211_leave_ibss()
1697 ath6kl_disconnect(vif); in ath6kl_cfg80211_leave_ibss()
1698 memset(vif->ssid, 0, sizeof(vif->ssid)); in ath6kl_cfg80211_leave_ibss()
1699 vif->ssid_len = 0; in ath6kl_cfg80211_leave_ibss()
1778 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_get_station() local
1785 if (memcmp(mac, vif->bssid, ETH_ALEN) != 0) in ath6kl_get_station()
1791 set_bit(STATS_UPDATE_PEND, &vif->flags); in ath6kl_get_station()
1793 ret = ath6kl_wmi_get_stats_cmd(ar->wmi, vif->fw_vif_idx); in ath6kl_get_station()
1802 &vif->flags), in ath6kl_get_station()
1812 if (vif->target_stats.rx_byte) { in ath6kl_get_station()
1813 sinfo->rx_bytes = vif->target_stats.rx_byte; in ath6kl_get_station()
1815 sinfo->rx_packets = vif->target_stats.rx_pkt; in ath6kl_get_station()
1819 if (vif->target_stats.tx_byte) { in ath6kl_get_station()
1820 sinfo->tx_bytes = vif->target_stats.tx_byte; in ath6kl_get_station()
1822 sinfo->tx_packets = vif->target_stats.tx_pkt; in ath6kl_get_station()
1826 sinfo->signal = vif->target_stats.cs_rssi; in ath6kl_get_station()
1829 rate = vif->target_stats.tx_ucast_rate; in ath6kl_get_station()
1862 if (test_bit(CONNECTED, &vif->flags) && in ath6kl_get_station()
1863 test_bit(DTIM_PERIOD_AVAIL, &vif->flags) && in ath6kl_get_station()
1864 vif->nw_type == INFRA_NETWORK) { in ath6kl_get_station()
1867 sinfo->bss_param.dtim_period = vif->assoc_bss_dtim_period; in ath6kl_get_station()
1868 sinfo->bss_param.beacon_interval = vif->assoc_bss_beacon_int; in ath6kl_get_station()
1878 struct ath6kl_vif *vif = netdev_priv(netdev); in ath6kl_set_pmksa() local
1880 return ath6kl_wmi_setpmkid_cmd(ar->wmi, vif->fw_vif_idx, pmksa->bssid, in ath6kl_set_pmksa()
1888 struct ath6kl_vif *vif = netdev_priv(netdev); in ath6kl_del_pmksa() local
1890 return ath6kl_wmi_setpmkid_cmd(ar->wmi, vif->fw_vif_idx, pmksa->bssid, in ath6kl_del_pmksa()
1897 struct ath6kl_vif *vif = netdev_priv(netdev); in ath6kl_flush_pmksa() local
1899 if (test_bit(CONNECTED, &vif->flags)) in ath6kl_flush_pmksa()
1900 return ath6kl_wmi_setpmkid_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_flush_pmksa()
1901 vif->bssid, NULL, false); in ath6kl_flush_pmksa()
1905 static int ath6kl_wow_usr(struct ath6kl *ar, struct ath6kl_vif *vif, in ath6kl_wow_usr() argument
1934 vif->fw_vif_idx, WOW_LIST_ID, in ath6kl_wow_usr()
1960 static int ath6kl_wow_ap(struct ath6kl *ar, struct ath6kl_vif *vif) in ath6kl_wow_ap() argument
1994 vif->fw_vif_idx, WOW_LIST_ID, in ath6kl_wow_ap()
2004 vif->fw_vif_idx, WOW_LIST_ID, in ath6kl_wow_ap()
2017 vif->fw_vif_idx, WOW_LIST_ID, in ath6kl_wow_ap()
2027 vif->fw_vif_idx, WOW_LIST_ID, in ath6kl_wow_ap()
2038 static int ath6kl_wow_sta(struct ath6kl *ar, struct ath6kl_vif *vif) in ath6kl_wow_sta() argument
2040 struct net_device *ndev = vif->ndev; in ath6kl_wow_sta()
2050 vif->fw_vif_idx, WOW_LIST_ID, in ath6kl_wow_sta()
2065 vif->fw_vif_idx, WOW_LIST_ID, in ath6kl_wow_sta()
2077 static int is_hsleep_mode_procsed(struct ath6kl_vif *vif) in is_hsleep_mode_procsed() argument
2079 return test_bit(HOST_SLEEP_MODE_CMD_PROCESSED, &vif->flags); in is_hsleep_mode_procsed()
2087 static int ath6kl_cfg80211_host_sleep(struct ath6kl *ar, struct ath6kl_vif *vif) in ath6kl_cfg80211_host_sleep() argument
2091 clear_bit(HOST_SLEEP_MODE_CMD_PROCESSED, &vif->flags); in ath6kl_cfg80211_host_sleep()
2093 ret = ath6kl_wmi_set_host_sleep_mode_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_host_sleep()
2099 is_hsleep_mode_procsed(vif), in ath6kl_cfg80211_host_sleep()
2126 static int ath6kl_wow_suspend_vif(struct ath6kl_vif *vif, in ath6kl_wow_suspend_vif() argument
2129 struct ath6kl *ar = vif->ar; in ath6kl_wow_suspend_vif()
2137 if (!test_bit(NETDEV_MCAST_ALL_ON, &vif->flags) && in ath6kl_wow_suspend_vif()
2140 ret = ath6kl_wmi_mcast_filter_cmd(vif->ar->wmi, in ath6kl_wow_suspend_vif()
2141 vif->fw_vif_idx, false); in ath6kl_wow_suspend_vif()
2148 ath6kl_wmi_del_wow_pattern_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_wow_suspend_vif()
2157 ret = ath6kl_wow_usr(ar, vif, wow, filter); in ath6kl_wow_suspend_vif()
2158 else if (vif->nw_type == AP_NETWORK) in ath6kl_wow_suspend_vif()
2159 ret = ath6kl_wow_ap(ar, vif); in ath6kl_wow_suspend_vif()
2161 ret = ath6kl_wow_sta(ar, vif); in ath6kl_wow_suspend_vif()
2166 netif_stop_queue(vif->ndev); in ath6kl_wow_suspend_vif()
2168 if (vif->nw_type != AP_NETWORK) { in ath6kl_wow_suspend_vif()
2169 ret = ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_wow_suspend_vif()
2180 ret = ath6kl_wmi_bmisstime_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_wow_suspend_vif()
2185 ret = ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_wow_suspend_vif()
2193 in_dev = __in_dev_get_rtnl(vif->ndev); in ath6kl_wow_suspend_vif()
2212 ret = ath6kl_wmi_set_ip_cmd(ar->wmi, vif->fw_vif_idx, ips[0], ips[1]); in ath6kl_wow_suspend_vif()
2223 struct ath6kl_vif *first_vif, *vif; in ath6kl_wow_suspend() local
2239 list_for_each_entry(vif, &ar->vif_list, list) { in ath6kl_wow_suspend()
2240 if (!test_bit(CONNECTED, &vif->flags) || in ath6kl_wow_suspend()
2241 !ath6kl_cfg80211_ready(vif)) in ath6kl_wow_suspend()
2245 ret = ath6kl_wow_suspend_vif(vif, wow, &filter); in ath6kl_wow_suspend()
2268 static int ath6kl_wow_resume_vif(struct ath6kl_vif *vif) in ath6kl_wow_resume_vif() argument
2270 struct ath6kl *ar = vif->ar; in ath6kl_wow_resume_vif()
2273 if (vif->nw_type != AP_NETWORK) { in ath6kl_wow_resume_vif()
2274 ret = ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_wow_resume_vif()
2279 ret = ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_wow_resume_vif()
2280 vif->listen_intvl_t, 0); in ath6kl_wow_resume_vif()
2284 ret = ath6kl_wmi_bmisstime_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_wow_resume_vif()
2285 vif->bmiss_time_t, 0); in ath6kl_wow_resume_vif()
2290 if (!test_bit(NETDEV_MCAST_ALL_OFF, &vif->flags) && in ath6kl_wow_resume_vif()
2293 ret = ath6kl_wmi_mcast_filter_cmd(vif->ar->wmi, in ath6kl_wow_resume_vif()
2294 vif->fw_vif_idx, true); in ath6kl_wow_resume_vif()
2299 netif_wake_queue(vif->ndev); in ath6kl_wow_resume_vif()
2306 struct ath6kl_vif *vif; in ath6kl_wow_resume() local
2309 vif = ath6kl_vif_first(ar); in ath6kl_wow_resume()
2310 if (WARN_ON(!vif) || in ath6kl_wow_resume()
2311 !ath6kl_cfg80211_ready(vif)) in ath6kl_wow_resume()
2316 ret = ath6kl_wmi_set_host_sleep_mode_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_wow_resume()
2325 list_for_each_entry(vif, &ar->vif_list, list) { in ath6kl_wow_resume()
2326 if (!test_bit(CONNECTED, &vif->flags) || in ath6kl_wow_resume()
2327 !ath6kl_cfg80211_ready(vif)) in ath6kl_wow_resume()
2329 ret = ath6kl_wow_resume_vif(vif); in ath6kl_wow_resume()
2348 struct ath6kl_vif *vif; in ath6kl_cfg80211_deepsleep_suspend() local
2351 vif = ath6kl_vif_first(ar); in ath6kl_cfg80211_deepsleep_suspend()
2352 if (!vif) in ath6kl_cfg80211_deepsleep_suspend()
2370 ret = ath6kl_wmi_set_wow_mode_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_deepsleep_suspend()
2379 ret = ath6kl_cfg80211_host_sleep(ar, vif); in ath6kl_cfg80211_deepsleep_suspend()
2388 struct ath6kl_vif *vif; in ath6kl_cfg80211_deepsleep_resume() local
2391 vif = ath6kl_vif_first(ar); in ath6kl_cfg80211_deepsleep_resume()
2393 if (!vif) in ath6kl_cfg80211_deepsleep_resume()
2403 ret = ath6kl_wmi_set_host_sleep_mode_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_deepsleep_resume()
2411 ret = ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_deepsleep_resume()
2423 struct ath6kl_vif *vif; in ath6kl_cfg80211_suspend() local
2486 list_for_each_entry(vif, &ar->vif_list, list) in ath6kl_cfg80211_suspend()
2487 ath6kl_cfg80211_scan_complete_event(vif, true); in ath6kl_cfg80211_suspend()
2596 static int ath6kl_set_htcap(struct ath6kl_vif *vif, enum nl80211_band band, in ath6kl_set_htcap() argument
2599 struct ath6kl_htcap *htcap = &vif->htcap[band]; in ath6kl_set_htcap()
2613 return ath6kl_wmi_set_htcap_cmd(vif->ar->wmi, vif->fw_vif_idx, in ath6kl_set_htcap()
2617 static int ath6kl_restore_htcap(struct ath6kl_vif *vif) in ath6kl_restore_htcap() argument
2619 struct wiphy *wiphy = vif->ar->wiphy; in ath6kl_restore_htcap()
2626 ret = ath6kl_set_htcap(vif, band, in ath6kl_restore_htcap()
2642 static int ath6kl_set_ap_probe_resp_ies(struct ath6kl_vif *vif, in ath6kl_set_ap_probe_resp_ies() argument
2645 struct ath6kl *ar = vif->ar; in ath6kl_set_ap_probe_resp_ies()
2672 ret = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_set_ap_probe_resp_ies()
2678 static int ath6kl_set_ies(struct ath6kl_vif *vif, in ath6kl_set_ies() argument
2681 struct ath6kl *ar = vif->ar; in ath6kl_set_ies()
2685 res = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_set_ies()
2693 res = ath6kl_set_ap_probe_resp_ies(vif, info->proberesp_ies, in ath6kl_set_ies()
2699 res = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_set_ies()
2765 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_start_ap() local
2777 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_start_ap()
2780 if (vif->next_mode != AP_NETWORK) in ath6kl_start_ap()
2783 res = ath6kl_set_ies(vif, &info->beacon); in ath6kl_start_ap()
2787 ret = ath6kl_wmi_ap_set_beacon_intvl_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_start_ap()
2793 ret = ath6kl_wmi_ap_set_dtim_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_start_ap()
2809 memcpy(vif->ssid, info->ssid, info->ssid_len); in ath6kl_start_ap()
2810 vif->ssid_len = info->ssid_len; in ath6kl_start_ap()
2814 res = ath6kl_wmi_ap_hidden_ssid(ar->wmi, vif->fw_vif_idx, hidden); in ath6kl_start_ap()
2818 ret = ath6kl_set_auth_type(vif, info->auth_type); in ath6kl_start_ap()
2842 vif->auth_mode = p.auth_mode; in ath6kl_start_ap()
2863 ath6kl_set_cipher(vif, 0, true); in ath6kl_start_ap()
2865 ath6kl_set_cipher(vif, info->crypto.ciphers_pairwise[0], true); in ath6kl_start_ap()
2886 ath6kl_set_cipher(vif, info->crypto.cipher_group, false); in ath6kl_start_ap()
2889 vif->nw_type = vif->next_mode; in ath6kl_start_ap()
2891 p.ssid_len = vif->ssid_len; in ath6kl_start_ap()
2892 memcpy(p.ssid, vif->ssid, vif->ssid_len); in ath6kl_start_ap()
2893 p.dot11_auth_mode = vif->dot11_auth_mode; in ath6kl_start_ap()
2897 res = ath6kl_wmi_ap_set_apsd(ar->wmi, vif->fw_vif_idx, true); in ath6kl_start_ap()
2901 if (vif->wdev.iftype == NL80211_IFTYPE_P2P_GO) { in ath6kl_start_ap()
2919 res = ath6kl_wmi_set_inact_period(ar->wmi, vif->fw_vif_idx, in ath6kl_start_ap()
2925 if (ath6kl_set_htcap(vif, info->chandef.chan->band, in ath6kl_start_ap()
2939 res = ath6kl_wmi_set_ie_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_start_ap()
2943 vif->rsn_capab = rsn_capab; in ath6kl_start_ap()
2948 memcpy(&vif->profile, &p, sizeof(p)); in ath6kl_start_ap()
2949 res = ath6kl_wmi_ap_profile_commit(ar->wmi, vif->fw_vif_idx, &p); in ath6kl_start_ap()
2959 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_change_beacon() local
2961 if (!ath6kl_cfg80211_ready(vif)) in ath6kl_change_beacon()
2964 if (vif->next_mode != AP_NETWORK) in ath6kl_change_beacon()
2967 return ath6kl_set_ies(vif, beacon); in ath6kl_change_beacon()
2974 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_stop_ap() local
2976 if (vif->nw_type != AP_NETWORK) in ath6kl_stop_ap()
2978 if (!test_bit(CONNECTED, &vif->flags)) in ath6kl_stop_ap()
2981 ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx); in ath6kl_stop_ap()
2982 clear_bit(CONNECTED, &vif->flags); in ath6kl_stop_ap()
2983 netif_carrier_off(vif->ndev); in ath6kl_stop_ap()
2986 return ath6kl_restore_htcap(vif); in ath6kl_stop_ap()
2995 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_del_station() local
2998 return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx, WMI_AP_DEAUTH, in ath6kl_del_station()
3007 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_change_station() local
3010 if (vif->nw_type != AP_NETWORK) in ath6kl_change_station()
3019 return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx, in ath6kl_change_station()
3021 return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx, in ath6kl_change_station()
3031 struct ath6kl_vif *vif = ath6kl_vif_from_wdev(wdev); in ath6kl_remain_on_channel() local
3032 struct ath6kl *ar = ath6kl_priv(vif->ndev); in ath6kl_remain_on_channel()
3037 id = ++vif->last_roc_id; in ath6kl_remain_on_channel()
3040 id = ++vif->last_roc_id; in ath6kl_remain_on_channel()
3044 return ath6kl_wmi_remain_on_chnl_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_remain_on_channel()
3052 struct ath6kl_vif *vif = ath6kl_vif_from_wdev(wdev); in ath6kl_cancel_remain_on_channel() local
3053 struct ath6kl *ar = ath6kl_priv(vif->ndev); in ath6kl_cancel_remain_on_channel()
3055 if (cookie != vif->last_roc_id) in ath6kl_cancel_remain_on_channel()
3057 vif->last_cancel_roc_id = cookie; in ath6kl_cancel_remain_on_channel()
3059 return ath6kl_wmi_cancel_remain_on_chnl_cmd(ar->wmi, vif->fw_vif_idx); in ath6kl_cancel_remain_on_channel()
3062 static int ath6kl_send_go_probe_resp(struct ath6kl_vif *vif, in ath6kl_send_go_probe_resp() argument
3066 struct ath6kl *ar = vif->ar; in ath6kl_send_go_probe_resp()
3093 ret = ath6kl_wmi_send_probe_response_cmd(ar->wmi, vif->fw_vif_idx, freq, in ath6kl_send_go_probe_resp()
3099 static bool ath6kl_mgmt_powersave_ap(struct ath6kl_vif *vif, in ath6kl_mgmt_powersave_ap() argument
3113 struct ath6kl *ar = vif->ar; in ath6kl_mgmt_powersave_ap()
3119 conn = ath6kl_find_sta(vif, mgmt->da); in ath6kl_mgmt_powersave_ap()
3151 ath6kl_wmi_set_pvb_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_mgmt_powersave_ap()
3187 struct ath6kl_vif *vif = ath6kl_vif_from_wdev(wdev); in ath6kl_mgmt_tx() local
3188 struct ath6kl *ar = ath6kl_priv(vif->ndev); in ath6kl_mgmt_tx()
3201 freq = vif->ch_hint; in ath6kl_mgmt_tx()
3210 if (vif->nw_type == AP_NETWORK && test_bit(CONNECTED, &vif->flags) && in ath6kl_mgmt_tx()
3218 return ath6kl_send_go_probe_resp(vif, buf, len, freq); in ath6kl_mgmt_tx()
3221 id = vif->send_action_id++; in ath6kl_mgmt_tx()
3227 id = vif->send_action_id++; in ath6kl_mgmt_tx()
3233 if (vif->nw_type == AP_NETWORK) { in ath6kl_mgmt_tx()
3234 queued = ath6kl_mgmt_powersave_ap(vif, id, freq, wait, buf, len, in ath6kl_mgmt_tx()
3240 return ath6kl_wmi_send_mgmt_cmd(ar->wmi, vif->fw_vif_idx, id, freq, in ath6kl_mgmt_tx()
3257 struct ath6kl_vif *vif = ath6kl_vif_from_wdev(wdev); in ath6kl_update_mgmt_frame_registrations() local
3264 vif->probe_req_report = in ath6kl_update_mgmt_frame_registrations()
3273 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_cfg80211_sscan_start() local
3289 if (vif->sme_state != SME_DISCONNECTED) in ath6kl_cfg80211_sscan_start()
3292 ath6kl_cfg80211_scan_complete_event(vif, true); in ath6kl_cfg80211_sscan_start()
3294 ret = ath6kl_set_probed_ssids(ar, vif, request->ssids, in ath6kl_cfg80211_sscan_start()
3302 ret = ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_sscan_start()
3307 ret = ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_sscan_start()
3322 ret = ath6kl_wmi_set_rssi_filter_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_sscan_start()
3333 ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_sscan_start()
3335 vif->bg_scan_period, 0, 0, 0, 3, 0, 0, 0); in ath6kl_cfg80211_sscan_start()
3338 ret = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_sscan_start()
3347 ret = ath6kl_wmi_enable_sched_scan_cmd(ar->wmi, vif->fw_vif_idx, true); in ath6kl_cfg80211_sscan_start()
3351 set_bit(SCHED_SCANNING, &vif->flags); in ath6kl_cfg80211_sscan_start()
3359 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_cfg80211_sscan_stop() local
3362 stopped = __ath6kl_cfg80211_sscan_stop(vif); in ath6kl_cfg80211_sscan_stop()
3377 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_cfg80211_set_bitrate() local
3379 return ath6kl_wmi_set_bitrate_mask(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_set_bitrate()
3388 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_cfg80211_set_txe_config() local
3390 if (vif->nw_type != INFRA_NETWORK || in ath6kl_cfg80211_set_txe_config()
3394 if (vif->sme_state != SME_CONNECTED) in ath6kl_cfg80211_set_txe_config()
3398 vif->txe_intvl = intvl; in ath6kl_cfg80211_set_txe_config()
3400 return ath6kl_wmi_set_txe_notify(ar->wmi, vif->fw_vif_idx, in ath6kl_cfg80211_set_txe_config()
3475 void ath6kl_cfg80211_stop(struct ath6kl_vif *vif) in ath6kl_cfg80211_stop() argument
3477 ath6kl_cfg80211_sscan_disable(vif); in ath6kl_cfg80211_stop()
3479 switch (vif->sme_state) { in ath6kl_cfg80211_stop()
3483 cfg80211_connect_result(vif->ndev, vif->bssid, NULL, 0, in ath6kl_cfg80211_stop()
3489 cfg80211_disconnected(vif->ndev, 0, NULL, 0, true, GFP_KERNEL); in ath6kl_cfg80211_stop()
3493 if (vif->ar->state != ATH6KL_STATE_RECOVERY && in ath6kl_cfg80211_stop()
3494 (test_bit(CONNECTED, &vif->flags) || in ath6kl_cfg80211_stop()
3495 test_bit(CONNECT_PEND, &vif->flags))) in ath6kl_cfg80211_stop()
3496 ath6kl_wmi_disconnect_cmd(vif->ar->wmi, vif->fw_vif_idx); in ath6kl_cfg80211_stop()
3498 vif->sme_state = SME_DISCONNECTED; in ath6kl_cfg80211_stop()
3499 clear_bit(CONNECTED, &vif->flags); in ath6kl_cfg80211_stop()
3500 clear_bit(CONNECT_PEND, &vif->flags); in ath6kl_cfg80211_stop()
3503 netif_stop_queue(vif->ndev); in ath6kl_cfg80211_stop()
3504 netif_carrier_off(vif->ndev); in ath6kl_cfg80211_stop()
3507 if (vif->ar->state != ATH6KL_STATE_RECOVERY && in ath6kl_cfg80211_stop()
3508 ath6kl_wmi_scanparams_cmd(vif->ar->wmi, vif->fw_vif_idx, 0xFFFF, in ath6kl_cfg80211_stop()
3512 ath6kl_cfg80211_scan_complete_event(vif, true); in ath6kl_cfg80211_stop()
3517 struct ath6kl_vif *vif; in ath6kl_cfg80211_stop_all() local
3519 vif = ath6kl_vif_first(ar); in ath6kl_cfg80211_stop_all()
3520 if (!vif && ar->state != ATH6KL_STATE_RECOVERY) { in ath6kl_cfg80211_stop_all()
3534 list_for_each_entry(vif, &ar->vif_list, list) in ath6kl_cfg80211_stop_all()
3535 ath6kl_cfg80211_stop(vif); in ath6kl_cfg80211_stop_all()
3582 static int ath6kl_cfg80211_vif_init(struct ath6kl_vif *vif) in ath6kl_cfg80211_vif_init() argument
3584 vif->aggr_cntxt = aggr_init(vif); in ath6kl_cfg80211_vif_init()
3585 if (!vif->aggr_cntxt) { in ath6kl_cfg80211_vif_init()
3590 timer_setup(&vif->disconnect_timer, disconnect_timer_handler, 0); in ath6kl_cfg80211_vif_init()
3591 timer_setup(&vif->sched_scan_timer, ath6kl_wmi_sscan_timer, 0); in ath6kl_cfg80211_vif_init()
3593 set_bit(WMM_ENABLED, &vif->flags); in ath6kl_cfg80211_vif_init()
3594 spin_lock_init(&vif->if_lock); in ath6kl_cfg80211_vif_init()
3596 INIT_LIST_HEAD(&vif->mc_filter); in ath6kl_cfg80211_vif_init()
3601 void ath6kl_cfg80211_vif_stop(struct ath6kl_vif *vif, bool wmi_ready) in ath6kl_cfg80211_vif_stop() argument
3606 netif_stop_queue(vif->ndev); in ath6kl_cfg80211_vif_stop()
3608 clear_bit(WLAN_ENABLED, &vif->flags); in ath6kl_cfg80211_vif_stop()
3611 discon_issued = test_bit(CONNECTED, &vif->flags) || in ath6kl_cfg80211_vif_stop()
3612 test_bit(CONNECT_PEND, &vif->flags); in ath6kl_cfg80211_vif_stop()
3613 ath6kl_disconnect(vif); in ath6kl_cfg80211_vif_stop()
3614 del_timer(&vif->disconnect_timer); in ath6kl_cfg80211_vif_stop()
3617 ath6kl_disconnect_event(vif, DISCONNECT_CMD, in ath6kl_cfg80211_vif_stop()
3618 (vif->nw_type & AP_NETWORK) ? in ath6kl_cfg80211_vif_stop()
3619 bcast_mac : vif->bssid, in ath6kl_cfg80211_vif_stop()
3623 if (vif->scan_req) { in ath6kl_cfg80211_vif_stop()
3628 cfg80211_scan_done(vif->scan_req, &info); in ath6kl_cfg80211_vif_stop()
3629 vif->scan_req = NULL; in ath6kl_cfg80211_vif_stop()
3633 ath6kl_cfg80211_sta_bmiss_enhance(vif, false); in ath6kl_cfg80211_vif_stop()
3636 void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif) in ath6kl_cfg80211_vif_cleanup() argument
3638 struct ath6kl *ar = vif->ar; in ath6kl_cfg80211_vif_cleanup()
3641 aggr_module_destroy(vif->aggr_cntxt); in ath6kl_cfg80211_vif_cleanup()
3643 ar->avail_idx_map |= BIT(vif->fw_vif_idx); in ath6kl_cfg80211_vif_cleanup()
3645 if (vif->nw_type == ADHOC_NETWORK) in ath6kl_cfg80211_vif_cleanup()
3648 list_for_each_entry_safe(mc_filter, tmp, &vif->mc_filter, list) { in ath6kl_cfg80211_vif_cleanup()
3653 cfg80211_unregister_netdevice(vif->ndev); in ath6kl_cfg80211_vif_cleanup()
3701 struct ath6kl_vif *vif = netdev_priv(dev); in ath6kl_get_stats() local
3702 struct ath6kl *ar = vif->ar; in ath6kl_get_stats()
3708 ath6kl_read_tgt_stats(ar, vif); in ath6kl_get_stats()
3710 tgt_stats = &vif->target_stats; in ath6kl_get_stats()
3785 struct ath6kl_vif *vif; in ath6kl_interface_add() local
3788 ndev = alloc_netdev(sizeof(*vif), name, name_assign_type, ether_setup); in ath6kl_interface_add()
3792 vif = netdev_priv(ndev); in ath6kl_interface_add()
3793 ndev->ieee80211_ptr = &vif->wdev; in ath6kl_interface_add()
3794 vif->wdev.wiphy = ar->wiphy; in ath6kl_interface_add()
3795 vif->ar = ar; in ath6kl_interface_add()
3796 vif->ndev = ndev; in ath6kl_interface_add()
3797 SET_NETDEV_DEV(ndev, wiphy_dev(vif->wdev.wiphy)); in ath6kl_interface_add()
3798 vif->wdev.netdev = ndev; in ath6kl_interface_add()
3799 vif->wdev.iftype = type; in ath6kl_interface_add()
3800 vif->fw_vif_idx = fw_vif_idx; in ath6kl_interface_add()
3801 vif->nw_type = nw_type; in ath6kl_interface_add()
3802 vif->next_mode = nw_type; in ath6kl_interface_add()
3803 vif->listen_intvl_t = ATH6KL_DEFAULT_LISTEN_INTVAL; in ath6kl_interface_add()
3804 vif->bmiss_time_t = ATH6KL_DEFAULT_BMISS_TIME; in ath6kl_interface_add()
3805 vif->bg_scan_period = 0; in ath6kl_interface_add()
3806 vif->htcap[NL80211_BAND_2GHZ].ht_enable = true; in ath6kl_interface_add()
3807 vif->htcap[NL80211_BAND_5GHZ].ht_enable = true; in ath6kl_interface_add()
3820 ath6kl_init_control_info(vif); in ath6kl_interface_add()
3822 if (ath6kl_cfg80211_vif_init(vif)) in ath6kl_interface_add()
3831 vif->sme_state = SME_DISCONNECTED; in ath6kl_interface_add()
3832 set_bit(WLAN_ENABLED, &vif->flags); in ath6kl_interface_add()
3839 list_add_tail(&vif->list, &ar->vif_list); in ath6kl_interface_add()
3842 return &vif->wdev; in ath6kl_interface_add()
3845 aggr_module_destroy(vif->aggr_cntxt); in ath6kl_interface_add()