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()
90 struct ieee80211_local *local = in ieee80211_reconfig_filter() local
93 ieee80211_configure_filter(local); in ieee80211_reconfig_filter()
96 static u32 ieee80211_calc_hw_conf_chan(struct ieee80211_local *local, in ieee80211_calc_hw_conf_chan() argument
107 if (!local->emulate_chanctx) in ieee80211_calc_hw_conf_chan()
110 offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; in ieee80211_calc_hw_conf_chan()
122 if (local->scan_chandef.chan) { in ieee80211_calc_hw_conf_chan()
123 chandef = local->scan_chandef; in ieee80211_calc_hw_conf_chan()
124 } else if (local->tmp_channel) { in ieee80211_calc_hw_conf_chan()
125 chandef.chan = local->tmp_channel; in ieee80211_calc_hw_conf_chan()
132 chandef = local->dflt_chandef; in ieee80211_calc_hw_conf_chan()
144 local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL; in ieee80211_calc_hw_conf_chan()
146 local->hw.conf.flags &= ~IEEE80211_CONF_OFFCHANNEL; in ieee80211_calc_hw_conf_chan()
148 offchannel_flag ^= local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; in ieee80211_calc_hw_conf_chan()
151 if (offchannel_flag || local->scanning || local->in_reconfig || in ieee80211_calc_hw_conf_chan()
152 !cfg80211_chandef_identical(&local->hw.conf.chandef, &chandef)) { in ieee80211_calc_hw_conf_chan()
153 local->hw.conf.chandef = chandef; in ieee80211_calc_hw_conf_chan()
157 if (!conf_is_ht(&local->hw.conf)) { in ieee80211_calc_hw_conf_chan()
163 local->hw.conf.smps_mode = IEEE80211_SMPS_STATIC; in ieee80211_calc_hw_conf_chan()
164 } else if (local->hw.conf.smps_mode != smps_mode) { in ieee80211_calc_hw_conf_chan()
165 local->hw.conf.smps_mode = smps_mode; in ieee80211_calc_hw_conf_chan()
170 if (local->user_power_level != IEEE80211_UNSET_POWER_LEVEL) in ieee80211_calc_hw_conf_chan()
171 power = min(local->user_power_level, power); in ieee80211_calc_hw_conf_chan()
174 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_calc_hw_conf_chan()
185 if (local->hw.conf.power_level != power) { in ieee80211_calc_hw_conf_chan()
187 local->hw.conf.power_level = power; in ieee80211_calc_hw_conf_chan()
193 int ieee80211_hw_config(struct ieee80211_local *local, int radio_idx, in ieee80211_hw_config() argument
204 if (changed && local->open_count) { in ieee80211_hw_config()
205 ret = drv_config(local, radio_idx, changed); in ieee80211_hw_config()
227 static int _ieee80211_hw_conf_chan(struct ieee80211_local *local, in _ieee80211_hw_conf_chan() argument
232 if (!local->open_count) in _ieee80211_hw_conf_chan()
235 changed = ieee80211_calc_hw_conf_chan(local, ctx); in _ieee80211_hw_conf_chan()
239 return drv_config(local, -1, changed); in _ieee80211_hw_conf_chan()
242 int ieee80211_hw_conf_chan(struct ieee80211_local *local) in ieee80211_hw_conf_chan() argument
246 ctx = list_first_entry_or_null(&local->chanctx_list, in ieee80211_hw_conf_chan()
250 return _ieee80211_hw_conf_chan(local, ctx ? &ctx->conf : NULL); in ieee80211_hw_conf_chan()
253 void ieee80211_hw_conf_init(struct ieee80211_local *local) in ieee80211_hw_conf_init() argument
259 if (WARN_ON(!local->open_count)) in ieee80211_hw_conf_init()
262 if (local->emulate_chanctx) { in ieee80211_hw_conf_init()
265 ctx = list_first_entry_or_null(&local->chanctx_list, in ieee80211_hw_conf_init()
269 changed |= ieee80211_calc_hw_conf_chan(local, in ieee80211_hw_conf_init()
273 WARN_ON(drv_config(local, -1, changed)); in ieee80211_hw_conf_init()
279 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_emulate_add_chanctx() local
281 local->hw.conf.radar_enabled = ctx->radar_enabled; in ieee80211_emulate_add_chanctx()
283 return _ieee80211_hw_conf_chan(local, ctx); in ieee80211_emulate_add_chanctx()
290 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_emulate_remove_chanctx() local
292 local->hw.conf.radar_enabled = false; in ieee80211_emulate_remove_chanctx()
294 _ieee80211_hw_conf_chan(local, NULL); in ieee80211_emulate_remove_chanctx()
302 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_emulate_change_chanctx() local
304 local->hw.conf.radar_enabled = ctx->radar_enabled; in ieee80211_emulate_change_chanctx()
306 _ieee80211_hw_conf_chan(local, ctx); in ieee80211_emulate_change_chanctx()
315 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_emulate_switch_vif_chanctx() local
320 local->hw.conf.radar_enabled = vifs[0].new_ctx->radar_enabled; in ieee80211_emulate_switch_vif_chanctx()
321 _ieee80211_hw_conf_chan(local, vifs[0].new_ctx); in ieee80211_emulate_switch_vif_chanctx()
339 struct ieee80211_local *local = sdata->local; in ieee80211_bss_info_change_notify() local
368 trace_drv_vif_cfg_changed(local, sdata, changed); in ieee80211_bss_info_change_notify()
369 if (local->ops->vif_cfg_changed) in ieee80211_bss_info_change_notify()
370 local->ops->vif_cfg_changed(&local->hw, &sdata->vif, ch); in ieee80211_bss_info_change_notify()
376 trace_drv_link_info_changed(local, sdata, &sdata->vif.bss_conf, in ieee80211_bss_info_change_notify()
378 if (local->ops->link_info_changed) in ieee80211_bss_info_change_notify()
379 local->ops->link_info_changed(&local->hw, &sdata->vif, in ieee80211_bss_info_change_notify()
383 if (local->ops->bss_info_changed) in ieee80211_bss_info_change_notify()
384 local->ops->bss_info_changed(&local->hw, &sdata->vif, in ieee80211_bss_info_change_notify()
386 trace_drv_return_void(local); in ieee80211_bss_info_change_notify()
392 struct ieee80211_local *local = sdata->local; in ieee80211_vif_cfg_change_notify() local
399 drv_vif_cfg_changed(local, sdata, changed); in ieee80211_vif_cfg_change_notify()
406 struct ieee80211_local *local = sdata->local; in ieee80211_link_info_change_notify() local
417 if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF)) in ieee80211_link_info_change_notify()
427 drv_link_info_changed(local, sdata, link->conf, link->link_id, changed); in ieee80211_link_info_change_notify()
441 void ieee80211_handle_queued_frames(struct ieee80211_local *local) in ieee80211_handle_queued_frames() argument
445 while ((skb = skb_dequeue(&local->skb_queue)) || in ieee80211_handle_queued_frames()
446 (skb = skb_dequeue(&local->skb_queue_unreliable))) { in ieee80211_handle_queued_frames()
452 ieee80211_rx(&local->hw, skb); in ieee80211_handle_queued_frames()
456 ieee80211_tx_status_skb(&local->hw, skb); in ieee80211_handle_queued_frames()
469 struct ieee80211_local *local = from_tasklet(local, t, tasklet); in ieee80211_tasklet_handler() local
471 ieee80211_handle_queued_frames(local); in ieee80211_tasklet_handler()
476 struct ieee80211_local *local = in ieee80211_restart_work() local
481 flush_workqueue(local->workqueue); in ieee80211_restart_work()
485 wiphy_lock(local->hw.wiphy); in ieee80211_restart_work()
486 wiphy_work_flush(local->hw.wiphy, NULL); in ieee80211_restart_work()
488 WARN(test_bit(SCAN_HW_SCANNING, &local->scanning), in ieee80211_restart_work()
491 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_restart_work()
508 wiphy_work_cancel(local->hw.wiphy, in ieee80211_restart_work()
515 wiphy_delayed_work_flush(local->hw.wiphy, in ieee80211_restart_work()
518 ieee80211_scan_cancel(local); in ieee80211_restart_work()
520 /* make sure any new ROC will consider local->in_reconfig */ in ieee80211_restart_work()
521 wiphy_delayed_work_flush(local->hw.wiphy, &local->roc_work); in ieee80211_restart_work()
522 wiphy_work_flush(local->hw.wiphy, &local->hw_roc_done); in ieee80211_restart_work()
527 ret = ieee80211_reconfig(local); in ieee80211_restart_work()
528 wiphy_unlock(local->hw.wiphy); in ieee80211_restart_work()
531 cfg80211_shutdown_all_interfaces(local->hw.wiphy); in ieee80211_restart_work()
538 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_restart_hw() local
540 trace_api_restart_hw(local); in ieee80211_restart_hw()
554 local->in_reconfig = true; in ieee80211_restart_hw()
557 queue_work(system_freezable_wq, &local->restart_work); in ieee80211_restart_hw()
566 struct ieee80211_local *local = in ieee80211_ifa_changed() local
581 if (wdev->wiphy != local->hw.wiphy || !wdev->registered) in ieee80211_ifa_changed()
613 mutex_lock_nested(&local->hw.wiphy->mtx, 1); in ieee80211_ifa_changed()
614 __acquire(&local->hw.wiphy->mtx); in ieee80211_ifa_changed()
631 wiphy_unlock(local->hw.wiphy); in ieee80211_ifa_changed()
644 struct ieee80211_local *local = in ieee80211_ifa6_changed() local
650 if (!wdev || wdev->wiphy != local->hw.wiphy) in ieee80211_ifa6_changed()
662 drv_ipv6_addr_change(local, sdata, idev); in ieee80211_ifa6_changed()
795 struct ieee80211_local *local; in ieee80211_alloc_hw_nm() local
849 priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len; in ieee80211_alloc_hw_nm()
921 local = wiphy_priv(wiphy); in ieee80211_alloc_hw_nm()
923 if (sta_info_init(local)) in ieee80211_alloc_hw_nm()
926 local->hw.wiphy = wiphy; in ieee80211_alloc_hw_nm()
928 local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); in ieee80211_alloc_hw_nm()
930 local->ops = ops; in ieee80211_alloc_hw_nm()
931 local->emulate_chanctx = emulate_chanctx; in ieee80211_alloc_hw_nm()
934 ieee80211_hw_set(&local->hw, CHANCTX_STA_CSA); in ieee80211_alloc_hw_nm()
940 * second, so 7 is ~8ms of queued data. Only affects local TCP in ieee80211_alloc_hw_nm()
943 * for local reasons (longer buffers, longer completion time, or in ieee80211_alloc_hw_nm()
946 local->hw.tx_sk_pacing_shift = 7; in ieee80211_alloc_hw_nm()
949 local->hw.queues = 1; in ieee80211_alloc_hw_nm()
950 local->hw.max_rates = 1; in ieee80211_alloc_hw_nm()
951 local->hw.max_report_rates = 0; in ieee80211_alloc_hw_nm()
952 local->hw.max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HT; in ieee80211_alloc_hw_nm()
953 local->hw.max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HT; in ieee80211_alloc_hw_nm()
954 local->hw.offchannel_tx_hw_queue = IEEE80211_INVAL_HW_QUEUE; in ieee80211_alloc_hw_nm()
955 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long; in ieee80211_alloc_hw_nm()
956 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short; in ieee80211_alloc_hw_nm()
957 local->hw.radiotap_mcs_details = IEEE80211_RADIOTAP_MCS_HAVE_MCS | in ieee80211_alloc_hw_nm()
960 local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | in ieee80211_alloc_hw_nm()
962 local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES; in ieee80211_alloc_hw_nm()
963 local->hw.uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN; in ieee80211_alloc_hw_nm()
964 local->hw.max_mtu = IEEE80211_MAX_DATA_LEN; in ieee80211_alloc_hw_nm()
965 local->user_power_level = IEEE80211_UNSET_POWER_LEVEL; in ieee80211_alloc_hw_nm()
969 local->ext_capa[7] = WLAN_EXT_CAPA8_OPMODE_NOTIF; in ieee80211_alloc_hw_nm()
971 wiphy->extended_capabilities = local->ext_capa; in ieee80211_alloc_hw_nm()
972 wiphy->extended_capabilities_mask = local->ext_capa; in ieee80211_alloc_hw_nm()
974 ARRAY_SIZE(local->ext_capa); in ieee80211_alloc_hw_nm()
976 INIT_LIST_HEAD(&local->interfaces); in ieee80211_alloc_hw_nm()
977 INIT_LIST_HEAD(&local->mon_list); in ieee80211_alloc_hw_nm()
979 __hw_addr_init(&local->mc_list); in ieee80211_alloc_hw_nm()
981 mutex_init(&local->iflist_mtx); in ieee80211_alloc_hw_nm()
982 spin_lock_init(&local->filter_lock); in ieee80211_alloc_hw_nm()
983 spin_lock_init(&local->rx_path_lock); in ieee80211_alloc_hw_nm()
984 spin_lock_init(&local->queue_stop_reason_lock); in ieee80211_alloc_hw_nm()
987 INIT_LIST_HEAD(&local->active_txqs[i]); in ieee80211_alloc_hw_nm()
988 spin_lock_init(&local->active_txq_lock[i]); in ieee80211_alloc_hw_nm()
989 local->aql_txq_limit_low[i] = IEEE80211_DEFAULT_AQL_TXQ_LIMIT_L; in ieee80211_alloc_hw_nm()
990 local->aql_txq_limit_high[i] = in ieee80211_alloc_hw_nm()
992 atomic_set(&local->aql_ac_pending_airtime[i], 0); in ieee80211_alloc_hw_nm()
995 local->airtime_flags = AIRTIME_USE_TX | AIRTIME_USE_RX; in ieee80211_alloc_hw_nm()
996 local->aql_threshold = IEEE80211_AQL_THRESHOLD; in ieee80211_alloc_hw_nm()
997 atomic_set(&local->aql_total_pending_airtime, 0); in ieee80211_alloc_hw_nm()
999 spin_lock_init(&local->handle_wake_tx_queue_lock); in ieee80211_alloc_hw_nm()
1001 INIT_LIST_HEAD(&local->chanctx_list); in ieee80211_alloc_hw_nm()
1003 wiphy_delayed_work_init(&local->scan_work, ieee80211_scan_work); in ieee80211_alloc_hw_nm()
1005 INIT_WORK(&local->restart_work, ieee80211_restart_work); in ieee80211_alloc_hw_nm()
1007 wiphy_work_init(&local->radar_detected_work, in ieee80211_alloc_hw_nm()
1010 wiphy_work_init(&local->reconfig_filter, ieee80211_reconfig_filter); in ieee80211_alloc_hw_nm()
1012 wiphy_work_init(&local->dynamic_ps_enable_work, in ieee80211_alloc_hw_nm()
1014 wiphy_work_init(&local->dynamic_ps_disable_work, in ieee80211_alloc_hw_nm()
1016 timer_setup(&local->dynamic_ps_timer, ieee80211_dynamic_ps_timer, 0); in ieee80211_alloc_hw_nm()
1018 wiphy_work_init(&local->sched_scan_stopped_work, in ieee80211_alloc_hw_nm()
1021 spin_lock_init(&local->ack_status_lock); in ieee80211_alloc_hw_nm()
1022 idr_init(&local->ack_status_frames); in ieee80211_alloc_hw_nm()
1025 skb_queue_head_init(&local->pending[i]); in ieee80211_alloc_hw_nm()
1026 atomic_set(&local->agg_queue_stop[i], 0); in ieee80211_alloc_hw_nm()
1028 tasklet_setup(&local->tx_pending_tasklet, ieee80211_tx_pending); in ieee80211_alloc_hw_nm()
1029 tasklet_setup(&local->wake_txqs_tasklet, ieee80211_wake_txqs); in ieee80211_alloc_hw_nm()
1030 tasklet_setup(&local->tasklet, ieee80211_tasklet_handler); in ieee80211_alloc_hw_nm()
1032 skb_queue_head_init(&local->skb_queue); in ieee80211_alloc_hw_nm()
1033 skb_queue_head_init(&local->skb_queue_unreliable); in ieee80211_alloc_hw_nm()
1035 ieee80211_alloc_led_names(local); in ieee80211_alloc_hw_nm()
1037 ieee80211_roc_setup(local); in ieee80211_alloc_hw_nm()
1039 local->hw.radiotap_timestamp.units_pos = -1; in ieee80211_alloc_hw_nm()
1040 local->hw.radiotap_timestamp.accuracy = -1; in ieee80211_alloc_hw_nm()
1042 return &local->hw; in ieee80211_alloc_hw_nm()
1049 static int ieee80211_init_cipher_suites(struct ieee80211_local *local) in ieee80211_init_cipher_suites() argument
1051 bool have_mfp = ieee80211_hw_check(&local->hw, MFP_CAPABLE); in ieee80211_init_cipher_suites()
1069 if (ieee80211_hw_check(&local->hw, SW_CRYPTO_CONTROL) && fips_enabled) { in ieee80211_init_cipher_suites()
1070 dev_err(local->hw.wiphy->dev.parent, in ieee80211_init_cipher_suites()
1075 if (WARN_ON(ieee80211_hw_check(&local->hw, SW_CRYPTO_CONTROL) && in ieee80211_init_cipher_suites()
1076 !local->hw.wiphy->cipher_suites)) in ieee80211_init_cipher_suites()
1079 if (fips_enabled || !local->hw.wiphy->cipher_suites) { in ieee80211_init_cipher_suites()
1083 local->hw.wiphy->cipher_suites = cipher_suites; in ieee80211_init_cipher_suites()
1084 local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); in ieee80211_init_cipher_suites()
1087 local->hw.wiphy->n_cipher_suites -= 4; in ieee80211_init_cipher_suites()
1091 local->hw.wiphy->cipher_suites += 3; in ieee80211_init_cipher_suites()
1092 local->hw.wiphy->n_cipher_suites -= 3; in ieee80211_init_cipher_suites()
1122 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_register_hw() local
1130 (local->hw.offchannel_tx_hw_queue == IEEE80211_INVAL_HW_QUEUE || in ieee80211_register_hw()
1131 local->hw.offchannel_tx_hw_queue >= local->hw.queues)) in ieee80211_register_hw()
1135 (!local->ops->tdls_channel_switch || in ieee80211_register_hw()
1136 !local->ops->tdls_cancel_channel_switch || in ieee80211_register_hw()
1137 !local->ops->tdls_recv_channel_switch)) in ieee80211_register_hw()
1141 !local->ops->set_frag_threshold)) in ieee80211_register_hw()
1144 if (WARN_ON(local->hw.wiphy->interface_modes & in ieee80211_register_hw()
1146 (!local->ops->start_nan || !local->ops->stop_nan))) in ieee80211_register_hw()
1156 if (WARN_ON(local->emulate_chanctx)) in ieee80211_register_hw()
1159 if (WARN_ON(!local->ops->link_info_changed)) in ieee80211_register_hw()
1190 if (hw->wiphy->wowlan && (!local->ops->suspend || !local->ops->resume)) in ieee80211_register_hw()
1194 if (local->emulate_chanctx) { in ieee80211_register_hw()
1195 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
1198 comb = &local->hw.wiphy->iface_combinations[i]; in ieee80211_register_hw()
1226 local->rx_chains = 1; in ieee80211_register_hw()
1245 sband = local->hw.wiphy->bands[band]; in ieee80211_register_hw()
1267 local->monitor_chanreq.oper = dflt_chandef; in ieee80211_register_hw()
1268 if (local->emulate_chanctx) { in ieee80211_register_hw()
1269 local->dflt_chandef = dflt_chandef; in ieee80211_register_hw()
1270 local->hw.conf.chandef = dflt_chandef; in ieee80211_register_hw()
1322 if (WARN_ON(local->hw.queues < IEEE80211_NUM_ACS && in ieee80211_register_hw()
1338 local->rx_chains = in ieee80211_register_hw()
1340 local->rx_chains); in ieee80211_register_hw()
1351 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_AP) && in ieee80211_register_hw()
1352 !ieee80211_hw_check(&local->hw, SW_CRYPTO_CONTROL)) { in ieee80211_register_hw()
1362 local->int_scan_req = kzalloc_flex(*local->int_scan_req, channels, in ieee80211_register_hw()
1364 if (!local->int_scan_req) in ieee80211_register_hw()
1367 eth_broadcast_addr(local->int_scan_req->bssid); in ieee80211_register_hw()
1370 if (!local->hw.wiphy->bands[band]) in ieee80211_register_hw()
1372 local->int_scan_req->rates[band] = (u32) -1; in ieee80211_register_hw()
1377 local->hw.wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MESH_POINT); in ieee80211_register_hw()
1382 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_MESH_POINT)) in ieee80211_register_hw()
1383 local->hw.wiphy->flags |= WIPHY_FLAG_MESH_AUTH; in ieee80211_register_hw()
1386 local->hw.wiphy->flags |= WIPHY_FLAG_CONTROL_PORT_PROTOCOL; in ieee80211_register_hw()
1388 if (ieee80211_hw_check(&local->hw, SIGNAL_DBM)) { in ieee80211_register_hw()
1389 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; in ieee80211_register_hw()
1390 } else if (ieee80211_hw_check(&local->hw, SIGNAL_UNSPEC)) { in ieee80211_register_hw()
1391 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC; in ieee80211_register_hw()
1401 if (!local->ops->set_key) { in ieee80211_register_hw()
1402 wiphy_ext_feature_set(local->hw.wiphy, in ieee80211_register_hw()
1404 wiphy_ext_feature_set(local->hw.wiphy, in ieee80211_register_hw()
1408 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_ADHOC)) in ieee80211_register_hw()
1409 wiphy_ext_feature_set(local->hw.wiphy, in ieee80211_register_hw()
1418 local->scan_ies_len = 4 + max_bitrates /* (ext) supp rates */ + in ieee80211_register_hw()
1421 local->scan_ies_len += 2 + sizeof(struct ieee80211_ht_cap); in ieee80211_register_hw()
1424 local->scan_ies_len += in ieee80211_register_hw()
1428 local->scan_ies_len += 2 + sizeof(struct ieee80211_s1g_cap); in ieee80211_register_hw()
1433 local->scan_ies_len += in ieee80211_register_hw()
1439 local->scan_ies_len += in ieee80211_register_hw()
1446 local->scan_ies_len += in ieee80211_register_hw()
1450 if (!local->ops->hw_scan) { in ieee80211_register_hw()
1452 local->hw.wiphy->max_scan_ssids = 4; in ieee80211_register_hw()
1453 local->hw.wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; in ieee80211_register_hw()
1463 if (local->hw.wiphy->max_scan_ie_len) in ieee80211_register_hw()
1464 local->hw.wiphy->max_scan_ie_len -= local->scan_ies_len; in ieee80211_register_hw()
1466 result = ieee80211_init_cipher_suites(local); in ieee80211_register_hw()
1470 if (!local->ops->remain_on_channel) in ieee80211_register_hw()
1471 local->hw.wiphy->max_remain_on_channel_duration = 5000; in ieee80211_register_hw()
1474 if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) in ieee80211_register_hw()
1475 local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP; in ieee80211_register_hw()
1478 if (ieee80211_hw_check(&local->hw, CHANCTX_STA_CSA)) in ieee80211_register_hw()
1479 local->ext_capa[0] |= WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING; in ieee80211_register_hw()
1482 if (ieee80211_hw_check(&local->hw, SUPPORTS_MULTI_BSSID)) { in ieee80211_register_hw()
1483 local->hw.wiphy->support_mbssid = true; in ieee80211_register_hw()
1484 if (ieee80211_hw_check(&local->hw, in ieee80211_register_hw()
1486 local->hw.wiphy->support_only_he_mbssid = true; in ieee80211_register_hw()
1488 local->ext_capa[2] |= in ieee80211_register_hw()
1492 local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CNTDWN_COUNTERS_NUM; in ieee80211_register_hw()
1501 local->workqueue = in ieee80211_register_hw()
1502 alloc_ordered_workqueue("%s", 0, wiphy_name(local->hw.wiphy)); in ieee80211_register_hw()
1503 if (!local->workqueue) { in ieee80211_register_hw()
1513 local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom, in ieee80211_register_hw()
1520 if (local->hw.max_listen_interval == 0) in ieee80211_register_hw()
1521 local->hw.max_listen_interval = 5; in ieee80211_register_hw()
1523 local->hw.conf.listen_interval = local->hw.max_listen_interval; in ieee80211_register_hw()
1525 local->dynamic_ps_forced_timeout = -1; in ieee80211_register_hw()
1527 if (!local->hw.max_nan_de_entries) in ieee80211_register_hw()
1528 local->hw.max_nan_de_entries = IEEE80211_MAX_NAN_INSTANCE_ID; in ieee80211_register_hw()
1530 if (!local->hw.weight_multiplier) in ieee80211_register_hw()
1531 local->hw.weight_multiplier = 1; in ieee80211_register_hw()
1533 ieee80211_wep_init(local); in ieee80211_register_hw()
1535 local->hw.conf.flags = IEEE80211_CONF_IDLE; in ieee80211_register_hw()
1537 ieee80211_led_init(local); in ieee80211_register_hw()
1539 result = ieee80211_txq_setup_flows(local); in ieee80211_register_hw()
1544 result = ieee80211_init_rate_ctrl_alg(local, in ieee80211_register_hw()
1548 wiphy_debug(local->hw.wiphy, in ieee80211_register_hw()
1553 if (local->rate_ctrl) { in ieee80211_register_hw()
1555 if (local->rate_ctrl->ops->capa & RATE_CTRL_CAPA_VHT_EXT_NSS_BW) in ieee80211_register_hw()
1567 BUILD_BUG_ON(NUM_NL80211_BANDS > 8 * sizeof(local->sband_allocated)); in ieee80211_register_hw()
1574 sband = local->hw.wiphy->bands[band]; in ieee80211_register_hw()
1596 local->hw.wiphy->bands[band] = sband; in ieee80211_register_hw()
1597 local->sband_allocated |= BIT(band); in ieee80211_register_hw()
1600 result = wiphy_register(local->hw.wiphy); in ieee80211_register_hw()
1604 debugfs_hw_add(local); in ieee80211_register_hw()
1605 rate_control_add_debugfs(local); in ieee80211_register_hw()
1607 ieee80211_check_wbrf_support(local); in ieee80211_register_hw()
1613 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) && in ieee80211_register_hw()
1617 result = ieee80211_if_add(local, "wlan%d", NET_NAME_ENUM, NULL, in ieee80211_register_hw()
1620 wiphy_warn(local->hw.wiphy, in ieee80211_register_hw()
1628 local->ifa_notifier.notifier_call = ieee80211_ifa_changed; in ieee80211_register_hw()
1629 result = register_inetaddr_notifier(&local->ifa_notifier); in ieee80211_register_hw()
1635 local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; in ieee80211_register_hw()
1636 result = register_inet6addr_notifier(&local->ifa6_notifier); in ieee80211_register_hw()
1646 unregister_inetaddr_notifier(&local->ifa_notifier); in ieee80211_register_hw()
1652 wiphy_unregister(local->hw.wiphy); in ieee80211_register_hw()
1655 rate_control_deinitialize(local); in ieee80211_register_hw()
1656 ieee80211_remove_interfaces(local); in ieee80211_register_hw()
1659 ieee80211_txq_teardown_flows(local); in ieee80211_register_hw()
1661 ieee80211_led_exit(local); in ieee80211_register_hw()
1662 destroy_workqueue(local->workqueue); in ieee80211_register_hw()
1664 kfree(local->int_scan_req); in ieee80211_register_hw()
1671 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_unregister_hw() local
1673 tasklet_kill(&local->tx_pending_tasklet); in ieee80211_unregister_hw()
1674 tasklet_kill(&local->tasklet); in ieee80211_unregister_hw()
1677 unregister_inetaddr_notifier(&local->ifa_notifier); in ieee80211_unregister_hw()
1680 unregister_inet6addr_notifier(&local->ifa6_notifier); in ieee80211_unregister_hw()
1690 ieee80211_remove_interfaces(local); in ieee80211_unregister_hw()
1692 ieee80211_txq_teardown_flows(local); in ieee80211_unregister_hw()
1694 wiphy_lock(local->hw.wiphy); in ieee80211_unregister_hw()
1695 wiphy_delayed_work_cancel(local->hw.wiphy, &local->roc_work); in ieee80211_unregister_hw()
1696 wiphy_work_cancel(local->hw.wiphy, &local->reconfig_filter); in ieee80211_unregister_hw()
1697 wiphy_work_cancel(local->hw.wiphy, &local->sched_scan_stopped_work); in ieee80211_unregister_hw()
1698 wiphy_work_cancel(local->hw.wiphy, &local->radar_detected_work); in ieee80211_unregister_hw()
1699 wiphy_unlock(local->hw.wiphy); in ieee80211_unregister_hw()
1702 cancel_work_sync(&local->restart_work); in ieee80211_unregister_hw()
1704 ieee80211_clear_tx_pending(local); in ieee80211_unregister_hw()
1705 rate_control_deinitialize(local); in ieee80211_unregister_hw()
1707 if (skb_queue_len(&local->skb_queue) || in ieee80211_unregister_hw()
1708 skb_queue_len(&local->skb_queue_unreliable)) in ieee80211_unregister_hw()
1709 wiphy_warn(local->hw.wiphy, "skb_queue not empty\n"); in ieee80211_unregister_hw()
1710 skb_queue_purge(&local->skb_queue); in ieee80211_unregister_hw()
1711 skb_queue_purge(&local->skb_queue_unreliable); in ieee80211_unregister_hw()
1713 wiphy_unregister(local->hw.wiphy); in ieee80211_unregister_hw()
1714 destroy_workqueue(local->workqueue); in ieee80211_unregister_hw()
1715 ieee80211_led_exit(local); in ieee80211_unregister_hw()
1716 kfree(local->int_scan_req); in ieee80211_unregister_hw()
1729 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_free_hw() local
1732 mutex_destroy(&local->iflist_mtx); in ieee80211_free_hw()
1734 idr_for_each(&local->ack_status_frames, in ieee80211_free_hw()
1736 idr_destroy(&local->ack_status_frames); in ieee80211_free_hw()
1738 sta_info_stop(local); in ieee80211_free_hw()
1740 ieee80211_free_led_names(local); in ieee80211_free_hw()
1743 if (!(local->sband_allocated & BIT(band))) in ieee80211_free_hw()
1745 kfree(local->hw.wiphy->bands[band]); in ieee80211_free_hw()
1748 wiphy_free(local->hw.wiphy); in ieee80211_free_hw()