Lines Matching refs:hw
99 offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
116 local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
118 local->hw.conf.flags &= ~IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
120 offchannel_flag ^= local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; in ieee80211_hw_conf_chan()
123 !cfg80211_chandef_identical(&local->hw.conf.chandef, in ieee80211_hw_conf_chan()
125 local->hw.conf.chandef = chandef; in ieee80211_hw_conf_chan()
129 if (!conf_is_ht(&local->hw.conf)) { in ieee80211_hw_conf_chan()
135 local->hw.conf.smps_mode = IEEE80211_SMPS_STATIC; in ieee80211_hw_conf_chan()
136 } else if (local->hw.conf.smps_mode != local->smps_mode) { in ieee80211_hw_conf_chan()
137 local->hw.conf.smps_mode = local->smps_mode; in ieee80211_hw_conf_chan()
153 if (local->hw.conf.power_level != power) { in ieee80211_hw_conf_chan()
155 local->hw.conf.power_level = power; in ieee80211_hw_conf_chan()
228 ieee80211_rx(&local->hw, skb); in ieee80211_tasklet_handler()
232 ieee80211_tx_status(&local->hw, skb); in ieee80211_tasklet_handler()
263 void ieee80211_restart_hw(struct ieee80211_hw *hw) in ieee80211_restart_hw() argument
265 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_restart_hw()
269 wiphy_info(hw->wiphy, in ieee80211_restart_hw()
273 ieee80211_stop_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_restart_hw()
308 if (wdev->wiphy != local->hw.wiphy) in ieee80211_ifa_changed()
360 if (!wdev || wdev->wiphy != local->hw.wiphy) in ieee80211_ifa6_changed()
561 local->hw.wiphy = wiphy; in ieee80211_alloc_hw_nm()
563 local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); in ieee80211_alloc_hw_nm()
569 local->hw.queues = 1; in ieee80211_alloc_hw_nm()
570 local->hw.max_rates = 1; in ieee80211_alloc_hw_nm()
571 local->hw.max_report_rates = 0; in ieee80211_alloc_hw_nm()
572 local->hw.max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; in ieee80211_alloc_hw_nm()
573 local->hw.max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; in ieee80211_alloc_hw_nm()
574 local->hw.offchannel_tx_hw_queue = IEEE80211_INVAL_HW_QUEUE; in ieee80211_alloc_hw_nm()
575 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long; in ieee80211_alloc_hw_nm()
576 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short; in ieee80211_alloc_hw_nm()
577 local->hw.radiotap_mcs_details = IEEE80211_RADIOTAP_MCS_HAVE_MCS | in ieee80211_alloc_hw_nm()
580 local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | in ieee80211_alloc_hw_nm()
582 local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES; in ieee80211_alloc_hw_nm()
583 local->hw.uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN; in ieee80211_alloc_hw_nm()
654 return &local->hw; in ieee80211_alloc_hw_nm()
665 bool have_mfp = ieee80211_hw_check(&local->hw, MFP_CAPABLE); in ieee80211_init_cipher_suites()
685 if (ieee80211_hw_check(&local->hw, SW_CRYPTO_CONTROL) || in ieee80211_init_cipher_suites()
686 local->hw.wiphy->cipher_suites) { in ieee80211_init_cipher_suites()
694 if (!local->hw.wiphy->n_cipher_suites) in ieee80211_init_cipher_suites()
698 suites = kmemdup(local->hw.wiphy->cipher_suites, in ieee80211_init_cipher_suites()
699 sizeof(u32) * local->hw.wiphy->n_cipher_suites, in ieee80211_init_cipher_suites()
704 for (r = 0; r < local->hw.wiphy->n_cipher_suites; r++) { in ieee80211_init_cipher_suites()
705 u32 suite = local->hw.wiphy->cipher_suites[r]; in ieee80211_init_cipher_suites()
712 } else if (!local->hw.cipher_schemes) { in ieee80211_init_cipher_suites()
717 local->hw.wiphy->cipher_suites = cipher_suites; in ieee80211_init_cipher_suites()
718 local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); in ieee80211_init_cipher_suites()
721 local->hw.wiphy->n_cipher_suites -= 4; in ieee80211_init_cipher_suites()
724 local->hw.wiphy->cipher_suites += 2; in ieee80211_init_cipher_suites()
725 local->hw.wiphy->n_cipher_suites -= 2; in ieee80211_init_cipher_suites()
733 cs = local->hw.cipher_schemes; in ieee80211_init_cipher_suites()
741 n_suites = local->hw.n_cipher_schemes + 5; in ieee80211_init_cipher_suites()
775 for (r = 0; r < local->hw.n_cipher_schemes; r++) { in ieee80211_init_cipher_suites()
784 local->hw.wiphy->cipher_suites = suites; in ieee80211_init_cipher_suites()
785 local->hw.wiphy->n_cipher_suites = w; in ieee80211_init_cipher_suites()
791 int ieee80211_register_hw(struct ieee80211_hw *hw) in ieee80211_register_hw() argument
793 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_register_hw()
801 if (ieee80211_hw_check(hw, QUEUE_CONTROL) && in ieee80211_register_hw()
802 (local->hw.offchannel_tx_hw_queue == IEEE80211_INVAL_HW_QUEUE || in ieee80211_register_hw()
803 local->hw.offchannel_tx_hw_queue >= local->hw.queues)) in ieee80211_register_hw()
806 if ((hw->wiphy->features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH) && in ieee80211_register_hw()
813 if (hw->wiphy->wowlan && (!local->ops->suspend || !local->ops->resume)) in ieee80211_register_hw()
818 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
821 comb = &local->hw.wiphy->iface_combinations[i]; in ieee80211_register_hw()
832 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS)) in ieee80211_register_hw()
836 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
839 comb = &local->hw.wiphy->iface_combinations[i]; in ieee80211_register_hw()
851 if (WARN_ON(hw->netdev_features & ~feature_whitelist)) in ieee80211_register_hw()
854 if (hw->max_report_rates == 0) in ieee80211_register_hw()
855 hw->max_report_rates = hw->max_rates; in ieee80211_register_hw()
871 sband = local->hw.wiphy->bands[band]; in ieee80211_register_hw()
881 local->hw.conf.chandef = dflt_chandef; in ieee80211_register_hw()
903 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_AP)) { in ieee80211_register_hw()
904 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP_VLAN); in ieee80211_register_hw()
905 hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_AP_VLAN); in ieee80211_register_hw()
909 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_MONITOR); in ieee80211_register_hw()
910 hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_MONITOR); in ieee80211_register_hw()
913 for (i = 0; i < hw->wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
917 c = &hw->wiphy->iface_combinations[i]; in ieee80211_register_hw()
931 if (!local->hw.wiphy->bands[band]) in ieee80211_register_hw()
938 local->hw.wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MESH_POINT); in ieee80211_register_hw()
943 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_MESH_POINT)) in ieee80211_register_hw()
944 local->hw.wiphy->flags |= WIPHY_FLAG_MESH_AUTH; in ieee80211_register_hw()
947 local->hw.wiphy->flags |= WIPHY_FLAG_CONTROL_PORT_PROTOCOL; in ieee80211_register_hw()
949 if (ieee80211_hw_check(&local->hw, SIGNAL_DBM)) { in ieee80211_register_hw()
950 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; in ieee80211_register_hw()
951 } else if (ieee80211_hw_check(&local->hw, SIGNAL_UNSPEC)) { in ieee80211_register_hw()
952 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC; in ieee80211_register_hw()
953 if (hw->max_signal <= 0) { in ieee80211_register_hw()
976 local->hw.wiphy->max_scan_ssids = 4; in ieee80211_register_hw()
977 local->hw.wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; in ieee80211_register_hw()
987 if (local->hw.wiphy->max_scan_ie_len) in ieee80211_register_hw()
988 local->hw.wiphy->max_scan_ie_len -= local->scan_ies_len; in ieee80211_register_hw()
990 WARN_ON(!ieee80211_cs_list_valid(local->hw.cipher_schemes, in ieee80211_register_hw()
991 local->hw.n_cipher_schemes)); in ieee80211_register_hw()
998 local->hw.wiphy->max_remain_on_channel_duration = 5000; in ieee80211_register_hw()
1001 if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) in ieee80211_register_hw()
1002 local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP; in ieee80211_register_hw()
1005 if (ieee80211_hw_check(&local->hw, CHANCTX_STA_CSA)) in ieee80211_register_hw()
1008 local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CSA_COUNTERS_NUM; in ieee80211_register_hw()
1010 result = wiphy_register(local->hw.wiphy); in ieee80211_register_hw()
1018 if (hw->queues > IEEE80211_MAX_QUEUES) in ieee80211_register_hw()
1019 hw->queues = IEEE80211_MAX_QUEUES; in ieee80211_register_hw()
1022 alloc_ordered_workqueue("%s", 0, wiphy_name(local->hw.wiphy)); in ieee80211_register_hw()
1033 local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom, in ieee80211_register_hw()
1042 if (local->hw.max_listen_interval == 0) in ieee80211_register_hw()
1043 local->hw.max_listen_interval = 5; in ieee80211_register_hw()
1045 local->hw.conf.listen_interval = local->hw.max_listen_interval; in ieee80211_register_hw()
1049 if (!local->hw.txq_ac_max_pending) in ieee80211_register_hw()
1050 local->hw.txq_ac_max_pending = 64; in ieee80211_register_hw()
1054 wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", in ieee80211_register_hw()
1057 local->hw.conf.flags = IEEE80211_CONF_IDLE; in ieee80211_register_hw()
1064 hw->rate_control_algorithm); in ieee80211_register_hw()
1066 wiphy_debug(local->hw.wiphy, in ieee80211_register_hw()
1072 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) && in ieee80211_register_hw()
1073 !ieee80211_hw_check(hw, NO_AUTO_VIF)) { in ieee80211_register_hw()
1077 wiphy_warn(local->hw.wiphy, in ieee80211_register_hw()
1117 wiphy_unregister(local->hw.wiphy); in ieee80211_register_hw()
1120 kfree(local->hw.wiphy->cipher_suites); in ieee80211_register_hw()
1126 void ieee80211_unregister_hw(struct ieee80211_hw *hw) in ieee80211_unregister_hw() argument
1128 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_unregister_hw()
1161 wiphy_warn(local->hw.wiphy, "skb_queue not empty\n"); in ieee80211_unregister_hw()
1167 wiphy_unregister(local->hw.wiphy); in ieee80211_unregister_hw()
1181 void ieee80211_free_hw(struct ieee80211_hw *hw) in ieee80211_free_hw() argument
1183 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_free_hw()
1189 kfree(local->hw.wiphy->cipher_suites); in ieee80211_free_hw()
1199 wiphy_free(local->hw.wiphy); in ieee80211_free_hw()