1 /*
2  * FST module - auxiliary definitions
3  * Copyright (c) 2014, Qualcomm Atheros, Inc.
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef FST_INTERNAL_H
10 #define FST_INTERNAL_H
11 
12 #include "utils/includes.h"
13 #include "utils/common.h"
14 #include "common/defs.h"
15 #include "common/ieee802_11_defs.h"
16 #include "fst/fst_iface.h"
17 #include "fst/fst_group.h"
18 #include "fst/fst_session.h"
19 
20 #define fst_printf(level, format, ...) \
21 	wpa_printf((level), "FST: " format, ##__VA_ARGS__)
22 
23 #define fst_printf_group(group, level, format, ...) \
24 	wpa_printf((level), "FST: %s: " format, \
25 		   fst_group_get_id(group), ##__VA_ARGS__)
26 
27 #define fst_printf_iface(iface, level, format, ...) \
28 	fst_printf_group(fst_iface_get_group(iface), (level), "%s: " format, \
29 			 fst_iface_get_name(iface), ##__VA_ARGS__)
30 
31 enum mb_band_id fst_hw_mode_to_band(enum hostapd_hw_mode mode);
32 
33 struct fst_ctrl_handle {
34 	struct fst_ctrl ctrl;
35 	struct dl_list global_ctrls_lentry;
36 };
37 
38 extern struct dl_list fst_global_ctrls_list;
39 
40 #define foreach_fst_ctrl_call(clb, ...) \
41 	do { \
42 		struct fst_ctrl_handle *__fst_ctrl_h; \
43 		dl_list_for_each(__fst_ctrl_h, &fst_global_ctrls_list, \
44 			struct fst_ctrl_handle, global_ctrls_lentry) \
45 			if (__fst_ctrl_h->ctrl.clb) \
46 				__fst_ctrl_h->ctrl.clb(__VA_ARGS__);\
47 	} while (0)
48 
49 #endif /* FST_INTERNAL_H */
50