1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
4 * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
5 * Copyright (C) 2018 Stanislaw Gruszka <stf_xl@wp.pl>
11 #include <linux/bitfield.h>
12 #include <linux/kernel.h>
13 #include <linux/device.h>
14 #include <linux/mutex.h>
15 #include <linux/usb.h>
16 #include <linux/completion.h>
17 #include <net/mac80211.h>
18 #include <linux/debugfs.h>
20 #include "../mt76x02.h"
23 #define MT7610E_FIRMWARE "mediatek/mt7610e.bin"
24 #define MT7650E_FIRMWARE "mediatek/mt7650e.bin"
26 #define MT7610U_FIRMWARE "mediatek/mt7610u.bin"
28 #define MT_USB_AGGR_SIZE_LIMIT 21 /* * 1024B */
29 #define MT_USB_AGGR_TIMEOUT 0x80 /* * 33ns */
31 static inline bool is_mt7610e(struct mt76x02_dev
*dev
)
33 if (!mt76_is_mmio(&dev
->mt76
))
36 return mt76_chip(&dev
->mt76
) == 0x7610;
39 static inline bool is_mt7630(struct mt76x02_dev
*dev
)
41 return mt76_chip(&dev
->mt76
) == 0x7630;
45 int mt76x0_init_hardware(struct mt76x02_dev
*dev
);
46 int mt76x0_register_device(struct mt76x02_dev
*dev
);
47 void mt76x0_chip_onoff(struct mt76x02_dev
*dev
, bool enable
, bool reset
);
49 void mt76x0_mac_stop(struct mt76x02_dev
*dev
);
51 int mt76x0_config(struct ieee80211_hw
*hw
, u32 changed
);
54 void mt76x0_phy_init(struct mt76x02_dev
*dev
);
55 int mt76x0_phy_wait_bbp_ready(struct mt76x02_dev
*dev
);
56 void mt76x0_phy_set_channel(struct mt76x02_dev
*dev
,
57 struct cfg80211_chan_def
*chandef
);
58 void mt76x0_phy_set_txpower(struct mt76x02_dev
*dev
);
59 void mt76x0_phy_calibrate(struct mt76x02_dev
*dev
, bool power_on
);