xref: /dflybsd-src/contrib/wpa_supplicant/src/common/hw_features_common.h (revision 3a84a4273475ed07d0ab1c2dfeffdfedef35d9cd)
1*a1157835SDaniel Fojt /*
2*a1157835SDaniel Fojt  * Common hostapd/wpa_supplicant HW features
3*a1157835SDaniel Fojt  * Copyright (c) 2002-2013, Jouni Malinen <j@w1.fi>
4*a1157835SDaniel Fojt  * Copyright (c) 2015, Qualcomm Atheros, Inc.
5*a1157835SDaniel Fojt  *
6*a1157835SDaniel Fojt  * This software may be distributed under the terms of the BSD license.
7*a1157835SDaniel Fojt  * See README for more details.
8*a1157835SDaniel Fojt  */
9*a1157835SDaniel Fojt 
10*a1157835SDaniel Fojt #ifndef HW_FEATURES_COMMON_H
11*a1157835SDaniel Fojt #define HW_FEATURES_COMMON_H
12*a1157835SDaniel Fojt 
13*a1157835SDaniel Fojt #include "drivers/driver.h"
14*a1157835SDaniel Fojt 
15*a1157835SDaniel Fojt struct hostapd_channel_data * hw_get_channel_chan(struct hostapd_hw_modes *mode,
16*a1157835SDaniel Fojt 						  int chan, int *freq);
17*a1157835SDaniel Fojt struct hostapd_channel_data * hw_get_channel_freq(struct hostapd_hw_modes *mode,
18*a1157835SDaniel Fojt 						  int freq, int *chan);
19*a1157835SDaniel Fojt 
20*a1157835SDaniel Fojt int hw_get_freq(struct hostapd_hw_modes *mode, int chan);
21*a1157835SDaniel Fojt int hw_get_chan(struct hostapd_hw_modes *mode, int freq);
22*a1157835SDaniel Fojt 
23*a1157835SDaniel Fojt int allowed_ht40_channel_pair(struct hostapd_hw_modes *mode, int pri_chan,
24*a1157835SDaniel Fojt 			      int sec_chan);
25*a1157835SDaniel Fojt void get_pri_sec_chan(struct wpa_scan_res *bss, int *pri_chan, int *sec_chan);
26*a1157835SDaniel Fojt int check_40mhz_5g(struct hostapd_hw_modes *mode,
27*a1157835SDaniel Fojt 		   struct wpa_scan_results *scan_res, int pri_chan,
28*a1157835SDaniel Fojt 		   int sec_chan);
29*a1157835SDaniel Fojt int check_40mhz_2g4(struct hostapd_hw_modes *mode,
30*a1157835SDaniel Fojt 		    struct wpa_scan_results *scan_res, int pri_chan,
31*a1157835SDaniel Fojt 		    int sec_chan);
32*a1157835SDaniel Fojt int hostapd_set_freq_params(struct hostapd_freq_params *data,
33*a1157835SDaniel Fojt 			    enum hostapd_hw_mode mode,
34*a1157835SDaniel Fojt 			    int freq, int channel, int ht_enabled,
35*a1157835SDaniel Fojt 			    int vht_enabled, int he_enabled,
36*a1157835SDaniel Fojt 			    int sec_channel_offset,
37*a1157835SDaniel Fojt 			    int oper_chwidth, int center_segment0,
38*a1157835SDaniel Fojt 			    int center_segment1, u32 vht_caps,
39*a1157835SDaniel Fojt 			    struct he_capabilities *he_caps);
40*a1157835SDaniel Fojt void set_disable_ht40(struct ieee80211_ht_capabilities *htcaps,
41*a1157835SDaniel Fojt 		      int disabled);
42*a1157835SDaniel Fojt int ieee80211ac_cap_check(u32 hw, u32 conf);
43*a1157835SDaniel Fojt 
44*a1157835SDaniel Fojt u32 num_chan_to_bw(int num_chans);
45*a1157835SDaniel Fojt int chan_bw_allowed(const struct hostapd_channel_data *chan, u32 bw,
46*a1157835SDaniel Fojt 		    int ht40_plus, int pri);
47*a1157835SDaniel Fojt int chan_pri_allowed(const struct hostapd_channel_data *chan);
48*a1157835SDaniel Fojt 
49*a1157835SDaniel Fojt #endif /* HW_FEATURES_COMMON_H */
50