xref: /freebsd/sys/contrib/dev/mediatek/mt76/mt76x2/mt76x2u.h (revision 6c92544d7c9722a3fe6263134938d1f864c158c5)
1 /* SPDX-License-Identifier: ISC */
2 /*
3  * Copyright (C) 2018 Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
4  */
5 
6 #ifndef __MT76x2U_H
7 #define __MT76x2U_H
8 
9 #include <linux/device.h>
10 
11 #include "mt76x2.h"
12 #include "mcu.h"
13 
14 #define MT7612U_EEPROM_SIZE		512
15 
16 #define MT_USB_AGGR_SIZE_LIMIT		21 /* 1024B unit */
17 #define MT_USB_AGGR_TIMEOUT		0x80 /* 33ns unit */
18 
19 extern const struct ieee80211_ops mt76x2u_ops;
20 
21 int mt76x2u_register_device(struct mt76x02_dev *dev);
22 int mt76x2u_init_hardware(struct mt76x02_dev *dev);
23 void mt76x2u_cleanup(struct mt76x02_dev *dev);
24 void mt76x2u_stop_hw(struct mt76x02_dev *dev);
25 
26 int mt76x2u_mac_reset(struct mt76x02_dev *dev);
27 int mt76x2u_mac_stop(struct mt76x02_dev *dev);
28 
29 int mt76x2u_phy_set_channel(struct mt76x02_dev *dev,
30 			    struct cfg80211_chan_def *chandef);
31 void mt76x2u_phy_calibrate(struct work_struct *work);
32 
33 void mt76x2u_mcu_complete_urb(struct urb *urb);
34 int mt76x2u_mcu_init(struct mt76x02_dev *dev);
35 int mt76x2u_mcu_fw_init(struct mt76x02_dev *dev);
36 
37 int mt76x2u_alloc_queues(struct mt76x02_dev *dev);
38 void mt76x2u_queues_deinit(struct mt76x02_dev *dev);
39 void mt76x2u_stop_queues(struct mt76x02_dev *dev);
40 int mt76x2u_skb_dma_info(struct sk_buff *skb, enum dma_msg_port port,
41 			 u32 flags);
42 
43 #endif /* __MT76x2U_H */
44