Lines Matching refs:wil
105 static int wil_num_supported_channels(struct wil6210_priv *wil)
109 if (!test_bit(WMI_FW_CAPABILITY_CHANNEL_4, wil->fw_capabilities))
115 void update_supported_bands(struct wil6210_priv *wil)
117 struct wiphy *wiphy = wil_to_wiphy(wil);
119 wil_dbg_misc(wil, "update supported bands");
122 wil_num_supported_channels(wil);
124 if (test_bit(WMI_FW_CAPABILITY_CHANNEL_BONDING, wil->fw_capabilities)) {
433 struct wil6210_priv *wil = vif_to_wil(vif);
442 struct wil_net_stats *stats = &wil->sta[cid].stats;
450 rc = wmi_call(wil, WMI_NOTIFY_REQ_CMDID, vif->mid, &cmd, sizeof(cmd),
458 wil_dbg_wmi(wil, "Link status for CID %d MID %d: {\n"
477 sinfo->generation = wil->sinfo_gen;
488 if (wil->use_enhanced_dma_hw && reply.evt.tx_mode != WMI_TX_MODE_DMG) {
526 wil->fw_capabilities))
540 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
543 int cid = wil_find_cid(wil, vif->mid, mac);
545 wil_dbg_misc(wil, "get_station: %pM CID %d MID %d\n", mac, cid,
547 if (!wil_cid_valid(wil, cid))
558 int wil_find_cid_by_idx(struct wil6210_priv *wil, u8 mid, int idx)
562 for (i = 0; i < wil->max_assoc_sta; i++) {
563 if (wil->sta[i].status == wil_sta_unused)
565 if (wil->sta[i].mid != mid)
580 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
582 int cid = wil_find_cid_by_idx(wil, vif->mid, idx);
584 if (!wil_cid_valid(wil, cid))
587 ether_addr_copy(mac, wil->sta[cid].addr);
588 wil_dbg_misc(wil, "dump_station: %pM CID %d MID %d\n", mac, cid,
599 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
601 wil_dbg_misc(wil, "start_p2p_device: entered\n");
602 wil->p2p_dev_started = 1;
609 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
611 if (!wil->p2p_dev_started)
614 wil_dbg_misc(wil, "stop_p2p_device: entered\n");
615 mutex_lock(&wil->mutex);
616 mutex_lock(&wil->vif_mutex);
617 wil_p2p_stop_radio_operations(wil);
618 wil->p2p_dev_started = 0;
619 mutex_unlock(&wil->vif_mutex);
620 mutex_unlock(&wil->mutex);
623 static int wil_cfg80211_validate_add_iface(struct wil6210_priv *wil,
632 for (i = 0; i < GET_MAX_VIFS(wil); i++) {
633 if (wil->vifs[i]) {
634 wdev = vif_to_wdev(wil->vifs[i]);
639 return cfg80211_check_combinations(wil->wiphy, ¶ms);
642 static int wil_cfg80211_validate_change_iface(struct wil6210_priv *wil,
653 for (i = 0; i < GET_MAX_VIFS(wil); i++) {
654 struct wil6210_vif *vif_pos = wil->vifs[i];
665 ret = cfg80211_check_combinations(wil->wiphy, ¶ms);
676 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
677 struct net_device *ndev_main = wil->main_ndev, *ndev;
682 wil_dbg_misc(wil, "add_iface, type %d\n", type);
689 if (wil->p2p_wdev) {
690 wil_err(wil, "P2P_DEVICE interface already created\n");
703 wil->p2p_wdev = p2p_wdev;
708 if (!wil->wiphy->n_iface_combinations) {
709 wil_err(wil, "virtual interfaces not supported\n");
713 rc = wil_cfg80211_validate_add_iface(wil, type);
715 wil_err(wil, "iface validation failed, err=%d\n", rc);
719 vif = wil_vif_alloc(wil, name, name_assign_type, type);
737 rc = wil_vif_add(wil, vif);
741 wil_info(wil, "added VIF, mid %d iftype %d MAC %pM\n",
751 struct wil6210_priv *wil = vif_to_wil(vif);
763 wil_info(wil, "failed to stop AP, status %d\n",
777 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
778 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
781 wil_dbg_misc(wil, "del_iface\n");
784 if (wdev != wil->p2p_wdev) {
785 wil_err(wil, "delete of incorrect interface 0x%p\n",
791 wil_p2p_wdev_free(wil);
796 wil_err(wil, "cannot remove the main interface\n");
804 wil_info(wil, "deleted VIF, mid %d iftype %d MAC %pM\n",
807 wil_vif_remove(wil, vif->mid);
827 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
833 wil_dbg_misc(wil, "change_iface: type=%d\n", type);
836 rc = wil_cfg80211_validate_change_iface(wil, vif, type);
838 wil_err(wil, "iface validation failed, err=%d\n", rc);
846 if (!wil_has_other_active_ifaces(wil, ndev, true, false) &&
847 netif_running(ndev) && !wil_is_recovery_blocked(wil) &&
849 wil_dbg_misc(wil, "interface is up. resetting...\n");
850 mutex_lock(&wil->mutex);
851 __wil_down(wil);
852 rc = __wil_up(wil);
853 mutex_unlock(&wil->mutex);
868 wil->monitor_flags = params->flags;
874 if (vif->mid != 0 && wil_has_active_ifaces(wil, true, false)) {
877 rc = wmi_port_delete(wil, vif->mid);
880 rc = wmi_port_allocate(wil, vif->mid, ndev->dev_addr, type);
892 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
894 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
900 wil_dbg_misc(wil, "scan: wdev=0x%p iftype=%d\n", wdev, wdev->iftype);
914 if (test_bit(wil_status_dontscan, wil->status)) {
915 wil_err(wil, "Can't scan now\n");
919 mutex_lock(&wil->mutex);
921 mutex_lock(&wil->vif_mutex);
923 wil_err(wil, "Already scanning\n");
924 mutex_unlock(&wil->vif_mutex);
928 mutex_unlock(&wil->vif_mutex);
931 if (!wil->p2p_dev_started) {
932 wil_err(wil, "P2P search requested on stopped P2P device\n");
940 wil->radio_wdev = wdev;
944 wil->radio_wdev =
945 wil->main_ndev->ieee80211_ptr;
954 wil_dbg_misc(wil, "Start scan_request 0x%p\n", request);
955 wil_dbg_misc(wil, "SSID count: %d", request->n_ssids);
958 wil_dbg_misc(wil, "SSID[%d]", i);
971 wil_err(wil, "set SSID for scan request failed: %d\n", rc);
985 wil_err(wil,
993 wil_dbg_misc(wil, "Scan for ch %d : %d MHz\n", ch,
1001 wil_dbg_misc(wil, "Scan has no IE's\n");
1008 if (wil->discovery_mode && cmd->scan_type == WMI_ACTIVE_SCAN) {
1010 wil_dbg_misc(wil, "active scan with discovery_mode=1\n");
1014 wil->radio_wdev = wdev;
1015 rc = wmi_send(wil, WMI_START_SCAN_CMDID, vif->mid,
1022 wil->radio_wdev = wil->main_ndev->ieee80211_ptr;
1026 mutex_unlock(&wil->mutex);
1033 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1034 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
1036 wil_dbg_misc(wil, "wdev=0x%p iftype=%d\n", wdev, wdev->iftype);
1038 mutex_lock(&wil->mutex);
1039 mutex_lock(&wil->vif_mutex);
1045 wil_dbg_misc(wil, "abort scan was called on the wrong iface\n");
1049 if (wdev == wil->p2p_wdev && wil->radio_wdev == wil->p2p_wdev)
1050 wil_p2p_stop_radio_operations(wil);
1055 mutex_unlock(&wil->vif_mutex);
1056 mutex_unlock(&wil->mutex);
1059 static void wil_print_crypto(struct wil6210_priv *wil,
1064 wil_dbg_misc(wil, "WPA versions: 0x%08x cipher group 0x%08x\n",
1066 wil_dbg_misc(wil, "Pairwise ciphers [%d] {\n", c->n_ciphers_pairwise);
1069 wil_dbg_misc(wil, " [%d] = 0x%08x\n", i,
1071 wil_dbg_misc(wil, "}\n");
1072 wil_dbg_misc(wil, "AKM suites [%d] {\n", c->n_akm_suites);
1075 wil_dbg_misc(wil, " [%d] = 0x%08x\n", i,
1077 wil_dbg_misc(wil, "}\n");
1078 wil_dbg_misc(wil, "Control port : %d, eth_type 0x%04x no_encrypt %d\n",
1103 static void wil_print_connect_params(struct wil6210_priv *wil,
1106 wil_info(wil, "Connecting to:\n");
1108 wil_info(wil, " Channel: %d freq %d\n",
1112 wil_info(wil, " BSSID: %pM\n", sme->bssid);
1117 wil_info(wil, " Previous BSSID=%pM\n", sme->prev_bssid);
1118 wil_info(wil, " Auth Type: %s\n",
1120 wil_info(wil, " Privacy: %s\n", sme->privacy ? "secure" : "open");
1121 wil_info(wil, " PBSS: %d\n", sme->pbss);
1122 wil_print_crypto(wil, &sme->crypto);
1129 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1134 if (!test_bit(WMI_FW_CAPABILITY_FT_ROAMING, wil->fw_capabilities)) {
1135 wil_err(wil, "FT: FW does not support FT roaming\n");
1140 wil_err(wil, "FT: prev_bssid was not set\n");
1145 wil_err(wil, "FT: can not roam to same AP\n");
1150 wil_err(wil, "FT: roam while not connected\n");
1155 wil_err(wil, "FT: privacy mismatch, current (%d) roam (%d)\n",
1161 wil_err(wil, "FT: roam is not valid for PBSS\n");
1169 wil_info(wil, "FT: roaming\n");
1172 rc = wmi_send(wil, WMI_FT_AUTH_CMDID, vif->mid,
1183 static int wil_get_wmi_edmg_channel(struct wil6210_priv *wil, u8 edmg_bw_config,
1199 wil_err(wil, "Unsupported edmg channel bitmap 0x%x\n",
1204 wil_err(wil, "Unsupported EDMG BW configuration %d\n",
1214 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1226 wil_dbg_misc(wil, "connect, mid=%d\n", vif->mid);
1227 wil_print_connect_params(wil, sme);
1241 wil_err(wil, "IE too large (%td bytes)\n", sme->ie_len);
1249 wil_info(wil, "WSC connection\n");
1251 wil_err(wil, "No WSC with FT roam\n");
1263 wil_err(wil, "Unable to find BSS\n");
1269 wil_err(wil, "No SSID\n");
1288 wil_err(wil, "Unsupported BSS type, capability= 0x%04x\n",
1296 wil_err(wil, "BSS at unknown frequency %dMhz\n",
1304 wil_err(wil, "FT: Unsupported BSS type, capability= 0x%04x\n",
1320 wil_err(wil, "WMI_DELETE_CIPHER_KEY_CMD(PTK) failed\n");
1326 wil_err(wil, "WMI_DELETE_CIPHER_KEY_CMD(GTK) failed\n");
1355 rc = wil_get_wmi_edmg_channel(wil, sme->edmg.bw_config,
1365 rc = wmi_send(wil, WMI_CONNECT_CMDID, vif->mid, &conn, sizeof(conn));
1368 if (!wil_has_other_active_ifaces(wil, ndev, false, true))
1369 wil6210_bus_request(wil, WIL_MAX_BUS_REQUEST_KBPS);
1389 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1392 wil_dbg_misc(wil, "disconnect: reason=%d, mid=%d\n",
1397 wil_err(wil, "Disconnect was called while disconnected\n");
1402 rc = wmi_call(wil, WMI_DISCONNECT_CMDID, vif->mid, NULL, 0,
1406 wil_err(wil, "disconnect error %d\n", rc);
1414 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1424 rc = wmi_set_mgmt_retry(wil, wiphy->retry_short);
1438 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1439 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
1443 wil_dbg_misc(wil, "mgmt_tx: channel %d offchan %d, wait %d\n",
1454 wil_err(wil, "invalid channel\n");
1459 wil_dbg_misc(wil,
1466 wil_dbg_misc(wil,
1473 wil_err(wil,
1500 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1502 wil->monitor_chandef = *chandef;
1510 struct wil6210_priv *wil = wdev_to_wil(wdev);
1527 wil_err(wil, "Can't determine GTK type\n");
1532 wil_dbg_misc(wil, "detect_key_usage: -> %s\n", key_usage_str[rc]);
1538 wil_find_sta_by_key_usage(struct wil6210_priv *wil, u8 mid,
1548 cid = wil_find_cid(wil, mid, mac_addr);
1550 cid = wil_find_cid_by_idx(wil, mid, 0);
1552 wil_err(wil, "No CID for %pM %s\n", mac_addr,
1557 return &wil->sta[cid];
1629 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1632 struct wil_sta_info *cs = wil_find_sta_by_key_usage(wil, vif->mid,
1637 wil_err(wil, "NULL params\n");
1641 wil_dbg_misc(wil, "add_key: %pM %s[%d] PN %*phN\n",
1650 wil_err(wil, "Not connected, %pM %s[%d] PN %*phN\n",
1660 wil_err(wil,
1668 spin_lock_bh(&wil->eap_lock);
1674 wil_dbg_misc(wil, "Store EAPOL key\n");
1676 spin_unlock_bh(&wil->eap_lock);
1703 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1706 struct wil_sta_info *cs = wil_find_sta_by_key_usage(wil, vif->mid,
1710 wil_dbg_misc(wil, "del_key: %pM %s[%d]\n", mac_addr,
1714 wil_info(wil, "Not connected, %pM %s[%d]\n",
1729 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1731 wil_dbg_misc(wil, "set_default_key: entered\n");
1741 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1744 wil_dbg_misc(wil,
1748 rc = wil_p2p_listen(wil, wdev, duration, chan, cookie);
1756 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1757 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
1759 wil_dbg_misc(wil, "cancel_remain_on_channel\n");
1937 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1950 wil_dbg_misc(wil, "start_ap: mid=%d, is_go=%d\n", vif->mid, is_go);
1952 wil_err(wil, "P2P GO must be in PBSS\n");
1956 wil_set_recovery_state(wil, fw_recovery_idle);
1970 wil->fw_capabilities)) {
1971 wil_err(wil, "FW does not support FT roaming\n");
1977 mutex_lock(&wil->mutex);
1979 if (!wil_has_other_active_ifaces(wil, ndev, true, false)) {
1980 __wil_down(wil);
1981 rc = __wil_up(wil);
2004 if (!wil_has_other_active_ifaces(wil, ndev, false, true))
2005 wil6210_bus_request(wil, WIL_MAX_BUS_REQUEST_KBPS);
2022 if (!wil_has_other_active_ifaces(wil, ndev, false, true))
2023 wil6210_bus_request(wil, WIL_DEFAULT_BUS_REQUEST_KBPS);
2025 mutex_unlock(&wil->mutex);
2029 void wil_cfg80211_ap_recovery(struct wil6210_priv *wil)
2032 struct wiphy *wiphy = wil_to_wiphy(wil);
2034 for (i = 0; i < GET_MAX_VIFS(wil); i++) {
2035 struct wil6210_vif *vif = wil->vifs[i];
2051 wil_info(wil,
2064 wil_err(wil, "vif %d recovery failed (%d)\n", i, rc);
2077 wil_err(wil, "vif %d recovery add key failed (%d)\n",
2086 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2093 wil_dbg_misc(wil, "change_beacon, mid=%d\n", vif->mid);
2106 wil_dbg_misc(wil, "privacy changed %d=>%d. Restarting AP\n",
2128 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2135 wil_dbg_misc(wil, "start_ap\n");
2137 rc = wil_get_wmi_edmg_channel(wil, info->chandef.edmg.bw_config,
2144 wil_err(wil, "AP: No channel???\n");
2162 wil_err(wil, "AP: Invalid hidden SSID %d\n", info->hidden_ssid);
2165 wil_dbg_misc(wil, "AP on Channel %d %d MHz, %s\n", channel->hw_value,
2167 wil_dbg_misc(wil, "Privacy: %d auth_type %d\n",
2169 wil_dbg_misc(wil, "Hidden SSID mode: %d\n",
2171 wil_dbg_misc(wil, "BI %d DTIM %d\n", info->beacon_interval,
2173 wil_dbg_misc(wil, "PBSS %d\n", info->pbss);
2177 wil_print_crypto(wil, crypto);
2192 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2196 wil_dbg_misc(wil, "stop_ap, mid=%d\n", vif->mid);
2199 last = !wil_has_other_active_ifaces(wil, ndev, false, true);
2201 wil6210_bus_request(wil, WIL_DEFAULT_BUS_REQUEST_KBPS);
2202 wil_set_recovery_state(wil, fw_recovery_idle);
2203 set_bit(wil_status_resetting, wil->status);
2206 mutex_lock(&wil->mutex);
2218 __wil_down(wil);
2222 mutex_unlock(&wil->mutex);
2233 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2235 wil_dbg_misc(wil, "add station %pM aid %d mid %d mask 0x%x set 0x%x\n",
2240 wil_err(wil, "not supported with AP SME enabled\n");
2245 wil_err(wil, "invalid aid\n");
2257 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2259 wil_dbg_misc(wil, "del_station: %pM, reason=%d mid=%d\n",
2262 mutex_lock(&wil->mutex);
2264 mutex_unlock(&wil->mutex);
2275 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2280 wil_dbg_misc(wil, "change station %pM mask 0x%x set 0x%x mid %d\n",
2285 wil_dbg_misc(wil, "not supported with AP SME enabled\n");
2292 cid = wil_find_cid(wil, vif->mid, mac);
2294 wil_err(wil, "station not found\n");
2298 for (i = 0; i < ARRAY_SIZE(wil->ring2cid_tid); i++)
2299 if (wil->ring2cid_tid[i][0] == cid) {
2300 txdata = &wil->ring_tx_data[i];
2305 wil_err(wil, "ring data not found\n");
2311 wil_dbg_misc(wil, "cid %d ring %d authorize %d\n", cid, i,
2318 static void wil_probe_client_handle(struct wil6210_priv *wil,
2323 struct wil_sta_info *sta = &wil->sta[req->cid];
2353 struct wil6210_priv *wil = vif_to_wil(vif);
2360 wil_probe_client_handle(wil, vif, req);
2368 struct wil6210_priv *wil = vif_to_wil(vif);
2370 wil_dbg_misc(wil, "probe_client_flush\n");
2386 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2389 int cid = wil_find_cid(wil, vif->mid, peer);
2391 wil_dbg_misc(wil, "probe_client: %pM => CID %d MID %d\n",
2409 queue_work(wil->wq_service, &vif->probe_client_worker);
2417 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2421 wil_dbg_misc(wil, "change_bss: ap_isolate MID %d, %d => %d\n",
2433 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2436 wil_dbg_misc(wil, "enabled=%d, timeout=%d\n",
2444 return wil_ps_update(wil, ps_profile);
2450 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2455 if (test_bit(wil_status_suspended, wil->status)) {
2456 wil_dbg_pm(wil, "trying to suspend while suspended\n");
2460 rc = wil_can_suspend(wil, false);
2464 wil_dbg_pm(wil, "suspending\n");
2466 mutex_lock(&wil->mutex);
2467 mutex_lock(&wil->vif_mutex);
2468 wil_p2p_stop_radio_operations(wil);
2469 wil_abort_scan_all_vifs(wil, true);
2470 mutex_unlock(&wil->vif_mutex);
2471 mutex_unlock(&wil->mutex);
2479 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2481 wil_dbg_pm(wil, "resuming\n");
2491 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2498 wil_dbg_misc(wil,
2502 wil_dbg_misc(wil, "SSID[%d]:", i);
2507 wil_dbg_misc(wil, "channels:");
2509 wil_dbg_misc(wil, " %d%s", request->channels[i]->hw_value,
2511 wil_dbg_misc(wil, "n_match_sets %d, min_rssi_thold %d, delay %d\n",
2517 wil_dbg_misc(wil, "MATCHSET[%d]: rssi_thold %d\n",
2523 wil_dbg_misc(wil, "n_scan_plans %d\n", request->n_scan_plans);
2527 wil_dbg_misc(wil, "SCAN PLAN[%d]: interval %d iterations %d\n",
2535 return wmi_start_sched_scan(wil, request);
2542 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2549 rc = wmi_stop_sched_scan(wil);
2553 wil_dbg_misc(wil, "sched scan stopped (%d)\n", rc);
2562 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2568 wil_dbg_misc(wil, "update ft ies, mid=%d\n", vif->mid);
2572 if (!test_bit(WMI_FW_CAPABILITY_FT_ROAMING, wil->fw_capabilities)) {
2573 wil_err(wil, "FW does not support FT roaming\n");
2591 wil_err(wil, "FT: bss is NULL\n");
2598 rc = wmi_send(wil, WMI_FT_REASSOC_CMDID, vif->mid,
2601 wil_err(wil, "FT: reassoc failed (%d)\n", rc);
2610 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2612 if (wil->multicast_to_unicast == enabled)
2615 wil_info(wil, "set multicast to unicast, enabled=%d\n", enabled);
2616 wil->multicast_to_unicast = enabled;
2625 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2628 wil->cqm_rssi_thold = rssi_thold;
2630 rc = wmi_set_cqm_rssi_config(wil, rssi_thold, rssi_hyst);
2633 wil->cqm_rssi_thold = 0;
2721 struct wil6210_priv *wil, const struct wil_fw_record_concurrency *conc)
2723 struct wiphy *wiphy = wil_to_wiphy(wil);
2733 wil_dbg_misc(wil, "iface_combinations already set, skipping\n");
2761 wil_dbg_misc(wil,
2770 wil_dbg_misc(wil,
2780 wil_dbg_misc(wil, "multiple VIFs supported, n_mids %d\n", conc->n_mids);
2781 wil->max_vifs = conc->n_mids + 1; /* including main interface */
2782 if (wil->max_vifs > WIL_MAX_VIFS) {
2783 wil_info(wil, "limited number of VIFs supported(%d, FW %d)\n",
2784 WIL_MAX_VIFS, wil->max_vifs);
2785 wil->max_vifs = WIL_MAX_VIFS;
2795 struct wil6210_priv *wil;
2811 wil = wiphy_to_wil(wiphy);
2812 wil->wiphy = wiphy;
2816 cfg80211_chandef_create(&wil->monitor_chandef, ch, NL80211_CHAN_NO_HT);
2818 return wil;
2821 void wil_cfg80211_deinit(struct wil6210_priv *wil)
2823 struct wiphy *wiphy = wil_to_wiphy(wil);
2825 dev_dbg(wil_to_dev(wil), "%s()\n", __func__);
2837 void wil_p2p_wdev_free(struct wil6210_priv *wil)
2841 mutex_lock(&wil->vif_mutex);
2842 p2p_wdev = wil->p2p_wdev;
2843 wil->p2p_wdev = NULL;
2844 wil->radio_wdev = wil->main_ndev->ieee80211_ptr;
2845 mutex_unlock(&wil->vif_mutex);
2872 struct wil6210_priv *wil = wdev_to_wil(wdev);
2873 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
2891 if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
2897 wil_err(wil, "Invalid rf sector ATTR\n");
2904 wil_err(wil, "Invalid rf sector spec\n");
2911 wil_err(wil, "Invalid sector index %d\n", sector_index);
2917 wil_err(wil, "Invalid sector type %d\n", sector_type);
2924 wil_err(wil, "Invalid rf module mask 0x%x\n", rf_modules_vec);
2931 rc = wmi_call(wil, WMI_GET_RF_SECTOR_PARAMS_CMDID, vif->mid,
2938 wil_err(wil, "get rf sector cfg failed with status %d\n",
2993 struct wil6210_priv *wil = wdev_to_wil(wdev);
2994 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
3011 if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
3017 wil_err(wil, "Invalid rf sector ATTR\n");
3024 wil_err(wil, "Invalid rf sector spec\n");
3031 wil_err(wil, "Invalid sector index %d\n", sector_index);
3037 wil_err(wil, "Invalid sector type %d\n", sector_type);
3053 wil_err(wil, "invalid sector cfg\n");
3064 wil_err(wil, "missing cfg params\n");
3071 wil_err(wil, "invalid RF module index %d\n",
3092 rc = wmi_call(wil, WMI_SET_RF_SECTOR_PARAMS_CMDID, vif->mid,
3105 struct wil6210_priv *wil = wdev_to_wil(wdev);
3106 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
3120 if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
3126 wil_err(wil, "Invalid rf sector ATTR\n");
3131 wil_err(wil, "Invalid rf sector spec\n");
3136 wil_err(wil, "Invalid sector type %d\n", sector_type);
3142 cid = wil_find_cid(wil, vif->mid, mac_addr);
3144 wil_err(wil, "invalid MAC address %pM\n", mac_addr);
3149 wil_err(wil, "must specify MAC address when connected\n");
3157 rc = wmi_call(wil, WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID, vif->mid,
3165 wil_err(wil, "get rf selected sector cfg failed with status %d\n",
3189 static int wil_rf_sector_wmi_set_selected(struct wil6210_priv *wil,
3206 rc = wmi_call(wil, WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID, mid,
3220 struct wil6210_priv *wil = wdev_to_wil(wdev);
3221 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
3228 if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
3234 wil_err(wil, "Invalid rf sector ATTR\n");
3240 wil_err(wil, "Invalid rf sector spec\n");
3248 wil_err(wil, "Invalid sector index %d\n", sector_index);
3254 wil_err(wil, "Invalid sector type %d\n", sector_type);
3261 cid = wil_find_cid(wil, vif->mid, mac_addr);
3263 wil_err(wil, "invalid MAC address %pM\n",
3269 wil_err(wil, "broadcast MAC valid only with unlocking\n");
3276 wil_err(wil, "must specify MAC address when connected\n");
3283 rc = wil_rf_sector_wmi_set_selected(wil, vif->mid, sector_index,
3288 wil, vif->mid, WMI_INVALID_RF_SECTOR_INDEX,
3291 for (i = 0; i < wil->max_assoc_sta; i++) {
3292 if (wil->sta[i].mid != vif->mid)
3295 wil, vif->mid,
3303 wil_err(wil, "unlock cid %d failed with status %d\n",