Lines Matching full:vif

79 	struct qtnf_vif *vif;  in qtnf_validate_iface_combinations()  local
91 vif = &mac->iflist[i]; in qtnf_validate_iface_combinations()
92 if (vif->wdev.iftype != NL80211_IFTYPE_UNSPECIFIED) in qtnf_validate_iface_combinations()
93 params.iftype_num[vif->wdev.iftype]++; in qtnf_validate_iface_combinations()
108 /* Check repeater interface combination: primary VIF should be STA only. in qtnf_validate_iface_combinations()
112 vif = qtnf_mac_get_base_vif(mac); in qtnf_validate_iface_combinations()
113 if (vif && vif->wdev.iftype == NL80211_IFTYPE_AP && in qtnf_validate_iface_combinations()
114 vif != change_vif && new_type == NL80211_IFTYPE_STATION) { in qtnf_validate_iface_combinations()
129 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_change_virtual_intf() local
134 ret = qtnf_validate_iface_combinations(wiphy, vif, type); in qtnf_change_virtual_intf()
136 pr_err("VIF%u.%u combination check: failed to set type %d\n", in qtnf_change_virtual_intf()
137 vif->mac->macid, vif->vifid, type); in qtnf_change_virtual_intf()
146 qtnf_scan_done(vif->mac, true); in qtnf_change_virtual_intf()
148 ret = qtnf_cmd_send_change_intf_type(vif, type, use4addr, mac_addr); in qtnf_change_virtual_intf()
150 pr_err("VIF%u.%u: failed to change type to %d\n", in qtnf_change_virtual_intf()
151 vif->mac->macid, vif->vifid, type); in qtnf_change_virtual_intf()
155 vif->wdev.iftype = type; in qtnf_change_virtual_intf()
162 struct qtnf_vif *vif; in qtnf_del_virtual_intf() local
168 vif = qtnf_netdev_get_priv(wdev->netdev); in qtnf_del_virtual_intf()
170 qtnf_scan_done(vif->mac, true); in qtnf_del_virtual_intf()
177 while ((skb = skb_dequeue(&vif->high_pri_tx_queue))) in qtnf_del_virtual_intf()
180 cancel_work_sync(&vif->high_pri_tx_work); in qtnf_del_virtual_intf()
185 if (qtnf_cmd_send_del_intf(vif)) in qtnf_del_virtual_intf()
186 pr_err("VIF%u.%u: failed to delete VIF\n", vif->mac->macid, in qtnf_del_virtual_intf()
187 vif->vifid); in qtnf_del_virtual_intf()
189 vif->netdev->ieee80211_ptr = NULL; in qtnf_del_virtual_intf()
190 vif->netdev = NULL; in qtnf_del_virtual_intf()
191 vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; in qtnf_del_virtual_intf()
203 struct qtnf_vif *vif; in qtnf_add_virtual_intf() local
223 vif = qtnf_mac_get_free_vif(mac); in qtnf_add_virtual_intf()
224 if (!vif) { in qtnf_add_virtual_intf()
225 pr_err("MAC%u: no free VIF available\n", mac->macid); in qtnf_add_virtual_intf()
229 eth_zero_addr(vif->mac_addr); in qtnf_add_virtual_intf()
230 eth_zero_addr(vif->bssid); in qtnf_add_virtual_intf()
231 vif->bss_priority = QTNF_DEF_BSS_PRIORITY; in qtnf_add_virtual_intf()
232 memset(&vif->wdev, 0, sizeof(vif->wdev)); in qtnf_add_virtual_intf()
233 vif->wdev.wiphy = wiphy; in qtnf_add_virtual_intf()
234 vif->wdev.iftype = type; in qtnf_add_virtual_intf()
246 ret = qtnf_cmd_send_add_intf(vif, type, use4addr, mac_addr); in qtnf_add_virtual_intf()
248 pr_err("VIF%u.%u: failed to add VIF %pM\n", in qtnf_add_virtual_intf()
249 mac->macid, vif->vifid, mac_addr); in qtnf_add_virtual_intf()
253 if (!is_valid_ether_addr(vif->mac_addr)) { in qtnf_add_virtual_intf()
254 pr_err("VIF%u.%u: FW reported bad MAC: %pM\n", in qtnf_add_virtual_intf()
255 mac->macid, vif->vifid, vif->mac_addr); in qtnf_add_virtual_intf()
260 ret = qtnf_core_net_attach(mac, vif, name, name_assign_t); in qtnf_add_virtual_intf()
262 pr_err("VIF%u.%u: failed to attach netdev\n", mac->macid, in qtnf_add_virtual_intf()
263 vif->vifid); in qtnf_add_virtual_intf()
268 ret = qtnf_cmd_netdev_changeupper(vif, vif->netdev->ifindex); in qtnf_add_virtual_intf()
270 cfg80211_unregister_netdevice(vif->netdev); in qtnf_add_virtual_intf()
271 vif->netdev = NULL; in qtnf_add_virtual_intf()
276 vif->wdev.netdev = vif->netdev; in qtnf_add_virtual_intf()
277 return &vif->wdev; in qtnf_add_virtual_intf()
280 qtnf_cmd_send_del_intf(vif); in qtnf_add_virtual_intf()
282 vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; in qtnf_add_virtual_intf()
287 static int qtnf_mgmt_set_appie(struct qtnf_vif *vif, in qtnf_mgmt_set_appie() argument
293 ret = qtnf_cmd_send_mgmt_set_appie(vif, QLINK_IE_SET_BEACON_IES, in qtnf_mgmt_set_appie()
296 ret = qtnf_cmd_send_mgmt_set_appie(vif, QLINK_IE_SET_BEACON_IES, in qtnf_mgmt_set_appie()
305 ret = qtnf_cmd_send_mgmt_set_appie(vif, in qtnf_mgmt_set_appie()
309 ret = qtnf_cmd_send_mgmt_set_appie(vif, in qtnf_mgmt_set_appie()
319 ret = qtnf_cmd_send_mgmt_set_appie(vif, in qtnf_mgmt_set_appie()
323 ret = qtnf_cmd_send_mgmt_set_appie(vif, in qtnf_mgmt_set_appie()
336 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_change_beacon() local
338 return qtnf_mgmt_set_appie(vif, &info->beacon); in qtnf_change_beacon()
344 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_start_ap() local
347 ret = qtnf_cmd_send_start_ap(vif, settings); in qtnf_start_ap()
349 pr_err("VIF%u.%u: failed to start AP\n", vif->mac->macid, in qtnf_start_ap()
350 vif->vifid); in qtnf_start_ap()
358 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_stop_ap() local
361 qtnf_scan_done(vif->mac, true); in qtnf_stop_ap()
363 ret = qtnf_cmd_send_stop_ap(vif); in qtnf_stop_ap()
365 pr_err("VIF%u.%u: failed to stop AP operation in FW\n", in qtnf_stop_ap()
366 vif->mac->macid, vif->vifid); in qtnf_stop_ap()
368 netif_carrier_off(vif->netdev); in qtnf_stop_ap()
376 struct qtnf_vif *vif; in qtnf_set_wiphy_params() local
379 vif = qtnf_mac_get_base_vif(mac); in qtnf_set_wiphy_params()
380 if (!vif) { in qtnf_set_wiphy_params()
381 pr_err("MAC%u: primary VIF is not configured\n", mac->macid); in qtnf_set_wiphy_params()
397 struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); in qtnf_update_mgmt_frame_registrations() local
399 u16 old_mask = vif->mgmt_frames_bitmask; in qtnf_update_mgmt_frame_registrations()
437 if (qtnf_cmd_send_register_mgmt(vif, qlink_frame_type, reg)) in qtnf_update_mgmt_frame_registrations()
438 pr_warn("VIF%u.%u: failed to %sregister qlink frame type 0x%x\n", in qtnf_update_mgmt_frame_registrations()
439 vif->mac->macid, vif->vifid, reg ? "" : "un", in qtnf_update_mgmt_frame_registrations()
443 vif->mgmt_frames_bitmask = new_mask; in qtnf_update_mgmt_frame_registrations()
450 struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); in qtnf_mgmt_tx() local
480 return qtnf_cmd_send_frame(vif, short_cookie, flags, in qtnf_mgmt_tx()
488 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_get_station() local
490 sinfo->generation = vif->generation; in qtnf_get_station()
491 return qtnf_cmd_get_sta_info(vif, mac, sinfo); in qtnf_get_station()
498 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_dump_station() local
502 switch (vif->wdev.iftype) { in qtnf_dump_station()
504 if (idx != 0 || !vif->wdev.connected) in qtnf_dump_station()
507 ether_addr_copy(mac, vif->bssid); in qtnf_dump_station()
510 sta_node = qtnf_sta_list_lookup_index(&vif->sta_list, idx); in qtnf_dump_station()
520 ret = qtnf_cmd_get_sta_info(vif, mac, sinfo); in qtnf_dump_station()
522 if (vif->wdev.iftype == NL80211_IFTYPE_AP) { in qtnf_dump_station()
524 cfg80211_del_sta(vif->netdev, mac, GFP_KERNEL); in qtnf_dump_station()
529 sinfo->generation = vif->generation; in qtnf_dump_station()
538 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_add_key() local
541 ret = qtnf_cmd_send_add_key(vif, key_index, pairwise, mac_addr, params); in qtnf_add_key()
543 pr_err("VIF%u.%u: failed to add key: cipher=%x idx=%u pw=%u\n", in qtnf_add_key()
544 vif->mac->macid, vif->vifid, params->cipher, key_index, in qtnf_add_key()
554 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_del_key() local
557 ret = qtnf_cmd_send_del_key(vif, key_index, pairwise, mac_addr); in qtnf_del_key()
560 pr_debug("VIF%u.%u: key index %d out of bounds\n", in qtnf_del_key()
561 vif->mac->macid, vif->vifid, key_index); in qtnf_del_key()
563 pr_err("VIF%u.%u: failed to delete key: idx=%u pw=%u\n", in qtnf_del_key()
564 vif->mac->macid, vif->vifid, in qtnf_del_key()
576 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_set_default_key() local
579 ret = qtnf_cmd_send_set_default_key(vif, key_index, unicast, multicast); in qtnf_set_default_key()
581 pr_err("VIF%u.%u: failed to set dflt key: idx=%u uc=%u mc=%u\n", in qtnf_set_default_key()
582 vif->mac->macid, vif->vifid, key_index, unicast, in qtnf_set_default_key()
592 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_set_default_mgmt_key() local
595 ret = qtnf_cmd_send_set_default_mgmt_key(vif, key_index); in qtnf_set_default_mgmt_key()
597 pr_err("VIF%u.%u: failed to set default MGMT key: idx=%u\n", in qtnf_set_default_mgmt_key()
598 vif->mac->macid, vif->vifid, key_index); in qtnf_set_default_mgmt_key()
607 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_change_station() local
610 ret = qtnf_cmd_send_change_sta(vif, mac, params); in qtnf_change_station()
612 pr_err("VIF%u.%u: failed to change STA %pM\n", in qtnf_change_station()
613 vif->mac->macid, vif->vifid, mac); in qtnf_change_station()
622 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_del_station() local
626 (vif->wdev.iftype == NL80211_IFTYPE_AP) && in qtnf_del_station()
628 !qtnf_sta_list_lookup(&vif->sta_list, params->mac)) in qtnf_del_station()
631 ret = qtnf_cmd_send_del_sta(vif, params); in qtnf_del_station()
633 pr_err("VIF%u.%u: failed to delete STA %pM\n", in qtnf_del_station()
634 vif->mac->macid, vif->vifid, params->mac); in qtnf_del_station()
668 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_connect() local
671 if (vif->wdev.iftype != NL80211_IFTYPE_STATION) in qtnf_connect()
681 ether_addr_copy(vif->bssid, sme->bssid); in qtnf_connect()
683 eth_zero_addr(vif->bssid); in qtnf_connect()
685 ret = qtnf_cmd_send_connect(vif, sme); in qtnf_connect()
687 pr_err("VIF%u.%u: failed to connect\n", in qtnf_connect()
688 vif->mac->macid, vif->vifid); in qtnf_connect()
697 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_external_auth() local
700 if (vif->wdev.iftype == NL80211_IFTYPE_STATION && in qtnf_external_auth()
701 !ether_addr_equal(vif->bssid, auth->bssid)) in qtnf_external_auth()
704 ret = qtnf_cmd_send_external_auth(vif, auth); in qtnf_external_auth()
706 pr_err("VIF%u.%u: failed to report external auth\n", in qtnf_external_auth()
707 vif->mac->macid, vif->vifid); in qtnf_external_auth()
717 struct qtnf_vif *vif; in qtnf_disconnect() local
720 vif = qtnf_mac_get_base_vif(mac); in qtnf_disconnect()
721 if (!vif) { in qtnf_disconnect()
722 pr_err("MAC%u: primary VIF is not configured\n", mac->macid); in qtnf_disconnect()
726 if (vif->wdev.iftype != NL80211_IFTYPE_STATION) in qtnf_disconnect()
729 ret = qtnf_cmd_send_disconnect(vif, reason_code); in qtnf_disconnect()
731 pr_err("VIF%u.%u: failed to disconnect\n", in qtnf_disconnect()
732 mac->macid, vif->vifid); in qtnf_disconnect()
734 if (vif->wdev.connected) { in qtnf_disconnect()
735 netif_carrier_off(vif->netdev); in qtnf_disconnect()
736 cfg80211_disconnected(vif->netdev, reason_code, in qtnf_disconnect()
786 struct qtnf_vif *vif; in qtnf_get_channel() local
792 vif = qtnf_netdev_get_priv(wdev->netdev); in qtnf_get_channel()
794 ret = qtnf_cmd_get_channel(vif, chandef); in qtnf_get_channel()
817 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_channel_switch() local
829 ret = qtnf_cmd_send_chan_switch(vif, params); in qtnf_channel_switch()
842 struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); in qtnf_start_radar_detection() local
848 ret = qtnf_cmd_start_cac(vif, chandef, cac_time_ms); in qtnf_start_radar_detection()
859 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_set_mac_acl() local
862 ret = qtnf_cmd_set_mac_acl(vif, params); in qtnf_set_mac_acl()
872 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_set_power_mgmt() local
875 ret = qtnf_cmd_send_pm_set(vif, enabled ? QLINK_PM_AUTO_STANDBY : in qtnf_set_power_mgmt()
886 struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); in qtnf_get_tx_power() local
889 ret = qtnf_cmd_get_tx_power(vif, dbm); in qtnf_get_tx_power()
891 pr_err("MAC%u: failed to get Tx power\n", vif->mac->macid); in qtnf_get_tx_power()
899 struct qtnf_vif *vif; in qtnf_set_tx_power() local
903 vif = qtnf_netdev_get_priv(wdev->netdev); in qtnf_set_tx_power()
907 vif = qtnf_mac_get_base_vif(mac); in qtnf_set_tx_power()
908 if (!vif) { in qtnf_set_tx_power()
909 pr_err("MAC%u: primary VIF is not configured\n", in qtnf_set_tx_power()
915 ret = qtnf_cmd_set_tx_power(vif, type, mbm); in qtnf_set_tx_power()
917 pr_err("MAC%u: failed to set Tx power\n", vif->mac->macid); in qtnf_set_tx_power()
925 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); in qtnf_update_owe_info() local
928 if (vif->wdev.iftype != NL80211_IFTYPE_AP) in qtnf_update_owe_info()
931 ret = qtnf_cmd_send_update_owe(vif, owe_info); in qtnf_update_owe_info()
933 pr_err("VIF%u.%u: failed to update owe info\n", in qtnf_update_owe_info()
934 vif->mac->macid, vif->vifid); in qtnf_update_owe_info()
943 struct qtnf_vif *vif; in qtnf_suspend() local
946 vif = qtnf_mac_get_base_vif(mac); in qtnf_suspend()
947 if (!vif) { in qtnf_suspend()
948 pr_err("MAC%u: primary VIF is not configured\n", mac->macid); in qtnf_suspend()
955 qtnf_virtual_intf_cleanup(vif->netdev); in qtnf_suspend()
959 qtnf_scan_done(vif->mac, true); in qtnf_suspend()
961 ret = qtnf_cmd_send_wowlan_set(vif, wowlan); in qtnf_suspend()
975 struct qtnf_vif *vif; in qtnf_resume() local
978 vif = qtnf_mac_get_base_vif(mac); in qtnf_resume()
979 if (!vif) { in qtnf_resume()
980 pr_err("MAC%u: primary VIF is not configured\n", mac->macid); in qtnf_resume()
984 ret = qtnf_cmd_send_wowlan_set(vif, NULL); in qtnf_resume()
1245 struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); in qtnf_netdev_updown() local
1247 if (qtnf_cmd_send_updown_intf(vif, up)) in qtnf_netdev_updown()
1248 pr_err("failed to send %s command to VIF%u.%u\n", in qtnf_netdev_updown()
1249 up ? "UP" : "DOWN", vif->mac->macid, vif->vifid); in qtnf_netdev_updown()
1254 struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); in qtnf_virtual_intf_cleanup() local
1255 struct qtnf_wmac *mac = wiphy_priv(vif->wdev.wiphy); in qtnf_virtual_intf_cleanup()
1257 if (vif->wdev.iftype == NL80211_IFTYPE_STATION) in qtnf_virtual_intf_cleanup()
1258 qtnf_disconnect(vif->wdev.wiphy, ndev, in qtnf_virtual_intf_cleanup()
1264 void qtnf_cfg80211_vif_reset(struct qtnf_vif *vif) in qtnf_cfg80211_vif_reset() argument
1266 if (vif->wdev.iftype == NL80211_IFTYPE_STATION) in qtnf_cfg80211_vif_reset()
1267 cfg80211_disconnected(vif->netdev, WLAN_REASON_DEAUTH_LEAVING, in qtnf_cfg80211_vif_reset()
1270 cfg80211_shutdown_all_interfaces(vif->wdev.wiphy); in qtnf_cfg80211_vif_reset()