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()
289 void ieee80211_restart_hw(struct ieee80211_hw *hw) in ieee80211_restart_hw() argument
291 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_restart_hw()
295 wiphy_info(hw->wiphy, in ieee80211_restart_hw()
299 ieee80211_stop_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_restart_hw()
334 if (wdev->wiphy != local->hw.wiphy) in ieee80211_ifa_changed()
386 if (!wdev || wdev->wiphy != local->hw.wiphy) in ieee80211_ifa6_changed()
588 local->hw.wiphy = wiphy; in ieee80211_alloc_hw_nm()
590 local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); in ieee80211_alloc_hw_nm()
596 local->hw.queues = 1; in ieee80211_alloc_hw_nm()
597 local->hw.max_rates = 1; in ieee80211_alloc_hw_nm()
598 local->hw.max_report_rates = 0; in ieee80211_alloc_hw_nm()
599 local->hw.max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; in ieee80211_alloc_hw_nm()
600 local->hw.max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF; in ieee80211_alloc_hw_nm()
601 local->hw.offchannel_tx_hw_queue = IEEE80211_INVAL_HW_QUEUE; in ieee80211_alloc_hw_nm()
602 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long; in ieee80211_alloc_hw_nm()
603 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short; in ieee80211_alloc_hw_nm()
604 local->hw.radiotap_mcs_details = IEEE80211_RADIOTAP_MCS_HAVE_MCS | in ieee80211_alloc_hw_nm()
607 local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | in ieee80211_alloc_hw_nm()
609 local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES; in ieee80211_alloc_hw_nm()
610 local->hw.uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN; in ieee80211_alloc_hw_nm()
682 local->hw.radiotap_timestamp.units_pos = -1; in ieee80211_alloc_hw_nm()
683 local->hw.radiotap_timestamp.accuracy = -1; in ieee80211_alloc_hw_nm()
685 return &local->hw; in ieee80211_alloc_hw_nm()
696 bool have_mfp = ieee80211_hw_check(&local->hw, MFP_CAPABLE); in ieee80211_init_cipher_suites()
716 if (ieee80211_hw_check(&local->hw, SW_CRYPTO_CONTROL) || in ieee80211_init_cipher_suites()
717 local->hw.wiphy->cipher_suites) { in ieee80211_init_cipher_suites()
725 if (!local->hw.wiphy->n_cipher_suites) in ieee80211_init_cipher_suites()
729 suites = kmemdup(local->hw.wiphy->cipher_suites, in ieee80211_init_cipher_suites()
730 sizeof(u32) * local->hw.wiphy->n_cipher_suites, in ieee80211_init_cipher_suites()
735 for (r = 0; r < local->hw.wiphy->n_cipher_suites; r++) { in ieee80211_init_cipher_suites()
736 u32 suite = local->hw.wiphy->cipher_suites[r]; in ieee80211_init_cipher_suites()
743 } else if (!local->hw.cipher_schemes) { in ieee80211_init_cipher_suites()
748 local->hw.wiphy->cipher_suites = cipher_suites; in ieee80211_init_cipher_suites()
749 local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); in ieee80211_init_cipher_suites()
752 local->hw.wiphy->n_cipher_suites -= 4; in ieee80211_init_cipher_suites()
755 local->hw.wiphy->cipher_suites += 2; in ieee80211_init_cipher_suites()
756 local->hw.wiphy->n_cipher_suites -= 2; in ieee80211_init_cipher_suites()
764 cs = local->hw.cipher_schemes; in ieee80211_init_cipher_suites()
772 n_suites = local->hw.n_cipher_schemes + 5; in ieee80211_init_cipher_suites()
806 for (r = 0; r < local->hw.n_cipher_schemes; r++) { in ieee80211_init_cipher_suites()
815 local->hw.wiphy->cipher_suites = suites; in ieee80211_init_cipher_suites()
816 local->hw.wiphy->n_cipher_suites = w; in ieee80211_init_cipher_suites()
822 int ieee80211_register_hw(struct ieee80211_hw *hw) in ieee80211_register_hw() argument
824 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_register_hw()
832 if (ieee80211_hw_check(hw, QUEUE_CONTROL) && in ieee80211_register_hw()
833 (local->hw.offchannel_tx_hw_queue == IEEE80211_INVAL_HW_QUEUE || in ieee80211_register_hw()
834 local->hw.offchannel_tx_hw_queue >= local->hw.queues)) in ieee80211_register_hw()
837 if ((hw->wiphy->features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH) && in ieee80211_register_hw()
843 if (WARN_ON(ieee80211_hw_check(hw, SUPPORTS_TX_FRAG) && in ieee80211_register_hw()
847 if (WARN_ON(local->hw.wiphy->interface_modes & in ieee80211_register_hw()
853 if (hw->wiphy->wowlan && (!local->ops->suspend || !local->ops->resume)) in ieee80211_register_hw()
858 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
861 comb = &local->hw.wiphy->iface_combinations[i]; in ieee80211_register_hw()
872 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS)) in ieee80211_register_hw()
876 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
879 comb = &local->hw.wiphy->iface_combinations[i]; in ieee80211_register_hw()
891 if (WARN_ON(hw->netdev_features & ~feature_whitelist)) in ieee80211_register_hw()
894 if (hw->max_report_rates == 0) in ieee80211_register_hw()
895 hw->max_report_rates = hw->max_rates; in ieee80211_register_hw()
911 sband = local->hw.wiphy->bands[band]; in ieee80211_register_hw()
921 local->hw.conf.chandef = dflt_chandef; in ieee80211_register_hw()
948 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_AP)) { in ieee80211_register_hw()
949 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP_VLAN); in ieee80211_register_hw()
950 hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_AP_VLAN); in ieee80211_register_hw()
954 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_MONITOR); in ieee80211_register_hw()
955 hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_MONITOR); in ieee80211_register_hw()
958 for (i = 0; i < hw->wiphy->n_iface_combinations; i++) { in ieee80211_register_hw()
962 c = &hw->wiphy->iface_combinations[i]; in ieee80211_register_hw()
976 if (!local->hw.wiphy->bands[band]) in ieee80211_register_hw()
983 local->hw.wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MESH_POINT); in ieee80211_register_hw()
988 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_MESH_POINT)) in ieee80211_register_hw()
989 local->hw.wiphy->flags |= WIPHY_FLAG_MESH_AUTH; in ieee80211_register_hw()
992 local->hw.wiphy->flags |= WIPHY_FLAG_CONTROL_PORT_PROTOCOL; in ieee80211_register_hw()
994 if (ieee80211_hw_check(&local->hw, SIGNAL_DBM)) { in ieee80211_register_hw()
995 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; in ieee80211_register_hw()
996 } else if (ieee80211_hw_check(&local->hw, SIGNAL_UNSPEC)) { in ieee80211_register_hw()
997 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC; in ieee80211_register_hw()
998 if (hw->max_signal <= 0) { in ieee80211_register_hw()
1021 local->hw.wiphy->max_scan_ssids = 4; in ieee80211_register_hw()
1022 local->hw.wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; in ieee80211_register_hw()
1032 if (local->hw.wiphy->max_scan_ie_len) in ieee80211_register_hw()
1033 local->hw.wiphy->max_scan_ie_len -= local->scan_ies_len; in ieee80211_register_hw()
1035 WARN_ON(!ieee80211_cs_list_valid(local->hw.cipher_schemes, in ieee80211_register_hw()
1036 local->hw.n_cipher_schemes)); in ieee80211_register_hw()
1043 local->hw.wiphy->max_remain_on_channel_duration = 5000; in ieee80211_register_hw()
1046 if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) in ieee80211_register_hw()
1047 local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP; in ieee80211_register_hw()
1050 if (ieee80211_hw_check(&local->hw, CHANCTX_STA_CSA)) in ieee80211_register_hw()
1053 local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CSA_COUNTERS_NUM; in ieee80211_register_hw()
1055 result = wiphy_register(local->hw.wiphy); in ieee80211_register_hw()
1063 if (hw->queues > IEEE80211_MAX_QUEUES) in ieee80211_register_hw()
1064 hw->queues = IEEE80211_MAX_QUEUES; in ieee80211_register_hw()
1067 alloc_ordered_workqueue("%s", 0, wiphy_name(local->hw.wiphy)); in ieee80211_register_hw()
1078 local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom, in ieee80211_register_hw()
1087 if (local->hw.max_listen_interval == 0) in ieee80211_register_hw()
1088 local->hw.max_listen_interval = 5; in ieee80211_register_hw()
1090 local->hw.conf.listen_interval = local->hw.max_listen_interval; in ieee80211_register_hw()
1094 if (!local->hw.max_nan_de_entries) in ieee80211_register_hw()
1095 local->hw.max_nan_de_entries = IEEE80211_MAX_NAN_INSTANCE_ID; in ieee80211_register_hw()
1099 wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", in ieee80211_register_hw()
1102 local->hw.conf.flags = IEEE80211_CONF_IDLE; in ieee80211_register_hw()
1109 hw->rate_control_algorithm); in ieee80211_register_hw()
1111 wiphy_debug(local->hw.wiphy, in ieee80211_register_hw()
1117 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) && in ieee80211_register_hw()
1118 !ieee80211_hw_check(hw, NO_AUTO_VIF)) { in ieee80211_register_hw()
1122 wiphy_warn(local->hw.wiphy, in ieee80211_register_hw()
1168 wiphy_unregister(local->hw.wiphy); in ieee80211_register_hw()
1171 kfree(local->hw.wiphy->cipher_suites); in ieee80211_register_hw()
1177 void ieee80211_unregister_hw(struct ieee80211_hw *hw) in ieee80211_unregister_hw() argument
1179 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_unregister_hw()
1215 wiphy_warn(local->hw.wiphy, "skb_queue not empty\n"); in ieee80211_unregister_hw()
1221 wiphy_unregister(local->hw.wiphy); in ieee80211_unregister_hw()
1235 void ieee80211_free_hw(struct ieee80211_hw *hw) in ieee80211_free_hw() argument
1237 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_free_hw()
1243 kfree(local->hw.wiphy->cipher_suites); in ieee80211_free_hw()
1253 wiphy_free(local->hw.wiphy); in ieee80211_free_hw()