diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2021-12-24 11:58:02 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-02-03 13:57:58 +0100 |
commit | 2fec2ea644c5a7e3c9c29f67dc77eea39f1e4b6c (patch) | |
tree | f50329f3b845bc4db6a127a2b44b50f4994f99eb /drivers/net/wireless/mediatek/mt76/mt76_connac.h | |
parent | 5a521c0f7b6aa6adcd3513feca43f557dbe400c3 (diff) |
mt76: connac: introduce is_connac_v1 utility routine
Introduce is_connac_v1 inline utility routine to check if the device is
generation v1.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76_connac.h')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76_connac.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac.h b/drivers/net/wireless/mediatek/mt76/mt76_connac.h index 8701f04a28e3..426adbb56a2d 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac.h +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac.h @@ -115,6 +115,29 @@ static inline bool is_mt7916(struct mt76_dev *dev) return mt76_chip(dev) == 0x7906; } +static inline bool is_mt7622(struct mt76_dev *dev) +{ + if (!IS_ENABLED(CONFIG_MT7622_WMAC)) + return false; + + return mt76_chip(dev) == 0x7622; +} + +static inline bool is_mt7615(struct mt76_dev *dev) +{ + return mt76_chip(dev) == 0x7615 || mt76_chip(dev) == 0x7611; +} + +static inline bool is_mt7611(struct mt76_dev *dev) +{ + return mt76_chip(dev) == 0x7611; +} + +static inline bool is_connac_v1(struct mt76_dev *dev) +{ + return is_mt7615(dev) || is_mt7663(dev) || is_mt7622(dev); +} + static inline u8 mt76_connac_chan_bw(struct cfg80211_chan_def *chandef) { static const u8 width_to_bw[] = { |