Lines Matching refs:hw
104 offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
121 local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
123 local->hw.conf.flags &= ~IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
125 offchannel_flag ^= local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
128 !cfg80211_chandef_identical(&local->hw.conf.chandef, in ieee80211_hw_conf_chan()
130 local->hw.conf.chandef = chandef; in ieee80211_hw_conf_chan()
134 if (!conf_is_ht(&local->hw.conf)) { in ieee80211_hw_conf_chan()
140 local->hw.conf.smps_mode = IEEE80211_SMPS_STATIC; in ieee80211_hw_conf_chan()
141 } else if (local->hw.conf.smps_mode != local->smps_mode) { in ieee80211_hw_conf_chan()
142 local->hw.conf.smps_mode = local->smps_mode; in ieee80211_hw_conf_chan()
158 if (local->hw.conf.power_level != power) { in ieee80211_hw_conf_chan()
160 local->hw.conf.power_level = power; in ieee80211_hw_conf_chan()
233 ieee80211_rx(&local->hw, skb); in ieee80211_tasklet_handler()
237 ieee80211_tx_status(&local->hw, skb); in ieee80211_tasklet_handler()
268 void ieee80211_restart_hw(struct ieee80211_hw *hw) in ieee80211_restart_hw() argument
270 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_restart_hw()
274 wiphy_info(hw->wiphy, in ieee80211_restart_hw()
278 ieee80211_stop_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_restart_hw()
313 if (wdev->wiphy != local->hw.wiphy) in ieee80211_ifa_changed()
365 if (!wdev || wdev->wiphy != local->hw.wiphy) in ieee80211_ifa6_changed()
566 local->hw.wiphy = wiphy; in ieee80211_alloc_hw_nm()
568 local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); in ieee80211_alloc_hw_nm()
574 local->hw.queues = 1; in ieee80211_alloc_hw_nm()
575 local->hw.max_rates = 1; in ieee80211_alloc_hw_nm()
576 local->hw.max_report_rates = 0; in ieee80211_alloc_hw_nm()
577 local->hw.max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; in ieee80211_alloc_hw_nm()
578 local->hw.max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; in ieee80211_alloc_hw_nm()
579 local->hw.offchannel_tx_hw_queue = IEEE80211_INVAL_HW_QUEUE; in ieee80211_alloc_hw_nm()
580 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long; in ieee80211_alloc_hw_nm()
581 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short; in ieee80211_alloc_hw_nm()
582 local->hw.radiotap_mcs_details = IEEE80211_RADIOTAP_MCS_HAVE_MCS | in ieee80211_alloc_hw_nm()
585 local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | in ieee80211_alloc_hw_nm()
587 local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES; in ieee80211_alloc_hw_nm()
588 local->hw.uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN; in ieee80211_alloc_hw_nm()
656 return &local->hw; in ieee80211_alloc_hw_nm()
667 bool have_mfp = local->hw.flags & IEEE80211_HW_MFP_CAPABLE; in ieee80211_init_cipher_suites()
687 if (local->hw.flags & IEEE80211_HW_SW_CRYPTO_CONTROL || in ieee80211_init_cipher_suites()
688 local->hw.wiphy->cipher_suites) { in ieee80211_init_cipher_suites()
696 if (!local->hw.wiphy->n_cipher_suites) in ieee80211_init_cipher_suites()
700 suites = kmemdup(local->hw.wiphy->cipher_suites, in ieee80211_init_cipher_suites()
701 sizeof(u32) * local->hw.wiphy->n_cipher_suites, in ieee80211_init_cipher_suites()
706 for (r = 0; r < local->hw.wiphy->n_cipher_suites; r++) { in ieee80211_init_cipher_suites()
707 u32 suite = local->hw.wiphy->cipher_suites[r]; in ieee80211_init_cipher_suites()
714 } else if (!local->hw.cipher_schemes) { in ieee80211_init_cipher_suites()
719 local->hw.wiphy->cipher_suites = cipher_suites; in ieee80211_init_cipher_suites()
720 local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); in ieee80211_init_cipher_suites()
723 local->hw.wiphy->n_cipher_suites -= 4; in ieee80211_init_cipher_suites()
726 local->hw.wiphy->cipher_suites += 2; in ieee80211_init_cipher_suites()
727 local->hw.wiphy->n_cipher_suites -= 2; in ieee80211_init_cipher_suites()
735 cs = local->hw.cipher_schemes; in ieee80211_init_cipher_suites()
743 n_suites = local->hw.n_cipher_schemes + 5; in ieee80211_init_cipher_suites()
777 for (r = 0; r < local->hw.n_cipher_schemes; r++) in ieee80211_init_cipher_suites()
781 local->hw.wiphy->cipher_suites = suites; in ieee80211_init_cipher_suites()
782 local->hw.wiphy->n_cipher_suites = w; in ieee80211_init_cipher_suites()
788 int ieee80211_register_hw(struct ieee80211_hw *hw) in ieee80211_register_hw() argument
790 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_register_hw()
798 if (hw->flags & IEEE80211_HW_QUEUE_CONTROL && in ieee80211_register_hw()
799 (local->hw.offchannel_tx_hw_queue == IEEE80211_INVAL_HW_QUEUE || in ieee80211_register_hw()
800 local->hw.offchannel_tx_hw_queue >= local->hw.queues)) in ieee80211_register_hw()
803 if ((hw->wiphy->features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH) && in ieee80211_register_hw()
810 if (hw->wiphy->wowlan && (!local->ops->suspend || !local->ops->resume)) in ieee80211_register_hw()
815 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
818 comb = &local->hw.wiphy->iface_combinations[i]; in ieee80211_register_hw()
829 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS)) in ieee80211_register_hw()
833 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
836 comb = &local->hw.wiphy->iface_combinations[i]; in ieee80211_register_hw()
847 if (WARN_ON(hw->netdev_features & ~feature_whitelist)) in ieee80211_register_hw()
850 if (hw->max_report_rates == 0) in ieee80211_register_hw()
851 hw->max_report_rates = hw->max_rates; in ieee80211_register_hw()
867 sband = local->hw.wiphy->bands[band]; in ieee80211_register_hw()
877 local->hw.conf.chandef = dflt_chandef; in ieee80211_register_hw()
899 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_AP)) { in ieee80211_register_hw()
900 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP_VLAN); in ieee80211_register_hw()
901 hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_AP_VLAN); in ieee80211_register_hw()
905 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_MONITOR); in ieee80211_register_hw()
906 hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_MONITOR); in ieee80211_register_hw()
909 for (i = 0; i < hw->wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
913 c = &hw->wiphy->iface_combinations[i]; in ieee80211_register_hw()
927 if (!local->hw.wiphy->bands[band]) in ieee80211_register_hw()
934 local->hw.wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MESH_POINT); in ieee80211_register_hw()
939 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_MESH_POINT)) in ieee80211_register_hw()
940 local->hw.wiphy->flags |= WIPHY_FLAG_MESH_AUTH; in ieee80211_register_hw()
943 local->hw.wiphy->flags |= WIPHY_FLAG_CONTROL_PORT_PROTOCOL; in ieee80211_register_hw()
945 if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) { in ieee80211_register_hw()
946 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; in ieee80211_register_hw()
947 } else if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC) { in ieee80211_register_hw()
948 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC; in ieee80211_register_hw()
949 if (hw->max_signal <= 0) { in ieee80211_register_hw()
972 local->hw.wiphy->max_scan_ssids = 4; in ieee80211_register_hw()
973 local->hw.wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; in ieee80211_register_hw()
983 if (local->hw.wiphy->max_scan_ie_len) in ieee80211_register_hw()
984 local->hw.wiphy->max_scan_ie_len -= local->scan_ies_len; in ieee80211_register_hw()
986 WARN_ON(!ieee80211_cs_list_valid(local->hw.cipher_schemes, in ieee80211_register_hw()
987 local->hw.n_cipher_schemes)); in ieee80211_register_hw()
994 local->hw.wiphy->max_remain_on_channel_duration = 5000; in ieee80211_register_hw()
997 if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) in ieee80211_register_hw()
998 local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP; in ieee80211_register_hw()
1001 if (local->hw.flags & IEEE80211_HW_CHANCTX_STA_CSA) in ieee80211_register_hw()
1004 local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CSA_COUNTERS_NUM; in ieee80211_register_hw()
1006 result = wiphy_register(local->hw.wiphy); in ieee80211_register_hw()
1014 if (hw->queues > IEEE80211_MAX_QUEUES) in ieee80211_register_hw()
1015 hw->queues = IEEE80211_MAX_QUEUES; in ieee80211_register_hw()
1018 alloc_ordered_workqueue("%s", 0, wiphy_name(local->hw.wiphy)); in ieee80211_register_hw()
1029 local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom, in ieee80211_register_hw()
1038 if (local->hw.max_listen_interval == 0) in ieee80211_register_hw()
1039 local->hw.max_listen_interval = 5; in ieee80211_register_hw()
1041 local->hw.conf.listen_interval = local->hw.max_listen_interval; in ieee80211_register_hw()
1045 if (!local->hw.txq_ac_max_pending) in ieee80211_register_hw()
1046 local->hw.txq_ac_max_pending = 64; in ieee80211_register_hw()
1050 wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", in ieee80211_register_hw()
1053 local->hw.conf.flags = IEEE80211_CONF_IDLE; in ieee80211_register_hw()
1060 hw->rate_control_algorithm); in ieee80211_register_hw()
1062 wiphy_debug(local->hw.wiphy, in ieee80211_register_hw()
1068 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) && in ieee80211_register_hw()
1069 !(hw->flags & IEEE80211_HW_NO_AUTO_VIF)) { in ieee80211_register_hw()
1073 wiphy_warn(local->hw.wiphy, in ieee80211_register_hw()
1123 wiphy_unregister(local->hw.wiphy); in ieee80211_register_hw()
1126 kfree(local->hw.wiphy->cipher_suites); in ieee80211_register_hw()
1132 void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi, in ieee80211_napi_add() argument
1137 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_napi_add()
1144 void ieee80211_unregister_hw(struct ieee80211_hw *hw) in ieee80211_unregister_hw() argument
1146 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_unregister_hw()
1180 wiphy_warn(local->hw.wiphy, "skb_queue not empty\n"); in ieee80211_unregister_hw()
1185 wiphy_unregister(local->hw.wiphy); in ieee80211_unregister_hw()
1199 void ieee80211_free_hw(struct ieee80211_hw *hw) in ieee80211_free_hw() argument
1201 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_free_hw()
1207 kfree(local->hw.wiphy->cipher_suites); in ieee80211_free_hw()
1215 wiphy_free(local->hw.wiphy); in ieee80211_free_hw()