Lines Matching defs:local
70 ieee80211_hw_config(sdata->local, 0);
85 static u32 __ieee80211_idle_off(struct ieee80211_local *local)
87 if (!(local->hw.conf.flags & IEEE80211_CONF_IDLE))
90 local->hw.conf.flags &= ~IEEE80211_CONF_IDLE;
94 static u32 __ieee80211_idle_on(struct ieee80211_local *local)
96 if (local->hw.conf.flags & IEEE80211_CONF_IDLE)
99 ieee80211_flush_queues(local, NULL, false);
101 local->hw.conf.flags |= IEEE80211_CONF_IDLE;
105 static u32 __ieee80211_recalc_idle(struct ieee80211_local *local,
111 lockdep_assert_held(&local->mtx);
114 !list_empty(&local->chanctx_list) ||
115 local->monitors;
117 working = !local->ops->remain_on_channel &&
118 !list_empty(&local->roc_list);
120 scanning = test_bit(SCAN_SW_SCANNING, &local->scanning) ||
121 test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning);
133 ieee80211_mod_tpt_led_trig(local, led_trig_start, led_trig_stop);
136 return __ieee80211_idle_off(local);
137 return __ieee80211_idle_on(local);
140 u32 ieee80211_idle_off(struct ieee80211_local *local)
142 return __ieee80211_recalc_idle(local, true);
145 void ieee80211_recalc_idle(struct ieee80211_local *local)
147 u32 change = __ieee80211_recalc_idle(local, false);
149 ieee80211_hw_config(local, change);
155 struct ieee80211_local *local = sdata->local;
161 if (is_zero_ether_addr(local->hw.wiphy->addr_mask))
169 m = local->hw.wiphy->addr_mask;
177 mutex_lock(&local->iflist_mtx);
178 list_for_each_entry(iter, &local->interfaces, list) {
196 mutex_unlock(&local->iflist_mtx);
246 struct ieee80211_local *local = sdata->local;
253 list_for_each_entry(nsdata, &local->interfaces, list) {
308 mutex_lock(&local->chanctx_mtx);
310 mutex_unlock(&local->chanctx_mtx);
317 int n_queues = sdata->local->hw.queues;
337 !ieee80211_hw_check(&sdata->local->hw, QUEUE_CONTROL)) {
370 struct ieee80211_local *local = sdata->local;
382 cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata;
384 ieee80211_scan_cancel(local);
392 ieee80211_roc_purge(local, sdata);
432 atomic_dec(&local->iff_allmultis);
435 local->fif_pspoll--;
436 local->fif_probe_req--;
438 local->fif_probe_req--;
443 spin_lock_bh(&local->filter_lock);
444 __hw_addr_unsync(&local->mc_list, &sdata->dev->mc,
446 spin_unlock_bh(&local->filter_lock);
450 del_timer_sync(&local->dynamic_ps_timer);
451 cancel_work_sync(&local->dynamic_ps_enable_work);
455 mutex_lock(&local->mtx);
460 ieee80211_wake_vif_queues(local, sdata,
464 mutex_unlock(&local->mtx);
473 WARN_ON(local->suspended);
474 mutex_lock(&local->mtx);
476 mutex_unlock(&local->mtx);
499 local->total_ps_buffered--;
500 ieee80211_free_txskb(&local->hw, skb);
507 local->open_count--;
511 mutex_lock(&local->mtx);
513 mutex_unlock(&local->mtx);
521 local->cooked_mntrs--;
525 local->monitors--;
526 if (local->monitors == 0) {
527 local->hw.conf.flags &= ~IEEE80211_CONF_MONITOR;
547 RCU_INIT_POINTER(local->p2p_sdata, NULL);
567 spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
569 skb_queue_walk_safe(&local->pending[i], skb, tmp) {
572 __skb_unlink(skb, &local->pending[i]);
573 ieee80211_free_txskb(&local->hw, skb);
577 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
580 ieee80211_txq_remove_vlan(local, sdata);
584 if (local->open_count == 0)
585 ieee80211_clear_tx_pending(local);
598 if (local->suspended) {
599 WARN_ON(local->wowlan);
600 WARN_ON(rtnl_dereference(local->monitor_sdata));
608 if (local->monitors == 0)
609 ieee80211_del_virtual_monitor(local);
611 mutex_lock(&local->mtx);
612 ieee80211_recalc_idle(local);
613 mutex_unlock(&local->mtx);
621 drv_remove_interface(local, sdata);
624 ieee80211_recalc_ps(local);
627 flush_delayed_work(&local->scan_work);
629 if (local->open_count == 0) {
630 ieee80211_stop_device(local);
637 ieee80211_configure_filter(local);
638 ieee80211_hw_config(local, hw_reconf_flags);
640 if (local->monitors == local->open_count)
641 ieee80211_add_virtual_monitor(local);
656 struct ieee80211_local *local = sdata->local;
664 atomic_inc(&local->iff_allmultis);
666 atomic_dec(&local->iff_allmultis);
670 spin_lock_bh(&local->filter_lock);
671 __hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len);
672 spin_unlock_bh(&local->filter_lock);
673 ieee80211_queue_work(&local->hw, &local->reconfig_filter);
727 struct ieee80211_local *local = sdata->local;
732 if (local->hw.queues < IEEE80211_NUM_ACS)
786 struct ieee80211_local *local = sdata->local;
791 if (ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) &&
795 if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_FRAG) &&
796 local->hw.wiphy->frag_threshold != (u32)-1)
799 if (local->monitors)
814 struct ieee80211_local *local = sdata->local;
825 if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) ||
840 struct ieee80211_local *local = sdata->local;
844 drv_update_vif_offload(local, sdata);
848 list_for_each_entry(vsdata, &local->interfaces, list) {
857 void ieee80211_recalc_offload(struct ieee80211_local *local)
861 if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD))
864 mutex_lock(&local->iflist_mtx);
866 list_for_each_entry(sdata, &local->interfaces, list) {
873 mutex_unlock(&local->iflist_mtx);
879 struct ieee80211_local *local = sdata->local;
884 local->fif_##_s += offset; \
898 struct ieee80211_local *local = sdata->local;
902 if (ieee80211_hw_check(&local->hw, QUEUE_CONTROL))
904 else if (local->hw.queues >= IEEE80211_NUM_ACS)
912 int ieee80211_add_virtual_monitor(struct ieee80211_local *local)
917 if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
922 if (local->monitor_sdata)
925 sdata = kzalloc(sizeof(*sdata) + local->hw.vif_data_size, GFP_KERNEL);
930 sdata->local = local;
933 wiphy_name(local->hw.wiphy));
940 ret = drv_add_interface(local, sdata);
955 mutex_lock(&local->iflist_mtx);
956 rcu_assign_pointer(local->monitor_sdata, sdata);
957 mutex_unlock(&local->iflist_mtx);
959 mutex_lock(&local->mtx);
960 ret = ieee80211_vif_use_channel(sdata, &local->monitor_chandef,
962 mutex_unlock(&local->mtx);
964 mutex_lock(&local->iflist_mtx);
965 RCU_INIT_POINTER(local->monitor_sdata, NULL);
966 mutex_unlock(&local->iflist_mtx);
968 drv_remove_interface(local, sdata);
979 void ieee80211_del_virtual_monitor(struct ieee80211_local *local)
983 if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
988 mutex_lock(&local->iflist_mtx);
990 sdata = rcu_dereference_protected(local->monitor_sdata,
991 lockdep_is_held(&local->iflist_mtx));
993 mutex_unlock(&local->iflist_mtx);
997 RCU_INIT_POINTER(local->monitor_sdata, NULL);
998 mutex_unlock(&local->iflist_mtx);
1002 mutex_lock(&local->mtx);
1004 mutex_unlock(&local->mtx);
1006 drv_remove_interface(local, sdata);
1020 struct ieee80211_local *local = sdata->local;
1037 mutex_lock(&local->mtx);
1039 mutex_unlock(&local->mtx);
1056 mutex_lock(&local->key_mtx);
1059 mutex_unlock(&local->key_mtx);
1084 if (local->open_count == 0) {
1085 res = drv_start(local);
1090 ieee80211_led_radio(local, true);
1091 ieee80211_mod_tpt_led_trig(local,
1101 local->hw.wiphy->perm_addr,
1124 local->cooked_mntrs++;
1129 res = drv_add_interface(local, sdata);
1132 } else if (local->monitors == 0 && local->open_count == 0) {
1133 res = ieee80211_add_virtual_monitor(local);
1139 local->monitors++;
1140 if (local->monitors == 1) {
1141 local->hw.conf.flags |= IEEE80211_CONF_MONITOR;
1146 ieee80211_configure_filter(local);
1147 ieee80211_recalc_offload(local);
1148 mutex_lock(&local->mtx);
1149 ieee80211_recalc_idle(local);
1150 mutex_unlock(&local->mtx);
1156 ieee80211_del_virtual_monitor(local);
1159 res = drv_add_interface(local, sdata);
1171 local->fif_pspoll++;
1172 local->fif_probe_req++;
1174 ieee80211_configure_filter(local);
1176 local->fif_probe_req++;
1180 drv_config_iface_filter(local, sdata,
1242 rcu_assign_pointer(local->p2p_sdata, sdata);
1247 list_add_tail_rcu(&sdata->u.mntr.list, &local->mon_list);
1259 atomic_inc(&local->iff_allmultis);
1262 local->open_count++;
1265 ieee80211_hw_config(local, hw_reconf_flags);
1267 ieee80211_recalc_ps(local);
1271 local->ops->wake_tx_queue) {
1280 if (local->hw.queues < IEEE80211_NUM_ACS)
1283 spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
1285 (local->queue_stop_reasons[sdata->vif.cab_queue] == 0 &&
1286 skb_queue_empty(&local->pending[sdata->vif.cab_queue]))) {
1290 if (local->queue_stop_reasons[ac_queue] == 0 &&
1291 skb_queue_empty(&local->pending[ac_queue]))
1295 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
1300 drv_remove_interface(local, sdata);
1302 if (!local->open_count)
1303 drv_stop(local);
1307 mutex_lock(&local->mtx);
1309 mutex_unlock(&local->mtx);
1340 struct ieee80211_local *local = sdata->local;
1347 if (test_bit(SCAN_SW_SCANNING, &local->scanning))
1350 if (!ieee80211_can_run_worker(local))
1361 mutex_lock(&local->sta_mtx);
1367 local, sta, mgmt, len);
1370 ieee80211_process_addba_resp(local, sta,
1382 mutex_unlock(&local->sta_mtx);
1395 mutex_lock(&local->sta_mtx);
1403 mutex_unlock(&local->sta_mtx);
1437 mutex_lock(&local->sta_mtx);
1447 mutex_unlock(&local->sta_mtx);
1599 struct ieee80211_local *local = sdata->local;
1606 if (!local->ops->change_interface)
1653 ieee80211_stop_vif_queues(local, sdata,
1662 ret = drv_change_interface(local, sdata, internal_type, p2p);
1679 ieee80211_wake_vif_queues(local, sdata,
1711 static void ieee80211_assign_perm_addr(struct ieee80211_local *local,
1721 memcpy(perm_addr, local->hw.wiphy->perm_addr, ETH_ALEN);
1723 if (is_zero_ether_addr(local->hw.wiphy->addr_mask) &&
1724 local->hw.wiphy->n_addresses <= 1)
1727 mutex_lock(&local->iflist_mtx);
1736 list_for_each_entry(sdata, &local->interfaces, list) {
1746 if (ieee80211_hw_check(&local->hw, P2P_DEV_ADDR_FOR_INTF)) {
1747 list_for_each_entry(sdata, &local->interfaces, list) {
1759 for (i = 0; i < local->hw.wiphy->n_addresses; i++) {
1762 list_for_each_entry(sdata, &local->interfaces, list) {
1763 if (ether_addr_equal(local->hw.wiphy->addresses[i].addr,
1772 local->hw.wiphy->addresses[i].addr,
1779 if (is_zero_ether_addr(local->hw.wiphy->addr_mask))
1782 m = local->hw.wiphy->addr_mask;
1797 m = local->hw.wiphy->perm_addr;
1798 list_for_each_entry(sdata, &local->interfaces, list) {
1823 list_for_each_entry(sdata, &local->interfaces, list) {
1841 mutex_unlock(&local->iflist_mtx);
1844 int ieee80211_if_add(struct ieee80211_local *local, const char *name,
1861 sdata = kzalloc(sizeof(*sdata) + local->hw.vif_data_size,
1869 ieee80211_assign_perm_addr(local, wdev->address, type);
1872 int size = ALIGN(sizeof(*sdata) + local->hw.vif_data_size,
1876 if (local->ops->wake_tx_queue &&
1881 local->hw.txq_data_size;
1883 if (local->ops->wake_tx_queue) {
1887 if (local->hw.queues >= IEEE80211_NUM_ACS)
1897 if (!local->ops->wake_tx_queue && local->hw.wiphy->tx_queue_len)
1898 ndev->tx_queue_len = local->hw.wiphy->tx_queue_len;
1900 dev_net_set(ndev, wiphy_net(local->hw.wiphy));
1908 ndev->needed_headroom = local->tx_headroom +
1924 ieee80211_assign_perm_addr(local, ndev->perm_addr, type);
1929 SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
1946 sdata->wdev.wiphy = local->hw.wiphy;
1947 sdata->local = local;
1960 sband = local->hw.wiphy->bands[i];
1985 sdata->user_power_level = local->user_power_level;
1997 ndev->features |= local->hw.netdev_features;
2012 ndev->max_mtu = local->hw.max_mtu;
2021 mutex_lock(&local->iflist_mtx);
2022 list_add_tail_rcu(&sdata->list, &local->interfaces);
2023 mutex_unlock(&local->iflist_mtx);
2035 mutex_lock(&sdata->local->iflist_mtx);
2037 mutex_unlock(&sdata->local->iflist_mtx);
2040 ieee80211_txq_purge(sdata->local, to_txq_info(sdata->vif.txq));
2060 void ieee80211_remove_interfaces(struct ieee80211_local *local)
2079 cfg80211_shutdown_all_interfaces(local->hw.wiphy);
2081 WARN(local->open_count, "%s: open count remains %d\n",
2082 wiphy_name(local->hw.wiphy), local->open_count);
2084 ieee80211_txq_teardown_flows(local);
2086 mutex_lock(&local->iflist_mtx);
2087 list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) {
2095 mutex_unlock(&local->iflist_mtx);