1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
4*4882a593Smuzhiyun */
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun #include <linux/kernel.h>
7*4882a593Smuzhiyun #include <linux/module.h>
8*4882a593Smuzhiyun #include <linux/usb.h>
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun #include "mt76x0.h"
11*4882a593Smuzhiyun #include "mcu.h"
12*4882a593Smuzhiyun #include "../mt76x02_usb.h"
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun static struct usb_device_id mt76x0_device_table[] = {
15*4882a593Smuzhiyun { USB_DEVICE(0x148F, 0x7610) }, /* MT7610U */
16*4882a593Smuzhiyun { USB_DEVICE(0x13B1, 0x003E) }, /* Linksys AE6000 */
17*4882a593Smuzhiyun { USB_DEVICE(0x0E8D, 0x7610) }, /* Sabrent NTWLAC */
18*4882a593Smuzhiyun { USB_DEVICE(0x7392, 0xa711) }, /* Edimax 7711mac */
19*4882a593Smuzhiyun { USB_DEVICE(0x7392, 0xb711) }, /* Edimax / Elecom */
20*4882a593Smuzhiyun { USB_DEVICE(0x148f, 0x761a) }, /* TP-Link TL-WDN5200 */
21*4882a593Smuzhiyun { USB_DEVICE(0x148f, 0x760a) }, /* TP-Link unknown */
22*4882a593Smuzhiyun { USB_DEVICE(0x0b05, 0x17d1) }, /* Asus USB-AC51 */
23*4882a593Smuzhiyun { USB_DEVICE(0x0b05, 0x17db) }, /* Asus USB-AC50 */
24*4882a593Smuzhiyun { USB_DEVICE(0x0df6, 0x0075) }, /* Sitecom WLA-3100 */
25*4882a593Smuzhiyun { USB_DEVICE(0x2019, 0xab31) }, /* Planex GW-450D */
26*4882a593Smuzhiyun { USB_DEVICE(0x2001, 0x3d02) }, /* D-LINK DWA-171 rev B1 */
27*4882a593Smuzhiyun { USB_DEVICE(0x0586, 0x3425) }, /* Zyxel NWD6505 */
28*4882a593Smuzhiyun { USB_DEVICE(0x07b8, 0x7610) }, /* AboCom AU7212 */
29*4882a593Smuzhiyun { USB_DEVICE(0x04bb, 0x0951) }, /* I-O DATA WN-AC433UK */
30*4882a593Smuzhiyun { USB_DEVICE(0x057c, 0x8502) }, /* AVM FRITZ!WLAN USB Stick AC 430 */
31*4882a593Smuzhiyun { USB_DEVICE(0x293c, 0x5702) }, /* Comcast Xfinity KXW02AAA */
32*4882a593Smuzhiyun { USB_DEVICE(0x20f4, 0x806b) }, /* TRENDnet TEW-806UBH */
33*4882a593Smuzhiyun { USB_DEVICE(0x7392, 0xc711) }, /* Devolo Wifi ac Stick */
34*4882a593Smuzhiyun { USB_DEVICE(0x0df6, 0x0079) }, /* Sitecom Europe B.V. ac Stick */
35*4882a593Smuzhiyun { USB_DEVICE(0x2357, 0x0123) }, /* TP-LINK T2UHP */
36*4882a593Smuzhiyun /* TP-LINK Archer T1U */
37*4882a593Smuzhiyun { USB_DEVICE(0x2357, 0x0105), .driver_info = 1, },
38*4882a593Smuzhiyun /* MT7630U */
39*4882a593Smuzhiyun { USB_DEVICE_AND_INTERFACE_INFO(0x0E8D, 0x7630, 0xff, 0x2, 0xff)},
40*4882a593Smuzhiyun /* MT7650U */
41*4882a593Smuzhiyun { USB_DEVICE_AND_INTERFACE_INFO(0x0E8D, 0x7650, 0xff, 0x2, 0xff)},
42*4882a593Smuzhiyun { 0, }
43*4882a593Smuzhiyun };
44*4882a593Smuzhiyun
mt76x0_init_usb_dma(struct mt76x02_dev * dev)45*4882a593Smuzhiyun static void mt76x0_init_usb_dma(struct mt76x02_dev *dev)
46*4882a593Smuzhiyun {
47*4882a593Smuzhiyun u32 val;
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun val = mt76_rr(dev, MT_USB_DMA_CFG);
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun val |= MT_USB_DMA_CFG_RX_BULK_EN |
52*4882a593Smuzhiyun MT_USB_DMA_CFG_TX_BULK_EN;
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun /* disable AGGR_BULK_RX in order to receive one
55*4882a593Smuzhiyun * frame in each rx urb and avoid copies
56*4882a593Smuzhiyun */
57*4882a593Smuzhiyun val &= ~MT_USB_DMA_CFG_RX_BULK_AGG_EN;
58*4882a593Smuzhiyun mt76_wr(dev, MT_USB_DMA_CFG, val);
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun val = mt76_rr(dev, MT_COM_REG0);
61*4882a593Smuzhiyun if (val & 1)
62*4882a593Smuzhiyun dev_dbg(dev->mt76.dev, "MCU not ready\n");
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun val = mt76_rr(dev, MT_USB_DMA_CFG);
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun val |= MT_USB_DMA_CFG_RX_DROP_OR_PAD;
67*4882a593Smuzhiyun mt76_wr(dev, MT_USB_DMA_CFG, val);
68*4882a593Smuzhiyun val &= ~MT_USB_DMA_CFG_RX_DROP_OR_PAD;
69*4882a593Smuzhiyun mt76_wr(dev, MT_USB_DMA_CFG, val);
70*4882a593Smuzhiyun }
71*4882a593Smuzhiyun
mt76x0u_cleanup(struct mt76x02_dev * dev)72*4882a593Smuzhiyun static void mt76x0u_cleanup(struct mt76x02_dev *dev)
73*4882a593Smuzhiyun {
74*4882a593Smuzhiyun clear_bit(MT76_STATE_INITIALIZED, &dev->mphy.state);
75*4882a593Smuzhiyun mt76x0_chip_onoff(dev, false, false);
76*4882a593Smuzhiyun mt76u_queues_deinit(&dev->mt76);
77*4882a593Smuzhiyun }
78*4882a593Smuzhiyun
mt76x0u_stop(struct ieee80211_hw * hw)79*4882a593Smuzhiyun static void mt76x0u_stop(struct ieee80211_hw *hw)
80*4882a593Smuzhiyun {
81*4882a593Smuzhiyun struct mt76x02_dev *dev = hw->priv;
82*4882a593Smuzhiyun
83*4882a593Smuzhiyun clear_bit(MT76_STATE_RUNNING, &dev->mphy.state);
84*4882a593Smuzhiyun cancel_delayed_work_sync(&dev->cal_work);
85*4882a593Smuzhiyun cancel_delayed_work_sync(&dev->mt76.mac_work);
86*4882a593Smuzhiyun mt76u_stop_tx(&dev->mt76);
87*4882a593Smuzhiyun mt76x02u_exit_beacon_config(dev);
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun if (test_bit(MT76_REMOVED, &dev->mphy.state))
90*4882a593Smuzhiyun return;
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun if (!mt76_poll(dev, MT_USB_DMA_CFG, MT_USB_DMA_CFG_TX_BUSY, 0, 1000))
93*4882a593Smuzhiyun dev_warn(dev->mt76.dev, "TX DMA did not stop\n");
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun mt76x0_mac_stop(dev);
96*4882a593Smuzhiyun
97*4882a593Smuzhiyun if (!mt76_poll(dev, MT_USB_DMA_CFG, MT_USB_DMA_CFG_RX_BUSY, 0, 1000))
98*4882a593Smuzhiyun dev_warn(dev->mt76.dev, "RX DMA did not stop\n");
99*4882a593Smuzhiyun }
100*4882a593Smuzhiyun
mt76x0u_start(struct ieee80211_hw * hw)101*4882a593Smuzhiyun static int mt76x0u_start(struct ieee80211_hw *hw)
102*4882a593Smuzhiyun {
103*4882a593Smuzhiyun struct mt76x02_dev *dev = hw->priv;
104*4882a593Smuzhiyun int ret;
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun ret = mt76x02u_mac_start(dev);
107*4882a593Smuzhiyun if (ret)
108*4882a593Smuzhiyun return ret;
109*4882a593Smuzhiyun
110*4882a593Smuzhiyun mt76x0_phy_calibrate(dev, true);
111*4882a593Smuzhiyun ieee80211_queue_delayed_work(dev->mt76.hw, &dev->mt76.mac_work,
112*4882a593Smuzhiyun MT_MAC_WORK_INTERVAL);
113*4882a593Smuzhiyun ieee80211_queue_delayed_work(dev->mt76.hw, &dev->cal_work,
114*4882a593Smuzhiyun MT_CALIBRATE_INTERVAL);
115*4882a593Smuzhiyun set_bit(MT76_STATE_RUNNING, &dev->mphy.state);
116*4882a593Smuzhiyun return 0;
117*4882a593Smuzhiyun }
118*4882a593Smuzhiyun
119*4882a593Smuzhiyun static const struct ieee80211_ops mt76x0u_ops = {
120*4882a593Smuzhiyun .tx = mt76x02_tx,
121*4882a593Smuzhiyun .start = mt76x0u_start,
122*4882a593Smuzhiyun .stop = mt76x0u_stop,
123*4882a593Smuzhiyun .add_interface = mt76x02_add_interface,
124*4882a593Smuzhiyun .remove_interface = mt76x02_remove_interface,
125*4882a593Smuzhiyun .config = mt76x0_config,
126*4882a593Smuzhiyun .configure_filter = mt76x02_configure_filter,
127*4882a593Smuzhiyun .bss_info_changed = mt76x02_bss_info_changed,
128*4882a593Smuzhiyun .sta_state = mt76_sta_state,
129*4882a593Smuzhiyun .sta_pre_rcu_remove = mt76_sta_pre_rcu_remove,
130*4882a593Smuzhiyun .set_key = mt76x02_set_key,
131*4882a593Smuzhiyun .conf_tx = mt76x02_conf_tx,
132*4882a593Smuzhiyun .sw_scan_start = mt76_sw_scan,
133*4882a593Smuzhiyun .sw_scan_complete = mt76x02_sw_scan_complete,
134*4882a593Smuzhiyun .ampdu_action = mt76x02_ampdu_action,
135*4882a593Smuzhiyun .sta_rate_tbl_update = mt76x02_sta_rate_tbl_update,
136*4882a593Smuzhiyun .set_rts_threshold = mt76x02_set_rts_threshold,
137*4882a593Smuzhiyun .wake_tx_queue = mt76_wake_tx_queue,
138*4882a593Smuzhiyun .get_txpower = mt76_get_txpower,
139*4882a593Smuzhiyun .get_survey = mt76_get_survey,
140*4882a593Smuzhiyun .set_tim = mt76_set_tim,
141*4882a593Smuzhiyun .release_buffered_frames = mt76_release_buffered_frames,
142*4882a593Smuzhiyun .get_antenna = mt76_get_antenna,
143*4882a593Smuzhiyun };
144*4882a593Smuzhiyun
mt76x0u_init_hardware(struct mt76x02_dev * dev,bool reset)145*4882a593Smuzhiyun static int mt76x0u_init_hardware(struct mt76x02_dev *dev, bool reset)
146*4882a593Smuzhiyun {
147*4882a593Smuzhiyun int err;
148*4882a593Smuzhiyun
149*4882a593Smuzhiyun mt76x0_chip_onoff(dev, true, reset);
150*4882a593Smuzhiyun
151*4882a593Smuzhiyun if (!mt76x02_wait_for_mac(&dev->mt76))
152*4882a593Smuzhiyun return -ETIMEDOUT;
153*4882a593Smuzhiyun
154*4882a593Smuzhiyun err = mt76x0u_mcu_init(dev);
155*4882a593Smuzhiyun if (err < 0)
156*4882a593Smuzhiyun return err;
157*4882a593Smuzhiyun
158*4882a593Smuzhiyun mt76x0_init_usb_dma(dev);
159*4882a593Smuzhiyun err = mt76x0_init_hardware(dev);
160*4882a593Smuzhiyun if (err < 0)
161*4882a593Smuzhiyun return err;
162*4882a593Smuzhiyun
163*4882a593Smuzhiyun mt76x02u_init_beacon_config(dev);
164*4882a593Smuzhiyun
165*4882a593Smuzhiyun mt76_rmw(dev, MT_US_CYC_CFG, MT_US_CYC_CNT, 0x1e);
166*4882a593Smuzhiyun mt76_wr(dev, MT_TXOP_CTRL_CFG,
167*4882a593Smuzhiyun FIELD_PREP(MT_TXOP_TRUN_EN, 0x3f) |
168*4882a593Smuzhiyun FIELD_PREP(MT_TXOP_EXT_CCA_DLY, 0x58));
169*4882a593Smuzhiyun
170*4882a593Smuzhiyun return 0;
171*4882a593Smuzhiyun }
172*4882a593Smuzhiyun
mt76x0u_register_device(struct mt76x02_dev * dev)173*4882a593Smuzhiyun static int mt76x0u_register_device(struct mt76x02_dev *dev)
174*4882a593Smuzhiyun {
175*4882a593Smuzhiyun struct ieee80211_hw *hw = dev->mt76.hw;
176*4882a593Smuzhiyun struct mt76_usb *usb = &dev->mt76.usb;
177*4882a593Smuzhiyun int err;
178*4882a593Smuzhiyun
179*4882a593Smuzhiyun usb->mcu.data = devm_kmalloc(dev->mt76.dev, MCU_RESP_URB_SIZE,
180*4882a593Smuzhiyun GFP_KERNEL);
181*4882a593Smuzhiyun if (!usb->mcu.data)
182*4882a593Smuzhiyun return -ENOMEM;
183*4882a593Smuzhiyun
184*4882a593Smuzhiyun err = mt76u_alloc_queues(&dev->mt76);
185*4882a593Smuzhiyun if (err < 0)
186*4882a593Smuzhiyun goto out_err;
187*4882a593Smuzhiyun
188*4882a593Smuzhiyun err = mt76x0u_init_hardware(dev, true);
189*4882a593Smuzhiyun if (err < 0)
190*4882a593Smuzhiyun goto out_err;
191*4882a593Smuzhiyun
192*4882a593Smuzhiyun /* check hw sg support in order to enable AMSDU */
193*4882a593Smuzhiyun hw->max_tx_fragments = dev->mt76.usb.sg_en ? MT_TX_SG_MAX_SIZE : 1;
194*4882a593Smuzhiyun err = mt76x0_register_device(dev);
195*4882a593Smuzhiyun if (err < 0)
196*4882a593Smuzhiyun goto out_err;
197*4882a593Smuzhiyun
198*4882a593Smuzhiyun set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state);
199*4882a593Smuzhiyun
200*4882a593Smuzhiyun return 0;
201*4882a593Smuzhiyun
202*4882a593Smuzhiyun out_err:
203*4882a593Smuzhiyun mt76x0u_cleanup(dev);
204*4882a593Smuzhiyun return err;
205*4882a593Smuzhiyun }
206*4882a593Smuzhiyun
mt76x0u_probe(struct usb_interface * usb_intf,const struct usb_device_id * id)207*4882a593Smuzhiyun static int mt76x0u_probe(struct usb_interface *usb_intf,
208*4882a593Smuzhiyun const struct usb_device_id *id)
209*4882a593Smuzhiyun {
210*4882a593Smuzhiyun static const struct mt76_driver_ops drv_ops = {
211*4882a593Smuzhiyun .drv_flags = MT_DRV_SW_RX_AIRTIME,
212*4882a593Smuzhiyun .survey_flags = SURVEY_INFO_TIME_TX,
213*4882a593Smuzhiyun .update_survey = mt76x02_update_channel,
214*4882a593Smuzhiyun .tx_prepare_skb = mt76x02u_tx_prepare_skb,
215*4882a593Smuzhiyun .tx_complete_skb = mt76x02u_tx_complete_skb,
216*4882a593Smuzhiyun .tx_status_data = mt76x02_tx_status_data,
217*4882a593Smuzhiyun .rx_skb = mt76x02_queue_rx_skb,
218*4882a593Smuzhiyun .sta_ps = mt76x02_sta_ps,
219*4882a593Smuzhiyun .sta_add = mt76x02_sta_add,
220*4882a593Smuzhiyun .sta_remove = mt76x02_sta_remove,
221*4882a593Smuzhiyun };
222*4882a593Smuzhiyun struct usb_device *usb_dev = interface_to_usbdev(usb_intf);
223*4882a593Smuzhiyun struct mt76x02_dev *dev;
224*4882a593Smuzhiyun struct mt76_dev *mdev;
225*4882a593Smuzhiyun u32 mac_rev;
226*4882a593Smuzhiyun int ret;
227*4882a593Smuzhiyun
228*4882a593Smuzhiyun mdev = mt76_alloc_device(&usb_intf->dev, sizeof(*dev), &mt76x0u_ops,
229*4882a593Smuzhiyun &drv_ops);
230*4882a593Smuzhiyun if (!mdev)
231*4882a593Smuzhiyun return -ENOMEM;
232*4882a593Smuzhiyun
233*4882a593Smuzhiyun dev = container_of(mdev, struct mt76x02_dev, mt76);
234*4882a593Smuzhiyun mutex_init(&dev->phy_mutex);
235*4882a593Smuzhiyun
236*4882a593Smuzhiyun /* Quirk for Archer T1U */
237*4882a593Smuzhiyun if (id->driver_info)
238*4882a593Smuzhiyun dev->no_2ghz = true;
239*4882a593Smuzhiyun
240*4882a593Smuzhiyun usb_dev = usb_get_dev(usb_dev);
241*4882a593Smuzhiyun usb_reset_device(usb_dev);
242*4882a593Smuzhiyun
243*4882a593Smuzhiyun usb_set_intfdata(usb_intf, dev);
244*4882a593Smuzhiyun
245*4882a593Smuzhiyun mt76x02u_init_mcu(mdev);
246*4882a593Smuzhiyun ret = mt76u_init(mdev, usb_intf, false);
247*4882a593Smuzhiyun if (ret)
248*4882a593Smuzhiyun goto err;
249*4882a593Smuzhiyun
250*4882a593Smuzhiyun /* Disable the HW, otherwise MCU fail to initialize on hot reboot */
251*4882a593Smuzhiyun mt76x0_chip_onoff(dev, false, false);
252*4882a593Smuzhiyun
253*4882a593Smuzhiyun if (!mt76x02_wait_for_mac(mdev)) {
254*4882a593Smuzhiyun ret = -ETIMEDOUT;
255*4882a593Smuzhiyun goto err;
256*4882a593Smuzhiyun }
257*4882a593Smuzhiyun
258*4882a593Smuzhiyun mdev->rev = mt76_rr(dev, MT_ASIC_VERSION);
259*4882a593Smuzhiyun mac_rev = mt76_rr(dev, MT_MAC_CSR0);
260*4882a593Smuzhiyun dev_info(mdev->dev, "ASIC revision: %08x MAC revision: %08x\n",
261*4882a593Smuzhiyun mdev->rev, mac_rev);
262*4882a593Smuzhiyun if (!is_mt76x0(dev)) {
263*4882a593Smuzhiyun ret = -ENODEV;
264*4882a593Smuzhiyun goto err;
265*4882a593Smuzhiyun }
266*4882a593Smuzhiyun
267*4882a593Smuzhiyun /* Note: vendor driver skips this check for MT76X0U */
268*4882a593Smuzhiyun if (!(mt76_rr(dev, MT_EFUSE_CTRL) & MT_EFUSE_CTRL_SEL))
269*4882a593Smuzhiyun dev_warn(mdev->dev, "Warning: eFUSE not present\n");
270*4882a593Smuzhiyun
271*4882a593Smuzhiyun ret = mt76x0u_register_device(dev);
272*4882a593Smuzhiyun if (ret < 0)
273*4882a593Smuzhiyun goto err;
274*4882a593Smuzhiyun
275*4882a593Smuzhiyun return 0;
276*4882a593Smuzhiyun
277*4882a593Smuzhiyun err:
278*4882a593Smuzhiyun usb_set_intfdata(usb_intf, NULL);
279*4882a593Smuzhiyun usb_put_dev(interface_to_usbdev(usb_intf));
280*4882a593Smuzhiyun mt76_free_device(&dev->mt76);
281*4882a593Smuzhiyun
282*4882a593Smuzhiyun return ret;
283*4882a593Smuzhiyun }
284*4882a593Smuzhiyun
mt76x0_disconnect(struct usb_interface * usb_intf)285*4882a593Smuzhiyun static void mt76x0_disconnect(struct usb_interface *usb_intf)
286*4882a593Smuzhiyun {
287*4882a593Smuzhiyun struct mt76x02_dev *dev = usb_get_intfdata(usb_intf);
288*4882a593Smuzhiyun bool initialized = test_bit(MT76_STATE_INITIALIZED, &dev->mphy.state);
289*4882a593Smuzhiyun
290*4882a593Smuzhiyun if (!initialized)
291*4882a593Smuzhiyun return;
292*4882a593Smuzhiyun
293*4882a593Smuzhiyun ieee80211_unregister_hw(dev->mt76.hw);
294*4882a593Smuzhiyun mt76x0u_cleanup(dev);
295*4882a593Smuzhiyun
296*4882a593Smuzhiyun usb_set_intfdata(usb_intf, NULL);
297*4882a593Smuzhiyun usb_put_dev(interface_to_usbdev(usb_intf));
298*4882a593Smuzhiyun
299*4882a593Smuzhiyun mt76_free_device(&dev->mt76);
300*4882a593Smuzhiyun }
301*4882a593Smuzhiyun
mt76x0_suspend(struct usb_interface * usb_intf,pm_message_t state)302*4882a593Smuzhiyun static int __maybe_unused mt76x0_suspend(struct usb_interface *usb_intf,
303*4882a593Smuzhiyun pm_message_t state)
304*4882a593Smuzhiyun {
305*4882a593Smuzhiyun struct mt76x02_dev *dev = usb_get_intfdata(usb_intf);
306*4882a593Smuzhiyun
307*4882a593Smuzhiyun mt76u_stop_rx(&dev->mt76);
308*4882a593Smuzhiyun clear_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
309*4882a593Smuzhiyun mt76x0_chip_onoff(dev, false, false);
310*4882a593Smuzhiyun
311*4882a593Smuzhiyun return 0;
312*4882a593Smuzhiyun }
313*4882a593Smuzhiyun
mt76x0_resume(struct usb_interface * usb_intf)314*4882a593Smuzhiyun static int __maybe_unused mt76x0_resume(struct usb_interface *usb_intf)
315*4882a593Smuzhiyun {
316*4882a593Smuzhiyun struct mt76x02_dev *dev = usb_get_intfdata(usb_intf);
317*4882a593Smuzhiyun int ret;
318*4882a593Smuzhiyun
319*4882a593Smuzhiyun ret = mt76u_resume_rx(&dev->mt76);
320*4882a593Smuzhiyun if (ret < 0)
321*4882a593Smuzhiyun goto err;
322*4882a593Smuzhiyun
323*4882a593Smuzhiyun ret = mt76x0u_init_hardware(dev, false);
324*4882a593Smuzhiyun if (ret)
325*4882a593Smuzhiyun goto err;
326*4882a593Smuzhiyun
327*4882a593Smuzhiyun return 0;
328*4882a593Smuzhiyun err:
329*4882a593Smuzhiyun mt76x0u_cleanup(dev);
330*4882a593Smuzhiyun return ret;
331*4882a593Smuzhiyun }
332*4882a593Smuzhiyun
333*4882a593Smuzhiyun MODULE_DEVICE_TABLE(usb, mt76x0_device_table);
334*4882a593Smuzhiyun MODULE_FIRMWARE(MT7610E_FIRMWARE);
335*4882a593Smuzhiyun MODULE_FIRMWARE(MT7610U_FIRMWARE);
336*4882a593Smuzhiyun MODULE_LICENSE("GPL");
337*4882a593Smuzhiyun
338*4882a593Smuzhiyun static struct usb_driver mt76x0_driver = {
339*4882a593Smuzhiyun .name = KBUILD_MODNAME,
340*4882a593Smuzhiyun .id_table = mt76x0_device_table,
341*4882a593Smuzhiyun .probe = mt76x0u_probe,
342*4882a593Smuzhiyun .disconnect = mt76x0_disconnect,
343*4882a593Smuzhiyun .suspend = mt76x0_suspend,
344*4882a593Smuzhiyun .resume = mt76x0_resume,
345*4882a593Smuzhiyun .reset_resume = mt76x0_resume,
346*4882a593Smuzhiyun .soft_unbind = 1,
347*4882a593Smuzhiyun .disable_hub_initiated_lpm = 1,
348*4882a593Smuzhiyun };
349*4882a593Smuzhiyun module_usb_driver(mt76x0_driver);
350