mt792x.h (20249e1a853c412f452aa6ee0beb752360e69f17) mt792x.h (c74df1c067f2af0a3758a5ab02806f501473797c)
1/* SPDX-License-Identifier: ISC */
2/* Copyright (C) 2023 MediaTek Inc. */
3
4#ifndef __MT792X_H
5#define __MT792X_H
6
7#include <linux/interrupt.h>
8#include <linux/ktime.h>
9
10#include "mt76_connac_mcu.h"
11
1/* SPDX-License-Identifier: ISC */
2/* Copyright (C) 2023 MediaTek Inc. */
3
4#ifndef __MT792X_H
5#define __MT792X_H
6
7#include <linux/interrupt.h>
8#include <linux/ktime.h>
9
10#include "mt76_connac_mcu.h"
11
12#define MT792x_MAX_INTERFACES 4
13#define MT792x_WTBL_SIZE 20
14#define MT792x_WTBL_RESERVED (MT792x_WTBL_SIZE - 1)
15#define MT792x_WTBL_STA (MT792x_WTBL_RESERVED - MT792x_MAX_INTERFACES)
16
17#define MT792x_CFEND_RATE_DEFAULT 0x49 /* OFDM 24M */
18#define MT792x_CFEND_RATE_11B 0x03 /* 11B LP, 11M */
19
20/* NOTE: used to map mt76_rates. idx may change if firmware expands table */
21#define MT792x_BASIC_RATES_TBL 11
22
23#define MT792x_WATCHDOG_TIME (HZ / 4)
24
12struct mt792x_vif;
13struct mt792x_sta;
14
15enum {
16 MT792x_CLC_POWER,
17 MT792x_CLC_CHAN,
18 MT792x_CLC_MAX_NUM,
19};

--- 109 unchanged lines hidden (view full) ---

129static inline struct mt792x_dev *
130mt792x_hw_dev(struct ieee80211_hw *hw)
131{
132 struct mt76_phy *phy = hw->priv;
133
134 return container_of(phy->dev, struct mt792x_dev, mt76);
135}
136
25struct mt792x_vif;
26struct mt792x_sta;
27
28enum {
29 MT792x_CLC_POWER,
30 MT792x_CLC_CHAN,
31 MT792x_CLC_MAX_NUM,
32};

--- 109 unchanged lines hidden (view full) ---

142static inline struct mt792x_dev *
143mt792x_hw_dev(struct ieee80211_hw *hw)
144{
145 struct mt76_phy *phy = hw->priv;
146
147 return container_of(phy->dev, struct mt792x_dev, mt76);
148}
149
150static inline struct mt792x_phy *
151mt792x_hw_phy(struct ieee80211_hw *hw)
152{
153 struct mt76_phy *phy = hw->priv;
154
155 return phy->priv;
156}
157
137#define mt792x_mutex_acquire(dev) \
138 mt76_connac_mutex_acquire(&(dev)->mt76, &(dev)->pm)
139#define mt792x_mutex_release(dev) \
140 mt76_connac_mutex_release(&(dev)->mt76, &(dev)->pm)
141
158#define mt792x_mutex_acquire(dev) \
159 mt76_connac_mutex_acquire(&(dev)->mt76, &(dev)->pm)
160#define mt792x_mutex_release(dev) \
161 mt76_connac_mutex_release(&(dev)->mt76, &(dev)->pm)
162
163void mt792x_mac_update_mib_stats(struct mt792x_phy *phy);
164void mt792x_mac_set_timeing(struct mt792x_phy *phy);
165void mt792x_mac_work(struct work_struct *work);
166void mt792x_remove_interface(struct ieee80211_hw *hw,
167 struct ieee80211_vif *vif);
168void mt792x_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
169 struct sk_buff *skb);
170int mt792x_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
171 unsigned int link_id, u16 queue,
172 const struct ieee80211_tx_queue_params *params);
173int mt792x_get_stats(struct ieee80211_hw *hw,
174 struct ieee80211_low_level_stats *stats);
175u64 mt792x_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
176void mt792x_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
177 u64 timestamp);
178void mt792x_tx_worker(struct mt76_worker *w);
179void mt792x_roc_timer(struct timer_list *timer);
180void mt792x_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
181 u32 queues, bool drop);
182int mt792x_assign_vif_chanctx(struct ieee80211_hw *hw,
183 struct ieee80211_vif *vif,
184 struct ieee80211_bss_conf *link_conf,
185 struct ieee80211_chanctx_conf *ctx);
186void mt792x_unassign_vif_chanctx(struct ieee80211_hw *hw,
187 struct ieee80211_vif *vif,
188 struct ieee80211_bss_conf *link_conf,
189 struct ieee80211_chanctx_conf *ctx);
190void mt792x_set_wakeup(struct ieee80211_hw *hw, bool enabled);
191void mt792x_get_et_strings(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
192 u32 sset, u8 *data);
193int mt792x_get_et_sset_count(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
194 int sset);
195void mt792x_get_et_stats(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
196 struct ethtool_stats *stats, u64 *data);
197void mt792x_sta_statistics(struct ieee80211_hw *hw,
198 struct ieee80211_vif *vif,
199 struct ieee80211_sta *sta,
200 struct station_info *sinfo);
201void mt792x_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class);
202
142#endif /* __MT7925_H */
203#endif /* __MT7925_H */