mt7915.h (b662b71ac3cccb50e9a45aae194591fc50e433ce) mt7915.h (4dbcb9125cc3e10a6d879c10e4f5816d05a87c49)
1/* SPDX-License-Identifier: ISC */
2/* Copyright (C) 2020 MediaTek Inc. */
3
4#ifndef __MT7915_H
5#define __MT7915_H
6
7#include <linux/interrupt.h>
8#include <linux/ktime.h>

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

219 u32 rx_pfdrop_cnt;
220 u32 rx_vec_queue_overflow_drop_cnt;
221 u32 rx_ba_cnt;
222
223 u32 tx_amsdu[8];
224 u32 tx_amsdu_cnt;
225};
226
1/* SPDX-License-Identifier: ISC */
2/* Copyright (C) 2020 MediaTek Inc. */
3
4#ifndef __MT7915_H
5#define __MT7915_H
6
7#include <linux/interrupt.h>
8#include <linux/ktime.h>

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

219 u32 rx_pfdrop_cnt;
220 u32 rx_vec_queue_overflow_drop_cnt;
221 u32 rx_ba_cnt;
222
223 u32 tx_amsdu[8];
224 u32 tx_amsdu_cnt;
225};
226
227/* crash-dump */
228struct mt7915_crash_data {
229 guid_t guid;
230 struct timespec64 timestamp;
231
232 u8 *memdump_buf;
233 size_t memdump_buf_len;
234};
235
227struct mt7915_hif {
228 struct list_head list;
229
230 struct device *dev;
231 void __iomem *regs;
232 int irq;
233};
234

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

300 struct mt7915_phy *rdd2_phy;
301
302 u16 chainmask;
303 u16 chainshift;
304 u32 hif_idx;
305
306 struct work_struct init_work;
307 struct work_struct rc_work;
236struct mt7915_hif {
237 struct list_head list;
238
239 struct device *dev;
240 void __iomem *regs;
241 int irq;
242};
243

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

309 struct mt7915_phy *rdd2_phy;
310
311 u16 chainmask;
312 u16 chainshift;
313 u32 hif_idx;
314
315 struct work_struct init_work;
316 struct work_struct rc_work;
317 struct work_struct dump_work;
308 struct work_struct reset_work;
309 wait_queue_head_t reset_wait;
310
311 struct {
312 u32 state;
313 u32 wa_reset_count;
314 u32 wm_reset_count;
315 bool hw_full_reset:1;
316 bool hw_init_done:1;
317 bool restart:1;
318 } recovery;
319
318 struct work_struct reset_work;
319 wait_queue_head_t reset_wait;
320
321 struct {
322 u32 state;
323 u32 wa_reset_count;
324 u32 wm_reset_count;
325 bool hw_full_reset:1;
326 bool hw_init_done:1;
327 bool restart:1;
328 } recovery;
329
330 /* protects coredump data */
331 struct mutex dump_mutex;
332#ifdef CONFIG_DEV_COREDUMP
333 struct {
334 struct mt7915_crash_data *crash_data;
335 } coredump;
336#endif
337
320 struct list_head sta_rc_list;
321 struct list_head sta_poll_list;
322 struct list_head twt_list;
323 spinlock_t sta_poll_lock;
324
325 u32 hw_pattern;
326
327 bool dbdc_support;

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

557static inline void mt7915_irq_disable(struct mt7915_dev *dev, u32 mask)
558{
559 if (dev->hif2)
560 mt7915_dual_hif_set_irq_mask(dev, true, mask, 0);
561 else
562 mt76_set_irq_mask(&dev->mt76, MT_INT_MASK_CSR, mask, 0);
563}
564
338 struct list_head sta_rc_list;
339 struct list_head sta_poll_list;
340 struct list_head twt_list;
341 spinlock_t sta_poll_lock;
342
343 u32 hw_pattern;
344
345 bool dbdc_support;

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

