diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2023-06-28 09:05:58 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-07-26 11:36:12 +0200 |
commit | 311f121c240967ad4add9e4b00fbd5204e9b93f7 (patch) | |
tree | 4d8c7082d0a5c3a16c81dba5ef2ecb1edc7791f2 /drivers/net/wireless/mediatek/mt76/mt792x.h | |
parent | wifi: mt76: mt792x: introduce mt792x-lib module (diff) | |
download | linux-311f121c240967ad4add9e4b00fbd5204e9b93f7.tar.xz linux-311f121c240967ad4add9e4b00fbd5204e9b93f7.zip |
wifi: mt76: mt7921: move mac shared code in mt792x-lib module
Reduce duplicated code moving mac shared code in mt792x-lib module.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt792x.h')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt792x.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h index 83236a6c300e..f0f9fb3fd970 100644 --- a/drivers/net/wireless/mediatek/mt76/mt792x.h +++ b/drivers/net/wireless/mediatek/mt76/mt792x.h @@ -155,11 +155,31 @@ mt792x_hw_phy(struct ieee80211_hw *hw) return phy->priv; } +static inline void +mt792x_get_status_freq_info(struct mt76_rx_status *status, u8 chfreq) +{ + if (chfreq > 180) { + status->band = NL80211_BAND_6GHZ; + chfreq = (chfreq - 181) * 4 + 1; + } else if (chfreq > 14) { + status->band = NL80211_BAND_5GHZ; + } else { + status->band = NL80211_BAND_2GHZ; + } + status->freq = ieee80211_channel_to_frequency(chfreq, status->band); +} + #define mt792x_mutex_acquire(dev) \ mt76_connac_mutex_acquire(&(dev)->mt76, &(dev)->pm) #define mt792x_mutex_release(dev) \ mt76_connac_mutex_release(&(dev)->mt76, &(dev)->pm) +void mt792x_reset(struct mt76_dev *mdev); +void mt792x_update_channel(struct mt76_phy *mphy); +void mt792x_mac_reset_counters(struct mt792x_phy *phy); +void mt792x_mac_assoc_rssi(struct mt792x_dev *dev, struct sk_buff *skb); +struct mt76_wcid *mt792x_rx_get_wcid(struct mt792x_dev *dev, u16 idx, + bool unicast); void mt792x_mac_update_mib_stats(struct mt792x_phy *phy); void mt792x_mac_set_timeing(struct mt792x_phy *phy); void mt792x_mac_work(struct work_struct *work); |