wifi: iwlwifi: mvm: move phy band to nl80211 band helper
This function is useful in other places, so move it in order to share it. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240415114847.8e456d6c599e.Ibaa76864b30c990bfc35d886ec1344d513a96d14@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
20af85e2de
commit
91d80986d1
2 changed files with 16 additions and 16 deletions
|
@ -2464,6 +2464,21 @@ static inline u8 iwl_mvm_phy_band_from_nl80211(enum nl80211_band band)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline u8 iwl_mvm_nl80211_band_from_phy(u8 phy_band)
|
||||||
|
{
|
||||||
|
switch (phy_band) {
|
||||||
|
case PHY_BAND_24:
|
||||||
|
return NL80211_BAND_2GHZ;
|
||||||
|
case PHY_BAND_5:
|
||||||
|
return NL80211_BAND_5GHZ;
|
||||||
|
case PHY_BAND_6:
|
||||||
|
return NL80211_BAND_6GHZ;
|
||||||
|
default:
|
||||||
|
WARN_ONCE(1, "Unsupported phy band (%u)\n", phy_band);
|
||||||
|
return NL80211_BAND_5GHZ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Channel Switch */
|
/* Channel Switch */
|
||||||
void iwl_mvm_channel_switch_disconnect_wk(struct work_struct *wk);
|
void iwl_mvm_channel_switch_disconnect_wk(struct work_struct *wk);
|
||||||
int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw,
|
int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw,
|
||||||
|
|
|
@ -1890,21 +1890,6 @@ static void iwl_mvm_decode_lsig(struct sk_buff *skb,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u8 iwl_mvm_nl80211_band_from_rx_msdu(u8 phy_band)
|
|
||||||
{
|
|
||||||
switch (phy_band) {
|
|
||||||
case PHY_BAND_24:
|
|
||||||
return NL80211_BAND_2GHZ;
|
|
||||||
case PHY_BAND_5:
|
|
||||||
return NL80211_BAND_5GHZ;
|
|
||||||
case PHY_BAND_6:
|
|
||||||
return NL80211_BAND_6GHZ;
|
|
||||||
default:
|
|
||||||
WARN_ONCE(1, "Unsupported phy band (%u)\n", phy_band);
|
|
||||||
return NL80211_BAND_5GHZ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct iwl_rx_sta_csa {
|
struct iwl_rx_sta_csa {
|
||||||
bool all_sta_unblocked;
|
bool all_sta_unblocked;
|
||||||
struct ieee80211_vif *vif;
|
struct ieee80211_vif *vif;
|
||||||
|
@ -2168,7 +2153,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
|
||||||
if (iwl_mvm_is_band_in_rx_supported(mvm)) {
|
if (iwl_mvm_is_band_in_rx_supported(mvm)) {
|
||||||
u8 band = BAND_IN_RX_STATUS(desc->mac_phy_idx);
|
u8 band = BAND_IN_RX_STATUS(desc->mac_phy_idx);
|
||||||
|
|
||||||
rx_status->band = iwl_mvm_nl80211_band_from_rx_msdu(band);
|
rx_status->band = iwl_mvm_nl80211_band_from_phy(band);
|
||||||
} else {
|
} else {
|
||||||
rx_status->band = phy_data.channel > 14 ? NL80211_BAND_5GHZ :
|
rx_status->band = phy_data.channel > 14 ? NL80211_BAND_5GHZ :
|
||||||
NL80211_BAND_2GHZ;
|
NL80211_BAND_2GHZ;
|
||||||
|
|
Loading…
Add table
Reference in a new issue