1 /*
2  * hostapd / Hardware feature query and different modes
3  * Copyright 2002-2003, Instant802 Networks, Inc.
4  * Copyright 2005-2006, Devicescape Software, Inc.
5  * Copyright (c) 2008-2011, Jouni Malinen <j@w1.fi>
6  *
7  * This software may be distributed under the terms of the BSD license.
8  * See README for more details.
9  */
10 
11 #ifndef HW_FEATURES_H
12 #define HW_FEATURES_H
13 
14 #ifdef NEED_AP_MLME
15 void hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
16 			      size_t num_hw_features);
17 int hostapd_get_hw_features(struct hostapd_iface *iface);
18 int hostapd_csa_update_hwmode(struct hostapd_iface *iface);
19 int hostapd_acs_completed(struct hostapd_iface *iface, int err);
20 int hostapd_select_hw_mode(struct hostapd_iface *iface);
21 const char * hostapd_hw_mode_txt(int mode);
22 int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan);
23 int hostapd_hw_get_channel(struct hostapd_data *hapd, int freq);
24 int hostapd_check_ht_capab(struct hostapd_iface *iface);
25 int hostapd_check_edmg_capab(struct hostapd_iface *iface);
26 int hostapd_check_he_6ghz_capab(struct hostapd_iface *iface);
27 int hostapd_prepare_rates(struct hostapd_iface *iface,
28 			  struct hostapd_hw_modes *mode);
29 void hostapd_stop_setup_timers(struct hostapd_iface *iface);
30 int hostapd_hw_skip_mode(struct hostapd_iface *iface,
31 			 struct hostapd_hw_modes *mode);
32 int hostapd_determine_mode(struct hostapd_iface *iface);
33 void hostapd_free_multi_hw_info(struct hostapd_multi_hw_info *multi_hw_info);
34 int hostapd_set_current_hw_info(struct hostapd_iface *iface, int oper_freq);
35 #else /* NEED_AP_MLME */
36 static inline void
hostapd_free_hw_features(struct hostapd_hw_modes * hw_features,size_t num_hw_features)37 hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
38 			 size_t num_hw_features)
39 {
40 }
41 
hostapd_get_hw_features(struct hostapd_iface * iface)42 static inline int hostapd_get_hw_features(struct hostapd_iface *iface)
43 {
44 	return -1;
45 }
46 
hostapd_csa_update_hwmode(struct hostapd_iface * iface)47 static inline int hostapd_csa_update_hwmode(struct hostapd_iface *iface)
48 {
49 	return 0;
50 }
51 
hostapd_acs_completed(struct hostapd_iface * iface,int err)52 static inline int hostapd_acs_completed(struct hostapd_iface *iface, int err)
53 {
54 	return -1;
55 }
56 
hostapd_select_hw_mode(struct hostapd_iface * iface)57 static inline int hostapd_select_hw_mode(struct hostapd_iface *iface)
58 {
59 	return -100;
60 }
61 
hostapd_hw_mode_txt(int mode)62 static inline const char * hostapd_hw_mode_txt(int mode)
63 {
64 	return "UNKNOWN";
65 }
66 
hostapd_hw_get_freq(struct hostapd_data * hapd,int chan)67 static inline int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan)
68 {
69 	return -1;
70 }
71 
hostapd_check_ht_capab(struct hostapd_iface * iface)72 static inline int hostapd_check_ht_capab(struct hostapd_iface *iface)
73 {
74 	return 0;
75 }
76 
hostapd_check_edmg_capab(struct hostapd_iface * iface)77 static inline int hostapd_check_edmg_capab(struct hostapd_iface *iface)
78 {
79 	return 0;
80 }
81 
hostapd_prepare_rates(struct hostapd_iface * iface,struct hostapd_hw_modes * mode)82 static inline int hostapd_prepare_rates(struct hostapd_iface *iface,
83 					struct hostapd_hw_modes *mode)
84 {
85 	return 0;
86 }
87 
hostapd_stop_setup_timers(struct hostapd_iface * iface)88 static inline void hostapd_stop_setup_timers(struct hostapd_iface *iface)
89 {
90 }
91 
hostapd_hw_skip_mode(struct hostapd_iface * iface,struct hostapd_hw_modes * mode)92 static inline int hostapd_hw_skip_mode(struct hostapd_iface *iface,
93 				       struct hostapd_hw_modes *mode)
94 {
95 	return 0;
96 }
97 
hostapd_check_he_6ghz_capab(struct hostapd_iface * iface)98 static inline int hostapd_check_he_6ghz_capab(struct hostapd_iface *iface)
99 {
100 	return 0;
101 }
102 
hostapd_determine_mode(struct hostapd_iface * iface)103 static inline int hostapd_determine_mode(struct hostapd_iface *iface)
104 {
105 	return 0;
106 }
107 
108 static inline
hostapd_free_multi_hw_info(struct hostapd_multi_hw_info * multi_hw_info)109 void hostapd_free_multi_hw_info(struct hostapd_multi_hw_info *multi_hw_info)
110 {
111 }
112 
hostapd_set_current_hw_info(struct hostapd_iface * iface,u32 oper_freq)113 static inline int hostapd_set_current_hw_info(struct hostapd_iface *iface,
114 					      u32 oper_freq)
115 {
116 	return 0;
117 }
118 #endif /* NEED_AP_MLME */
119 
120 #endif /* HW_FEATURES_H */
121