Lines Matching +full:mac +full:- +full:s

1 // SPDX-License-Identifier: GPL-2.0+
2 /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
78 struct qtnf_wmac *mac; in qtnf_validate_iface_combinations() local
86 mac = wiphy_priv(wiphy); in qtnf_validate_iface_combinations()
87 if (!mac) in qtnf_validate_iface_combinations()
88 return -EFAULT; in qtnf_validate_iface_combinations()
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()
98 params.iftype_num[change_vif->wdev.iftype]--; 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()
115 ret = -EINVAL; in qtnf_validate_iface_combinations()
116 pr_err("MAC%u invalid combination: AP as primary repeater interface is not supported\n", in qtnf_validate_iface_combinations()
117 mac->macid); in qtnf_validate_iface_combinations()
137 vif->mac->macid, vif->vifid, type); in qtnf_change_virtual_intf()
142 mac_addr = params->macaddr; in qtnf_change_virtual_intf()
143 use4addr = params->use_4addr; in qtnf_change_virtual_intf()
146 qtnf_scan_done(vif->mac, true); 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()
161 struct net_device *netdev = wdev->netdev; in qtnf_del_virtual_intf()
166 return -EFAULT; in qtnf_del_virtual_intf()
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()
182 if (netdev->reg_state == NETREG_REGISTERED) 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()
202 struct qtnf_wmac *mac; in qtnf_add_virtual_intf() local
208 mac = wiphy_priv(wiphy); in qtnf_add_virtual_intf()
210 if (!mac) in qtnf_add_virtual_intf()
211 return ERR_PTR(-EFAULT); in qtnf_add_virtual_intf()
215 pr_err("MAC%u invalid combination: failed to add type %d\n", in qtnf_add_virtual_intf()
216 mac->macid, type); in qtnf_add_virtual_intf()
223 vif = qtnf_mac_get_free_vif(mac); in qtnf_add_virtual_intf()
225 pr_err("MAC%u: no free VIF available\n", mac->macid); in qtnf_add_virtual_intf()
226 return ERR_PTR(-EFAULT); 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()
237 pr_err("MAC%u: unsupported IF type %d\n", mac->macid, type); in qtnf_add_virtual_intf()
238 return ERR_PTR(-ENOTSUPP); in qtnf_add_virtual_intf()
242 mac_addr = params->macaddr; in qtnf_add_virtual_intf()
243 use4addr = params->use_4addr; 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()
256 ret = -EINVAL; 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()
267 if (qtnf_hwcap_is_set(&mac->bus->hw_info, QLINK_HW_CAPAB_HW_BRIDGE)) { 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()
282 vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; in qtnf_add_virtual_intf()
292 if (!info->beacon_ies || !info->beacon_ies_len) { in qtnf_mgmt_set_appie()
297 info->beacon_ies, in qtnf_mgmt_set_appie()
298 info->beacon_ies_len); in qtnf_mgmt_set_appie()
304 if (!info->proberesp_ies || !info->proberesp_ies_len) { in qtnf_mgmt_set_appie()
311 info->proberesp_ies, in qtnf_mgmt_set_appie()
312 info->proberesp_ies_len); in qtnf_mgmt_set_appie()
318 if (!info->assocresp_ies || !info->assocresp_ies_len) { in qtnf_mgmt_set_appie()
325 info->assocresp_ies, in qtnf_mgmt_set_appie()
326 info->assocresp_ies_len); in qtnf_mgmt_set_appie()
338 return qtnf_mgmt_set_appie(vif, &info->beacon); in qtnf_change_beacon()
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()
361 qtnf_scan_done(vif->mac, true); in qtnf_stop_ap()
366 vif->mac->macid, vif->vifid); in qtnf_stop_ap()
368 netif_carrier_off(vif->netdev); in qtnf_stop_ap()
375 struct qtnf_wmac *mac = wiphy_priv(wiphy); in qtnf_set_wiphy_params() local
379 vif = qtnf_mac_get_base_vif(mac); in qtnf_set_wiphy_params()
381 pr_err("MAC%u: primary VIF is not configured\n", mac->macid); in qtnf_set_wiphy_params()
382 return -EFAULT; in qtnf_set_wiphy_params()
385 ret = qtnf_cmd_send_update_phy_params(mac, changed); in qtnf_set_wiphy_params()
387 pr_err("MAC%u: failed to update PHY params\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()
398 u16 new_mask = upd->interface_stypes; in qtnf_update_mgmt_frame_registrations()
399 u16 old_mask = vif->mgmt_frames_bitmask; 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()
451 const struct ieee80211_mgmt *mgmt_frame = (void *)params->buf; in qtnf_mgmt_tx()
458 if (params->offchan) in qtnf_mgmt_tx()
461 if (params->no_cck) in qtnf_mgmt_tx()
464 if (params->dont_wait_for_ack) in qtnf_mgmt_tx()
470 if (params->chan) in qtnf_mgmt_tx()
471 freq = params->chan->center_freq; in qtnf_mgmt_tx()
475 pr_debug("%s freq:%u; FC:%.4X; DA:%pM; len:%zu; C:%.8X; FL:%.4X\n", in qtnf_mgmt_tx()
476 wdev->netdev->name, freq, in qtnf_mgmt_tx()
477 le16_to_cpu(mgmt_frame->frame_control), mgmt_frame->da, in qtnf_mgmt_tx()
478 params->len, short_cookie, flags); in qtnf_mgmt_tx()
481 freq, params->buf, params->len); in qtnf_mgmt_tx()
486 const u8 *mac, struct station_info *sinfo) in qtnf_get_station() argument
490 sinfo->generation = vif->generation; in qtnf_get_station()
491 return qtnf_cmd_get_sta_info(vif, mac, sinfo); in qtnf_get_station()
496 int idx, u8 *mac, struct station_info *sinfo) in qtnf_dump_station() argument
502 switch (vif->wdev.iftype) { in qtnf_dump_station()
504 if (idx != 0 || !vif->wdev.connected) in qtnf_dump_station()
505 return -ENOENT; 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()
512 return -ENOENT; in qtnf_dump_station()
514 ether_addr_copy(mac, sta_node->mac_addr); in qtnf_dump_station()
517 return -ENOTSUPP; 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()
523 if (ret == -ENOENT) { in qtnf_dump_station()
524 cfg80211_del_sta(vif->netdev, mac, GFP_KERNEL); in qtnf_dump_station()
525 sinfo->filled = 0; in qtnf_dump_station()
529 sinfo->generation = vif->generation; in qtnf_dump_station()
544 vif->mac->macid, vif->vifid, params->cipher, key_index, in qtnf_add_key()
559 if (ret == -ENOENT) { in qtnf_del_key()
561 vif->mac->macid, vif->vifid, key_index); in qtnf_del_key()
564 vif->mac->macid, vif->vifid, in qtnf_del_key()
582 vif->mac->macid, vif->vifid, key_index, unicast, in qtnf_set_default_key()
598 vif->mac->macid, vif->vifid, key_index); in qtnf_set_default_mgmt_key()
605 const u8 *mac, struct station_parameters *params) in qtnf_change_station() argument
610 ret = qtnf_cmd_send_change_sta(vif, mac, params); in qtnf_change_station()
613 vif->mac->macid, vif->vifid, mac); in qtnf_change_station()
625 if (params->mac && in qtnf_del_station()
626 (vif->wdev.iftype == NL80211_IFTYPE_AP) && in qtnf_del_station()
627 !is_broadcast_ether_addr(params->mac) && in qtnf_del_station()
628 !qtnf_sta_list_lookup(&vif->sta_list, params->mac)) in qtnf_del_station()
634 vif->mac->macid, vif->vifid, params->mac); in qtnf_del_station()
642 struct qtnf_wmac *mac = wiphy_priv(wiphy); in qtnf_scan() local
645 cancel_delayed_work_sync(&mac->scan_timeout); in qtnf_scan()
647 mac->scan_req = request; in qtnf_scan()
649 ret = qtnf_cmd_send_scan(mac); in qtnf_scan()
651 pr_err("MAC%u: failed to start scan\n", mac->macid); in qtnf_scan()
652 mac->scan_req = NULL; in qtnf_scan()
656 pr_debug("MAC%u: scan started\n", mac->macid); in qtnf_scan()
657 queue_delayed_work(mac->bus->workqueue, &mac->scan_timeout, in qtnf_scan()
671 if (vif->wdev.iftype != NL80211_IFTYPE_STATION) in qtnf_connect()
672 return -EOPNOTSUPP; in qtnf_connect()
674 if (sme->auth_type == NL80211_AUTHTYPE_SAE && in qtnf_connect()
675 !(sme->flags & CONNECT_REQ_EXTERNAL_AUTH_SUPPORT)) { in qtnf_connect()
677 return -EOPNOTSUPP; in qtnf_connect()
680 if (sme->bssid) in qtnf_connect()
681 ether_addr_copy(vif->bssid, sme->bssid); in qtnf_connect()
683 eth_zero_addr(vif->bssid); in qtnf_connect()
688 vif->mac->macid, vif->vifid); in qtnf_connect()
700 if (vif->wdev.iftype == NL80211_IFTYPE_STATION && in qtnf_external_auth()
701 !ether_addr_equal(vif->bssid, auth->bssid)) in qtnf_external_auth()
702 pr_warn("unexpected bssid: %pM", auth->bssid); in qtnf_external_auth()
707 vif->mac->macid, vif->vifid); in qtnf_external_auth()
716 struct qtnf_wmac *mac = wiphy_priv(wiphy); in qtnf_disconnect() local
720 vif = qtnf_mac_get_base_vif(mac); in qtnf_disconnect()
722 pr_err("MAC%u: primary VIF is not configured\n", mac->macid); in qtnf_disconnect()
723 return -EFAULT; in qtnf_disconnect()
726 if (vif->wdev.iftype != NL80211_IFTYPE_STATION) in qtnf_disconnect()
727 return -EOPNOTSUPP; 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()
747 struct qtnf_wmac *mac = wiphy_priv(wiphy); in qtnf_dump_survey() local
748 struct wireless_dev *wdev = dev->ieee80211_ptr; in qtnf_dump_survey()
754 sband = wiphy->bands[NL80211_BAND_2GHZ]; in qtnf_dump_survey()
755 if (sband && idx >= sband->n_channels) { in qtnf_dump_survey()
756 idx -= sband->n_channels; in qtnf_dump_survey()
761 sband = wiphy->bands[NL80211_BAND_5GHZ]; in qtnf_dump_survey()
763 if (!sband || idx >= sband->n_channels) in qtnf_dump_survey()
764 return -ENOENT; in qtnf_dump_survey()
766 chan = &sband->channels[idx]; in qtnf_dump_survey()
767 survey->channel = chan; in qtnf_dump_survey()
768 survey->filled = 0x0; in qtnf_dump_survey()
770 if (chandef && chan == chandef->chan) in qtnf_dump_survey()
771 survey->filled = SURVEY_INFO_IN_USE; in qtnf_dump_survey()
773 ret = qtnf_cmd_get_chan_stats(mac, chan->center_freq, survey); in qtnf_dump_survey()
776 chan->hw_value); in qtnf_dump_survey()
785 struct net_device *ndev = wdev->netdev; in qtnf_get_channel()
790 return -ENODEV; in qtnf_get_channel()
792 vif = qtnf_netdev_get_priv(wdev->netdev); in qtnf_get_channel()
796 pr_err("%s: failed to get channel: %d\n", ndev->name, ret); in qtnf_get_channel()
797 ret = -ENODATA; in qtnf_get_channel()
802 pr_err("%s: bad channel freq=%u cf1=%u cf2=%u bw=%u\n", in qtnf_get_channel()
803 ndev->name, chandef->chan->center_freq, in qtnf_get_channel()
804 chandef->center_freq1, chandef->center_freq2, in qtnf_get_channel()
805 chandef->width); in qtnf_get_channel()
806 ret = -ENODATA; in qtnf_get_channel()
820 pr_debug("%s: chan(%u) count(%u) radar(%u) block_tx(%u)\n", dev->name, in qtnf_channel_switch()
821 params->chandef.chan->hw_value, params->count, in qtnf_channel_switch()
822 params->radar_required, params->block_tx); in qtnf_channel_switch()
824 if (!cfg80211_chandef_valid(&params->chandef)) { in qtnf_channel_switch()
825 pr_err("%s: invalid channel\n", dev->name); in qtnf_channel_switch()
826 return -EINVAL; in qtnf_channel_switch()
831 pr_warn("%s: failed to switch to channel (%u)\n", in qtnf_channel_switch()
832 dev->name, params->chandef.chan->hw_value); in qtnf_channel_switch()
846 return -ENOTSUPP; in qtnf_start_radar_detection()
850 pr_err("%s: failed to start CAC ret=%d\n", ndev->name, ret); in qtnf_start_radar_detection()
864 pr_err("%s: failed to set mac ACL ret=%d\n", dev->name, ret); in qtnf_set_mac_acl()
878 pr_err("%s: failed to set PM mode ret=%d\n", dev->name, ret); in qtnf_set_power_mgmt()
886 struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); in qtnf_get_tx_power()
891 pr_err("MAC%u: failed to get Tx power\n", vif->mac->macid); in qtnf_get_tx_power()
903 vif = qtnf_netdev_get_priv(wdev->netdev); in qtnf_set_tx_power()
905 struct qtnf_wmac *mac = wiphy_priv(wiphy); in qtnf_set_tx_power() local
907 vif = qtnf_mac_get_base_vif(mac); in qtnf_set_tx_power()
909 pr_err("MAC%u: primary VIF is not configured\n", in qtnf_set_tx_power()
910 mac->macid); in qtnf_set_tx_power()
911 return -EFAULT; in qtnf_set_tx_power()
917 pr_err("MAC%u: failed to set Tx power\n", vif->mac->macid); in qtnf_set_tx_power()
928 if (vif->wdev.iftype != NL80211_IFTYPE_AP) in qtnf_update_owe_info()
929 return -EOPNOTSUPP; in qtnf_update_owe_info()
934 vif->mac->macid, vif->vifid); in qtnf_update_owe_info()
942 struct qtnf_wmac *mac = wiphy_priv(wiphy); in qtnf_suspend() local
946 vif = qtnf_mac_get_base_vif(mac); in qtnf_suspend()
948 pr_err("MAC%u: primary VIF is not configured\n", mac->macid); in qtnf_suspend()
949 ret = -EFAULT; in qtnf_suspend()
955 qtnf_virtual_intf_cleanup(vif->netdev); in qtnf_suspend()
959 qtnf_scan_done(vif->mac, true); in qtnf_suspend()
963 pr_err("MAC%u: failed to set WoWLAN triggers\n", in qtnf_suspend()
964 mac->macid); in qtnf_suspend()
974 struct qtnf_wmac *mac = wiphy_priv(wiphy); in qtnf_resume() local
978 vif = qtnf_mac_get_base_vif(mac); in qtnf_resume()
980 pr_err("MAC%u: primary VIF is not configured\n", mac->macid); in qtnf_resume()
981 return -EFAULT; in qtnf_resume()
986 pr_err("MAC%u: failed to reset WoWLAN triggers\n", in qtnf_resume()
987 mac->macid); in qtnf_resume()
994 struct qtnf_wmac *mac = wiphy_priv(wiphy); in qtnf_set_wakeup() local
995 struct qtnf_bus *bus = mac->bus; in qtnf_set_wakeup()
997 device_set_wakeup_enable(bus->dev, enabled); in qtnf_set_wakeup()
1043 struct qtnf_wmac *mac = wiphy_priv(wiphy); in qtnf_cfg80211_reg_notifier() local
1047 pr_debug("MAC%u: initiator=%d alpha=%c%c\n", mac->macid, req->initiator, in qtnf_cfg80211_reg_notifier()
1048 req->alpha2[0], req->alpha2[1]); in qtnf_cfg80211_reg_notifier()
1050 ret = qtnf_cmd_reg_notify(mac, req, qtnf_slave_radar_get(), in qtnf_cfg80211_reg_notifier()
1053 pr_err("MAC%u: failed to update region to %c%c: %d\n", in qtnf_cfg80211_reg_notifier()
1054 mac->macid, req->alpha2[0], req->alpha2[1], ret); in qtnf_cfg80211_reg_notifier()
1059 if (!wiphy->bands[band]) in qtnf_cfg80211_reg_notifier()
1062 ret = qtnf_cmd_band_info_get(mac, wiphy->bands[band]); in qtnf_cfg80211_reg_notifier()
1064 pr_err("MAC%u: failed to update band %u\n", in qtnf_cfg80211_reg_notifier()
1065 mac->macid, band); in qtnf_cfg80211_reg_notifier()
1075 qtnf_hwcap_is_set(&bus->hw_info, QLINK_HW_CAPAB_DFS_OFFLOAD)) in qtnf_wiphy_allocate()
1078 if (!qtnf_hwcap_is_set(&bus->hw_info, QLINK_HW_CAPAB_PWR_MGMT)) in qtnf_wiphy_allocate()
1086 set_wiphy_dev(wiphy, &pdev->dev); in qtnf_wiphy_allocate()
1088 set_wiphy_dev(wiphy, bus->dev); in qtnf_wiphy_allocate()
1101 if_comb = mac_info->if_comb; in qtnf_wiphy_setup_if_comb()
1102 n_if_comb = mac_info->n_if_comb; in qtnf_wiphy_setup_if_comb()
1105 return -ENOENT; in qtnf_wiphy_setup_if_comb()
1108 if_comb[i].radar_detect_widths = mac_info->radar_detect_widths; in qtnf_wiphy_setup_if_comb()
1114 wiphy->iface_combinations = if_comb; in qtnf_wiphy_setup_if_comb()
1115 wiphy->n_iface_combinations = n_if_comb; in qtnf_wiphy_setup_if_comb()
1116 wiphy->interface_modes = interface_modes; in qtnf_wiphy_setup_if_comb()
1121 int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac) in qtnf_wiphy_register() argument
1123 struct wiphy *wiphy = priv_to_wiphy(mac); in qtnf_wiphy_register()
1124 struct qtnf_mac_info *macinfo = &mac->macinfo; in qtnf_wiphy_register()
1130 return -EFAULT; in qtnf_wiphy_register()
1133 wiphy->frag_threshold = macinfo->frag_thr; in qtnf_wiphy_register()
1134 wiphy->rts_threshold = macinfo->rts_thr; in qtnf_wiphy_register()
1135 wiphy->retry_short = macinfo->sretry_limit; in qtnf_wiphy_register()
1136 wiphy->retry_long = macinfo->lretry_limit; in qtnf_wiphy_register()
1137 wiphy->coverage_class = macinfo->coverage_class; in qtnf_wiphy_register()
1139 wiphy->max_scan_ssids = in qtnf_wiphy_register()
1140 (macinfo->max_scan_ssids) ? macinfo->max_scan_ssids : 1; in qtnf_wiphy_register()
1141 wiphy->max_scan_ie_len = QTNF_MAX_VSIE_LEN; in qtnf_wiphy_register()
1142 wiphy->mgmt_stypes = qtnf_mgmt_stypes; in qtnf_wiphy_register()
1143 wiphy->max_remain_on_channel_duration = 5000; in qtnf_wiphy_register()
1144 wiphy->max_acl_mac_addrs = macinfo->max_acl_mac_addrs; in qtnf_wiphy_register()
1145 wiphy->max_num_csa_counters = 2; in qtnf_wiphy_register()
1152 wiphy->cipher_suites = qtnf_cipher_suites; in qtnf_wiphy_register()
1153 wiphy->n_cipher_suites = ARRAY_SIZE(qtnf_cipher_suites); in qtnf_wiphy_register()
1154 wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; in qtnf_wiphy_register()
1155 wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME | in qtnf_wiphy_register()
1161 wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; in qtnf_wiphy_register()
1171 wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS | in qtnf_wiphy_register()
1174 wiphy->available_antennas_tx = macinfo->num_tx_chain; in qtnf_wiphy_register()
1175 wiphy->available_antennas_rx = macinfo->num_rx_chain; in qtnf_wiphy_register()
1177 wiphy->max_ap_assoc_sta = macinfo->max_ap_assoc_sta; in qtnf_wiphy_register()
1178 wiphy->ht_capa_mod_mask = &macinfo->ht_cap_mod_mask; in qtnf_wiphy_register()
1179 wiphy->vht_capa_mod_mask = &macinfo->vht_cap_mod_mask; in qtnf_wiphy_register()
1181 ether_addr_copy(wiphy->perm_addr, mac->macaddr); in qtnf_wiphy_register()
1184 wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER; in qtnf_wiphy_register()
1187 wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR; in qtnf_wiphy_register()
1190 wiphy->features |= NL80211_FEATURE_NEED_OBSS_SCAN; in qtnf_wiphy_register()
1193 wiphy->features |= NL80211_FEATURE_SAE; in qtnf_wiphy_register()
1196 if (macinfo->wowlan) in qtnf_wiphy_register()
1197 wiphy->wowlan = macinfo->wowlan; in qtnf_wiphy_register()
1200 regdomain_is_known = isalpha(mac->rd->alpha2[0]) && in qtnf_wiphy_register()
1201 isalpha(mac->rd->alpha2[1]); in qtnf_wiphy_register()
1204 wiphy->reg_notifier = qtnf_cfg80211_reg_notifier; in qtnf_wiphy_register()
1206 if (mac->rd->alpha2[0] == '9' && mac->rd->alpha2[1] == '9') { in qtnf_wiphy_register()
1207 wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG | in qtnf_wiphy_register()
1209 wiphy_apply_custom_regulatory(wiphy, mac->rd); in qtnf_wiphy_register()
1211 wiphy->regulatory_flags |= REGULATORY_STRICT_REG; in qtnf_wiphy_register()
1214 wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED; in qtnf_wiphy_register()
1217 if (mac->macinfo.extended_capabilities_len) { in qtnf_wiphy_register()
1218 wiphy->extended_capabilities = in qtnf_wiphy_register()
1219 mac->macinfo.extended_capabilities; in qtnf_wiphy_register()
1220 wiphy->extended_capabilities_mask = in qtnf_wiphy_register()
1221 mac->macinfo.extended_capabilities_mask; in qtnf_wiphy_register()
1222 wiphy->extended_capabilities_len = in qtnf_wiphy_register()
1223 mac->macinfo.extended_capabilities_len; in qtnf_wiphy_register()
1226 strscpy(wiphy->fw_version, hw_info->fw_version, in qtnf_wiphy_register()
1227 sizeof(wiphy->fw_version)); in qtnf_wiphy_register()
1228 wiphy->hw_version = hw_info->hw_version; in qtnf_wiphy_register()
1234 if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) in qtnf_wiphy_register()
1235 ret = regulatory_set_wiphy_regd(wiphy, mac->rd); in qtnf_wiphy_register()
1237 ret = regulatory_hint(wiphy, mac->rd->alpha2); in qtnf_wiphy_register()
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()
1255 struct qtnf_wmac *mac = wiphy_priv(vif->wdev.wiphy); in qtnf_virtual_intf_cleanup() local
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()
1261 qtnf_scan_done(mac, true); in qtnf_virtual_intf_cleanup()
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()
1275 switch (band->band) { in qtnf_band_init_rates()
1277 band->bitrates = qtnf_rates_2g; in qtnf_band_init_rates()
1278 band->n_bitrates = ARRAY_SIZE(qtnf_rates_2g); in qtnf_band_init_rates()
1281 band->bitrates = qtnf_rates_5g; in qtnf_band_init_rates()
1282 band->n_bitrates = ARRAY_SIZE(qtnf_rates_5g); in qtnf_band_init_rates()
1285 band->bitrates = NULL; in qtnf_band_init_rates()
1286 band->n_bitrates = 0; in qtnf_band_init_rates()