575static inline void mt7915_irq_disable(struct mt7915_dev *dev, u32 mask)
576{
577 if (dev->hif2)
578 mt7915_dual_hif_set_irq_mask(dev, true, mask, 0);
579 else
580 mt76_set_irq_mask(&dev->mt76, MT_INT_MASK_CSR, mask, 0);
581}
582
583void mt7915_memcpy_fromio(struct mt7915_dev *dev, void *buf, u32 offset,
584 size_t len);
585
565void mt7915_mac_init(struct mt7915_dev *dev);
566u32 mt7915_mac_wtbl_lmac_addr(struct mt7915_dev *dev, u16 wcid, u8 dw);
567bool mt7915_mac_wtbl_update(struct mt7915_dev *dev, int idx, u32 mask);
568void mt7915_mac_reset_counters(struct mt7915_phy *phy);
569void mt7915_mac_cca_stats_reset(struct mt7915_phy *phy);
570void mt7915_mac_enable_nf(struct mt7915_dev *dev, bool ext_phy);
571void mt7915_mac_enable_rtscts(struct mt7915_dev *dev,
572 struct ieee80211_vif *vif, bool enable);
573void mt7915_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
574 struct sk_buff *skb, struct mt76_wcid *wcid, int pid,
575 struct ieee80211_key_conf *key,
576 enum mt76_txq_id qid, u32 changed);
577void mt7915_mac_set_timing(struct mt7915_phy *phy);
578int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
579 struct ieee80211_sta *sta);
580void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
581 struct ieee80211_sta *sta);
582void mt7915_mac_work(struct work_struct *work);
583void mt7915_mac_reset_work(struct work_struct *work);
586void mt7915_mac_init(struct mt7915_dev *dev);
587u32 mt7915_mac_wtbl_lmac_addr(struct mt7915_dev *dev, u16 wcid, u8 dw);
588bool mt7915_mac_wtbl_update(struct mt7915_dev *dev, int idx, u32 mask);
589void mt7915_mac_reset_counters(struct mt7915_phy *phy);
590void mt7915_mac_cca_stats_reset(struct mt7915_phy *phy);
591void mt7915_mac_enable_nf(struct mt7915_dev *dev, bool ext_phy);
592void mt7915_mac_enable_rtscts(struct mt7915_dev *dev,
593 struct ieee80211_vif *vif, bool enable);
594void mt7915_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
595 struct sk_buff *skb, struct mt76_wcid *wcid, int pid,
596 struct ieee80211_key_conf *key,
597 enum mt76_txq_id qid, u32 changed);
598void mt7915_mac_set_timing(struct mt7915_phy *phy);
599int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
600 struct ieee80211_sta *sta);
601void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
602 struct ieee80211_sta *sta);
603void mt7915_mac_work(struct work_struct *work);
604void mt7915_mac_reset_work(struct work_struct *work);
605void mt7915_mac_dump_work(struct work_struct *work);
584void mt7915_mac_sta_rc_work(struct work_struct *work);
585void mt7915_mac_update_stats(struct mt7915_phy *phy);
586void mt7915_mac_twt_teardown_flow(struct mt7915_dev *dev,
587 struct mt7915_sta *msta,
588 u8 flowid);
589void mt7915_mac_add_twt_setup(struct ieee80211_hw *hw,
590 struct ieee80211_sta *sta,
591 struct ieee80211_twt_setup *twt);

--- 28 unchanged lines hidden ---
606void mt7915_mac_sta_rc_work(struct work_struct *work);
607void mt7915_mac_update_stats(struct mt7915_phy *phy);
608void mt7915_mac_twt_teardown_flow(struct mt7915_dev *dev,
609 struct mt7915_sta *msta,
610 u8 flowid);
611void mt7915_mac_add_twt_setup(struct ieee80211_hw *hw,
612 struct ieee80211_sta *sta,
613 struct ieee80211_twt_setup *twt);

--- 28 unchanged lines hidden ---