1

wifi: rtw89: pass chan to rfk_band_changed()

Originally, all chips have implemented rfk_band_changed() and access chan
with hard-code RTW89_CHANCTX_0 in it. But, it's problematic when the chip
supports multiple channels.

So, change the prototype of rfk_band_changed() and pass chan ahead. And,
we will refine the implementation of each chip in the following.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240819091724.33730-2-pkshih@realtek.com
This commit is contained in:
Zong-Zhe Yang 2024-08-19 17:17:17 +08:00 committed by Ping-Ke Shih
parent 6833337585
commit 7c31f10203
8 changed files with 18 additions and 10 deletions

View File

@ -429,7 +429,7 @@ int rtw89_set_channel(struct rtw89_dev *rtwdev)
if (!entity_active || chan_rcd->band_changed) {
rtw89_btc_ntfy_switch_band(rtwdev, phy_idx, chan->band_type);
rtw89_chip_rfk_band_changed(rtwdev, phy_idx);
rtw89_chip_rfk_band_changed(rtwdev, phy_idx, chan);
}
rtw89_set_entity_state(rtwdev, true);

View File

@ -3595,7 +3595,8 @@ struct rtw89_chip_ops {
void (*rfk_init_late)(struct rtw89_dev *rtwdev);
void (*rfk_channel)(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif);
void (*rfk_band_changed)(struct rtw89_dev *rtwdev,
enum rtw89_phy_idx phy_idx);
enum rtw89_phy_idx phy_idx,
const struct rtw89_chan *chan);
void (*rfk_scan)(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif,
bool start);
void (*rfk_track)(struct rtw89_dev *rtwdev);
@ -6227,12 +6228,13 @@ static inline void rtw89_chip_rfk_channel(struct rtw89_dev *rtwdev,
}
static inline void rtw89_chip_rfk_band_changed(struct rtw89_dev *rtwdev,
enum rtw89_phy_idx phy_idx)
enum rtw89_phy_idx phy_idx,
const struct rtw89_chan *chan)
{
const struct rtw89_chip_info *chip = rtwdev->chip;
if (chip->ops->rfk_band_changed)
chip->ops->rfk_band_changed(rtwdev, phy_idx);
chip->ops->rfk_band_changed(rtwdev, phy_idx, chan);
}
static inline void rtw89_chip_rfk_scan(struct rtw89_dev *rtwdev,

View File

@ -1601,7 +1601,8 @@ static void rtw8851b_rfk_channel(struct rtw89_dev *rtwdev, struct rtw89_vif *rtw
}
static void rtw8851b_rfk_band_changed(struct rtw89_dev *rtwdev,
enum rtw89_phy_idx phy_idx)
enum rtw89_phy_idx phy_idx,
const struct rtw89_chan *chan)
{
rtw8851b_tssi_scan(rtwdev, phy_idx);
}

View File

@ -1361,7 +1361,8 @@ static void rtw8852a_rfk_channel(struct rtw89_dev *rtwdev, struct rtw89_vif *rtw
}
static void rtw8852a_rfk_band_changed(struct rtw89_dev *rtwdev,
enum rtw89_phy_idx phy_idx)
enum rtw89_phy_idx phy_idx,
const struct rtw89_chan *chan)
{
rtw8852a_tssi_scan(rtwdev, phy_idx);
}

View File

@ -573,7 +573,8 @@ static void rtw8852b_rfk_channel(struct rtw89_dev *rtwdev, struct rtw89_vif *rtw
}
static void rtw8852b_rfk_band_changed(struct rtw89_dev *rtwdev,
enum rtw89_phy_idx phy_idx)
enum rtw89_phy_idx phy_idx,
const struct rtw89_chan *chan)
{
rtw8852b_tssi_scan(rtwdev, phy_idx);
}

View File

@ -546,7 +546,8 @@ static void rtw8852bt_rfk_channel(struct rtw89_dev *rtwdev, struct rtw89_vif *rt
}
static void rtw8852bt_rfk_band_changed(struct rtw89_dev *rtwdev,
enum rtw89_phy_idx phy_idx)
enum rtw89_phy_idx phy_idx,
const struct rtw89_chan *chan)
{
rtw8852bt_tssi_scan(rtwdev, phy_idx);
}

View File

@ -1859,7 +1859,8 @@ static void rtw8852c_rfk_channel(struct rtw89_dev *rtwdev, struct rtw89_vif *rtw
}
static void rtw8852c_rfk_band_changed(struct rtw89_dev *rtwdev,
enum rtw89_phy_idx phy_idx)
enum rtw89_phy_idx phy_idx,
const struct rtw89_chan *chan)
{
rtw8852c_tssi_scan(rtwdev, phy_idx);
}

View File

@ -2040,7 +2040,8 @@ static void rtw8922a_rfk_channel(struct rtw89_dev *rtwdev, struct rtw89_vif *rtw
}
static void rtw8922a_rfk_band_changed(struct rtw89_dev *rtwdev,
enum rtw89_phy_idx phy_idx)
enum rtw89_phy_idx phy_idx,
const struct rtw89_chan *chan)
{
rtw89_phy_rfk_tssi_and_wait(rtwdev, phy_idx, RTW89_TSSI_SCAN, 6);
}