Lines Matching full:local
38 void ieee80211_configure_filter(struct ieee80211_local *local) in ieee80211_configure_filter() argument
44 if (atomic_read(&local->iff_promiscs)) in ieee80211_configure_filter()
47 if (atomic_read(&local->iff_allmultis)) in ieee80211_configure_filter()
50 if (local->monitors || test_bit(SCAN_SW_SCANNING, &local->scanning)) in ieee80211_configure_filter()
53 if (local->fif_probe_req || local->probe_req_reg) in ieee80211_configure_filter()
56 if (local->fif_fcsfail) in ieee80211_configure_filter()
59 if (local->fif_plcpfail) in ieee80211_configure_filter()
62 if (local->fif_control) in ieee80211_configure_filter()
65 if (local->fif_other_bss) in ieee80211_configure_filter()
68 if (local->fif_pspoll) 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 int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) in ieee80211_hw_config() argument
108 offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_config()
109 if (local->scan_channel) { in ieee80211_hw_config()
110 chan = local->scan_channel; in ieee80211_hw_config()
114 if (chan == local->oper_channel) in ieee80211_hw_config()
115 channel_type = local->_oper_channel_type; in ieee80211_hw_config()
118 } else if (local->tmp_channel) { in ieee80211_hw_config()
119 chan = local->tmp_channel; in ieee80211_hw_config()
120 channel_type = local->tmp_channel_type; in ieee80211_hw_config()
122 chan = local->oper_channel; in ieee80211_hw_config()
123 channel_type = local->_oper_channel_type; in ieee80211_hw_config()
126 if (chan != local->oper_channel || in ieee80211_hw_config()
127 channel_type != local->_oper_channel_type) in ieee80211_hw_config()
128 local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_config()
130 local->hw.conf.flags &= ~IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_config()
132 offchannel_flag ^= local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_config()
134 if (offchannel_flag || chan != local->hw.conf.channel || in ieee80211_hw_config()
135 channel_type != local->hw.conf.channel_type) { in ieee80211_hw_config()
136 local->hw.conf.channel = chan; in ieee80211_hw_config()
137 local->hw.conf.channel_type = channel_type; in ieee80211_hw_config()
141 if (!conf_is_ht(&local->hw.conf)) { in ieee80211_hw_config()
147 local->hw.conf.smps_mode = IEEE80211_SMPS_STATIC; in ieee80211_hw_config()
148 } else if (local->hw.conf.smps_mode != local->smps_mode) { in ieee80211_hw_config()
149 local->hw.conf.smps_mode = local->smps_mode; in ieee80211_hw_config()
153 if (test_bit(SCAN_SW_SCANNING, &local->scanning) || in ieee80211_hw_config()
154 test_bit(SCAN_HW_SCANNING, &local->scanning)) in ieee80211_hw_config()
157 power = local->power_constr_level ? in ieee80211_hw_config()
158 (chan->max_power - local->power_constr_level) : in ieee80211_hw_config()
161 if (local->user_power_level >= 0) in ieee80211_hw_config()
162 power = min(power, local->user_power_level); in ieee80211_hw_config()
164 if (local->hw.conf.power_level != power) { in ieee80211_hw_config()
166 local->hw.conf.power_level = power; in ieee80211_hw_config()
169 if (changed && local->open_count) { in ieee80211_hw_config()
170 ret = drv_config(local, changed); in ieee80211_hw_config()
194 struct ieee80211_local *local = sdata->local; in ieee80211_bss_info_change_notify() local
238 if (local->quiescing || !ieee80211_sdata_running(sdata) || in ieee80211_bss_info_change_notify()
269 drv_bss_info_changed(local, sdata, &sdata->vif.bss_conf, changed); in ieee80211_bss_info_change_notify()
284 struct ieee80211_local *local = (struct ieee80211_local *) data; in ieee80211_tasklet_handler() local
289 while ((skb = skb_dequeue(&local->skb_queue)) || in ieee80211_tasklet_handler()
290 (skb = skb_dequeue(&local->skb_queue_unreliable))) { in ieee80211_tasklet_handler()
296 ieee80211_rx(local_to_hw(local), skb); in ieee80211_tasklet_handler()
300 ieee80211_tx_status(local_to_hw(local), skb); in ieee80211_tasklet_handler()
304 for_each_sta_info(local, eosp_data->sta, sta, tmp) { in ieee80211_tasklet_handler()
325 struct ieee80211_local *local = in ieee80211_restart_work() local
329 flush_workqueue(local->workqueue); in ieee80211_restart_work()
331 mutex_lock(&local->mtx); in ieee80211_restart_work()
332 WARN(test_bit(SCAN_HW_SCANNING, &local->scanning) || in ieee80211_restart_work()
333 local->sched_scanning, in ieee80211_restart_work()
335 mutex_unlock(&local->mtx); in ieee80211_restart_work()
338 ieee80211_scan_cancel(local); in ieee80211_restart_work()
339 ieee80211_reconfig(local); in ieee80211_restart_work()
345 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_restart_hw() local
347 trace_api_restart_hw(local); in ieee80211_restart_hw()
356 schedule_work(&local->restart_work); in ieee80211_restart_hw()
362 struct ieee80211_local *local = in ieee80211_recalc_smps_work() local
365 mutex_lock(&local->iflist_mtx); in ieee80211_recalc_smps_work()
366 ieee80211_recalc_smps(local); in ieee80211_recalc_smps_work()
367 mutex_unlock(&local->iflist_mtx); in ieee80211_recalc_smps_work()
375 struct ieee80211_local *local = in ieee80211_ifa_changed() local
390 if (wdev->wiphy != local->hw.wiphy) in ieee80211_ifa_changed()
439 struct ieee80211_local *local = in ieee80211_napi_poll() local
442 return local->ops->napi_poll(&local->hw, budget); in ieee80211_napi_poll()
447 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_napi_schedule() local
449 napi_schedule(&local->napi); in ieee80211_napi_schedule()
455 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_napi_complete() local
457 napi_complete(&local->napi); in ieee80211_napi_complete()
533 struct ieee80211_local *local; in ieee80211_alloc_hw() local
552 priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len; in ieee80211_alloc_hw()
578 local = wiphy_priv(wiphy); in ieee80211_alloc_hw()
580 local->hw.wiphy = wiphy; in ieee80211_alloc_hw()
582 local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); in ieee80211_alloc_hw()
591 local->ops = ops; in ieee80211_alloc_hw()
594 local->hw.queues = 1; in ieee80211_alloc_hw()
595 local->hw.max_rates = 1; in ieee80211_alloc_hw()
596 local->hw.max_report_rates = 0; in ieee80211_alloc_hw()
597 local->hw.max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; in ieee80211_alloc_hw()
598 local->hw.max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; in ieee80211_alloc_hw()
599 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long; in ieee80211_alloc_hw()
600 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short; in ieee80211_alloc_hw()
601 local->user_power_level = -1; in ieee80211_alloc_hw()
602 local->uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES; in ieee80211_alloc_hw()
603 local->uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN; in ieee80211_alloc_hw()
606 INIT_LIST_HEAD(&local->interfaces); in ieee80211_alloc_hw()
608 __hw_addr_init(&local->mc_list); in ieee80211_alloc_hw()
610 mutex_init(&local->iflist_mtx); in ieee80211_alloc_hw()
611 mutex_init(&local->mtx); in ieee80211_alloc_hw()
613 mutex_init(&local->key_mtx); in ieee80211_alloc_hw()
614 spin_lock_init(&local->filter_lock); in ieee80211_alloc_hw()
615 spin_lock_init(&local->queue_stop_reason_lock); in ieee80211_alloc_hw()
624 skb_queue_head_init_class(&local->rx_skb_queue, in ieee80211_alloc_hw()
627 INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work); in ieee80211_alloc_hw()
629 ieee80211_work_init(local); in ieee80211_alloc_hw()
631 INIT_WORK(&local->restart_work, ieee80211_restart_work); in ieee80211_alloc_hw()
633 INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter); in ieee80211_alloc_hw()
634 INIT_WORK(&local->recalc_smps, ieee80211_recalc_smps_work); in ieee80211_alloc_hw()
635 local->smps_mode = IEEE80211_SMPS_OFF; in ieee80211_alloc_hw()
637 INIT_WORK(&local->dynamic_ps_enable_work, in ieee80211_alloc_hw()
639 INIT_WORK(&local->dynamic_ps_disable_work, in ieee80211_alloc_hw()
641 setup_timer(&local->dynamic_ps_timer, in ieee80211_alloc_hw()
642 ieee80211_dynamic_ps_timer, (unsigned long) local); in ieee80211_alloc_hw()
644 INIT_WORK(&local->sched_scan_stopped_work, in ieee80211_alloc_hw()
647 spin_lock_init(&local->ack_status_lock); in ieee80211_alloc_hw()
648 idr_init(&local->ack_status_frames); in ieee80211_alloc_hw()
650 idr_pre_get(&local->ack_status_frames, GFP_KERNEL); in ieee80211_alloc_hw()
652 sta_info_init(local); in ieee80211_alloc_hw()
655 skb_queue_head_init(&local->pending[i]); in ieee80211_alloc_hw()
656 atomic_set(&local->agg_queue_stop[i], 0); in ieee80211_alloc_hw()
658 tasklet_init(&local->tx_pending_tasklet, ieee80211_tx_pending, in ieee80211_alloc_hw()
659 (unsigned long)local); in ieee80211_alloc_hw()
661 tasklet_init(&local->tasklet, in ieee80211_alloc_hw()
663 (unsigned long) local); in ieee80211_alloc_hw()
665 skb_queue_head_init(&local->skb_queue); in ieee80211_alloc_hw()
666 skb_queue_head_init(&local->skb_queue_unreliable); in ieee80211_alloc_hw()
669 init_dummy_netdev(&local->napi_dev); in ieee80211_alloc_hw()
671 ieee80211_led_names(local); in ieee80211_alloc_hw()
673 ieee80211_hw_roc_setup(local); in ieee80211_alloc_hw()
675 return local_to_hw(local); in ieee80211_alloc_hw()
681 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_register_hw() local
699 && (!local->ops->suspend || !local->ops->resume) in ieee80211_register_hw()
718 sband = local->hw.wiphy->bands[band]; in ieee80211_register_hw()
721 if (!local->oper_channel) { in ieee80211_register_hw()
723 local->hw.conf.channel = in ieee80211_register_hw()
724 local->oper_channel = &sband->channels[0]; in ieee80211_register_hw()
725 local->hw.conf.channel_type = NL80211_CHAN_NO_HT; in ieee80211_register_hw()
734 local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) + in ieee80211_register_hw()
736 if (!local->int_scan_req) in ieee80211_register_hw()
740 if (!local->hw.wiphy->bands[band]) in ieee80211_register_hw()
742 local->int_scan_req->rates[band] = (u32) -1; in ieee80211_register_hw()
746 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_AP)) { in ieee80211_register_hw()
776 local->hw.wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MESH_POINT); in ieee80211_register_hw()
781 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_MESH_POINT)) in ieee80211_register_hw()
782 local->hw.wiphy->flags |= WIPHY_FLAG_MESH_AUTH; in ieee80211_register_hw()
785 local->hw.wiphy->flags |= WIPHY_FLAG_CONTROL_PORT_PROTOCOL; in ieee80211_register_hw()
787 if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) in ieee80211_register_hw()
788 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; in ieee80211_register_hw()
789 else if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC) in ieee80211_register_hw()
790 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC; in ieee80211_register_hw()
792 WARN((local->hw.flags & IEEE80211_HW_SUPPORTS_UAPSD) in ieee80211_register_hw()
793 && (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK), in ieee80211_register_hw()
802 local->scan_ies_len = 4 + max_bitrates /* (ext) supp rates */ + in ieee80211_register_hw()
805 local->scan_ies_len += 2 + sizeof(struct ieee80211_ht_cap); in ieee80211_register_hw()
807 if (!local->ops->hw_scan) { in ieee80211_register_hw()
809 local->hw.wiphy->max_scan_ssids = 4; in ieee80211_register_hw()
810 local->hw.wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; in ieee80211_register_hw()
820 if (local->hw.wiphy->max_scan_ie_len) in ieee80211_register_hw()
821 local->hw.wiphy->max_scan_ie_len -= local->scan_ies_len; in ieee80211_register_hw()
824 if (!local->hw.wiphy->cipher_suites) { in ieee80211_register_hw()
825 local->hw.wiphy->cipher_suites = cipher_suites; in ieee80211_register_hw()
826 local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); in ieee80211_register_hw()
827 if (!(local->hw.flags & IEEE80211_HW_MFP_CAPABLE)) in ieee80211_register_hw()
828 local->hw.wiphy->n_cipher_suites--; in ieee80211_register_hw()
830 if (IS_ERR(local->wep_tx_tfm) || IS_ERR(local->wep_rx_tfm)) { in ieee80211_register_hw()
831 if (local->hw.wiphy->cipher_suites == cipher_suites) { in ieee80211_register_hw()
832 local->hw.wiphy->cipher_suites += 2; in ieee80211_register_hw()
833 local->hw.wiphy->n_cipher_suites -= 2; in ieee80211_register_hw()
841 local->hw.wiphy->cipher_suites, in ieee80211_register_hw()
842 sizeof(u32) * local->hw.wiphy->n_cipher_suites, in ieee80211_register_hw()
846 for (r = 0; r < local->hw.wiphy->n_cipher_suites; r++) { in ieee80211_register_hw()
847 u32 suite = local->hw.wiphy->cipher_suites[r]; in ieee80211_register_hw()
853 local->hw.wiphy->cipher_suites = suites; in ieee80211_register_hw()
854 local->hw.wiphy->n_cipher_suites = w; in ieee80211_register_hw()
855 local->wiphy_ciphers_allocated = true; in ieee80211_register_hw()
859 if (!local->ops->remain_on_channel) in ieee80211_register_hw()
860 local->hw.wiphy->max_remain_on_channel_duration = 5000; in ieee80211_register_hw()
862 if (local->ops->sched_scan_start) in ieee80211_register_hw()
863 local->hw.wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; in ieee80211_register_hw()
866 if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) in ieee80211_register_hw()
867 local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP; in ieee80211_register_hw()
869 result = wiphy_register(local->hw.wiphy); in ieee80211_register_hw()
880 local->workqueue = in ieee80211_register_hw()
881 alloc_ordered_workqueue(wiphy_name(local->hw.wiphy), 0); in ieee80211_register_hw()
882 if (!local->workqueue) { in ieee80211_register_hw()
892 local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom, in ieee80211_register_hw()
895 debugfs_hw_add(local); in ieee80211_register_hw()
901 if (local->hw.max_listen_interval == 0) in ieee80211_register_hw()
902 local->hw.max_listen_interval = 5; in ieee80211_register_hw()
904 local->hw.conf.listen_interval = local->hw.max_listen_interval; in ieee80211_register_hw()
906 local->dynamic_ps_forced_timeout = -1; in ieee80211_register_hw()
908 result = ieee80211_wep_init(local); in ieee80211_register_hw()
910 wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", in ieee80211_register_hw()
913 ieee80211_led_init(local); in ieee80211_register_hw()
917 result = ieee80211_init_rate_ctrl_alg(local, in ieee80211_register_hw()
920 wiphy_debug(local->hw.wiphy, in ieee80211_register_hw()
926 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) { in ieee80211_register_hw()
927 result = ieee80211_if_add(local, "wlan%d", NULL, in ieee80211_register_hw()
930 wiphy_warn(local->hw.wiphy, in ieee80211_register_hw()
936 local->network_latency_notifier.notifier_call = in ieee80211_register_hw()
939 &local->network_latency_notifier); in ieee80211_register_hw()
946 local->ifa_notifier.notifier_call = ieee80211_ifa_changed; in ieee80211_register_hw()
947 result = register_inetaddr_notifier(&local->ifa_notifier); in ieee80211_register_hw()
952 netif_napi_add(&local->napi_dev, &local->napi, ieee80211_napi_poll, in ieee80211_register_hw()
953 local->hw.napi_weight); in ieee80211_register_hw()
960 &local->network_latency_notifier); in ieee80211_register_hw()
964 ieee80211_led_exit(local); in ieee80211_register_hw()
965 ieee80211_remove_interfaces(local); in ieee80211_register_hw()
968 ieee80211_wep_free(local); in ieee80211_register_hw()
969 sta_info_stop(local); in ieee80211_register_hw()
970 destroy_workqueue(local->workqueue); in ieee80211_register_hw()
972 wiphy_unregister(local->hw.wiphy); in ieee80211_register_hw()
974 if (local->wiphy_ciphers_allocated) in ieee80211_register_hw()
975 kfree(local->hw.wiphy->cipher_suites); in ieee80211_register_hw()
976 kfree(local->int_scan_req); in ieee80211_register_hw()
983 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_unregister_hw() local
985 tasklet_kill(&local->tx_pending_tasklet); in ieee80211_unregister_hw()
986 tasklet_kill(&local->tasklet); in ieee80211_unregister_hw()
989 &local->network_latency_notifier); in ieee80211_unregister_hw()
991 unregister_inetaddr_notifier(&local->ifa_notifier); in ieee80211_unregister_hw()
1001 ieee80211_remove_interfaces(local); in ieee80211_unregister_hw()
1009 del_timer_sync(&local->work_timer); in ieee80211_unregister_hw()
1011 cancel_work_sync(&local->restart_work); in ieee80211_unregister_hw()
1012 cancel_work_sync(&local->reconfig_filter); in ieee80211_unregister_hw()
1014 ieee80211_clear_tx_pending(local); in ieee80211_unregister_hw()
1015 rate_control_deinitialize(local); in ieee80211_unregister_hw()
1017 if (skb_queue_len(&local->skb_queue) || in ieee80211_unregister_hw()
1018 skb_queue_len(&local->skb_queue_unreliable)) in ieee80211_unregister_hw()
1019 wiphy_warn(local->hw.wiphy, "skb_queue not empty\n"); in ieee80211_unregister_hw()
1020 skb_queue_purge(&local->skb_queue); in ieee80211_unregister_hw()
1021 skb_queue_purge(&local->skb_queue_unreliable); in ieee80211_unregister_hw()
1022 skb_queue_purge(&local->rx_skb_queue); in ieee80211_unregister_hw()
1024 destroy_workqueue(local->workqueue); in ieee80211_unregister_hw()
1025 wiphy_unregister(local->hw.wiphy); in ieee80211_unregister_hw()
1026 sta_info_stop(local); in ieee80211_unregister_hw()
1027 ieee80211_wep_free(local); in ieee80211_unregister_hw()
1028 ieee80211_led_exit(local); in ieee80211_unregister_hw()
1029 kfree(local->int_scan_req); in ieee80211_unregister_hw()
1042 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_free_hw() local
1044 mutex_destroy(&local->iflist_mtx); in ieee80211_free_hw()
1045 mutex_destroy(&local->mtx); in ieee80211_free_hw()
1047 if (local->wiphy_ciphers_allocated) in ieee80211_free_hw()
1048 kfree(local->hw.wiphy->cipher_suites); in ieee80211_free_hw()
1050 idr_for_each(&local->ack_status_frames, in ieee80211_free_hw()
1052 idr_destroy(&local->ack_status_frames); in ieee80211_free_hw()
1054 wiphy_free(local->hw.wiphy); in ieee80211_free_hw()