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;
448 rc = wmi_call(wil, WMI_NOTIFY_REQ_CMDID, vif->mid, &cmd, sizeof(cmd),
454 wil_dbg_wmi(wil, "Link status for CID %d MID %d: {\n"
473 sinfo->generation = wil->sinfo_gen;
484 if (wil->use_enhanced_dma_hw && reply.evt.tx_mode != WMI_TX_MODE_DMG)
504 wil->fw_capabilities))
518 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
521 int cid = wil_find_cid(wil, vif->mid, mac);
523 wil_dbg_misc(wil, "get_station: %pM CID %d MID %d\n", mac, cid,
525 if (!wil_cid_valid(wil, cid))
536 int wil_find_cid_by_idx(struct wil6210_priv *wil, u8 mid, int idx)
540 for (i = 0; i < wil->max_assoc_sta; i++) {
541 if (wil->sta[i].status == wil_sta_unused)
543 if (wil->sta[i].mid != mid)
558 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
560 int cid = wil_find_cid_by_idx(wil, vif->mid, idx);
562 if (!wil_cid_valid(wil, cid))
565 ether_addr_copy(mac, wil->sta[cid].addr);
566 wil_dbg_misc(wil, "dump_station: %pM CID %d MID %d\n", mac, cid,
577 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
579 wil_dbg_misc(wil, "start_p2p_device: entered\n");
580 wil->p2p_dev_started = 1;
587 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
589 if (!wil->p2p_dev_started)
592 wil_dbg_misc(wil, "stop_p2p_device: entered\n");
593 mutex_lock(&wil->mutex);
594 mutex_lock(&wil->vif_mutex);
595 wil_p2p_stop_radio_operations(wil);
596 wil->p2p_dev_started = 0;
597 mutex_unlock(&wil->vif_mutex);
598 mutex_unlock(&wil->mutex);
601 static int wil_cfg80211_validate_add_iface(struct wil6210_priv *wil,
610 for (i = 0; i < GET_MAX_VIFS(wil); i++) {
611 if (wil->vifs[i]) {
612 wdev = vif_to_wdev(wil->vifs[i]);
617 return cfg80211_check_combinations(wil->wiphy, ¶ms);
620 static int wil_cfg80211_validate_change_iface(struct wil6210_priv *wil,
631 for (i = 0; i < GET_MAX_VIFS(wil); i++) {
632 struct wil6210_vif *vif_pos = wil->vifs[i];
643 ret = cfg80211_check_combinations(wil->wiphy, ¶ms);
654 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
655 struct net_device *ndev_main = wil->main_ndev, *ndev;
660 wil_dbg_misc(wil, "add_iface, type %d\n", type);
667 if (wil->p2p_wdev) {
668 wil_err(wil, "P2P_DEVICE interface already created\n");
681 wil->p2p_wdev = p2p_wdev;
686 if (!wil->wiphy->n_iface_combinations) {
687 wil_err(wil, "virtual interfaces not supported\n");
691 rc = wil_cfg80211_validate_add_iface(wil, type);
693 wil_err(wil, "iface validation failed, err=%d\n", rc);
697 vif = wil_vif_alloc(wil, name, name_assign_type, type);
713 rc = wil_vif_add(wil, vif);
717 wil_info(wil, "added VIF, mid %d iftype %d MAC %pM\n",
727 struct wil6210_priv *wil = vif_to_wil(vif);
739 wil_info(wil, "failed to stop AP, status %d\n",
753 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
754 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
757 wil_dbg_misc(wil, "del_iface\n");
760 if (wdev != wil->p2p_wdev) {
761 wil_err(wil, "delete of incorrect interface 0x%p\n",
767 wil_p2p_wdev_free(wil);
772 wil_err(wil, "cannot remove the main interface\n");
780 wil_info(wil, "deleted VIF, mid %d iftype %d MAC %pM\n",
783 wil_vif_remove(wil, vif->mid);
803 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
809 wil_dbg_misc(wil, "change_iface: type=%d\n", type);
812 rc = wil_cfg80211_validate_change_iface(wil, vif, type);
814 wil_err(wil, "iface validation failed, err=%d\n", rc);
822 if (!wil_has_other_active_ifaces(wil, ndev, true, false) &&
823 netif_running(ndev) && !wil_is_recovery_blocked(wil) &&
825 wil_dbg_misc(wil, "interface is up. resetting...\n");
826 mutex_lock(&wil->mutex);
827 __wil_down(wil);
828 rc = __wil_up(wil);
829 mutex_unlock(&wil->mutex);
844 wil->monitor_flags = params->flags;
850 if (vif->mid != 0 && wil_has_active_ifaces(wil, true, false)) {
853 rc = wmi_port_delete(wil, vif->mid);
856 rc = wmi_port_allocate(wil, vif->mid, ndev->dev_addr, type);
868 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
870 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
878 wil_dbg_misc(wil, "scan: wdev=0x%p iftype=%d\n", wdev, wdev->iftype);
892 if (test_bit(wil_status_dontscan, wil->status)) {
893 wil_err(wil, "Can't scan now\n");
897 mutex_lock(&wil->mutex);
899 mutex_lock(&wil->vif_mutex);
901 wil_err(wil, "Already scanning\n");
902 mutex_unlock(&wil->vif_mutex);
906 mutex_unlock(&wil->vif_mutex);
909 if (!wil->p2p_dev_started) {
910 wil_err(wil, "P2P search requested on stopped P2P device\n");
918 wil->radio_wdev = wdev;
922 wil->radio_wdev =
923 wil->main_ndev->ieee80211_ptr;
932 wil_dbg_misc(wil, "Start scan_request 0x%p\n", request);
933 wil_dbg_misc(wil, "SSID count: %d", request->n_ssids);
936 wil_dbg_misc(wil, "SSID[%d]", i);
949 wil_err(wil, "set SSID for scan request failed: %d\n", rc);
964 wil_err(wil,
971 wil_dbg_misc(wil, "Scan for ch %d : %d MHz\n", ch,
979 wil_dbg_misc(wil, "Scan has no IE's\n");
986 if (wil->discovery_mode && cmd.cmd.scan_type == WMI_ACTIVE_SCAN) {
988 wil_dbg_misc(wil, "active scan with discovery_mode=1\n");
992 wil->radio_wdev = wdev;
993 rc = wmi_send(wil, WMI_START_SCAN_CMDID, vif->mid,
1001 wil->radio_wdev = wil->main_ndev->ieee80211_ptr;
1005 mutex_unlock(&wil->mutex);
1012 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1013 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
1015 wil_dbg_misc(wil, "wdev=0x%p iftype=%d\n", wdev, wdev->iftype);
1017 mutex_lock(&wil->mutex);
1018 mutex_lock(&wil->vif_mutex);
1024 wil_dbg_misc(wil, "abort scan was called on the wrong iface\n");
1028 if (wdev == wil->p2p_wdev && wil->radio_wdev == wil->p2p_wdev)
1029 wil_p2p_stop_radio_operations(wil);
1034 mutex_unlock(&wil->vif_mutex);
1035 mutex_unlock(&wil->mutex);
1038 static void wil_print_crypto(struct wil6210_priv *wil,
1043 wil_dbg_misc(wil, "WPA versions: 0x%08x cipher group 0x%08x\n",
1045 wil_dbg_misc(wil, "Pairwise ciphers [%d] {\n", c->n_ciphers_pairwise);
1048 wil_dbg_misc(wil, " [%d] = 0x%08x\n", i,
1050 wil_dbg_misc(wil, "}\n");
1051 wil_dbg_misc(wil, "AKM suites [%d] {\n", c->n_akm_suites);
1054 wil_dbg_misc(wil, " [%d] = 0x%08x\n", i,
1056 wil_dbg_misc(wil, "}\n");
1057 wil_dbg_misc(wil, "Control port : %d, eth_type 0x%04x no_encrypt %d\n",
1082 static void wil_print_connect_params(struct wil6210_priv *wil,
1085 wil_info(wil, "Connecting to:\n");
1087 wil_info(wil, " Channel: %d freq %d\n",
1091 wil_info(wil, " BSSID: %pM\n", sme->bssid);
1096 wil_info(wil, " Previous BSSID=%pM\n", sme->prev_bssid);
1097 wil_info(wil, " Auth Type: %s\n",
1099 wil_info(wil, " Privacy: %s\n", sme->privacy ? "secure" : "open");
1100 wil_info(wil, " PBSS: %d\n", sme->pbss);
1101 wil_print_crypto(wil, &sme->crypto);
1108 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1113 if (!test_bit(WMI_FW_CAPABILITY_FT_ROAMING, wil->fw_capabilities)) {
1114 wil_err(wil, "FT: FW does not support FT roaming\n");
1119 wil_err(wil, "FT: prev_bssid was not set\n");
1124 wil_err(wil, "FT: can not roam to same AP\n");
1129 wil_err(wil, "FT: roam while not connected\n");
1134 wil_err(wil, "FT: privacy mismatch, current (%d) roam (%d)\n",
1140 wil_err(wil, "FT: roam is not valid for PBSS\n");
1148 wil_info(wil, "FT: roaming\n");
1151 rc = wmi_send(wil, WMI_FT_AUTH_CMDID, vif->mid,
1162 static int wil_get_wmi_edmg_channel(struct wil6210_priv *wil, u8 edmg_bw_config,
1178 wil_err(wil, "Unsupported edmg channel bitmap 0x%x\n",
1183 wil_err(wil, "Unsupported EDMG BW configuration %d\n",
1193 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1205 wil_dbg_misc(wil, "connect, mid=%d\n", vif->mid);
1206 wil_print_connect_params(wil, sme);
1220 wil_err(wil, "IE too large (%td bytes)\n", sme->ie_len);
1228 wil_info(wil, "WSC connection\n");
1230 wil_err(wil, "No WSC with FT roam\n");
1242 wil_err(wil, "Unable to find BSS\n");
1248 wil_err(wil, "No SSID\n");
1267 wil_err(wil, "Unsupported BSS type, capability= 0x%04x\n",
1275 wil_err(wil, "BSS at unknown frequency %dMhz\n",
1283 wil_err(wil, "FT: Unsupported BSS type, capability= 0x%04x\n",
1299 wil_err(wil, "WMI_DELETE_CIPHER_KEY_CMD(PTK) failed\n");
1305 wil_err(wil, "WMI_DELETE_CIPHER_KEY_CMD(GTK) failed\n");
1334 rc = wil_get_wmi_edmg_channel(wil, sme->edmg.bw_config,
1344 rc = wmi_send(wil, WMI_CONNECT_CMDID, vif->mid, &conn, sizeof(conn));
1347 if (!wil_has_other_active_ifaces(wil, ndev, false, true))
1348 wil6210_bus_request(wil, WIL_MAX_BUS_REQUEST_KBPS);
1368 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1371 wil_dbg_misc(wil, "disconnect: reason=%d, mid=%d\n",
1376 wil_err(wil, "Disconnect was called while disconnected\n");
1381 rc = wmi_call(wil, WMI_DISCONNECT_CMDID, vif->mid, NULL, 0,
1385 wil_err(wil, "disconnect error %d\n", rc);
1392 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1402 rc = wmi_set_mgmt_retry(wil, wiphy->retry_short);
1416 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1417 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
1421 wil_dbg_misc(wil, "mgmt_tx: channel %d offchan %d, wait %d\n",
1432 wil_err(wil, "invalid channel\n");
1437 wil_dbg_misc(wil,
1444 wil_dbg_misc(wil,
1451 wil_err(wil,
1477 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1479 wil->monitor_chandef = *chandef;
1487 struct wil6210_priv *wil = wdev_to_wil(wdev);
1504 wil_err(wil, "Can't determine GTK type\n");
1509 wil_dbg_misc(wil, "detect_key_usage: -> %s\n", key_usage_str[rc]);
1515 wil_find_sta_by_key_usage(struct wil6210_priv *wil, u8 mid,
1525 cid = wil_find_cid(wil, mid, mac_addr);
1527 cid = wil_find_cid_by_idx(wil, mid, 0);
1529 wil_err(wil, "No CID for %pM %s\n", mac_addr,
1534 return &wil->sta[cid];
1606 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1609 struct wil_sta_info *cs = wil_find_sta_by_key_usage(wil, vif->mid,
1614 wil_err(wil, "NULL params\n");
1618 wil_dbg_misc(wil, "add_key: %pM %s[%d] PN %*phN\n",
1627 wil_err(wil, "Not connected, %pM %s[%d] PN %*phN\n",
1638 wil_err(wil,
1646 spin_lock_bh(&wil->eap_lock);
1652 wil_dbg_misc(wil, "Store EAPOL key\n");
1654 spin_unlock_bh(&wil->eap_lock);
1681 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1684 struct wil_sta_info *cs = wil_find_sta_by_key_usage(wil, vif->mid,
1688 wil_dbg_misc(wil, "del_key: %pM %s[%d]\n", mac_addr,
1692 wil_info(wil, "Not connected, %pM %s[%d]\n",
1707 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1709 wil_dbg_misc(wil, "set_default_key: entered\n");
1719 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1722 wil_dbg_misc(wil,
1726 rc = wil_p2p_listen(wil, wdev, duration, chan, cookie);
1734 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1735 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
1737 wil_dbg_misc(wil, "cancel_remain_on_channel\n");
1915 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
1928 wil_dbg_misc(wil, "start_ap: mid=%d, is_go=%d\n", vif->mid, is_go);
1930 wil_err(wil, "P2P GO must be in PBSS\n");
1934 wil_set_recovery_state(wil, fw_recovery_idle);
1948 wil->fw_capabilities)) {
1949 wil_err(wil, "FW does not support FT roaming\n");
1955 mutex_lock(&wil->mutex);
1957 if (!wil_has_other_active_ifaces(wil, ndev, true, false)) {
1958 __wil_down(wil);
1959 rc = __wil_up(wil);
1982 if (!wil_has_other_active_ifaces(wil, ndev, false, true))
1983 wil6210_bus_request(wil, WIL_MAX_BUS_REQUEST_KBPS);
2000 if (!wil_has_other_active_ifaces(wil, ndev, false, true))
2001 wil6210_bus_request(wil, WIL_DEFAULT_BUS_REQUEST_KBPS);
2003 mutex_unlock(&wil->mutex);
2007 void wil_cfg80211_ap_recovery(struct wil6210_priv *wil)
2010 struct wiphy *wiphy = wil_to_wiphy(wil);
2012 for (i = 0; i < GET_MAX_VIFS(wil); i++) {
2013 struct wil6210_vif *vif = wil->vifs[i];
2029 wil_info(wil,
2042 wil_err(wil, "vif %d recovery failed (%d)\n", i, rc);
2055 wil_err(wil, "vif %d recovery add key failed (%d)\n",
2064 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2070 wil_dbg_misc(wil, "change_beacon, mid=%d\n", vif->mid);
2083 wil_dbg_misc(wil, "privacy changed %d=>%d. Restarting AP\n",
2105 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2112 wil_dbg_misc(wil, "start_ap\n");
2114 rc = wil_get_wmi_edmg_channel(wil, info->chandef.edmg.bw_config,
2121 wil_err(wil, "AP: No channel???\n");
2139 wil_err(wil, "AP: Invalid hidden SSID %d\n", info->hidden_ssid);
2142 wil_dbg_misc(wil, "AP on Channel %d %d MHz, %s\n", channel->hw_value,
2144 wil_dbg_misc(wil, "Privacy: %d auth_type %d\n",
2146 wil_dbg_misc(wil, "Hidden SSID mode: %d\n",
2148 wil_dbg_misc(wil, "BI %d DTIM %d\n", info->beacon_interval,
2150 wil_dbg_misc(wil, "PBSS %d\n", info->pbss);
2154 wil_print_crypto(wil, crypto);
2168 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2172 wil_dbg_misc(wil, "stop_ap, mid=%d\n", vif->mid);
2175 last = !wil_has_other_active_ifaces(wil, ndev, false, true);
2177 wil6210_bus_request(wil, WIL_DEFAULT_BUS_REQUEST_KBPS);
2178 wil_set_recovery_state(wil, fw_recovery_idle);
2179 set_bit(wil_status_resetting, wil->status);
2182 mutex_lock(&wil->mutex);
2194 __wil_down(wil);
2198 mutex_unlock(&wil->mutex);
2209 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2211 wil_dbg_misc(wil, "add station %pM aid %d mid %d mask 0x%x set 0x%x\n",
2216 wil_err(wil, "not supported with AP SME enabled\n");
2221 wil_err(wil, "invalid aid\n");
2233 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2235 wil_dbg_misc(wil, "del_station: %pM, reason=%d mid=%d\n",
2238 mutex_lock(&wil->mutex);
2240 mutex_unlock(&wil->mutex);
2251 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2256 wil_dbg_misc(wil, "change station %pM mask 0x%x set 0x%x mid %d\n",
2261 wil_dbg_misc(wil, "not supported with AP SME enabled\n");
2268 cid = wil_find_cid(wil, vif->mid, mac);
2270 wil_err(wil, "station not found\n");
2274 for (i = 0; i < ARRAY_SIZE(wil->ring2cid_tid); i++)
2275 if (wil->ring2cid_tid[i][0] == cid) {
2276 txdata = &wil->ring_tx_data[i];
2281 wil_err(wil, "ring data not found\n");
2287 wil_dbg_misc(wil, "cid %d ring %d authorize %d\n", cid, i,
2294 static void wil_probe_client_handle(struct wil6210_priv *wil,
2299 struct wil_sta_info *sta = &wil->sta[req->cid];
2329 struct wil6210_priv *wil = vif_to_wil(vif);
2336 wil_probe_client_handle(wil, vif, req);
2344 struct wil6210_priv *wil = vif_to_wil(vif);
2346 wil_dbg_misc(wil, "probe_client_flush\n");
2362 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2365 int cid = wil_find_cid(wil, vif->mid, peer);
2367 wil_dbg_misc(wil, "probe_client: %pM => CID %d MID %d\n",
2385 queue_work(wil->wq_service, &vif->probe_client_worker);
2393 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2397 wil_dbg_misc(wil, "change_bss: ap_isolate MID %d, %d => %d\n",
2409 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2412 wil_dbg_misc(wil, "enabled=%d, timeout=%d\n",
2420 return wil_ps_update(wil, ps_profile);
2426 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2431 if (test_bit(wil_status_suspended, wil->status)) {
2432 wil_dbg_pm(wil, "trying to suspend while suspended\n");
2436 rc = wil_can_suspend(wil, false);
2440 wil_dbg_pm(wil, "suspending\n");
2442 mutex_lock(&wil->mutex);
2443 mutex_lock(&wil->vif_mutex);
2444 wil_p2p_stop_radio_operations(wil);
2445 wil_abort_scan_all_vifs(wil, true);
2446 mutex_unlock(&wil->vif_mutex);
2447 mutex_unlock(&wil->mutex);
2455 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2457 wil_dbg_pm(wil, "resuming\n");
2467 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2474 wil_dbg_misc(wil,
2478 wil_dbg_misc(wil, "SSID[%d]:", i);
2483 wil_dbg_misc(wil, "channels:");
2485 wil_dbg_misc(wil, " %d%s", request->channels[i]->hw_value,
2487 wil_dbg_misc(wil, "n_match_sets %d, min_rssi_thold %d, delay %d\n",
2493 wil_dbg_misc(wil, "MATCHSET[%d]: rssi_thold %d\n",
2499 wil_dbg_misc(wil, "n_scan_plans %d\n", request->n_scan_plans);
2503 wil_dbg_misc(wil, "SCAN PLAN[%d]: interval %d iterations %d\n",
2511 return wmi_start_sched_scan(wil, request);
2518 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2525 rc = wmi_stop_sched_scan(wil);
2529 wil_dbg_misc(wil, "sched scan stopped (%d)\n", rc);
2538 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2544 wil_dbg_misc(wil, "update ft ies, mid=%d\n", vif->mid);
2548 if (!test_bit(WMI_FW_CAPABILITY_FT_ROAMING, wil->fw_capabilities)) {
2549 wil_err(wil, "FW does not support FT roaming\n");
2567 wil_err(wil, "FT: bss is NULL\n");
2574 rc = wmi_send(wil, WMI_FT_REASSOC_CMDID, vif->mid,
2577 wil_err(wil, "FT: reassoc failed (%d)\n", rc);
2586 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2588 if (wil->multicast_to_unicast == enabled)
2591 wil_info(wil, "set multicast to unicast, enabled=%d\n", enabled);
2592 wil->multicast_to_unicast = enabled;
2601 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
2604 wil->cqm_rssi_thold = rssi_thold;
2606 rc = wmi_set_cqm_rssi_config(wil, rssi_thold, rssi_hyst);
2609 wil->cqm_rssi_thold = 0;
2697 struct wil6210_priv *wil, const struct wil_fw_record_concurrency *conc)
2699 struct wiphy *wiphy = wil_to_wiphy(wil);
2709 wil_dbg_misc(wil, "iface_combinations already set, skipping\n");
2737 wil_dbg_misc(wil,
2746 wil_dbg_misc(wil,
2756 wil_dbg_misc(wil, "multiple VIFs supported, n_mids %d\n", conc->n_mids);
2757 wil->max_vifs = conc->n_mids + 1; /* including main interface */
2758 if (wil->max_vifs > WIL_MAX_VIFS) {
2759 wil_info(wil, "limited number of VIFs supported(%d, FW %d)\n",
2760 WIL_MAX_VIFS, wil->max_vifs);
2761 wil->max_vifs = WIL_MAX_VIFS;
2771 struct wil6210_priv *wil;
2787 wil = wiphy_to_wil(wiphy);
2788 wil->wiphy = wiphy;
2792 cfg80211_chandef_create(&wil->monitor_chandef, ch, NL80211_CHAN_NO_HT);
2794 return wil;
2797 void wil_cfg80211_deinit(struct wil6210_priv *wil)
2799 struct wiphy *wiphy = wil_to_wiphy(wil);
2801 dev_dbg(wil_to_dev(wil), "%s()\n", __func__);
2813 void wil_p2p_wdev_free(struct wil6210_priv *wil)
2817 mutex_lock(&wil->vif_mutex);
2818 p2p_wdev = wil->p2p_wdev;
2819 wil->p2p_wdev = NULL;
2820 wil->radio_wdev = wil->main_ndev->ieee80211_ptr;
2821 mutex_unlock(&wil->vif_mutex);
2848 struct wil6210_priv *wil = wdev_to_wil(wdev);
2849 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
2867 if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
2873 wil_err(wil, "Invalid rf sector ATTR\n");
2880 wil_err(wil, "Invalid rf sector spec\n");
2887 wil_err(wil, "Invalid sector index %d\n", sector_index);
2893 wil_err(wil, "Invalid sector type %d\n", sector_type);
2900 wil_err(wil, "Invalid rf module mask 0x%x\n", rf_modules_vec);
2907 rc = wmi_call(wil, WMI_GET_RF_SECTOR_PARAMS_CMDID, vif->mid,
2914 wil_err(wil, "get rf sector cfg failed with status %d\n",
2969 struct wil6210_priv *wil = wdev_to_wil(wdev);
2970 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
2987 if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
2993 wil_err(wil, "Invalid rf sector ATTR\n");
3000 wil_err(wil, "Invalid rf sector spec\n");
3007 wil_err(wil, "Invalid sector index %d\n", sector_index);
3013 wil_err(wil, "Invalid sector type %d\n", sector_type);
3029 wil_err(wil, "invalid sector cfg\n");
3040 wil_err(wil, "missing cfg params\n");
3047 wil_err(wil, "invalid RF module index %d\n",
3068 rc = wmi_call(wil, WMI_SET_RF_SECTOR_PARAMS_CMDID, vif->mid,
3081 struct wil6210_priv *wil = wdev_to_wil(wdev);
3082 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
3096 if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
3102 wil_err(wil, "Invalid rf sector ATTR\n");
3107 wil_err(wil, "Invalid rf sector spec\n");
3112 wil_err(wil, "Invalid sector type %d\n", sector_type);
3118 cid = wil_find_cid(wil, vif->mid, mac_addr);
3120 wil_err(wil, "invalid MAC address %pM\n", mac_addr);
3125 wil_err(wil, "must specify MAC address when connected\n");
3133 rc = wmi_call(wil, WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID, vif->mid,
3141 wil_err(wil, "get rf selected sector cfg failed with status %d\n",
3165 static int wil_rf_sector_wmi_set_selected(struct wil6210_priv *wil,
3182 rc = wmi_call(wil, WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID, mid,
3196 struct wil6210_priv *wil = wdev_to_wil(wdev);
3197 struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
3204 if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
3210 wil_err(wil, "Invalid rf sector ATTR\n");
3216 wil_err(wil, "Invalid rf sector spec\n");
3224 wil_err(wil, "Invalid sector index %d\n", sector_index);
3230 wil_err(wil, "Invalid sector type %d\n", sector_type);
3237 cid = wil_find_cid(wil, vif->mid, mac_addr);
3239 wil_err(wil, "invalid MAC address %pM\n",
3245 wil_err(wil, "broadcast MAC valid only with unlocking\n");
3252 wil_err(wil, "must specify MAC address when connected\n");
3259 rc = wil_rf_sector_wmi_set_selected(wil, vif->mid, sector_index,
3264 wil, vif->mid, WMI_INVALID_RF_SECTOR_INDEX,
3267 for (i = 0; i < wil->max_assoc_sta; i++) {
3268 if (wil->sta[i].mid != vif->mid)
3271 wil, vif->mid,
3279 wil_err(wil, "unlock cid %d failed with status %d\n",