Commit b09df09b authored by Zong-Zhe Yang's avatar Zong-Zhe Yang Committed by Kalle Valo

wifi: rtw89: mcc: initialize start flow

We prepare to support TDMA-based MCC (multi-channel concurrency)
which allows two kinds of modes below.
* P2P GO + normal STA
* P2P GC + normal STA

Each mode has two vif and two chanctx. Then, each vif binds one
separate chanctx and becomes one MCC role. We name the two MCC
roles as follows.
* MCC role - reference (ref)
	We calculate the baseline of our TDMA things accodring
	to its info, e.g. TBTT. In normal case, it will be put
	at the first slot of TDMA.
* MCC role - auxiliary (aux)

MCC state machine will be running in FW eventually, but before that,
we have to fill and calculate things that are needed by FW. We fill
the information of MCC role according to its vif and its chanctx.
Then, we calculate the start time for MCC.

Note that the parameters used in the calculation now is assigned by
default rules. The precise parameters for better MCC behavior will be
derived in the following.
Signed-off-by: default avatarZong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230831053133.24015-2-pkshih@realtek.com
parent dae44649
This diff is collapsed.
......@@ -10,6 +10,15 @@
/* The dwell time in TU before doing rtw89_chanctx_work(). */
#define RTW89_CHANCTX_TIME_MCC_PREPARE 100
/* various MCC setting time in TU */
#define RTW89_MCC_LONG_TRIGGER_TIME 300
#define RTW89_MCC_SHORT_TRIGGER_TIME 100
#define RTW89_MCC_DFLT_TX_NULL_EARLY 3
#define RTW89_MCC_DFLT_COURTESY_SLOT 3
#define NUM_OF_RTW89_MCC_ROLES 2
static inline bool rtw89_get_entity_state(struct rtw89_dev *rtwdev)
{
struct rtw89_hal *hal = &rtwdev->hal;
......
......@@ -3892,6 +3892,10 @@ static int rtw89_core_register_hw(struct rtw89_dev *rtwdev)
ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS);
ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID);
ieee80211_hw_set(hw, WANT_MONITOR_VIF);
/* ref: description of rtw89_mcc_get_tbtt_ofst() in chan.c */
ieee80211_hw_set(hw, TIMING_BEACON_ONLY);
if (RTW89_CHK_FW_FEATURE(BEACON_FILTER, &rtwdev->fw))
ieee80211_hw_set(hw, CONNECTION_MONITOR);
......
......@@ -4357,8 +4357,84 @@ struct rtw89_wow_param {
u8 pattern_cnt;
};
struct rtw89_mcc_limit {
bool enable;
u16 max_tob; /* TU; max time offset behind */
u16 max_toa; /* TU; max time offset ahead */
u16 max_dur; /* TU */
};
struct rtw89_mcc_policy {
u8 c2h_rpt;
u8 tx_null_early;
u8 dis_tx_null;
u8 in_curr_ch;
u8 dis_sw_retry;
u8 sw_retry_count;
};
struct rtw89_mcc_role {
struct rtw89_vif *rtwvif;
struct rtw89_mcc_policy policy;
struct rtw89_mcc_limit limit;
/* byte-array in LE order for FW */
u8 macid_bitmap[BITS_TO_BYTES(RTW89_MAX_MAC_ID_NUM)];
u16 duration; /* TU */
u16 beacon_interval; /* TU */
bool is_2ghz;
bool is_go;
bool is_gc;
};
struct rtw89_mcc_bt_role {
u16 duration; /* TU */
};
struct rtw89_mcc_courtesy {
bool enable;
u8 slot_num;
u8 macid_src;
u8 macid_tgt;
};
enum rtw89_mcc_plan {
RTW89_MCC_PLAN_TAIL_BT,
RTW89_MCC_PLAN_MID_BT,
RTW89_MCC_PLAN_NO_BT,
};
struct rtw89_mcc_pattern {
s16 tob_ref; /* TU; time offset behind of reference role */
s16 toa_ref; /* TU; time offset ahead of reference role */
s16 tob_aux; /* TU; time offset behind of auxiliary role */
s16 toa_aux; /* TU; time offset ahead of auxiliary role */
enum rtw89_mcc_plan plan;
struct rtw89_mcc_courtesy courtesy;
};
struct rtw89_mcc_config {
struct rtw89_mcc_pattern pattern;
u64 start_tsf;
u16 mcc_interval; /* TU */
u16 beacon_offset; /* TU */
};
enum rtw89_mcc_mode {
RTW89_MCC_MODE_GO_STA,
RTW89_MCC_MODE_GC_STA,
};
struct rtw89_mcc_info {
struct rtw89_wait_info wait;
enum rtw89_mcc_mode mode;
struct rtw89_mcc_role role_ref; /* reference role */
struct rtw89_mcc_role role_aux; /* auxiliary role */
struct rtw89_mcc_bt_role bt_role;
struct rtw89_mcc_config config;
};
struct rtw89_dev {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment