Lines Matching refs:arvif

235 static int ath10k_send_key(struct ath10k_vif *arvif,  in ath10k_send_key()  argument
240 struct ath10k *ar = arvif->ar; in ath10k_send_key()
242 .vdev_id = arvif->vdev_id, in ath10k_send_key()
250 lockdep_assert_held(&arvif->ar->conf_mutex); in ath10k_send_key()
293 return ath10k_wmi_vdev_install_key(arvif->ar, &arg); in ath10k_send_key()
296 static int ath10k_install_key(struct ath10k_vif *arvif, in ath10k_install_key() argument
301 struct ath10k *ar = arvif->ar; in ath10k_install_key()
309 if (arvif->nohwcrypt) in ath10k_install_key()
312 ret = ath10k_send_key(arvif, key, cmd, macaddr, flags); in ath10k_install_key()
323 static int ath10k_install_peer_wep_keys(struct ath10k_vif *arvif, in ath10k_install_peer_wep_keys() argument
326 struct ath10k *ar = arvif->ar; in ath10k_install_peer_wep_keys()
334 if (WARN_ON(arvif->vif->type != NL80211_IFTYPE_AP && in ath10k_install_peer_wep_keys()
335 arvif->vif->type != NL80211_IFTYPE_ADHOC && in ath10k_install_peer_wep_keys()
336 arvif->vif->type != NL80211_IFTYPE_MESH_POINT)) in ath10k_install_peer_wep_keys()
340 peer = ath10k_peer_find(ar, arvif->vdev_id, addr); in ath10k_install_peer_wep_keys()
346 for (i = 0; i < ARRAY_SIZE(arvif->wep_keys); i++) { in ath10k_install_peer_wep_keys()
347 if (arvif->wep_keys[i] == NULL) in ath10k_install_peer_wep_keys()
350 switch (arvif->vif->type) { in ath10k_install_peer_wep_keys()
354 if (arvif->def_wep_key_idx == i) in ath10k_install_peer_wep_keys()
357 ret = ath10k_install_key(arvif, arvif->wep_keys[i], in ath10k_install_peer_wep_keys()
363 ret = ath10k_install_key(arvif, arvif->wep_keys[i], in ath10k_install_peer_wep_keys()
369 ret = ath10k_install_key(arvif, arvif->wep_keys[i], in ath10k_install_peer_wep_keys()
380 peer->keys[i] = arvif->wep_keys[i]; in ath10k_install_peer_wep_keys()
392 if (arvif->vif->type != NL80211_IFTYPE_ADHOC) in ath10k_install_peer_wep_keys()
395 if (arvif->def_wep_key_idx == -1) in ath10k_install_peer_wep_keys()
398 ret = ath10k_wmi_vdev_set_param(arvif->ar, in ath10k_install_peer_wep_keys()
399 arvif->vdev_id, in ath10k_install_peer_wep_keys()
400 arvif->ar->wmi.vdev_param->def_keyid, in ath10k_install_peer_wep_keys()
401 arvif->def_wep_key_idx); in ath10k_install_peer_wep_keys()
404 arvif->vdev_id, ret); in ath10k_install_peer_wep_keys()
411 static int ath10k_clear_peer_keys(struct ath10k_vif *arvif, in ath10k_clear_peer_keys() argument
414 struct ath10k *ar = arvif->ar; in ath10k_clear_peer_keys()
424 peer = ath10k_peer_find(ar, arvif->vdev_id, addr); in ath10k_clear_peer_keys()
435 ret = ath10k_install_key(arvif, peer->keys[i], in ath10k_clear_peer_keys()
477 static int ath10k_clear_vdev_key(struct ath10k_vif *arvif, in ath10k_clear_vdev_key() argument
480 struct ath10k *ar = arvif->ar; in ath10k_clear_vdev_key()
513 ret = ath10k_install_key(arvif, key, DISABLE_KEY, addr, flags); in ath10k_clear_vdev_key()
525 static int ath10k_mac_vif_update_wep_key(struct ath10k_vif *arvif, in ath10k_mac_vif_update_wep_key() argument
528 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_update_wep_key()
535 if (ether_addr_equal(peer->addr, arvif->vif->addr)) in ath10k_mac_vif_update_wep_key()
538 if (ether_addr_equal(peer->addr, arvif->bssid)) in ath10k_mac_vif_update_wep_key()
545 arvif->vdev_id, key->keyidx); in ath10k_mac_vif_update_wep_key()
547 ret = ath10k_install_peer_wep_keys(arvif, peer->addr); in ath10k_mac_vif_update_wep_key()
550 arvif->vdev_id, peer->addr, ret); in ath10k_mac_vif_update_wep_key()
731 struct ath10k_vif *arvif; in ath10k_peer_create() local
741 list_for_each_entry(arvif, &ar->arvifs, list) in ath10k_peer_create()
782 static int ath10k_mac_set_kickout(struct ath10k_vif *arvif) in ath10k_mac_set_kickout() argument
784 struct ath10k *ar = arvif->ar; in ath10k_mac_set_kickout()
793 arvif->vdev_id, ret); in ath10k_mac_set_kickout()
798 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, param, in ath10k_mac_set_kickout()
802 arvif->vdev_id, ret); in ath10k_mac_set_kickout()
807 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, param, in ath10k_mac_set_kickout()
811 arvif->vdev_id, ret); in ath10k_mac_set_kickout()
816 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, param, in ath10k_mac_set_kickout()
820 arvif->vdev_id, ret); in ath10k_mac_set_kickout()
827 static int ath10k_mac_set_rts(struct ath10k_vif *arvif, u32 value) in ath10k_mac_set_rts() argument
829 struct ath10k *ar = arvif->ar; in ath10k_mac_set_rts()
833 return ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, value); in ath10k_mac_set_rts()
971 void ath10k_mac_vif_beacon_free(struct ath10k_vif *arvif) in ath10k_mac_vif_beacon_free() argument
973 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_beacon_free()
977 if (!arvif->beacon) in ath10k_mac_vif_beacon_free()
980 if (!arvif->beacon_buf) in ath10k_mac_vif_beacon_free()
981 dma_unmap_single(ar->dev, ATH10K_SKB_CB(arvif->beacon)->paddr, in ath10k_mac_vif_beacon_free()
982 arvif->beacon->len, DMA_TO_DEVICE); in ath10k_mac_vif_beacon_free()
984 if (WARN_ON(arvif->beacon_state != ATH10K_BEACON_SCHEDULED && in ath10k_mac_vif_beacon_free()
985 arvif->beacon_state != ATH10K_BEACON_SENT)) in ath10k_mac_vif_beacon_free()
988 dev_kfree_skb_any(arvif->beacon); in ath10k_mac_vif_beacon_free()
990 arvif->beacon = NULL; in ath10k_mac_vif_beacon_free()
991 arvif->beacon_state = ATH10K_BEACON_SCHEDULED; in ath10k_mac_vif_beacon_free()
994 static void ath10k_mac_vif_beacon_cleanup(struct ath10k_vif *arvif) in ath10k_mac_vif_beacon_cleanup() argument
996 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_beacon_cleanup()
1000 ath10k_mac_vif_beacon_free(arvif); in ath10k_mac_vif_beacon_cleanup()
1002 if (arvif->beacon_buf) { in ath10k_mac_vif_beacon_cleanup()
1004 kfree(arvif->beacon_buf); in ath10k_mac_vif_beacon_cleanup()
1007 arvif->beacon_buf, in ath10k_mac_vif_beacon_cleanup()
1008 arvif->beacon_paddr); in ath10k_mac_vif_beacon_cleanup()
1009 arvif->beacon_buf = NULL; in ath10k_mac_vif_beacon_cleanup()
1310 static bool ath10k_mac_can_set_cts_prot(struct ath10k_vif *arvif) in ath10k_mac_can_set_cts_prot() argument
1312 struct ath10k *ar = arvif->ar; in ath10k_mac_can_set_cts_prot()
1316 if (!arvif->is_started) { in ath10k_mac_can_set_cts_prot()
1324 static int ath10k_mac_set_cts_prot(struct ath10k_vif *arvif) in ath10k_mac_set_cts_prot() argument
1326 struct ath10k *ar = arvif->ar; in ath10k_mac_set_cts_prot()
1334 arvif->vdev_id, arvif->use_cts_prot); in ath10k_mac_set_cts_prot()
1336 return ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_mac_set_cts_prot()
1337 arvif->use_cts_prot ? 1 : 0); in ath10k_mac_set_cts_prot()
1340 static int ath10k_recalc_rtscts_prot(struct ath10k_vif *arvif) in ath10k_recalc_rtscts_prot() argument
1342 struct ath10k *ar = arvif->ar; in ath10k_recalc_rtscts_prot()
1351 if (arvif->num_legacy_stations > 0) in ath10k_recalc_rtscts_prot()
1359 arvif->vdev_id, rts_cts); in ath10k_recalc_rtscts_prot()
1361 return ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_recalc_rtscts_prot()
1449 static int ath10k_vdev_stop(struct ath10k_vif *arvif) in ath10k_vdev_stop() argument
1451 struct ath10k *ar = arvif->ar; in ath10k_vdev_stop()
1459 ret = ath10k_wmi_vdev_stop(ar, arvif->vdev_id); in ath10k_vdev_stop()
1462 arvif->vdev_id, ret); in ath10k_vdev_stop()
1469 arvif->vdev_id, ret); in ath10k_vdev_stop()
1483 static int ath10k_vdev_start_restart(struct ath10k_vif *arvif, in ath10k_vdev_start_restart() argument
1487 struct ath10k *ar = arvif->ar; in ath10k_vdev_start_restart()
1496 arg.vdev_id = arvif->vdev_id; in ath10k_vdev_start_restart()
1497 arg.dtim_period = arvif->dtim_period; in ath10k_vdev_start_restart()
1498 arg.bcn_intval = arvif->beacon_interval; in ath10k_vdev_start_restart()
1510 if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { in ath10k_vdev_start_restart()
1511 arg.ssid = arvif->u.ap.ssid; in ath10k_vdev_start_restart()
1512 arg.ssid_len = arvif->u.ap.ssid_len; in ath10k_vdev_start_restart()
1513 arg.hidden_ssid = arvif->u.ap.hidden_ssid; in ath10k_vdev_start_restart()
1518 } else if (arvif->vdev_type == WMI_VDEV_TYPE_IBSS) { in ath10k_vdev_start_restart()
1519 arg.ssid = arvif->vif->cfg.ssid; in ath10k_vdev_start_restart()
1520 arg.ssid_len = arvif->vif->cfg.ssid_len; in ath10k_vdev_start_restart()
1553 static int ath10k_vdev_start(struct ath10k_vif *arvif, in ath10k_vdev_start() argument
1556 return ath10k_vdev_start_restart(arvif, def, false); in ath10k_vdev_start()
1559 static int ath10k_vdev_restart(struct ath10k_vif *arvif, in ath10k_vdev_restart() argument
1562 return ath10k_vdev_start_restart(arvif, def, true); in ath10k_vdev_restart()
1565 static int ath10k_mac_setup_bcn_p2p_ie(struct ath10k_vif *arvif, in ath10k_mac_setup_bcn_p2p_ie() argument
1568 struct ath10k *ar = arvif->ar; in ath10k_mac_setup_bcn_p2p_ie()
1573 if (arvif->vif->type != NL80211_IFTYPE_AP || !arvif->vif->p2p) in ath10k_mac_setup_bcn_p2p_ie()
1584 ret = ath10k_wmi_p2p_go_bcn_ie(ar, arvif->vdev_id, p2p_ie); in ath10k_mac_setup_bcn_p2p_ie()
1587 arvif->vdev_id, ret); in ath10k_mac_setup_bcn_p2p_ie()
1624 static int ath10k_mac_setup_bcn_tmpl(struct ath10k_vif *arvif) in ath10k_mac_setup_bcn_tmpl() argument
1626 struct ath10k *ar = arvif->ar; in ath10k_mac_setup_bcn_tmpl()
1628 struct ieee80211_vif *vif = arvif->vif; in ath10k_mac_setup_bcn_tmpl()
1636 if (arvif->vdev_type != WMI_VDEV_TYPE_AP && in ath10k_mac_setup_bcn_tmpl()
1637 arvif->vdev_type != WMI_VDEV_TYPE_IBSS) in ath10k_mac_setup_bcn_tmpl()
1646 ret = ath10k_mac_setup_bcn_p2p_ie(arvif, bcn); in ath10k_mac_setup_bcn_tmpl()
1661 ret = ath10k_wmi_bcn_tmpl(ar, arvif->vdev_id, offs.tim_offset, bcn, 0, in ath10k_mac_setup_bcn_tmpl()
1674 static int ath10k_mac_setup_prb_tmpl(struct ath10k_vif *arvif) in ath10k_mac_setup_prb_tmpl() argument
1676 struct ath10k *ar = arvif->ar; in ath10k_mac_setup_prb_tmpl()
1678 struct ieee80211_vif *vif = arvif->vif; in ath10k_mac_setup_prb_tmpl()
1685 if (arvif->vdev_type != WMI_VDEV_TYPE_AP) in ath10k_mac_setup_prb_tmpl()
1698 ret = ath10k_wmi_prb_tmpl(ar, arvif->vdev_id, prb); in ath10k_mac_setup_prb_tmpl()
1710 static int ath10k_mac_vif_fix_hidden_ssid(struct ath10k_vif *arvif) in ath10k_mac_vif_fix_hidden_ssid() argument
1712 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_fix_hidden_ssid()
1734 if (WARN_ON(!arvif->is_started)) in ath10k_mac_vif_fix_hidden_ssid()
1737 if (WARN_ON(!arvif->is_up)) in ath10k_mac_vif_fix_hidden_ssid()
1740 if (WARN_ON(ath10k_mac_vif_chan(arvif->vif, &def))) in ath10k_mac_vif_fix_hidden_ssid()
1743 ret = ath10k_wmi_vdev_down(ar, arvif->vdev_id); in ath10k_mac_vif_fix_hidden_ssid()
1746 arvif->vdev_id, ret); in ath10k_mac_vif_fix_hidden_ssid()
1754 ret = ath10k_mac_setup_bcn_tmpl(arvif); in ath10k_mac_vif_fix_hidden_ssid()
1760 ret = ath10k_mac_setup_prb_tmpl(arvif); in ath10k_mac_vif_fix_hidden_ssid()
1766 ret = ath10k_vdev_restart(arvif, &def); in ath10k_mac_vif_fix_hidden_ssid()
1769 arvif->vdev_id, ret); in ath10k_mac_vif_fix_hidden_ssid()
1773 ret = ath10k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, in ath10k_mac_vif_fix_hidden_ssid()
1774 arvif->bssid); in ath10k_mac_vif_fix_hidden_ssid()
1777 arvif->vdev_id, ret); in ath10k_mac_vif_fix_hidden_ssid()
1784 static void ath10k_control_beaconing(struct ath10k_vif *arvif, in ath10k_control_beaconing() argument
1787 struct ath10k *ar = arvif->ar; in ath10k_control_beaconing()
1790 lockdep_assert_held(&arvif->ar->conf_mutex); in ath10k_control_beaconing()
1793 ret = ath10k_wmi_vdev_down(ar, arvif->vdev_id); in ath10k_control_beaconing()
1796 arvif->vdev_id, ret); in ath10k_control_beaconing()
1798 arvif->is_up = false; in ath10k_control_beaconing()
1800 spin_lock_bh(&arvif->ar->data_lock); in ath10k_control_beaconing()
1801 ath10k_mac_vif_beacon_free(arvif); in ath10k_control_beaconing()
1802 spin_unlock_bh(&arvif->ar->data_lock); in ath10k_control_beaconing()
1807 arvif->tx_seq_no = 0x1000; in ath10k_control_beaconing()
1809 arvif->aid = 0; in ath10k_control_beaconing()
1810 ether_addr_copy(arvif->bssid, info->bssid); in ath10k_control_beaconing()
1812 ret = ath10k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, in ath10k_control_beaconing()
1813 arvif->bssid); in ath10k_control_beaconing()
1816 arvif->vdev_id, ret); in ath10k_control_beaconing()
1820 arvif->is_up = true; in ath10k_control_beaconing()
1822 ret = ath10k_mac_vif_fix_hidden_ssid(arvif); in ath10k_control_beaconing()
1825 arvif->vdev_id, ret); in ath10k_control_beaconing()
1829 ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d up\n", arvif->vdev_id); in ath10k_control_beaconing()
1832 static void ath10k_control_ibss(struct ath10k_vif *arvif, in ath10k_control_ibss() argument
1835 struct ath10k *ar = arvif->ar; in ath10k_control_ibss()
1839 lockdep_assert_held(&arvif->ar->conf_mutex); in ath10k_control_ibss()
1842 if (is_zero_ether_addr(arvif->bssid)) in ath10k_control_ibss()
1845 eth_zero_addr(arvif->bssid); in ath10k_control_ibss()
1850 vdev_param = arvif->ar->wmi.vdev_param->atim_window; in ath10k_control_ibss()
1851 ret = ath10k_wmi_vdev_set_param(arvif->ar, arvif->vdev_id, vdev_param, in ath10k_control_ibss()
1855 arvif->vdev_id, ret); in ath10k_control_ibss()
1858 static int ath10k_mac_vif_recalc_ps_wake_threshold(struct ath10k_vif *arvif) in ath10k_mac_vif_recalc_ps_wake_threshold() argument
1860 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_recalc_ps_wake_threshold()
1865 lockdep_assert_held(&arvif->ar->conf_mutex); in ath10k_mac_vif_recalc_ps_wake_threshold()
1867 if (arvif->u.sta.uapsd) in ath10k_mac_vif_recalc_ps_wake_threshold()
1873 ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, value); in ath10k_mac_vif_recalc_ps_wake_threshold()
1876 value, arvif->vdev_id, ret); in ath10k_mac_vif_recalc_ps_wake_threshold()
1883 static int ath10k_mac_vif_recalc_ps_poll_count(struct ath10k_vif *arvif) in ath10k_mac_vif_recalc_ps_poll_count() argument
1885 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_recalc_ps_poll_count()
1890 lockdep_assert_held(&arvif->ar->conf_mutex); in ath10k_mac_vif_recalc_ps_poll_count()
1892 if (arvif->u.sta.uapsd) in ath10k_mac_vif_recalc_ps_poll_count()
1898 ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, in ath10k_mac_vif_recalc_ps_poll_count()
1902 value, arvif->vdev_id, ret); in ath10k_mac_vif_recalc_ps_poll_count()
1911 struct ath10k_vif *arvif; in ath10k_mac_num_vifs_started() local
1916 list_for_each_entry(arvif, &ar->arvifs, list) in ath10k_mac_num_vifs_started()
1917 if (arvif->is_started) in ath10k_mac_num_vifs_started()
1923 static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) in ath10k_mac_vif_setup_ps() argument
1925 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_setup_ps()
1926 struct ieee80211_vif *vif = arvif->vif; in ath10k_mac_vif_setup_ps()
1934 lockdep_assert_held(&arvif->ar->conf_mutex); in ath10k_mac_vif_setup_ps()
1936 if (arvif->vif->type != NL80211_IFTYPE_STATION) in ath10k_mac_vif_setup_ps()
1939 enable_ps = arvif->ps; in ath10k_mac_vif_setup_ps()
1945 arvif->vdev_id); in ath10k_mac_vif_setup_ps()
1949 if (!arvif->is_started) { in ath10k_mac_vif_setup_ps()
1967 ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, in ath10k_mac_vif_setup_ps()
1971 arvif->vdev_id, ret); in ath10k_mac_vif_setup_ps()
1979 arvif->vdev_id, psmode ? "enable" : "disable"); in ath10k_mac_vif_setup_ps()
1981 ret = ath10k_wmi_set_psmode(ar, arvif->vdev_id, psmode); in ath10k_mac_vif_setup_ps()
1984 psmode, arvif->vdev_id, ret); in ath10k_mac_vif_setup_ps()
1991 static int ath10k_mac_vif_disable_keepalive(struct ath10k_vif *arvif) in ath10k_mac_vif_disable_keepalive() argument
1993 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_disable_keepalive()
1997 lockdep_assert_held(&arvif->ar->conf_mutex); in ath10k_mac_vif_disable_keepalive()
1999 if (arvif->vdev_type != WMI_VDEV_TYPE_STA) in ath10k_mac_vif_disable_keepalive()
2008 arg.vdev_id = arvif->vdev_id; in ath10k_mac_vif_disable_keepalive()
2016 arvif->vdev_id, ret); in ath10k_mac_vif_disable_keepalive()
2023 static void ath10k_mac_vif_ap_csa_count_down(struct ath10k_vif *arvif) in ath10k_mac_vif_ap_csa_count_down() argument
2025 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_ap_csa_count_down()
2026 struct ieee80211_vif *vif = arvif->vif; in ath10k_mac_vif_ap_csa_count_down()
2029 lockdep_assert_held(&arvif->ar->conf_mutex); in ath10k_mac_vif_ap_csa_count_down()
2034 if (arvif->vdev_type != WMI_VDEV_TYPE_AP) in ath10k_mac_vif_ap_csa_count_down()
2040 if (!arvif->is_up) in ath10k_mac_vif_ap_csa_count_down()
2046 ret = ath10k_mac_setup_bcn_tmpl(arvif); in ath10k_mac_vif_ap_csa_count_down()
2051 ret = ath10k_mac_setup_prb_tmpl(arvif); in ath10k_mac_vif_ap_csa_count_down()
2062 struct ath10k_vif *arvif = container_of(work, struct ath10k_vif, in ath10k_mac_vif_ap_csa_work() local
2064 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_ap_csa_work()
2067 ath10k_mac_vif_ap_csa_count_down(arvif); in ath10k_mac_vif_ap_csa_work()
2076 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_handle_beacon_iter() local
2084 cancel_delayed_work(&arvif->connection_loss_work); in ath10k_mac_handle_beacon_iter()
2099 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_handle_beacon_miss_iter() local
2100 struct ath10k *ar = arvif->ar; in ath10k_mac_handle_beacon_miss_iter()
2103 if (arvif->vdev_id != *vdev_id) in ath10k_mac_handle_beacon_miss_iter()
2106 if (!arvif->is_up) in ath10k_mac_handle_beacon_miss_iter()
2116 ieee80211_queue_delayed_work(hw, &arvif->connection_loss_work, in ath10k_mac_handle_beacon_miss_iter()
2130 struct ath10k_vif *arvif = container_of(work, struct ath10k_vif, in ath10k_mac_vif_sta_connection_loss_work() local
2132 struct ieee80211_vif *vif = arvif->vif; in ath10k_mac_vif_sta_connection_loss_work()
2134 if (!arvif->is_up) in ath10k_mac_vif_sta_connection_loss_work()
2166 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_peer_assoc_h_basic() local
2177 arg->vdev_id = arvif->vdev_id; in ath10k_peer_assoc_h_basic()
2179 arg->peer_flags |= arvif->ar->wmi.peer_flags->auth; in ath10k_peer_assoc_h_basic()
2244 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_peer_assoc_h_rates() local
2262 ratemask &= arvif->bitrate_mask.control[band].legacy; in ath10k_peer_assoc_h_rates()
2307 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_peer_assoc_h_ht() local
2325 ht_mcs_mask = arvif->bitrate_mask.control[band].ht_mcs; in ath10k_peer_assoc_h_ht()
2326 vht_mcs_mask = arvif->bitrate_mask.control[band].vht_mcs; in ath10k_peer_assoc_h_ht()
2350 if (arvif->bitrate_mask.control[band].gi != NL80211_TXRATE_FORCE_LGI) { in ath10k_peer_assoc_h_ht()
2409 struct ath10k_vif *arvif, in ath10k_peer_assoc_qos_ap() argument
2438 ret = ath10k_wmi_set_ap_ps_param(ar, arvif->vdev_id, in ath10k_peer_assoc_qos_ap()
2444 arvif->vdev_id, ret); in ath10k_peer_assoc_qos_ap()
2448 ret = ath10k_wmi_set_ap_ps_param(ar, arvif->vdev_id, in ath10k_peer_assoc_qos_ap()
2454 arvif->vdev_id, ret); in ath10k_peer_assoc_qos_ap()
2463 ret = ath10k_wmi_set_ap_ps_param(ar, arvif->vdev_id, sta->addr, in ath10k_peer_assoc_qos_ap()
2468 arvif->vdev_id, ret); in ath10k_peer_assoc_qos_ap()
2557 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_peer_assoc_h_vht() local
2573 vht_mcs_mask = arvif->bitrate_mask.control[band].vht_mcs; in ath10k_peer_assoc_h_vht()
2664 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_peer_assoc_h_qos() local
2666 switch (arvif->vdev_type) { in ath10k_peer_assoc_h_qos()
2669 arg->peer_flags |= arvif->ar->wmi.peer_flags->qos; in ath10k_peer_assoc_h_qos()
2672 arg->peer_flags |= arvif->ar->wmi.peer_flags->apsd; in ath10k_peer_assoc_h_qos()
2678 arg->peer_flags |= arvif->ar->wmi.peer_flags->qos; in ath10k_peer_assoc_h_qos()
2682 arg->peer_flags |= arvif->ar->wmi.peer_flags->qos; in ath10k_peer_assoc_h_qos()
2690 arvif->ar->wmi.peer_flags->qos)); in ath10k_peer_assoc_h_qos()
2733 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_peer_assoc_h_phymode() local
2744 ht_mcs_mask = arvif->bitrate_mask.control[band].ht_mcs; in ath10k_peer_assoc_h_phymode()
2745 vht_mcs_mask = arvif->bitrate_mask.control[band].vht_mcs; in ath10k_peer_assoc_h_phymode()
2824 static int ath10k_setup_peer_smps(struct ath10k *ar, struct ath10k_vif *arvif, in ath10k_setup_peer_smps() argument
2839 return ath10k_wmi_peer_set_param(ar, arvif->vdev_id, addr, in ath10k_setup_peer_smps()
2848 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_vif_recalc_txbf() local
2899 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, param, value); in ath10k_mac_vif_recalc_txbf()
2911 struct ath10k_vif *arvif; in ath10k_mac_is_connected() local
2913 list_for_each_entry(arvif, &ar->arvifs, list) { in ath10k_mac_is_connected()
2914 if (arvif->is_up && arvif->vdev_type == WMI_VDEV_TYPE_STA) in ath10k_mac_is_connected()
2968 struct ath10k_vif *arvif; in ath10k_mac_txpower_recalc() local
2973 list_for_each_entry(arvif, &ar->arvifs, list) { in ath10k_mac_txpower_recalc()
2975 if (arvif->txpower == INT_MIN) in ath10k_mac_txpower_recalc()
2979 txpower = arvif->txpower; in ath10k_mac_txpower_recalc()
2981 txpower = min(txpower, arvif->txpower); in ath10k_mac_txpower_recalc()
3067 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_bss_assoc() local
3077 arvif->vdev_id, arvif->bssid, arvif->aid); in ath10k_bss_assoc()
3084 bss_conf->bssid, arvif->vdev_id); in ath10k_bss_assoc()
3098 bss_conf->bssid, arvif->vdev_id, ret); in ath10k_bss_assoc()
3108 bss_conf->bssid, arvif->vdev_id, ret); in ath10k_bss_assoc()
3112 ret = ath10k_setup_peer_smps(ar, arvif, bss_conf->bssid, &ht_cap); in ath10k_bss_assoc()
3115 arvif->vdev_id, ret); in ath10k_bss_assoc()
3122 arvif->vdev_id, bss_conf->bssid, ret); in ath10k_bss_assoc()
3128 arvif->vdev_id, bss_conf->bssid, vif->cfg.aid); in ath10k_bss_assoc()
3130 WARN_ON(arvif->is_up); in ath10k_bss_assoc()
3132 arvif->aid = vif->cfg.aid; in ath10k_bss_assoc()
3133 ether_addr_copy(arvif->bssid, bss_conf->bssid); in ath10k_bss_assoc()
3140 ret = ath10k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid); in ath10k_bss_assoc()
3143 arvif->vdev_id, ret); in ath10k_bss_assoc()
3147 arvif->is_up = true; in ath10k_bss_assoc()
3155 ret = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, arvif->bssid, in ath10k_bss_assoc()
3159 arvif->bssid, arvif->vdev_id, ret); in ath10k_bss_assoc()
3168 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_bss_disassoc() local
3175 arvif->vdev_id, arvif->bssid); in ath10k_bss_disassoc()
3177 ret = ath10k_wmi_vdev_down(ar, arvif->vdev_id); in ath10k_bss_disassoc()
3180 arvif->vdev_id, ret); in ath10k_bss_disassoc()
3182 arvif->def_wep_key_idx = -1; in ath10k_bss_disassoc()
3187 arvif->vdev_id, ret); in ath10k_bss_disassoc()
3191 arvif->is_up = false; in ath10k_bss_disassoc()
3195 cancel_delayed_work_sync(&arvif->connection_loss_work); in ath10k_bss_disassoc()
3200 struct ath10k_vif *arvif) in ath10k_new_peer_tid_config() argument
3209 if (arvif->retry_long[i] || arvif->ampdu[i] || in ath10k_new_peer_tid_config()
3210 arvif->rate_ctrl[i] || arvif->rtscts[i]) { in ath10k_new_peer_tid_config()
3213 arg.vdev_id = arvif->vdev_id; in ath10k_new_peer_tid_config()
3214 arg.retry_count = arvif->retry_long[i]; in ath10k_new_peer_tid_config()
3215 arg.aggr_control = arvif->ampdu[i]; in ath10k_new_peer_tid_config()
3216 arg.rate_ctrl = arvif->rate_ctrl[i]; in ath10k_new_peer_tid_config()
3217 arg.rcode_flags = arvif->rate_code[i]; in ath10k_new_peer_tid_config()
3219 if (arvif->rtscts[i]) in ath10k_new_peer_tid_config()
3225 arg.rtscts_ctrl = arvif->rtscts[i]; in ath10k_new_peer_tid_config()
3228 if (arvif->noack[i]) { in ath10k_new_peer_tid_config()
3229 arg.ack_policy = arvif->noack[i]; in ath10k_new_peer_tid_config()
3266 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_station_assoc() local
3275 sta->addr, arvif->vdev_id, ret); in ath10k_station_assoc()
3282 sta->addr, arvif->vdev_id, ret); in ath10k_station_assoc()
3290 ret = ath10k_setup_peer_smps(ar, arvif, sta->addr, in ath10k_station_assoc()
3294 arvif->vdev_id, ret); in ath10k_station_assoc()
3298 ret = ath10k_peer_assoc_qos_ap(ar, arvif, sta); in ath10k_station_assoc()
3301 sta->addr, arvif->vdev_id, ret); in ath10k_station_assoc()
3306 arvif->num_legacy_stations++; in ath10k_station_assoc()
3307 ret = ath10k_recalc_rtscts_prot(arvif); in ath10k_station_assoc()
3310 arvif->vdev_id, ret); in ath10k_station_assoc()
3316 if ((arvif->def_wep_key_idx != -1) && (!sta->tdls)) { in ath10k_station_assoc()
3317 ret = ath10k_install_peer_wep_keys(arvif, sta->addr); in ath10k_station_assoc()
3320 arvif->vdev_id, ret); in ath10k_station_assoc()
3329 return ath10k_new_peer_tid_config(ar, sta, arvif); in ath10k_station_assoc()
3336 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_station_disassoc() local
3342 arvif->num_legacy_stations--; in ath10k_station_disassoc()
3343 ret = ath10k_recalc_rtscts_prot(arvif); in ath10k_station_disassoc()
3346 arvif->vdev_id, ret); in ath10k_station_disassoc()
3351 ret = ath10k_clear_peer_keys(arvif, sta->addr); in ath10k_station_disassoc()
3354 arvif->vdev_id, ret); in ath10k_station_disassoc()
3599 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_tx_unlock_iter() local
3601 if (arvif->tx_paused) in ath10k_mac_tx_unlock_iter()
3604 ieee80211_wake_queue(ar->hw, arvif->vdev_id); in ath10k_mac_tx_unlock_iter()
3625 void ath10k_mac_vif_tx_lock(struct ath10k_vif *arvif, int reason) in ath10k_mac_vif_tx_lock() argument
3627 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_tx_lock()
3632 arvif->tx_paused |= BIT(reason); in ath10k_mac_vif_tx_lock()
3633 ieee80211_stop_queue(ar->hw, arvif->vdev_id); in ath10k_mac_vif_tx_lock()
3636 void ath10k_mac_vif_tx_unlock(struct ath10k_vif *arvif, int reason) in ath10k_mac_vif_tx_unlock() argument
3638 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_tx_unlock()
3643 arvif->tx_paused &= ~BIT(reason); in ath10k_mac_vif_tx_unlock()
3648 if (arvif->tx_paused) in ath10k_mac_vif_tx_unlock()
3651 ieee80211_wake_queue(ar->hw, arvif->vdev_id); in ath10k_mac_vif_tx_unlock()
3654 static void ath10k_mac_vif_handle_tx_pause(struct ath10k_vif *arvif, in ath10k_mac_vif_handle_tx_pause() argument
3658 struct ath10k *ar = arvif->ar; in ath10k_mac_vif_handle_tx_pause()
3664 ath10k_mac_vif_tx_lock(arvif, pause_id); in ath10k_mac_vif_handle_tx_pause()
3667 ath10k_mac_vif_tx_unlock(arvif, pause_id); in ath10k_mac_vif_handle_tx_pause()
3672 action, arvif->vdev_id); in ath10k_mac_vif_handle_tx_pause()
3686 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_handle_tx_pause_iter() local
3689 if (arvif->vdev_id != arg->vdev_id) in ath10k_mac_handle_tx_pause_iter()
3692 ath10k_mac_vif_handle_tx_pause(arvif, arg->pause_id, arg->action); in ath10k_mac_handle_tx_pause_iter()
3852 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_tx_h_add_p2p_noa_ie() local
3860 if (arvif->u.ap.noa_data) in ath10k_tx_h_add_p2p_noa_ie()
3861 if (!pskb_expand_head(skb, 0, arvif->u.ap.noa_len, in ath10k_tx_h_add_p2p_noa_ie()
3863 skb_put_data(skb, arvif->u.ap.noa_data, in ath10k_tx_h_add_p2p_noa_ie()
3864 arvif->u.ap.noa_len); in ath10k_tx_h_add_p2p_noa_ie()
3880 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_tx_h_fill_cb() local
3903 if (arvif->noack[tid] == WMI_PEER_TID_CONFIG_NOACK) in ath10k_mac_tx_h_fill_cb()
4106 struct ath10k_vif *arvif; in ath10k_offchan_tx_work() local
4167 arvif = ath10k_get_arvif(ar, vdev_id); in ath10k_offchan_tx_work()
4168 if (arvif) { in ath10k_offchan_tx_work()
4169 vif = arvif->vif; in ath10k_offchan_tx_work()
4775 struct ath10k_vif *arvif; in ath10k_halt() local
4797 list_for_each_entry(arvif, &ar->arvifs, list) in ath10k_halt()
4798 ath10k_mac_vif_beacon_cleanup(arvif); in ath10k_halt()
5403 struct ath10k_vif *arvif; in ath10k_config_ps() local
5408 list_for_each_entry(arvif, &ar->arvifs, list) { in ath10k_config_ps()
5409 ret = ath10k_mac_vif_setup_ps(arvif); in ath10k_config_ps()
5452 static int ath10k_mac_set_txbf_conf(struct ath10k_vif *arvif) in ath10k_mac_set_txbf_conf() argument
5455 struct ath10k *ar = arvif->ar; in ath10k_mac_set_txbf_conf()
5489 return ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, in ath10k_mac_set_txbf_conf()
5496 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_update_vif_offload() local
5508 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_update_vif_offload()
5513 arvif->vdev_id, ret); in ath10k_update_vif_offload()
5528 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_add_interface() local
5541 memset(arvif, 0, sizeof(*arvif)); in ath10k_add_interface()
5544 arvif->ar = ar; in ath10k_add_interface()
5545 arvif->vif = vif; in ath10k_add_interface()
5547 INIT_LIST_HEAD(&arvif->list); in ath10k_add_interface()
5548 INIT_WORK(&arvif->ap_csa_work, ath10k_mac_vif_ap_csa_work); in ath10k_add_interface()
5549 INIT_DELAYED_WORK(&arvif->connection_loss_work, in ath10k_add_interface()
5552 for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { in ath10k_add_interface()
5553 arvif->bitrate_mask.control[i].legacy = 0xffffffff; in ath10k_add_interface()
5554 memset(arvif->bitrate_mask.control[i].ht_mcs, 0xff, in ath10k_add_interface()
5555 sizeof(arvif->bitrate_mask.control[i].ht_mcs)); in ath10k_add_interface()
5556 memset(arvif->bitrate_mask.control[i].vht_mcs, 0xff, in ath10k_add_interface()
5557 sizeof(arvif->bitrate_mask.control[i].vht_mcs)); in ath10k_add_interface()
5576 arvif->vdev_id = bit; in ath10k_add_interface()
5577 arvif->vdev_subtype = in ath10k_add_interface()
5582 arvif->vdev_type = WMI_VDEV_TYPE_STA; in ath10k_add_interface()
5583 arvif->vdev_subtype = ath10k_wmi_get_vdev_subtype in ath10k_add_interface()
5588 arvif->vdev_type = WMI_VDEV_TYPE_STA; in ath10k_add_interface()
5590 arvif->vdev_subtype = ath10k_wmi_get_vdev_subtype in ath10k_add_interface()
5594 arvif->vdev_type = WMI_VDEV_TYPE_IBSS; in ath10k_add_interface()
5598 arvif->vdev_subtype = ath10k_wmi_get_vdev_subtype in ath10k_add_interface()
5605 arvif->vdev_type = WMI_VDEV_TYPE_AP; in ath10k_add_interface()
5608 arvif->vdev_type = WMI_VDEV_TYPE_AP; in ath10k_add_interface()
5611 arvif->vdev_subtype = ath10k_wmi_get_vdev_subtype in ath10k_add_interface()
5615 arvif->vdev_type = WMI_VDEV_TYPE_MONITOR; in ath10k_add_interface()
5627 vif->cab_queue = arvif->vdev_id % (IEEE80211_MAX_QUEUES - 1); in ath10k_add_interface()
5629 vif->hw_queue[i] = arvif->vdev_id % (IEEE80211_MAX_QUEUES - 1); in ath10k_add_interface()
5651 arvif->beacon_buf = kmalloc(IEEE80211_MAX_FRAME_LEN, in ath10k_add_interface()
5661 arvif->beacon_paddr = DMA_MAPPING_ERROR; in ath10k_add_interface()
5663 arvif->beacon_buf = in ath10k_add_interface()
5666 &arvif->beacon_paddr, in ath10k_add_interface()
5669 if (!arvif->beacon_buf) { in ath10k_add_interface()
5677 arvif->nohwcrypt = true; in ath10k_add_interface()
5679 if (arvif->nohwcrypt && in ath10k_add_interface()
5687 arvif->vdev_id, arvif->vdev_type, arvif->vdev_subtype, in ath10k_add_interface()
5688 arvif->beacon_buf ? "single-buf" : "per-skb"); in ath10k_add_interface()
5690 ret = ath10k_wmi_vdev_create(ar, arvif->vdev_id, arvif->vdev_type, in ath10k_add_interface()
5691 arvif->vdev_subtype, vif->addr); in ath10k_add_interface()
5694 arvif->vdev_id, ret); in ath10k_add_interface()
5701 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_add_interface()
5705 arvif->vdev_id, ret); in ath10k_add_interface()
5709 ar->free_vdev_map &= ~(1LL << arvif->vdev_id); in ath10k_add_interface()
5711 list_add(&arvif->list, &ar->arvifs); in ath10k_add_interface()
5717 ret = ath10k_mac_vif_disable_keepalive(arvif); in ath10k_add_interface()
5720 arvif->vdev_id, ret); in ath10k_add_interface()
5724 arvif->def_wep_key_idx = -1; in ath10k_add_interface()
5735 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_add_interface()
5739 arvif->vdev_id, ar->cfg_tx_chainmask, nss, in ath10k_add_interface()
5745 if (arvif->vdev_type == WMI_VDEV_TYPE_AP || in ath10k_add_interface()
5746 arvif->vdev_type == WMI_VDEV_TYPE_IBSS) { in ath10k_add_interface()
5747 ret = ath10k_peer_create(ar, vif, NULL, arvif->vdev_id, in ath10k_add_interface()
5751 arvif->vdev_id, ret); in ath10k_add_interface()
5757 peer = ath10k_peer_find(ar, arvif->vdev_id, vif->addr); in ath10k_add_interface()
5760 vif->addr, arvif->vdev_id); in ath10k_add_interface()
5766 arvif->peer_id = find_first_bit(peer->peer_ids, in ath10k_add_interface()
5771 arvif->peer_id = HTT_INVALID_PEERID; in ath10k_add_interface()
5774 if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { in ath10k_add_interface()
5775 ret = ath10k_mac_set_kickout(arvif); in ath10k_add_interface()
5778 arvif->vdev_id, ret); in ath10k_add_interface()
5783 if (arvif->vdev_type == WMI_VDEV_TYPE_STA) { in ath10k_add_interface()
5786 ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, in ath10k_add_interface()
5790 arvif->vdev_id, ret); in ath10k_add_interface()
5794 ret = ath10k_mac_vif_recalc_ps_wake_threshold(arvif); in ath10k_add_interface()
5797 arvif->vdev_id, ret); in ath10k_add_interface()
5801 ret = ath10k_mac_vif_recalc_ps_poll_count(arvif); in ath10k_add_interface()
5804 arvif->vdev_id, ret); in ath10k_add_interface()
5809 ret = ath10k_mac_set_txbf_conf(arvif); in ath10k_add_interface()
5812 arvif->vdev_id, ret); in ath10k_add_interface()
5816 ret = ath10k_mac_set_rts(arvif, ar->hw->wiphy->rts_threshold); in ath10k_add_interface()
5819 arvif->vdev_id, ret); in ath10k_add_interface()
5823 arvif->txpower = vif->bss_conf.txpower; in ath10k_add_interface()
5832 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_add_interface()
5833 arvif->ftm_responder); in ath10k_add_interface()
5838 arvif->vdev_id, ret); in ath10k_add_interface()
5842 ar->monitor_arvif = arvif; in ath10k_add_interface()
5852 ieee80211_wake_queue(ar->hw, arvif->vdev_id); in ath10k_add_interface()
5859 if (arvif->vdev_type == WMI_VDEV_TYPE_AP || in ath10k_add_interface()
5860 arvif->vdev_type == WMI_VDEV_TYPE_IBSS) { in ath10k_add_interface()
5861 ath10k_wmi_peer_delete(ar, arvif->vdev_id, vif->addr); in ath10k_add_interface()
5862 ath10k_wait_for_peer_delete_done(ar, arvif->vdev_id, in ath10k_add_interface()
5867 ath10k_wmi_vdev_delete(ar, arvif->vdev_id); in ath10k_add_interface()
5868 ar->free_vdev_map |= 1LL << arvif->vdev_id; in ath10k_add_interface()
5870 list_del(&arvif->list); in ath10k_add_interface()
5874 if (arvif->beacon_buf) { in ath10k_add_interface()
5876 kfree(arvif->beacon_buf); in ath10k_add_interface()
5879 arvif->beacon_buf, in ath10k_add_interface()
5880 arvif->beacon_paddr); in ath10k_add_interface()
5881 arvif->beacon_buf = NULL; in ath10k_add_interface()
5889 static void ath10k_mac_vif_tx_unlock_all(struct ath10k_vif *arvif) in ath10k_mac_vif_tx_unlock_all() argument
5894 ath10k_mac_vif_tx_unlock(arvif, i); in ath10k_mac_vif_tx_unlock_all()
5901 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_remove_interface() local
5907 cancel_work_sync(&arvif->ap_csa_work); in ath10k_remove_interface()
5908 cancel_delayed_work_sync(&arvif->connection_loss_work); in ath10k_remove_interface()
5912 ret = ath10k_spectral_vif_stop(arvif); in ath10k_remove_interface()
5915 arvif->vdev_id, ret); in ath10k_remove_interface()
5917 ar->free_vdev_map |= 1LL << arvif->vdev_id; in ath10k_remove_interface()
5919 list_del(&arvif->list); in ath10k_remove_interface()
5922 if (arvif->vdev_type == WMI_VDEV_TYPE_AP || in ath10k_remove_interface()
5923 arvif->vdev_type == WMI_VDEV_TYPE_IBSS) { in ath10k_remove_interface()
5924 ret = ath10k_wmi_peer_delete(arvif->ar, arvif->vdev_id, in ath10k_remove_interface()
5928 arvif->vdev_id, ret); in ath10k_remove_interface()
5930 ath10k_wait_for_peer_delete_done(ar, arvif->vdev_id, in ath10k_remove_interface()
5932 kfree(arvif->u.ap.noa_data); in ath10k_remove_interface()
5936 arvif->vdev_id); in ath10k_remove_interface()
5938 ret = ath10k_wmi_vdev_delete(ar, arvif->vdev_id); in ath10k_remove_interface()
5941 arvif->vdev_id, ret); in ath10k_remove_interface()
5955 if (arvif->vdev_type == WMI_VDEV_TYPE_AP || in ath10k_remove_interface()
5956 arvif->vdev_type == WMI_VDEV_TYPE_IBSS) { in ath10k_remove_interface()
5957 ret = ath10k_wait_for_peer_deleted(ar, arvif->vdev_id, in ath10k_remove_interface()
5961 arvif->vdev_id, ret); in ath10k_remove_interface()
5976 vif->addr, arvif->vdev_id); in ath10k_remove_interface()
5984 ath10k_mac_vif_beacon_cleanup(arvif); in ath10k_remove_interface()
5987 ath10k_peer_cleanup(ar, arvif->vdev_id); in ath10k_remove_interface()
6002 ath10k_mac_vif_tx_unlock_all(arvif); in ath10k_remove_interface()
6048 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_recalculate_mgmt_rate() local
6069 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_recalculate_mgmt_rate()
6081 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_bss_info_changed() local
6092 ath10k_control_ibss(arvif, vif); in ath10k_bss_info_changed()
6095 arvif->beacon_interval = info->beacon_int; in ath10k_bss_info_changed()
6097 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_bss_info_changed()
6098 arvif->beacon_interval); in ath10k_bss_info_changed()
6101 arvif->vdev_id, arvif->beacon_interval); in ath10k_bss_info_changed()
6105 arvif->vdev_id, ret); in ath10k_bss_info_changed()
6111 arvif->vdev_id); in ath10k_bss_info_changed()
6118 arvif->vdev_id, ret); in ath10k_bss_info_changed()
6120 ret = ath10k_mac_setup_bcn_tmpl(arvif); in ath10k_bss_info_changed()
6127 strncpy(arvif->u.ap.ssid, "mesh", in ath10k_bss_info_changed()
6128 sizeof(arvif->u.ap.ssid)); in ath10k_bss_info_changed()
6129 arvif->u.ap.ssid_len = 4; in ath10k_bss_info_changed()
6134 ret = ath10k_mac_setup_prb_tmpl(arvif); in ath10k_bss_info_changed()
6137 arvif->vdev_id, ret); in ath10k_bss_info_changed()
6141 arvif->dtim_period = info->dtim_period; in ath10k_bss_info_changed()
6145 arvif->vdev_id, arvif->dtim_period); in ath10k_bss_info_changed()
6148 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_bss_info_changed()
6149 arvif->dtim_period); in ath10k_bss_info_changed()
6152 arvif->vdev_id, ret); in ath10k_bss_info_changed()
6157 arvif->u.ap.ssid_len = vif->cfg.ssid_len; in ath10k_bss_info_changed()
6159 memcpy(arvif->u.ap.ssid, vif->cfg.ssid, in ath10k_bss_info_changed()
6161 arvif->u.ap.hidden_ssid = info->hidden_ssid; in ath10k_bss_info_changed()
6165 ether_addr_copy(arvif->bssid, info->bssid); in ath10k_bss_info_changed()
6168 arvif->ftm_responder != info->ftm_responder && in ath10k_bss_info_changed()
6170 arvif->ftm_responder = info->ftm_responder; in ath10k_bss_info_changed()
6173 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_bss_info_changed()
6174 arvif->ftm_responder); in ath10k_bss_info_changed()
6178 arvif->vdev_id, arvif->ftm_responder, ret); in ath10k_bss_info_changed()
6182 ath10k_control_beaconing(arvif, info); in ath10k_bss_info_changed()
6185 arvif->use_cts_prot = info->use_cts_prot; in ath10k_bss_info_changed()
6187 ret = ath10k_recalc_rtscts_prot(arvif); in ath10k_bss_info_changed()
6190 arvif->vdev_id, ret); in ath10k_bss_info_changed()
6192 if (ath10k_mac_can_set_cts_prot(arvif)) { in ath10k_bss_info_changed()
6193 ret = ath10k_mac_set_cts_prot(arvif); in ath10k_bss_info_changed()
6196 arvif->vdev_id, ret); in ath10k_bss_info_changed()
6208 arvif->vdev_id, slottime); in ath10k_bss_info_changed()
6211 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_bss_info_changed()
6215 arvif->vdev_id, ret); in ath10k_bss_info_changed()
6226 arvif->vdev_id, preamble); in ath10k_bss_info_changed()
6229 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_bss_info_changed()
6233 arvif->vdev_id, ret); in ath10k_bss_info_changed()
6253 arvif->vdev_id, info->txpower); in ath10k_bss_info_changed()
6255 arvif->txpower = info->txpower; in ath10k_bss_info_changed()
6262 arvif->ps = vif->cfg.ps; in ath10k_bss_info_changed()
6267 arvif->vdev_id, ret); in ath10k_bss_info_changed()
6271 !ath10k_mac_vif_chan(arvif->vif, &def)) { in ath10k_bss_info_changed()
6293 arvif->vdev_id, rate); in ath10k_bss_info_changed()
6296 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, in ath10k_bss_info_changed()
6301 arvif->vdev_id, ret); in ath10k_bss_info_changed()
6304 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, in ath10k_bss_info_changed()
6309 arvif->vdev_id, ret); in ath10k_bss_info_changed()
6313 !ath10k_mac_vif_chan(arvif->vif, &def)) in ath10k_bss_info_changed()
6343 struct ieee80211_vif *sta_vif = arsta->arvif->vif; in ath10k_mac_tdls_vif_stations_count_iter()
6367 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_hw_scan() local
6388 ar->scan.vdev_id = arvif->vdev_id; in ath10k_hw_scan()
6404 arg.vdev_id = arvif->vdev_id; in ath10k_hw_scan()
6480 struct ath10k_vif *arvif, in ath10k_set_key_h_def_keyidx() argument
6484 u32 vdev_param = arvif->ar->wmi.vdev_param->def_keyid; in ath10k_set_key_h_def_keyidx()
6498 if (arvif->vdev_type != WMI_VDEV_TYPE_AP && in ath10k_set_key_h_def_keyidx()
6499 arvif->vdev_type != WMI_VDEV_TYPE_IBSS) in ath10k_set_key_h_def_keyidx()
6514 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, in ath10k_set_key_h_def_keyidx()
6518 arvif->vdev_id, ret); in ath10k_set_key_h_def_keyidx()
6526 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_set_key() local
6544 if (arvif->nohwcrypt) in ath10k_set_key()
6558 } else if (arvif->vdev_type == WMI_VDEV_TYPE_STA) { in ath10k_set_key()
6568 arvif->wep_keys[key->keyidx] = key; in ath10k_set_key()
6570 arvif->wep_keys[key->keyidx] = NULL; in ath10k_set_key()
6577 peer = ath10k_peer_find(ar, arvif->vdev_id, peer_addr); in ath10k_set_key()
6599 ath10k_clear_vdev_key(arvif, key); in ath10k_set_key()
6607 ath10k_mac_vif_update_wep_key(arvif, key); in ath10k_set_key()
6615 if (cmd == SET_KEY && arvif->def_wep_key_idx == -1) in ath10k_set_key()
6619 ret = ath10k_install_key(arvif, key, cmd, peer_addr, flags); in ath10k_set_key()
6623 arvif->vdev_id, peer_addr, ret); in ath10k_set_key()
6635 ret = ath10k_install_key(arvif, key, cmd, peer_addr, flags2); in ath10k_set_key()
6639 arvif->vdev_id, peer_addr, ret); in ath10k_set_key()
6640 ret2 = ath10k_install_key(arvif, key, DISABLE_KEY, in ath10k_set_key()
6645 arvif->vdev_id, peer_addr, ret2); in ath10k_set_key()
6651 ath10k_set_key_h_def_keyidx(ar, arvif, cmd, key); in ath10k_set_key()
6654 peer = ath10k_peer_find(ar, arvif->vdev_id, peer_addr); in ath10k_set_key()
6665 ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, in ath10k_set_key()
6668 ath10k_wmi_peer_set_param(ar, arvif->vdev_id, peer_addr, in ath10k_set_key()
6681 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_set_default_unicast_key() local
6684 mutex_lock(&arvif->ar->conf_mutex); in ath10k_set_default_unicast_key()
6686 if (arvif->ar->state != ATH10K_STATE_ON) in ath10k_set_default_unicast_key()
6690 arvif->vdev_id, keyidx); in ath10k_set_default_unicast_key()
6692 ret = ath10k_wmi_vdev_set_param(arvif->ar, in ath10k_set_default_unicast_key()
6693 arvif->vdev_id, in ath10k_set_default_unicast_key()
6694 arvif->ar->wmi.vdev_param->def_keyid, in ath10k_set_default_unicast_key()
6699 arvif->vdev_id, in ath10k_set_default_unicast_key()
6704 arvif->def_wep_key_idx = keyidx; in ath10k_set_default_unicast_key()
6707 mutex_unlock(&arvif->ar->conf_mutex); in ath10k_set_default_unicast_key()
6713 struct ath10k_vif *arvif; in ath10k_sta_rc_update_wk() local
6725 arvif = arsta->arvif; in ath10k_sta_rc_update_wk()
6726 ar = arvif->ar; in ath10k_sta_rc_update_wk()
6728 if (WARN_ON(ath10k_mac_vif_chan(arvif->vif, &def))) in ath10k_sta_rc_update_wk()
6732 ht_mcs_mask = arvif->bitrate_mask.control[band].ht_mcs; in ath10k_sta_rc_update_wk()
6733 vht_mcs_mask = arvif->bitrate_mask.control[band].vht_mcs; in ath10k_sta_rc_update_wk()
6759 err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, in ath10k_sta_rc_update_wk()
6767 err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, in ath10k_sta_rc_update_wk()
6778 err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, in ath10k_sta_rc_update_wk()
6789 err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, in ath10k_sta_rc_update_wk()
6800 err = ath10k_station_assoc(ar, arvif->vif, sta, true); in ath10k_sta_rc_update_wk()
6810 static int ath10k_mac_inc_num_stations(struct ath10k_vif *arvif, in ath10k_mac_inc_num_stations() argument
6813 struct ath10k *ar = arvif->ar; in ath10k_mac_inc_num_stations()
6817 if (arvif->vdev_type == WMI_VDEV_TYPE_STA && !sta->tdls) in ath10k_mac_inc_num_stations()
6828 static void ath10k_mac_dec_num_stations(struct ath10k_vif *arvif, in ath10k_mac_dec_num_stations() argument
6831 struct ath10k *ar = arvif->ar; in ath10k_mac_dec_num_stations()
6835 if (arvif->vdev_type == WMI_VDEV_TYPE_STA && !sta->tdls) in ath10k_mac_dec_num_stations()
6846 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_sta_set_txpwr() local
6863 ret = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, in ath10k_sta_set_txpwr()
7060 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_set_tid_config() local
7086 arvif->noack[arg->tid] == WMI_PEER_TID_CONFIG_NOACK) { in ath10k_mac_set_tid_config()
7095 arvif->noack[arg->tid] == WMI_PEER_TID_CONFIG_NOACK) { in ath10k_mac_set_tid_config()
7139 if ((arvif->retry_long[arg->tid] || in ath10k_mac_set_tid_config()
7140 arvif->rate_code[arg->tid] || in ath10k_mac_set_tid_config()
7141 arvif->ampdu[arg->tid] == in ath10k_mac_set_tid_config()
7146 arvif->noack[arg->tid] = arg->ack_policy; in ath10k_mac_set_tid_config()
7147 arvif->ampdu[arg->tid] = arg->aggr_control; in ath10k_mac_set_tid_config()
7148 arvif->rate_ctrl[arg->tid] = arg->rate_ctrl; in ath10k_mac_set_tid_config()
7153 if (arvif->noack[arg->tid] == WMI_PEER_TID_CONFIG_NOACK) in ath10k_mac_set_tid_config()
7156 arvif->retry_long[arg->tid] = arg->retry_count; in ath10k_mac_set_tid_config()
7160 if (arvif->noack[arg->tid] == WMI_PEER_TID_CONFIG_NOACK) in ath10k_mac_set_tid_config()
7163 arvif->ampdu[arg->tid] = arg->aggr_control; in ath10k_mac_set_tid_config()
7168 if (arvif->noack[arg->tid] == WMI_PEER_TID_CONFIG_NOACK) { in ath10k_mac_set_tid_config()
7172 arvif->rate_ctrl[arg->tid] = arg->rate_ctrl; in ath10k_mac_set_tid_config()
7173 arvif->rate_code[arg->tid] = arg->rcode_flags; in ath10k_mac_set_tid_config()
7178 arvif->rtscts[arg->tid] = arg->rtscts_ctrl; in ath10k_mac_set_tid_config()
7183 arvif->tid_conf_changed[arg->tid] |= changed; in ath10k_mac_set_tid_config()
7270 struct ath10k_vif *arvif, in ath10k_mac_reset_tid_config() argument
7277 arg.vdev_id = arvif->vdev_id; in ath10k_mac_reset_tid_config()
7298 if (!arvif->tids_rst) { in ath10k_mac_reset_tid_config()
7306 arvif->retry_long[i] = 0; in ath10k_mac_reset_tid_config()
7307 arvif->noack[i] = 0; in ath10k_mac_reset_tid_config()
7308 arvif->ampdu[i] = 0; in ath10k_mac_reset_tid_config()
7309 arvif->rate_code[i] = 0; in ath10k_mac_reset_tid_config()
7310 arvif->rate_ctrl[i] = 0; in ath10k_mac_reset_tid_config()
7311 arvif->rtscts[i] = 0; in ath10k_mac_reset_tid_config()
7325 struct ath10k_vif *arvif; in ath10k_sta_tid_cfg_wk() local
7334 arvif = arsta->arvif; in ath10k_sta_tid_cfg_wk()
7335 ar = arvif->ar; in ath10k_sta_tid_cfg_wk()
7339 if (arvif->tids_rst) { in ath10k_sta_tid_cfg_wk()
7340 ret = ath10k_mac_reset_tid_config(ar, sta, arvif, in ath10k_sta_tid_cfg_wk()
7341 arvif->tids_rst); in ath10k_sta_tid_cfg_wk()
7349 changed = arvif->tid_conf_changed[i]; in ath10k_sta_tid_cfg_wk()
7356 arg.ack_policy = arvif->noack[i]; in ath10k_sta_tid_cfg_wk()
7357 arg.aggr_control = arvif->ampdu[i]; in ath10k_sta_tid_cfg_wk()
7358 arg.rate_ctrl = arvif->rate_ctrl[i]; in ath10k_sta_tid_cfg_wk()
7365 arvif->noack[i] == WMI_PEER_TID_CONFIG_NOACK) { in ath10k_sta_tid_cfg_wk()
7368 arg.retry_count = arvif->retry_long[i]; in ath10k_sta_tid_cfg_wk()
7376 arvif->noack[i] == WMI_PEER_TID_CONFIG_NOACK) { in ath10k_sta_tid_cfg_wk()
7379 arg.aggr_control = arvif->ampdu[i]; in ath10k_sta_tid_cfg_wk()
7386 nss = ATH10K_HW_NSS(arvif->rate_code[i]); in ath10k_sta_tid_cfg_wk()
7388 arvif->rate_code[i], in ath10k_sta_tid_cfg_wk()
7391 arvif->rate_ctrl[i] > WMI_TID_CONFIG_RATE_CONTROL_AUTO) { in ath10k_sta_tid_cfg_wk()
7399 arvif->noack[i] == WMI_PEER_TID_CONFIG_NOACK) { in ath10k_sta_tid_cfg_wk()
7403 arg.rate_ctrl = arvif->rate_ctrl[i]; in ath10k_sta_tid_cfg_wk()
7404 arg.rcode_flags = arvif->rate_code[i]; in ath10k_sta_tid_cfg_wk()
7414 arg.rtscts_ctrl = arvif->rtscts[i] - 1; in ath10k_sta_tid_cfg_wk()
7446 struct ieee80211_vif *sta_vif = arsta->arvif->vif; in ath10k_mac_vif_stations_tid_conf()
7461 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_sta_state() local
7470 arsta->arvif = arvif; in ath10k_sta_state()
7498 arvif->vdev_id, sta->addr, in ath10k_sta_state()
7507 arvif->vdev_id, in ath10k_sta_state()
7515 ret = ath10k_mac_inc_num_stations(arvif, sta); in ath10k_sta_state()
7526 ath10k_mac_dec_num_stations(arvif, sta); in ath10k_sta_state()
7532 ret = ath10k_peer_create(ar, vif, sta, arvif->vdev_id, in ath10k_sta_state()
7536 sta->addr, arvif->vdev_id, ret); in ath10k_sta_state()
7537 ath10k_mac_dec_num_stations(arvif, sta); in ath10k_sta_state()
7544 peer = ath10k_peer_find(ar, arvif->vdev_id, sta->addr); in ath10k_sta_state()
7547 vif->addr, arvif->vdev_id); in ath10k_sta_state()
7549 ath10k_peer_delete(ar, arvif->vdev_id, sta->addr); in ath10k_sta_state()
7550 ath10k_mac_dec_num_stations(arvif, sta); in ath10k_sta_state()
7564 ret = ath10k_wmi_update_fw_tdls_state(ar, arvif->vdev_id, in ath10k_sta_state()
7568 arvif->vdev_id, ret); in ath10k_sta_state()
7569 ath10k_peer_delete(ar, arvif->vdev_id, in ath10k_sta_state()
7571 ath10k_mac_dec_num_stations(arvif, sta); in ath10k_sta_state()
7576 ret = ath10k_mac_tdls_peer_update(ar, arvif->vdev_id, sta, in ath10k_sta_state()
7581 sta->addr, arvif->vdev_id, ret); in ath10k_sta_state()
7582 ath10k_peer_delete(ar, arvif->vdev_id, sta->addr); in ath10k_sta_state()
7583 ath10k_mac_dec_num_stations(arvif, sta); in ath10k_sta_state()
7588 ath10k_wmi_update_fw_tdls_state(ar, arvif->vdev_id, in ath10k_sta_state()
7598 arvif->vdev_id, sta->addr, sta); in ath10k_sta_state()
7601 ret = ath10k_mac_tdls_peer_update(ar, arvif->vdev_id, in ath10k_sta_state()
7610 ret = ath10k_peer_delete(ar, arvif->vdev_id, sta->addr); in ath10k_sta_state()
7613 sta->addr, arvif->vdev_id, ret); in ath10k_sta_state()
7615 ath10k_mac_dec_num_stations(arvif, sta); in ath10k_sta_state()
7625 sta->addr, peer, i, arvif->vdev_id); in ath10k_sta_state()
7651 ret = ath10k_wmi_update_fw_tdls_state(ar, arvif->vdev_id, in ath10k_sta_state()
7655 arvif->vdev_id, ret); in ath10k_sta_state()
7671 sta->addr, arvif->vdev_id, ret); in ath10k_sta_state()
7684 sta->addr, arvif->vdev_id, ret); in ath10k_sta_state()
7688 ret = ath10k_mac_tdls_peer_update(ar, arvif->vdev_id, sta, in ath10k_sta_state()
7692 sta->addr, arvif->vdev_id, ret); in ath10k_sta_state()
7707 sta->addr, arvif->vdev_id, ret); in ath10k_sta_state()
7717 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_conf_tx_uapsd() local
7725 if (arvif->vdev_type != WMI_VDEV_TYPE_STA) in ath10k_conf_tx_uapsd()
7756 arvif->u.sta.uapsd |= value; in ath10k_conf_tx_uapsd()
7758 arvif->u.sta.uapsd &= ~value; in ath10k_conf_tx_uapsd()
7760 ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, in ath10k_conf_tx_uapsd()
7762 arvif->u.sta.uapsd); in ath10k_conf_tx_uapsd()
7768 if (arvif->u.sta.uapsd) in ath10k_conf_tx_uapsd()
7773 ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, in ath10k_conf_tx_uapsd()
7779 ret = ath10k_mac_vif_recalc_ps_wake_threshold(arvif); in ath10k_conf_tx_uapsd()
7782 arvif->vdev_id, ret); in ath10k_conf_tx_uapsd()
7786 ret = ath10k_mac_vif_recalc_ps_poll_count(arvif); in ath10k_conf_tx_uapsd()
7789 arvif->vdev_id, ret); in ath10k_conf_tx_uapsd()
7807 ret = ath10k_wmi_vdev_sta_uapsd(ar, arvif->vdev_id, in ath10k_conf_tx_uapsd()
7808 arvif->bssid, &arg, 1); in ath10k_conf_tx_uapsd()
7826 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_conf_tx() local
7834 p = &arvif->wmm_params.ac_vo; in ath10k_conf_tx()
7837 p = &arvif->wmm_params.ac_vi; in ath10k_conf_tx()
7840 p = &arvif->wmm_params.ac_be; in ath10k_conf_tx()
7843 p = &arvif->wmm_params.ac_bk; in ath10k_conf_tx()
7864 ret = ath10k_wmi_vdev_wmm_conf(ar, arvif->vdev_id, in ath10k_conf_tx()
7865 &arvif->wmm_params); in ath10k_conf_tx()
7868 arvif->vdev_id, ret); in ath10k_conf_tx()
7875 ret = ath10k_wmi_pdev_set_wmm_params(ar, &arvif->wmm_params); in ath10k_conf_tx()
7898 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_remain_on_channel() local
7918 ar->scan.vdev_id = arvif->vdev_id; in ath10k_remain_on_channel()
7938 arg.vdev_id = arvif->vdev_id; in ath10k_remain_on_channel()
8007 struct ath10k_vif *arvif; in ath10k_set_rts_threshold() local
8011 list_for_each_entry(arvif, &ar->arvifs, list) { in ath10k_set_rts_threshold()
8013 arvif->vdev_id, value); in ath10k_set_rts_threshold()
8015 ret = ath10k_mac_set_rts(arvif, value); in ath10k_set_rts_threshold()
8018 arvif->vdev_id, ret); in ath10k_set_rts_threshold()
8077 struct ath10k_vif *arvif; in ath10k_flush() local
8083 list_for_each_entry(arvif, &ar->arvifs, list) { in ath10k_flush()
8084 if (arvif->vdev_type == WMI_VDEV_TYPE_STA) in ath10k_flush()
8085 ath10k_wmi_peer_flush(ar, arvif->vdev_id, in ath10k_flush()
8086 arvif->bssid, bitmap); in ath10k_flush()
8252 static int ath10k_mac_set_fixed_rate_params(struct ath10k_vif *arvif, in ath10k_mac_set_fixed_rate_params() argument
8255 struct ath10k *ar = arvif->ar; in ath10k_mac_set_fixed_rate_params()
8262 arvif->vdev_id, rate, nss, sgi); in ath10k_mac_set_fixed_rate_params()
8265 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, rate); in ath10k_mac_set_fixed_rate_params()
8273 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, nss); in ath10k_mac_set_fixed_rate_params()
8280 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, sgi); in ath10k_mac_set_fixed_rate_params()
8287 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, ldpc); in ath10k_mac_set_fixed_rate_params()
8329 struct ath10k_vif *arvif, in ath10k_mac_set_vht_bitrate_mask_fixup() argument
8333 u8 rate = arvif->vht_pfr; in ath10k_mac_set_vht_bitrate_mask_fixup()
8336 if (!sta->deflink.vht_cap.vht_supported || arvif->vht_num_rates != 1) in ath10k_mac_set_vht_bitrate_mask_fixup()
8339 err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, in ath10k_mac_set_vht_bitrate_mask_fixup()
8351 struct ath10k_vif *arvif = data; in ath10k_mac_set_bitrate_mask_iter() local
8353 struct ath10k *ar = arvif->ar; in ath10k_mac_set_bitrate_mask_iter()
8355 if (arsta->arvif != arvif) in ath10k_mac_set_bitrate_mask_iter()
8358 if (ath10k_mac_set_vht_bitrate_mask_fixup(ar, arvif, sta)) in ath10k_mac_set_bitrate_mask_iter()
8371 struct ath10k_vif *arvif = data; in ath10k_mac_clr_bitrate_mask_iter() local
8373 struct ath10k *ar = arvif->ar; in ath10k_mac_clr_bitrate_mask_iter()
8377 if (arsta->arvif != arvif || !sta->deflink.vht_cap.vht_supported) in ath10k_mac_clr_bitrate_mask_iter()
8380 err = ath10k_wmi_peer_set_param(ar, arvif->vdev_id, sta->addr, in ath10k_mac_clr_bitrate_mask_iter()
8392 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_op_set_bitrate_mask() local
8394 struct ath10k *ar = arvif->ar; in ath10k_mac_op_set_bitrate_mask()
8426 arvif); in ath10k_mac_op_set_bitrate_mask()
8437 arvif->vdev_id, ret); in ath10k_mac_op_set_bitrate_mask()
8473 arvif->bitrate_mask = *mask; in ath10k_mac_op_set_bitrate_mask()
8474 arvif->vht_num_rates = vht_num_rates; in ath10k_mac_op_set_bitrate_mask()
8475 arvif->vht_pfr = vht_pfr; in ath10k_mac_op_set_bitrate_mask()
8478 arvif); in ath10k_mac_op_set_bitrate_mask()
8485 ret = ath10k_mac_set_fixed_rate_params(arvif, rate, nss, sgi, ldpc); in ath10k_mac_op_set_bitrate_mask()
8488 arvif->vdev_id, ret); in ath10k_mac_op_set_bitrate_mask()
8505 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_sta_rc_update() local
8511 peer = ath10k_peer_find(ar, arvif->vdev_id, sta->addr); in ath10k_sta_rc_update()
8515 sta->addr, arvif->vdev_id); in ath10k_sta_rc_update()
8589 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_offset_tsf() local
8601 ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, in ath10k_offset_tsf()
8614 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_ampdu_action() local
8620 arvif->vdev_id, sta->addr, tid, action); in ath10k_ampdu_action()
8699 struct ath10k_vif *arvif; in ath10k_mac_update_vif_chan() local
8712 arvif = (void *)vifs[i].vif->drv_priv; in ath10k_mac_update_vif_chan()
8716 arvif->vdev_id, in ath10k_mac_update_vif_chan()
8722 if (WARN_ON(!arvif->is_started)) in ath10k_mac_update_vif_chan()
8725 if (WARN_ON(!arvif->is_up)) in ath10k_mac_update_vif_chan()
8728 ret = ath10k_wmi_vdev_down(ar, arvif->vdev_id); in ath10k_mac_update_vif_chan()
8731 arvif->vdev_id, ret); in ath10k_mac_update_vif_chan()
8745 arvif = (void *)vifs[i].vif->drv_priv; in ath10k_mac_update_vif_chan()
8747 if (WARN_ON(!arvif->is_started)) in ath10k_mac_update_vif_chan()
8750 if (WARN_ON(!arvif->is_up)) in ath10k_mac_update_vif_chan()
8753 ret = ath10k_mac_setup_bcn_tmpl(arvif); in ath10k_mac_update_vif_chan()
8758 ret = ath10k_mac_setup_prb_tmpl(arvif); in ath10k_mac_update_vif_chan()
8763 ret = ath10k_vdev_restart(arvif, &vifs[i].new_ctx->def); in ath10k_mac_update_vif_chan()
8766 arvif->vdev_id, ret); in ath10k_mac_update_vif_chan()
8770 ret = ath10k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, in ath10k_mac_update_vif_chan()
8771 arvif->bssid); in ath10k_mac_update_vif_chan()
8774 arvif->vdev_id, ret); in ath10k_mac_update_vif_chan()
8931 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_op_assign_vif_chanctx() local
8938 ctx, arvif->vdev_id); in ath10k_mac_op_assign_vif_chanctx()
8940 if (WARN_ON(arvif->is_started)) { in ath10k_mac_op_assign_vif_chanctx()
8945 ret = ath10k_vdev_start(arvif, &ctx->def); in ath10k_mac_op_assign_vif_chanctx()
8948 arvif->vdev_id, vif->addr, in ath10k_mac_op_assign_vif_chanctx()
8953 arvif->is_started = true; in ath10k_mac_op_assign_vif_chanctx()
8955 ret = ath10k_mac_vif_setup_ps(arvif); in ath10k_mac_op_assign_vif_chanctx()
8958 arvif->vdev_id, ret); in ath10k_mac_op_assign_vif_chanctx()
8963 ret = ath10k_wmi_vdev_up(ar, arvif->vdev_id, 0, vif->addr); in ath10k_mac_op_assign_vif_chanctx()
8966 arvif->vdev_id, ret); in ath10k_mac_op_assign_vif_chanctx()
8970 arvif->is_up = true; in ath10k_mac_op_assign_vif_chanctx()
8973 if (ath10k_mac_can_set_cts_prot(arvif)) { in ath10k_mac_op_assign_vif_chanctx()
8974 ret = ath10k_mac_set_cts_prot(arvif); in ath10k_mac_op_assign_vif_chanctx()
8977 arvif->vdev_id, ret); in ath10k_mac_op_assign_vif_chanctx()
8995 ath10k_vdev_stop(arvif); in ath10k_mac_op_assign_vif_chanctx()
8996 arvif->is_started = false; in ath10k_mac_op_assign_vif_chanctx()
8997 ath10k_mac_vif_setup_ps(arvif); in ath10k_mac_op_assign_vif_chanctx()
9011 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_op_unassign_vif_chanctx() local
9018 ctx, arvif->vdev_id); in ath10k_mac_op_unassign_vif_chanctx()
9020 WARN_ON(!arvif->is_started); in ath10k_mac_op_unassign_vif_chanctx()
9023 WARN_ON(!arvif->is_up); in ath10k_mac_op_unassign_vif_chanctx()
9025 ret = ath10k_wmi_vdev_down(ar, arvif->vdev_id); in ath10k_mac_op_unassign_vif_chanctx()
9028 arvif->vdev_id, ret); in ath10k_mac_op_unassign_vif_chanctx()
9030 arvif->is_up = false; in ath10k_mac_op_unassign_vif_chanctx()
9033 ret = ath10k_vdev_stop(arvif); in ath10k_mac_op_unassign_vif_chanctx()
9036 arvif->vdev_id, ret); in ath10k_mac_op_unassign_vif_chanctx()
9038 arvif->is_started = false; in ath10k_mac_op_unassign_vif_chanctx()
9253 arsta->arvif->vdev_type == WMI_VDEV_TYPE_STA)) in ath10k_mac_sta_get_peer_stats_info()
9257 peer = ath10k_peer_find(ar, arsta->arvif->vdev_id, sta->addr); in ath10k_mac_sta_get_peer_stats_info()
9265 arsta->arvif->vdev_id, in ath10k_mac_sta_get_peer_stats_info()
9267 arsta->arvif->bssid, in ath10k_mac_sta_get_peer_stats_info()
9307 struct ath10k *ar = arsta->arvif->ar; in ath10k_sta_statistics()
9348 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_op_set_tid_config() local
9354 arg.vdev_id = arvif->vdev_id; in ath10k_mac_op_set_tid_config()
9356 arvif->tids_rst = 0; in ath10k_mac_op_set_tid_config()
9357 memset(arvif->tid_conf_changed, 0, sizeof(arvif->tid_conf_changed)); in ath10k_mac_op_set_tid_config()
9372 arvif->tids_rst = 0; in ath10k_mac_op_set_tid_config()
9389 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_mac_op_reset_tid_config() local
9397 arvif->tids_rst = 0; in ath10k_mac_op_reset_tid_config()
9398 ret = ath10k_mac_reset_tid_config(ar, sta, arvif, tids); in ath10k_mac_op_reset_tid_config()
9402 arvif->tids_rst = tids; in ath10k_mac_op_reset_tid_config()
9785 struct ath10k_vif *arvif = (void *)vif->drv_priv; in ath10k_get_arvif_iter() local
9787 if (arvif->vdev_id == arvif_iter->vdev_id) in ath10k_get_arvif_iter()
9788 arvif_iter->arvif = arvif; in ath10k_get_arvif_iter()
9802 if (!arvif_iter.arvif) { in ath10k_get_arvif()
9807 return arvif_iter.arvif; in ath10k_get_arvif()