wcn36xx: Track the band and channel we are tuned to
Track the band and channel we are currently tuned to by way of pointers to the standard structures that describe them both embedded within the driver. Tracking of the pair makes it much easier when implementing ieee80211_ops->get_survey to return quickly captured metrics for the currently tuned channel. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220115001646.3981501-3-bryan.odonoghue@linaro.org
This commit is contained in:
parent
039d5d4db4
commit
d6f2746691
2 changed files with 30 additions and 0 deletions
|
@ -392,11 +392,38 @@ static void wcn36xx_change_opchannel(struct wcn36xx *wcn, int ch)
|
|||
{
|
||||
struct ieee80211_vif *vif = NULL;
|
||||
struct wcn36xx_vif *tmp;
|
||||
struct ieee80211_supported_band *band;
|
||||
struct ieee80211_channel *channel;
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(wcn->hw->wiphy->bands); i++) {
|
||||
band = wcn->hw->wiphy->bands[i];
|
||||
if (!band)
|
||||
break;
|
||||
for (j = 0; j < band->n_channels; j++) {
|
||||
if (HW_VALUE_CHANNEL(band->channels[j].hw_value) == ch) {
|
||||
channel = &band->channels[j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (channel)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!channel) {
|
||||
wcn36xx_err("Cannot tune to channel %d\n", ch);
|
||||
return;
|
||||
}
|
||||
|
||||
wcn->band = band;
|
||||
wcn->channel = channel;
|
||||
|
||||
list_for_each_entry(tmp, &wcn->vif_list, list) {
|
||||
vif = wcn36xx_priv_to_vif(tmp);
|
||||
wcn36xx_smd_switch_channel(wcn, vif, ch);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int wcn36xx_config(struct ieee80211_hw *hw, u32 changed)
|
||||
|
|
|
@ -281,6 +281,9 @@ struct wcn36xx {
|
|||
/* Debug file system entry */
|
||||
struct wcn36xx_dfs_entry dfs;
|
||||
#endif /* CONFIG_WCN36XX_DEBUGFS */
|
||||
|
||||
struct ieee80211_supported_band *band;
|
||||
struct ieee80211_channel *channel;
|
||||
};
|
||||
|
||||
static inline bool wcn36xx_is_fw_version(struct wcn36xx *wcn,
|
||||
|
|
Loading…
Add table
Reference in a new issue