Lines Matching full:local
37 void ieee80211_configure_filter(struct ieee80211_local *local) in ieee80211_configure_filter() argument
43 if (atomic_read(&local->iff_allmultis)) in ieee80211_configure_filter()
46 if (local->monitors || test_bit(SCAN_SW_SCANNING, &local->scanning) || in ieee80211_configure_filter()
47 test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning)) in ieee80211_configure_filter()
50 if (local->fif_probe_req || local->probe_req_reg) in ieee80211_configure_filter()
53 if (local->fif_fcsfail) in ieee80211_configure_filter()
56 if (local->fif_plcpfail) in ieee80211_configure_filter()
59 if (local->fif_control) in ieee80211_configure_filter()
62 if (local->fif_other_bss) in ieee80211_configure_filter()
65 if (local->fif_pspoll) in ieee80211_configure_filter()
68 if (local->rx_mcast_action_reg) in ieee80211_configure_filter()
71 spin_lock_bh(&local->filter_lock); in ieee80211_configure_filter()
72 changed_flags = local->filter_flags ^ new_flags; in ieee80211_configure_filter()
74 mc = drv_prepare_multicast(local, &local->mc_list); in ieee80211_configure_filter()
75 spin_unlock_bh(&local->filter_lock); in ieee80211_configure_filter()
80 drv_configure_filter(local, changed_flags, &new_flags, mc); in ieee80211_configure_filter()
84 local->filter_flags = new_flags & ~(1<<31); in ieee80211_configure_filter()
89 struct ieee80211_local *local = in ieee80211_reconfig_filter() local
92 ieee80211_configure_filter(local); in ieee80211_reconfig_filter()
95 static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local) in ieee80211_hw_conf_chan() argument
103 offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
105 if (local->scan_chandef.chan) { in ieee80211_hw_conf_chan()
106 chandef = local->scan_chandef; in ieee80211_hw_conf_chan()
107 } else if (local->tmp_channel) { in ieee80211_hw_conf_chan()
108 chandef.chan = local->tmp_channel; in ieee80211_hw_conf_chan()
113 chandef = local->_oper_chandef; in ieee80211_hw_conf_chan()
121 if (!cfg80211_chandef_identical(&chandef, &local->_oper_chandef)) in ieee80211_hw_conf_chan()
122 local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
124 local->hw.conf.flags &= ~IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
126 offchannel_flag ^= local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
129 !cfg80211_chandef_identical(&local->hw.conf.chandef, in ieee80211_hw_conf_chan()
130 &local->_oper_chandef)) { in ieee80211_hw_conf_chan()
131 local->hw.conf.chandef = chandef; in ieee80211_hw_conf_chan()
135 if (!conf_is_ht(&local->hw.conf)) { in ieee80211_hw_conf_chan()
141 local->hw.conf.smps_mode = IEEE80211_SMPS_STATIC; in ieee80211_hw_conf_chan()
142 } else if (local->hw.conf.smps_mode != local->smps_mode) { in ieee80211_hw_conf_chan()
143 local->hw.conf.smps_mode = local->smps_mode; in ieee80211_hw_conf_chan()
150 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_hw_conf_chan()
161 if (local->hw.conf.power_level != power) { in ieee80211_hw_conf_chan()
163 local->hw.conf.power_level = power; in ieee80211_hw_conf_chan()
169 int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) in ieee80211_hw_config() argument
175 if (!local->use_chanctx) in ieee80211_hw_config()
176 changed |= ieee80211_hw_conf_chan(local); in ieee80211_hw_config()
182 if (changed && local->open_count) { in ieee80211_hw_config()
183 ret = drv_config(local, changed); in ieee80211_hw_config()
214 struct ieee80211_local *local = sdata->local; in ieee80211_bss_info_change_notify() local
242 trace_drv_vif_cfg_changed(local, sdata, changed); in ieee80211_bss_info_change_notify()
243 if (local->ops->vif_cfg_changed) in ieee80211_bss_info_change_notify()
244 local->ops->vif_cfg_changed(&local->hw, &sdata->vif, ch); in ieee80211_bss_info_change_notify()
251 trace_drv_link_info_changed(local, sdata, &sdata->vif.bss_conf, in ieee80211_bss_info_change_notify()
253 if (local->ops->link_info_changed) in ieee80211_bss_info_change_notify()
254 local->ops->link_info_changed(&local->hw, &sdata->vif, in ieee80211_bss_info_change_notify()
258 if (local->ops->bss_info_changed) in ieee80211_bss_info_change_notify()
259 local->ops->bss_info_changed(&local->hw, &sdata->vif, in ieee80211_bss_info_change_notify()
261 trace_drv_return_void(local); in ieee80211_bss_info_change_notify()
267 struct ieee80211_local *local = sdata->local; in ieee80211_vif_cfg_change_notify() local
274 drv_vif_cfg_changed(local, sdata, changed); in ieee80211_vif_cfg_change_notify()
281 struct ieee80211_local *local = sdata->local; in ieee80211_link_info_change_notify() local
291 drv_link_info_changed(local, sdata, link->conf, link->link_id, changed); in ieee80211_link_info_change_notify()
306 struct ieee80211_local *local = from_tasklet(local, t, tasklet); in ieee80211_tasklet_handler() local
309 while ((skb = skb_dequeue(&local->skb_queue)) || in ieee80211_tasklet_handler()
310 (skb = skb_dequeue(&local->skb_queue_unreliable))) { in ieee80211_tasklet_handler()
316 ieee80211_rx(&local->hw, skb); in ieee80211_tasklet_handler()
320 ieee80211_tx_status(&local->hw, skb); in ieee80211_tasklet_handler()
333 struct ieee80211_local *local = in ieee80211_restart_work() local
339 flush_workqueue(local->workqueue); in ieee80211_restart_work()
340 flush_work(&local->sched_scan_stopped_work); in ieee80211_restart_work()
341 flush_work(&local->radar_detected_work); in ieee80211_restart_work()
345 wiphy_lock(local->hw.wiphy); in ieee80211_restart_work()
347 WARN(test_bit(SCAN_HW_SCANNING, &local->scanning), in ieee80211_restart_work()
350 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_restart_work()
367 wiphy_work_cancel(local->hw.wiphy, in ieee80211_restart_work()
379 ieee80211_scan_cancel(local); in ieee80211_restart_work()
381 /* make sure any new ROC will consider local->in_reconfig */ in ieee80211_restart_work()
382 flush_delayed_work(&local->roc_work); in ieee80211_restart_work()
383 flush_work(&local->hw_roc_done); in ieee80211_restart_work()
388 ret = ieee80211_reconfig(local); in ieee80211_restart_work()
389 wiphy_unlock(local->hw.wiphy); in ieee80211_restart_work()
392 cfg80211_shutdown_all_interfaces(local->hw.wiphy); in ieee80211_restart_work()
399 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_restart_hw() local
401 trace_api_restart_hw(local); in ieee80211_restart_hw()
415 local->in_reconfig = true; in ieee80211_restart_hw()
418 queue_work(system_freezable_wq, &local->restart_work); in ieee80211_restart_hw()
427 struct ieee80211_local *local = in ieee80211_ifa_changed() local
442 if (wdev->wiphy != local->hw.wiphy) in ieee80211_ifa_changed()
487 struct ieee80211_local *local = in ieee80211_ifa6_changed() local
493 if (!wdev || wdev->wiphy != local->hw.wiphy) in ieee80211_ifa6_changed()
505 drv_ipv6_addr_change(local, sdata, idev); in ieee80211_ifa6_changed()
628 struct ieee80211_local *local; in ieee80211_alloc_hw_nm() local
668 priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len; in ieee80211_alloc_hw_nm()
729 local = wiphy_priv(wiphy); in ieee80211_alloc_hw_nm()
731 if (sta_info_init(local)) in ieee80211_alloc_hw_nm()
734 local->hw.wiphy = wiphy; in ieee80211_alloc_hw_nm()
736 local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); in ieee80211_alloc_hw_nm()
738 local->ops = ops; in ieee80211_alloc_hw_nm()
739 local->use_chanctx = use_chanctx; in ieee80211_alloc_hw_nm()
745 * second, so 7 is ~8ms of queued data. Only affects local TCP in ieee80211_alloc_hw_nm()
748 * for local reasons (longer buffers, longer completion time, or in ieee80211_alloc_hw_nm()
751 local->hw.tx_sk_pacing_shift = 7; in ieee80211_alloc_hw_nm()
754 local->hw.queues = 1; in ieee80211_alloc_hw_nm()
755 local->hw.max_rates = 1; in ieee80211_alloc_hw_nm()
756 local->hw.max_report_rates = 0; in ieee80211_alloc_hw_nm()
757 local->hw.max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HT; in ieee80211_alloc_hw_nm()
758 local->hw.max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HT; in ieee80211_alloc_hw_nm()
759 local->hw.offchannel_tx_hw_queue = IEEE80211_INVAL_HW_QUEUE; in ieee80211_alloc_hw_nm()
760 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long; in ieee80211_alloc_hw_nm()
761 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short; in ieee80211_alloc_hw_nm()
762 local->hw.radiotap_mcs_details = IEEE80211_RADIOTAP_MCS_HAVE_MCS | in ieee80211_alloc_hw_nm()
765 local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | in ieee80211_alloc_hw_nm()
767 local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES; in ieee80211_alloc_hw_nm()
768 local->hw.uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN; in ieee80211_alloc_hw_nm()
769 local->hw.max_mtu = IEEE80211_MAX_DATA_LEN; in ieee80211_alloc_hw_nm()
770 local->user_power_level = IEEE80211_UNSET_POWER_LEVEL; in ieee80211_alloc_hw_nm()
774 local->ext_capa[7] = WLAN_EXT_CAPA8_OPMODE_NOTIF; in ieee80211_alloc_hw_nm()
776 wiphy->extended_capabilities = local->ext_capa; in ieee80211_alloc_hw_nm()
777 wiphy->extended_capabilities_mask = local->ext_capa; in ieee80211_alloc_hw_nm()
779 ARRAY_SIZE(local->ext_capa); in ieee80211_alloc_hw_nm()
781 INIT_LIST_HEAD(&local->interfaces); in ieee80211_alloc_hw_nm()
782 INIT_LIST_HEAD(&local->mon_list); in ieee80211_alloc_hw_nm()
784 __hw_addr_init(&local->mc_list); in ieee80211_alloc_hw_nm()
786 mutex_init(&local->iflist_mtx); in ieee80211_alloc_hw_nm()
787 mutex_init(&local->mtx); in ieee80211_alloc_hw_nm()
789 mutex_init(&local->key_mtx); in ieee80211_alloc_hw_nm()
790 spin_lock_init(&local->filter_lock); in ieee80211_alloc_hw_nm()
791 spin_lock_init(&local->rx_path_lock); in ieee80211_alloc_hw_nm()
792 spin_lock_init(&local->queue_stop_reason_lock); in ieee80211_alloc_hw_nm()
795 INIT_LIST_HEAD(&local->active_txqs[i]); in ieee80211_alloc_hw_nm()
796 spin_lock_init(&local->active_txq_lock[i]); in ieee80211_alloc_hw_nm()
797 local->aql_txq_limit_low[i] = IEEE80211_DEFAULT_AQL_TXQ_LIMIT_L; in ieee80211_alloc_hw_nm()
798 local->aql_txq_limit_high[i] = in ieee80211_alloc_hw_nm()
800 atomic_set(&local->aql_ac_pending_airtime[i], 0); in ieee80211_alloc_hw_nm()
803 local->airtime_flags = AIRTIME_USE_TX | AIRTIME_USE_RX; in ieee80211_alloc_hw_nm()
804 local->aql_threshold = IEEE80211_AQL_THRESHOLD; in ieee80211_alloc_hw_nm()
805 atomic_set(&local->aql_total_pending_airtime, 0); in ieee80211_alloc_hw_nm()
807 spin_lock_init(&local->handle_wake_tx_queue_lock); in ieee80211_alloc_hw_nm()
809 INIT_LIST_HEAD(&local->chanctx_list); in ieee80211_alloc_hw_nm()
810 mutex_init(&local->chanctx_mtx); in ieee80211_alloc_hw_nm()
812 INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work); in ieee80211_alloc_hw_nm()
814 INIT_WORK(&local->restart_work, ieee80211_restart_work); in ieee80211_alloc_hw_nm()
816 INIT_WORK(&local->radar_detected_work, in ieee80211_alloc_hw_nm()
819 INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter); in ieee80211_alloc_hw_nm()
820 local->smps_mode = IEEE80211_SMPS_OFF; in ieee80211_alloc_hw_nm()
822 INIT_WORK(&local->dynamic_ps_enable_work, in ieee80211_alloc_hw_nm()
824 INIT_WORK(&local->dynamic_ps_disable_work, in ieee80211_alloc_hw_nm()
826 timer_setup(&local->dynamic_ps_timer, ieee80211_dynamic_ps_timer, 0); in ieee80211_alloc_hw_nm()
828 INIT_WORK(&local->sched_scan_stopped_work, in ieee80211_alloc_hw_nm()
831 spin_lock_init(&local->ack_status_lock); in ieee80211_alloc_hw_nm()
832 idr_init(&local->ack_status_frames); in ieee80211_alloc_hw_nm()
835 skb_queue_head_init(&local->pending[i]); in ieee80211_alloc_hw_nm()
836 atomic_set(&local->agg_queue_stop[i], 0); in ieee80211_alloc_hw_nm()
838 tasklet_setup(&local->tx_pending_tasklet, ieee80211_tx_pending); in ieee80211_alloc_hw_nm()
839 tasklet_setup(&local->wake_txqs_tasklet, ieee80211_wake_txqs); in ieee80211_alloc_hw_nm()
840 tasklet_setup(&local->tasklet, ieee80211_tasklet_handler); in ieee80211_alloc_hw_nm()
842 skb_queue_head_init(&local->skb_queue); in ieee80211_alloc_hw_nm()
843 skb_queue_head_init(&local->skb_queue_unreliable); in ieee80211_alloc_hw_nm()
845 ieee80211_alloc_led_names(local); in ieee80211_alloc_hw_nm()
847 ieee80211_roc_setup(local); in ieee80211_alloc_hw_nm()
849 local->hw.radiotap_timestamp.units_pos = -1; in ieee80211_alloc_hw_nm()
850 local->hw.radiotap_timestamp.accuracy = -1; in ieee80211_alloc_hw_nm()
852 return &local->hw; in ieee80211_alloc_hw_nm()
859 static int ieee80211_init_cipher_suites(struct ieee80211_local *local) in ieee80211_init_cipher_suites() argument
862 bool have_mfp = ieee80211_hw_check(&local->hw, MFP_CAPABLE); in ieee80211_init_cipher_suites()
882 if (ieee80211_hw_check(&local->hw, SW_CRYPTO_CONTROL) || in ieee80211_init_cipher_suites()
883 local->hw.wiphy->cipher_suites) { in ieee80211_init_cipher_suites()
891 if (!local->hw.wiphy->n_cipher_suites) in ieee80211_init_cipher_suites()
895 suites = kmemdup(local->hw.wiphy->cipher_suites, in ieee80211_init_cipher_suites()
896 sizeof(u32) * local->hw.wiphy->n_cipher_suites, in ieee80211_init_cipher_suites()
901 for (r = 0; r < local->hw.wiphy->n_cipher_suites; r++) { in ieee80211_init_cipher_suites()
902 u32 suite = local->hw.wiphy->cipher_suites[r]; in ieee80211_init_cipher_suites()
913 local->hw.wiphy->cipher_suites = cipher_suites; in ieee80211_init_cipher_suites()
914 local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); in ieee80211_init_cipher_suites()
917 local->hw.wiphy->n_cipher_suites -= 4; in ieee80211_init_cipher_suites()
920 local->hw.wiphy->cipher_suites += 2; in ieee80211_init_cipher_suites()
921 local->hw.wiphy->n_cipher_suites -= 2; in ieee80211_init_cipher_suites()
928 local->hw.wiphy->cipher_suites = suites; in ieee80211_init_cipher_suites()
929 local->hw.wiphy->n_cipher_suites = w; in ieee80211_init_cipher_suites()
930 local->wiphy_ciphers_allocated = true; in ieee80211_init_cipher_suites()
937 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_register_hw() local
945 (local->hw.offchannel_tx_hw_queue == IEEE80211_INVAL_HW_QUEUE || in ieee80211_register_hw()
946 local->hw.offchannel_tx_hw_queue >= local->hw.queues)) in ieee80211_register_hw()
950 (!local->ops->tdls_channel_switch || in ieee80211_register_hw()
951 !local->ops->tdls_cancel_channel_switch || in ieee80211_register_hw()
952 !local->ops->tdls_recv_channel_switch)) in ieee80211_register_hw()
956 !local->ops->set_frag_threshold)) in ieee80211_register_hw()
959 if (WARN_ON(local->hw.wiphy->interface_modes & in ieee80211_register_hw()
961 (!local->ops->start_nan || !local->ops->stop_nan))) in ieee80211_register_hw()
971 if (WARN_ON(!local->use_chanctx)) in ieee80211_register_hw()
974 if (WARN_ON(!local->ops->link_info_changed)) in ieee80211_register_hw()
1011 if (hw->wiphy->wowlan && (!local->ops->suspend || !local->ops->resume)) in ieee80211_register_hw()
1015 if (!local->use_chanctx) { in ieee80211_register_hw()
1016 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
1019 comb = &local->hw.wiphy->iface_combinations[i]; in ieee80211_register_hw()
1026 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
1029 comb = &local->hw.wiphy->iface_combinations[i]; in ieee80211_register_hw()
1044 local->rx_chains = 1; in ieee80211_register_hw()
1060 sband = local->hw.wiphy->bands[band]; in ieee80211_register_hw()
1080 if (!local->use_chanctx && !local->_oper_chandef.chan) { in ieee80211_register_hw()
1081 local->hw.conf.chandef = dflt_chandef; in ieee80211_register_hw()
1082 local->_oper_chandef = dflt_chandef; in ieee80211_register_hw()
1084 local->monitor_chandef = dflt_chandef; in ieee80211_register_hw()
1114 if (WARN_ON(local->hw.queues < IEEE80211_NUM_ACS && in ieee80211_register_hw()
1126 local->rx_chains = in ieee80211_register_hw()
1128 local->rx_chains); in ieee80211_register_hw()
1139 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_AP) && in ieee80211_register_hw()
1140 !ieee80211_hw_check(&local->hw, SW_CRYPTO_CONTROL)) { in ieee80211_register_hw()
1162 local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) + in ieee80211_register_hw()
1164 if (!local->int_scan_req) in ieee80211_register_hw()
1167 eth_broadcast_addr(local->int_scan_req->bssid); in ieee80211_register_hw()
1170 if (!local->hw.wiphy->bands[band]) in ieee80211_register_hw()
1172 local->int_scan_req->rates[band] = (u32) -1; in ieee80211_register_hw()
1177 local->hw.wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MESH_POINT); in ieee80211_register_hw()
1182 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_MESH_POINT)) in ieee80211_register_hw()
1183 local->hw.wiphy->flags |= WIPHY_FLAG_MESH_AUTH; in ieee80211_register_hw()
1186 local->hw.wiphy->flags |= WIPHY_FLAG_CONTROL_PORT_PROTOCOL; in ieee80211_register_hw()
1188 if (ieee80211_hw_check(&local->hw, SIGNAL_DBM)) { in ieee80211_register_hw()
1189 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; in ieee80211_register_hw()
1190 } else if (ieee80211_hw_check(&local->hw, SIGNAL_UNSPEC)) { in ieee80211_register_hw()
1191 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC; in ieee80211_register_hw()
1201 if (!local->ops->set_key) { in ieee80211_register_hw()
1202 wiphy_ext_feature_set(local->hw.wiphy, in ieee80211_register_hw()
1204 wiphy_ext_feature_set(local->hw.wiphy, in ieee80211_register_hw()
1208 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_ADHOC)) in ieee80211_register_hw()
1209 wiphy_ext_feature_set(local->hw.wiphy, in ieee80211_register_hw()
1218 local->scan_ies_len = 4 + max_bitrates /* (ext) supp rates */ + in ieee80211_register_hw()
1221 local->scan_ies_len += 2 + sizeof(struct ieee80211_ht_cap); in ieee80211_register_hw()
1224 local->scan_ies_len += in ieee80211_register_hw()
1230 local->scan_ies_len += in ieee80211_register_hw()
1236 local->scan_ies_len += in ieee80211_register_hw()
1242 if (!local->ops->hw_scan) { in ieee80211_register_hw()
1244 local->hw.wiphy->max_scan_ssids = 4; in ieee80211_register_hw()
1245 local->hw.wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; in ieee80211_register_hw()
1255 if (local->hw.wiphy->max_scan_ie_len) in ieee80211_register_hw()
1256 local->hw.wiphy->max_scan_ie_len -= local->scan_ies_len; in ieee80211_register_hw()
1258 result = ieee80211_init_cipher_suites(local); in ieee80211_register_hw()
1262 if (!local->ops->remain_on_channel) in ieee80211_register_hw()
1263 local->hw.wiphy->max_remain_on_channel_duration = 5000; in ieee80211_register_hw()
1266 if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) in ieee80211_register_hw()
1267 local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP; in ieee80211_register_hw()
1270 if (ieee80211_hw_check(&local->hw, CHANCTX_STA_CSA)) in ieee80211_register_hw()
1271 local->ext_capa[0] |= WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING; in ieee80211_register_hw()
1274 if (ieee80211_hw_check(&local->hw, SUPPORTS_MULTI_BSSID)) { in ieee80211_register_hw()
1275 local->hw.wiphy->support_mbssid = true; in ieee80211_register_hw()
1276 if (ieee80211_hw_check(&local->hw, in ieee80211_register_hw()
1278 local->hw.wiphy->support_only_he_mbssid = true; in ieee80211_register_hw()
1280 local->ext_capa[2] |= in ieee80211_register_hw()
1284 local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CNTDWN_COUNTERS_NUM; in ieee80211_register_hw()
1293 local->workqueue = in ieee80211_register_hw()
1294 alloc_ordered_workqueue("%s", 0, wiphy_name(local->hw.wiphy)); in ieee80211_register_hw()
1295 if (!local->workqueue) { in ieee80211_register_hw()
1305 local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom, in ieee80211_register_hw()
1312 if (local->hw.max_listen_interval == 0) in ieee80211_register_hw()
1313 local->hw.max_listen_interval = 5; in ieee80211_register_hw()
1315 local->hw.conf.listen_interval = local->hw.max_listen_interval; in ieee80211_register_hw()
1317 local->dynamic_ps_forced_timeout = -1; in ieee80211_register_hw()
1319 if (!local->hw.max_nan_de_entries) in ieee80211_register_hw()
1320 local->hw.max_nan_de_entries = IEEE80211_MAX_NAN_INSTANCE_ID; in ieee80211_register_hw()
1322 if (!local->hw.weight_multiplier) in ieee80211_register_hw()
1323 local->hw.weight_multiplier = 1; in ieee80211_register_hw()
1325 ieee80211_wep_init(local); in ieee80211_register_hw()
1327 local->hw.conf.flags = IEEE80211_CONF_IDLE; in ieee80211_register_hw()
1329 ieee80211_led_init(local); in ieee80211_register_hw()
1331 result = ieee80211_txq_setup_flows(local); in ieee80211_register_hw()
1336 result = ieee80211_init_rate_ctrl_alg(local, in ieee80211_register_hw()
1340 wiphy_debug(local->hw.wiphy, in ieee80211_register_hw()
1345 if (local->rate_ctrl) { in ieee80211_register_hw()
1347 if (local->rate_ctrl->ops->capa & RATE_CTRL_CAPA_VHT_EXT_NSS_BW) in ieee80211_register_hw()
1359 BUILD_BUG_ON(NUM_NL80211_BANDS > 8 * sizeof(local->sband_allocated)); in ieee80211_register_hw()
1366 sband = local->hw.wiphy->bands[band]; in ieee80211_register_hw()
1388 local->hw.wiphy->bands[band] = sband; in ieee80211_register_hw()
1389 local->sband_allocated |= BIT(band); in ieee80211_register_hw()
1392 result = wiphy_register(local->hw.wiphy); in ieee80211_register_hw()
1396 debugfs_hw_add(local); in ieee80211_register_hw()
1397 rate_control_add_debugfs(local); in ieee80211_register_hw()
1403 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) && in ieee80211_register_hw()
1407 result = ieee80211_if_add(local, "wlan%d", NET_NAME_ENUM, NULL, in ieee80211_register_hw()
1410 wiphy_warn(local->hw.wiphy, in ieee80211_register_hw()
1418 local->ifa_notifier.notifier_call = ieee80211_ifa_changed; in ieee80211_register_hw()
1419 result = register_inetaddr_notifier(&local->ifa_notifier); in ieee80211_register_hw()
1425 local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; in ieee80211_register_hw()
1426 result = register_inet6addr_notifier(&local->ifa6_notifier); in ieee80211_register_hw()
1436 unregister_inetaddr_notifier(&local->ifa_notifier); in ieee80211_register_hw()
1442 wiphy_unregister(local->hw.wiphy); in ieee80211_register_hw()
1445 rate_control_deinitialize(local); in ieee80211_register_hw()
1446 ieee80211_remove_interfaces(local); in ieee80211_register_hw()
1450 ieee80211_led_exit(local); in ieee80211_register_hw()
1451 destroy_workqueue(local->workqueue); in ieee80211_register_hw()
1453 if (local->wiphy_ciphers_allocated) { in ieee80211_register_hw()
1454 kfree(local->hw.wiphy->cipher_suites); in ieee80211_register_hw()
1455 local->wiphy_ciphers_allocated = false; in ieee80211_register_hw()
1457 kfree(local->int_scan_req); in ieee80211_register_hw()
1464 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_unregister_hw() local
1466 tasklet_kill(&local->tx_pending_tasklet); in ieee80211_unregister_hw()
1467 tasklet_kill(&local->tasklet); in ieee80211_unregister_hw()
1470 unregister_inetaddr_notifier(&local->ifa_notifier); in ieee80211_unregister_hw()
1473 unregister_inet6addr_notifier(&local->ifa6_notifier); in ieee80211_unregister_hw()
1483 ieee80211_remove_interfaces(local); in ieee80211_unregister_hw()
1487 cancel_delayed_work_sync(&local->roc_work); in ieee80211_unregister_hw()
1488 cancel_work_sync(&local->restart_work); in ieee80211_unregister_hw()
1489 cancel_work_sync(&local->reconfig_filter); in ieee80211_unregister_hw()
1490 flush_work(&local->sched_scan_stopped_work); in ieee80211_unregister_hw()
1491 flush_work(&local->radar_detected_work); in ieee80211_unregister_hw()
1493 ieee80211_clear_tx_pending(local); in ieee80211_unregister_hw()
1494 rate_control_deinitialize(local); in ieee80211_unregister_hw()
1496 if (skb_queue_len(&local->skb_queue) || in ieee80211_unregister_hw()
1497 skb_queue_len(&local->skb_queue_unreliable)) in ieee80211_unregister_hw()
1498 wiphy_warn(local->hw.wiphy, "skb_queue not empty\n"); in ieee80211_unregister_hw()
1499 skb_queue_purge(&local->skb_queue); in ieee80211_unregister_hw()
1500 skb_queue_purge(&local->skb_queue_unreliable); in ieee80211_unregister_hw()
1502 wiphy_unregister(local->hw.wiphy); in ieee80211_unregister_hw()
1503 destroy_workqueue(local->workqueue); in ieee80211_unregister_hw()
1504 ieee80211_led_exit(local); in ieee80211_unregister_hw()
1505 kfree(local->int_scan_req); in ieee80211_unregister_hw()
1518 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_free_hw() local
1521 mutex_destroy(&local->iflist_mtx); in ieee80211_free_hw()
1522 mutex_destroy(&local->mtx); in ieee80211_free_hw()
1524 if (local->wiphy_ciphers_allocated) { in ieee80211_free_hw()
1525 kfree(local->hw.wiphy->cipher_suites); in ieee80211_free_hw()
1526 local->wiphy_ciphers_allocated = false; in ieee80211_free_hw()
1529 idr_for_each(&local->ack_status_frames, in ieee80211_free_hw()
1531 idr_destroy(&local->ack_status_frames); in ieee80211_free_hw()
1533 sta_info_stop(local); in ieee80211_free_hw()
1535 ieee80211_free_led_names(local); in ieee80211_free_hw()
1538 if (!(local->sband_allocated & BIT(band))) in ieee80211_free_hw()
1540 kfree(local->hw.wiphy->bands[band]); in ieee80211_free_hw()
1543 wiphy_free(local->hw.wiphy); in ieee80211_free_hw()