xref: /freebsd/contrib/wpa/src/common/hw_features_common.h (revision 206b73d0429edb7c49b612537544e677fa568e83)
15b9c547cSRui Paulo /*
25b9c547cSRui Paulo  * Common hostapd/wpa_supplicant HW features
35b9c547cSRui Paulo  * Copyright (c) 2002-2013, Jouni Malinen <j@w1.fi>
45b9c547cSRui Paulo  * Copyright (c) 2015, Qualcomm Atheros, Inc.
55b9c547cSRui Paulo  *
65b9c547cSRui Paulo  * This software may be distributed under the terms of the BSD license.
75b9c547cSRui Paulo  * See README for more details.
85b9c547cSRui Paulo  */
95b9c547cSRui Paulo 
105b9c547cSRui Paulo #ifndef HW_FEATURES_COMMON_H
115b9c547cSRui Paulo #define HW_FEATURES_COMMON_H
125b9c547cSRui Paulo 
135b9c547cSRui Paulo #include "drivers/driver.h"
145b9c547cSRui Paulo 
155b9c547cSRui Paulo struct hostapd_channel_data * hw_get_channel_chan(struct hostapd_hw_modes *mode,
165b9c547cSRui Paulo 						  int chan, int *freq);
175b9c547cSRui Paulo struct hostapd_channel_data * hw_get_channel_freq(struct hostapd_hw_modes *mode,
185b9c547cSRui Paulo 						  int freq, int *chan);
195b9c547cSRui Paulo 
205b9c547cSRui Paulo int hw_get_freq(struct hostapd_hw_modes *mode, int chan);
215b9c547cSRui Paulo int hw_get_chan(struct hostapd_hw_modes *mode, int freq);
225b9c547cSRui Paulo 
235b9c547cSRui Paulo int allowed_ht40_channel_pair(struct hostapd_hw_modes *mode, int pri_chan,
245b9c547cSRui Paulo 			      int sec_chan);
255b9c547cSRui Paulo void get_pri_sec_chan(struct wpa_scan_res *bss, int *pri_chan, int *sec_chan);
265b9c547cSRui Paulo int check_40mhz_5g(struct hostapd_hw_modes *mode,
275b9c547cSRui Paulo 		   struct wpa_scan_results *scan_res, int pri_chan,
285b9c547cSRui Paulo 		   int sec_chan);
295b9c547cSRui Paulo int check_40mhz_2g4(struct hostapd_hw_modes *mode,
305b9c547cSRui Paulo 		    struct wpa_scan_results *scan_res, int pri_chan,
315b9c547cSRui Paulo 		    int sec_chan);
325b9c547cSRui Paulo int hostapd_set_freq_params(struct hostapd_freq_params *data,
335b9c547cSRui Paulo 			    enum hostapd_hw_mode mode,
345b9c547cSRui Paulo 			    int freq, int channel, int ht_enabled,
35*206b73d0SCy Schubert 			    int vht_enabled, int he_enabled,
36*206b73d0SCy Schubert 			    int sec_channel_offset,
37*206b73d0SCy Schubert 			    int oper_chwidth, int center_segment0,
38*206b73d0SCy Schubert 			    int center_segment1, u32 vht_caps,
39*206b73d0SCy Schubert 			    struct he_capabilities *he_caps);
4085732ac8SCy Schubert void set_disable_ht40(struct ieee80211_ht_capabilities *htcaps,
4185732ac8SCy Schubert 		      int disabled);
4285732ac8SCy Schubert int ieee80211ac_cap_check(u32 hw, u32 conf);
435b9c547cSRui Paulo 
444bc52338SCy Schubert u32 num_chan_to_bw(int num_chans);
454bc52338SCy Schubert int chan_bw_allowed(const struct hostapd_channel_data *chan, u32 bw,
464bc52338SCy Schubert 		    int ht40_plus, int pri);
474bc52338SCy Schubert int chan_pri_allowed(const struct hostapd_channel_data *chan);
484bc52338SCy Schubert 
495b9c547cSRui Paulo #endif /* HW_FEATURES_COMMON_H */
50