mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 11:33:28 +02:00
wifi: iwlwifi: clean up band in RX metadata
Use u8_get_bits() instead of open-coding, and adjust the name as well. Also don't use enum nl80211_band for the variable holding an entirely different type. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250424153620.c41058510800.Ic3f16ce2f0c991fde2cfe7bcd58ee3b875575fce@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
c561ac93cd
commit
1f5532991b
|
|
@ -1,6 +1,6 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2012-2014, 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2012-2014, 2018-2025 Intel Corporation
|
||||
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
|
||||
* Copyright (C) 2015-2017 Intel Deutschland GmbH
|
||||
*/
|
||||
|
|
@ -193,10 +193,11 @@ enum iwl_rx_mpdu_amsdu_info {
|
|||
IWL_RX_MPDU_AMSDU_LAST_SUBFRAME = 0x80,
|
||||
};
|
||||
|
||||
#define RX_MPDU_BAND_POS 6
|
||||
#define RX_MPDU_BAND_MASK 0xC0
|
||||
#define BAND_IN_RX_STATUS(_val) \
|
||||
(((_val) & RX_MPDU_BAND_MASK) >> RX_MPDU_BAND_POS)
|
||||
enum iwl_rx_mpdu_mac_phy_band {
|
||||
IWL_RX_MPDU_MAC_PHY_BAND_MAC_MASK = 0x0f,
|
||||
IWL_RX_MPDU_MAC_PHY_BAND_PHY_MASK = 0x30,
|
||||
IWL_RX_MPDU_MAC_PHY_BAND_BAND_MASK = 0xc0,
|
||||
};
|
||||
|
||||
enum iwl_rx_l3_proto_values {
|
||||
IWL_RX_L3_TYPE_NONE,
|
||||
|
|
@ -668,9 +669,10 @@ struct iwl_rx_mpdu_desc {
|
|||
*/
|
||||
__le16 phy_info;
|
||||
/**
|
||||
* @mac_phy_idx: MAC/PHY index
|
||||
* @mac_phy_band: MAC ID, PHY ID, band;
|
||||
* see &enum iwl_rx_mpdu_mac_phy_band
|
||||
*/
|
||||
u8 mac_phy_idx;
|
||||
u8 mac_phy_band;
|
||||
/* DW4 */
|
||||
union {
|
||||
struct {
|
||||
|
|
|
|||
|
|
@ -1739,9 +1739,9 @@ iwl_mld_fill_rx_status_band_freq(struct iwl_mld_rx_phy_data *phy_data,
|
|||
struct iwl_rx_mpdu_desc *mpdu_desc,
|
||||
struct ieee80211_rx_status *rx_status)
|
||||
{
|
||||
enum nl80211_band band;
|
||||
u8 band = u8_get_bits(mpdu_desc->mac_phy_band,
|
||||
IWL_RX_MPDU_MAC_PHY_BAND_BAND_MASK);
|
||||
|
||||
band = BAND_IN_RX_STATUS(mpdu_desc->mac_phy_idx);
|
||||
rx_status->band = iwl_mld_phy_band_to_nl80211(band);
|
||||
rx_status->freq = ieee80211_channel_to_frequency(phy_data->channel,
|
||||
rx_status->band);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2012-2014, 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2012-2014, 2018-2025 Intel Corporation
|
||||
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
|
||||
* Copyright (C) 2015-2017 Intel Deutschland GmbH
|
||||
*/
|
||||
|
|
@ -2157,7 +2157,8 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
|
|||
}
|
||||
|
||||
if (iwl_mvm_is_band_in_rx_supported(mvm)) {
|
||||
u8 band = BAND_IN_RX_STATUS(desc->mac_phy_idx);
|
||||
u8 band = u8_get_bits(desc->mac_phy_band,
|
||||
IWL_RX_MPDU_MAC_PHY_BAND_BAND_MASK);
|
||||
|
||||
rx_status->band = iwl_mvm_nl80211_band_from_phy(band);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user