Lines Matching refs:local

38 void ieee80211_configure_filter(struct ieee80211_local *local)
44 if (atomic_read(&local->iff_promiscs))
47 if (atomic_read(&local->iff_allmultis))
50 if (local->monitors || test_bit(SCAN_SW_SCANNING, &local->scanning) ||
51 test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning))
54 if (local->fif_probe_req || local->probe_req_reg)
57 if (local->fif_fcsfail)
60 if (local->fif_plcpfail)
63 if (local->fif_control)
66 if (local->fif_other_bss)
69 if (local->fif_pspoll)
72 spin_lock_bh(&local->filter_lock);
73 changed_flags = local->filter_flags ^ new_flags;
75 mc = drv_prepare_multicast(local, &local->mc_list);
76 spin_unlock_bh(&local->filter_lock);
81 drv_configure_filter(local, changed_flags, &new_flags, mc);
85 local->filter_flags = new_flags & ~(1<<31);
90 struct ieee80211_local *local =
93 ieee80211_configure_filter(local);
96 static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local)
104 offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
106 if (local->scan_chandef.chan) {
107 chandef = local->scan_chandef;
108 } else if (local->tmp_channel) {
109 chandef.chan = local->tmp_channel;
113 chandef = local->_oper_chandef;
120 if (!cfg80211_chandef_identical(&chandef, &local->_oper_chandef))
121 local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL;
123 local->hw.conf.flags &= ~IEEE80211_CONF_OFFCHANNEL;
125 offchannel_flag ^= local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
128 !cfg80211_chandef_identical(&local->hw.conf.chandef,
129 &local->_oper_chandef)) {
130 local->hw.conf.chandef = chandef;
134 if (!conf_is_ht(&local->hw.conf)) {
140 local->hw.conf.smps_mode = IEEE80211_SMPS_STATIC;
141 } else if (local->hw.conf.smps_mode != local->smps_mode) {
142 local->hw.conf.smps_mode = local->smps_mode;
149 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
158 if (local->hw.conf.power_level != power) {
160 local->hw.conf.power_level = power;
166 int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
172 if (!local->use_chanctx)
173 changed |= ieee80211_hw_conf_chan(local);
178 if (changed && local->open_count) {
179 ret = drv_config(local, changed);
203 struct ieee80211_local *local = sdata->local;
208 drv_bss_info_changed(local, sdata, &sdata->vif.bss_conf, changed);
223 struct ieee80211_local *local = (struct ieee80211_local *) data;
226 while ((skb = skb_dequeue(&local->skb_queue)) ||
227 (skb = skb_dequeue(&local->skb_queue_unreliable))) {
233 ieee80211_rx(&local->hw, skb);
237 ieee80211_tx_status(&local->hw, skb);
250 struct ieee80211_local *local =
254 flush_workqueue(local->workqueue);
256 WARN(test_bit(SCAN_HW_SCANNING, &local->scanning),
260 ieee80211_scan_cancel(local);
261 ieee80211_reconfig(local);
267 struct ieee80211_local *local = hw_to_local(hw);
269 trace_api_restart_hw(local);
283 local->in_reconfig = true;
286 schedule_work(&local->restart_work);
295 struct ieee80211_local *local =
310 if (wdev->wiphy != local->hw.wiphy)
356 struct ieee80211_local *local =
362 if (!wdev || wdev->wiphy != local->hw.wiphy)
374 drv_ipv6_addr_change(local, sdata, idev);
489 struct ieee80211_local *local;
525 priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len;
565 local = wiphy_priv(wiphy);
567 local->hw.wiphy = wiphy;
569 local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN);
571 local->ops = ops;
572 local->use_chanctx = use_chanctx;
575 local->hw.queues = 1;
576 local->hw.max_rates = 1;
577 local->hw.max_report_rates = 0;
578 local->hw.max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF;
579 local->hw.max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF;
580 local->hw.offchannel_tx_hw_queue = IEEE80211_INVAL_HW_QUEUE;
581 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long;
582 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short;
583 local->hw.radiotap_mcs_details = IEEE80211_RADIOTAP_MCS_HAVE_MCS |
586 local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI |
588 local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES;
589 local->hw.uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN;
590 local->user_power_level = IEEE80211_UNSET_POWER_LEVEL;
594 INIT_LIST_HEAD(&local->interfaces);
596 __hw_addr_init(&local->mc_list);
598 mutex_init(&local->iflist_mtx);
599 mutex_init(&local->mtx);
601 mutex_init(&local->key_mtx);
602 spin_lock_init(&local->filter_lock);
603 spin_lock_init(&local->rx_path_lock);
604 spin_lock_init(&local->queue_stop_reason_lock);
606 INIT_LIST_HEAD(&local->chanctx_list);
607 mutex_init(&local->chanctx_mtx);
609 INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work);
611 INIT_WORK(&local->restart_work, ieee80211_restart_work);
613 INIT_WORK(&local->radar_detected_work,
616 INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter);
617 local->smps_mode = IEEE80211_SMPS_OFF;
619 INIT_WORK(&local->dynamic_ps_enable_work,
621 INIT_WORK(&local->dynamic_ps_disable_work,
623 setup_timer(&local->dynamic_ps_timer,
624 ieee80211_dynamic_ps_timer, (unsigned long) local);
626 INIT_WORK(&local->sched_scan_stopped_work,
629 spin_lock_init(&local->ack_status_lock);
630 idr_init(&local->ack_status_frames);
632 sta_info_init(local);
635 skb_queue_head_init(&local->pending[i]);
636 atomic_set(&local->agg_queue_stop[i], 0);
638 tasklet_init(&local->tx_pending_tasklet, ieee80211_tx_pending,
639 (unsigned long)local);
641 tasklet_init(&local->tasklet,
643 (unsigned long) local);
645 skb_queue_head_init(&local->skb_queue);
646 skb_queue_head_init(&local->skb_queue_unreliable);
648 ieee80211_led_names(local);
650 ieee80211_roc_setup(local);
652 return &local->hw;
656 static int ieee80211_init_cipher_suites(struct ieee80211_local *local)
658 bool have_wep = !(IS_ERR(local->wep_tx_tfm) ||
659 IS_ERR(local->wep_rx_tfm));
660 bool have_mfp = local->hw.flags & IEEE80211_HW_MFP_CAPABLE;
661 const struct ieee80211_cipher_scheme *cs = local->hw.cipher_schemes;
676 if (local->hw.wiphy->cipher_suites && have_wep)
680 if (!local->hw.wiphy->cipher_suites && !cs) {
681 local->hw.wiphy->cipher_suites = cipher_suites;
682 local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
685 local->hw.wiphy->n_cipher_suites--;
688 local->hw.wiphy->cipher_suites += 2;
689 local->hw.wiphy->n_cipher_suites -= 2;
695 if (!local->hw.wiphy->cipher_suites) {
700 n_suites = local->hw.n_cipher_schemes + 2;
725 for (r = 0; r < local->hw.n_cipher_schemes; r++)
729 suites = kmemdup(local->hw.wiphy->cipher_suites,
730 sizeof(u32) * local->hw.wiphy->n_cipher_suites,
735 for (r = 0; r < local->hw.wiphy->n_cipher_suites; r++) {
736 u32 suite = local->hw.wiphy->cipher_suites[r];
745 local->hw.wiphy->cipher_suites = suites;
746 local->hw.wiphy->n_cipher_suites = w;
747 local->wiphy_ciphers_allocated = true;
754 struct ieee80211_local *local = hw_to_local(hw);
763 (local->hw.offchannel_tx_hw_queue == IEEE80211_INVAL_HW_QUEUE ||
764 local->hw.offchannel_tx_hw_queue >= local->hw.queues))
768 if (hw->wiphy->wowlan && (!local->ops->suspend || !local->ops->resume))
772 if (!local->use_chanctx) {
773 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) {
776 comb = &local->hw.wiphy->iface_combinations[i];
787 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS))
791 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) {
794 comb = &local->hw.wiphy->iface_combinations[i];
810 local->rx_chains = 1;
824 sband = local->hw.wiphy->bands[band];
833 if (!local->use_chanctx && !local->_oper_chandef.chan) {
834 local->hw.conf.chandef = dflt_chandef;
835 local->_oper_chandef = dflt_chandef;
837 local->monitor_chandef = dflt_chandef;
848 local->rx_chains =
850 local->rx_chains);
856 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_AP)) {
878 local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) +
880 if (!local->int_scan_req)
884 if (!local->hw.wiphy->bands[band])
886 local->int_scan_req->rates[band] = (u32) -1;
891 local->hw.wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MESH_POINT);
896 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_MESH_POINT))
897 local->hw.wiphy->flags |= WIPHY_FLAG_MESH_AUTH;
900 local->hw.wiphy->flags |= WIPHY_FLAG_CONTROL_PORT_PROTOCOL;
902 if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) {
903 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
904 } else if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC) {
905 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC;
912 WARN((local->hw.flags & IEEE80211_HW_SUPPORTS_UAPSD)
913 && (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK),
922 local->scan_ies_len = 4 + max_bitrates /* (ext) supp rates */ +
925 local->scan_ies_len += 2 + sizeof(struct ieee80211_ht_cap);
928 local->scan_ies_len +=
931 if (!local->ops->hw_scan) {
933 local->hw.wiphy->max_scan_ssids = 4;
934 local->hw.wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
944 if (local->hw.wiphy->max_scan_ie_len)
945 local->hw.wiphy->max_scan_ie_len -= local->scan_ies_len;
947 WARN_ON(!ieee80211_cs_list_valid(local->hw.cipher_schemes,
948 local->hw.n_cipher_schemes));
950 result = ieee80211_init_cipher_suites(local);
954 if (!local->ops->remain_on_channel)
955 local->hw.wiphy->max_remain_on_channel_duration = 5000;
958 if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS)
959 local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP;
961 local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CSA_COUNTERS_NUM;
963 result = wiphy_register(local->hw.wiphy);
974 local->workqueue =
975 alloc_ordered_workqueue("%s", 0, wiphy_name(local->hw.wiphy));
976 if (!local->workqueue) {
986 local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom,
989 debugfs_hw_add(local);
995 if (local->hw.max_listen_interval == 0)
996 local->hw.max_listen_interval = 5;
998 local->hw.conf.listen_interval = local->hw.max_listen_interval;
1000 local->dynamic_ps_forced_timeout = -1;
1002 result = ieee80211_wep_init(local);
1004 wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n",
1007 local->hw.conf.flags = IEEE80211_CONF_IDLE;
1009 ieee80211_led_init(local);
1013 result = ieee80211_init_rate_ctrl_alg(local,
1016 wiphy_debug(local->hw.wiphy,
1022 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) {
1023 result = ieee80211_if_add(local, "wlan%d", NULL,
1026 wiphy_warn(local->hw.wiphy,
1032 local->network_latency_notifier.notifier_call =
1035 &local->network_latency_notifier);
1042 local->ifa_notifier.notifier_call = ieee80211_ifa_changed;
1043 result = register_inetaddr_notifier(&local->ifa_notifier);
1049 local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed;
1050 result = register_inet6addr_notifier(&local->ifa6_notifier);
1060 unregister_inetaddr_notifier(&local->ifa_notifier);
1066 &local->network_latency_notifier);
1070 ieee80211_led_exit(local);
1071 ieee80211_remove_interfaces(local);
1074 ieee80211_wep_free(local);
1075 sta_info_stop(local);
1076 destroy_workqueue(local->workqueue);
1078 wiphy_unregister(local->hw.wiphy);
1080 if (local->wiphy_ciphers_allocated)
1081 kfree(local->hw.wiphy->cipher_suites);
1082 kfree(local->int_scan_req);
1092 struct ieee80211_local *local = hw_to_local(hw);
1095 local->napi = napi;
1101 struct ieee80211_local *local = hw_to_local(hw);
1103 tasklet_kill(&local->tx_pending_tasklet);
1104 tasklet_kill(&local->tasklet);
1107 &local->network_latency_notifier);
1109 unregister_inetaddr_notifier(&local->ifa_notifier);
1112 unregister_inet6addr_notifier(&local->ifa6_notifier);
1122 ieee80211_remove_interfaces(local);
1126 cancel_work_sync(&local->restart_work);
1127 cancel_work_sync(&local->reconfig_filter);
1128 flush_work(&local->sched_scan_stopped_work);
1130 ieee80211_clear_tx_pending(local);
1131 rate_control_deinitialize(local);
1133 if (skb_queue_len(&local->skb_queue) ||
1134 skb_queue_len(&local->skb_queue_unreliable))
1135 wiphy_warn(local->hw.wiphy, "skb_queue not empty\n");
1136 skb_queue_purge(&local->skb_queue);
1137 skb_queue_purge(&local->skb_queue_unreliable);
1139 destroy_workqueue(local->workqueue);
1140 wiphy_unregister(local->hw.wiphy);
1141 sta_info_stop(local);
1142 ieee80211_wep_free(local);
1143 ieee80211_led_exit(local);
1144 kfree(local->int_scan_req);
1157 struct ieee80211_local *local = hw_to_local(hw);
1159 mutex_destroy(&local->iflist_mtx);
1160 mutex_destroy(&local->mtx);
1162 if (local->wiphy_ciphers_allocated)
1163 kfree(local->hw.wiphy->cipher_suites);
1165 idr_for_each(&local->ack_status_frames,
1167 idr_destroy(&local->ack_status_frames);
1169 kfree(rcu_access_pointer(local->tx_latency));
1171 wiphy_free(local->hw.wiphy);