1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2  * Copyright(c) 2020-2022  Realtek Corporation
3  */
4 
5 #ifndef __RTW89_CHAN_H__
6 #define __RTW89_CHAN_H__
7 
8 #include "core.h"
9 
10 static inline bool rtw89_get_entity_state(struct rtw89_dev *rtwdev)
11 {
12 	struct rtw89_hal *hal = &rtwdev->hal;
13 
14 	return READ_ONCE(hal->entity_active);
15 }
16 
17 static inline void rtw89_set_entity_state(struct rtw89_dev *rtwdev, bool active)
18 {
19 	struct rtw89_hal *hal = &rtwdev->hal;
20 
21 	WRITE_ONCE(hal->entity_active, active);
22 }
23 
24 void rtw89_chan_create(struct rtw89_chan *chan, u8 center_chan, u8 primary_chan,
25 		       enum rtw89_band band, enum rtw89_bandwidth bandwidth);
26 bool rtw89_assign_entity_chan(struct rtw89_dev *rtwdev,
27 			      enum rtw89_sub_entity_idx idx,
28 			      const struct rtw89_chan *new);
29 void rtw89_config_entity_chandef(struct rtw89_dev *rtwdev,
30 				 enum rtw89_sub_entity_idx idx,
31 				 const struct cfg80211_chan_def *chandef);
32 
33 #endif
34