32 #include <linux/module.h>
48 static void r871xu_dev_remove(
struct usb_interface *pusb_intf);
54 {USB_DEVICE(0x0BDA, 0x8171)},
55 {USB_DEVICE(0x0bda, 0x8173)},
56 {USB_DEVICE(0x0bda, 0x8712)},
57 {USB_DEVICE(0x0bda, 0x8713)},
58 {USB_DEVICE(0x0bda, 0xC512)},
60 {USB_DEVICE(0x07B8, 0x8188)},
62 {USB_DEVICE(0x0B05, 0x1786)},
63 {USB_DEVICE(0x0B05, 0x1791)},
65 {USB_DEVICE(0x050D, 0x945A)},
67 {USB_DEVICE(0x07AA, 0x0047)},
69 {USB_DEVICE(0x2001, 0x3306)},
70 {USB_DEVICE(0x07D1, 0x3306)},
72 {USB_DEVICE(0x7392, 0x7611)},
74 {USB_DEVICE(0x1740, 0x9603)},
76 {USB_DEVICE(0x0E66, 0x0016)},
78 {USB_DEVICE(0x06F8, 0xE034)},
79 {USB_DEVICE(0x06F8, 0xE032)},
81 {USB_DEVICE(0x0789, 0x0167)},
83 {USB_DEVICE(0x2019, 0xAB28)},
84 {USB_DEVICE(0x2019, 0xED16)},
86 {USB_DEVICE(0x0DF6, 0x0057)},
87 {USB_DEVICE(0x0DF6, 0x0045)},
88 {USB_DEVICE(0x0DF6, 0x0059)},
89 {USB_DEVICE(0x0DF6, 0x004B)},
90 {USB_DEVICE(0x0DF6, 0x005B)},
91 {USB_DEVICE(0x0DF6, 0x005D)},
92 {USB_DEVICE(0x0DF6, 0x0063)},
94 {USB_DEVICE(0x177F, 0x0154)},
96 {USB_DEVICE(0x0BDA, 0x5077)},
98 {USB_DEVICE(0x1690, 0x0752)},
100 {USB_DEVICE(0x20F4, 0x646B)},
101 {USB_DEVICE(0x083A, 0xC512)},
102 {USB_DEVICE(0x25D4, 0x4CA1)},
103 {USB_DEVICE(0x25D4, 0x4CAB)},
107 {USB_DEVICE(0x0BDA, 0x8172)},
108 {USB_DEVICE(0x0BDA, 0x8192)},
110 {USB_DEVICE(0x0EB0, 0x9061)},
112 {USB_DEVICE(0x13D3, 0x3323)},
113 {USB_DEVICE(0x13D3, 0x3311)},
114 {USB_DEVICE(0x13D3, 0x3342)},
116 {USB_DEVICE(0x13D3, 0x3333)},
117 {USB_DEVICE(0x13D3, 0x3334)},
118 {USB_DEVICE(0x13D3, 0x3335)},
119 {USB_DEVICE(0x13D3, 0x3336)},
121 {USB_DEVICE(0x13D3, 0x3309)},
123 {USB_DEVICE(0x050D, 0x815F)},
125 {USB_DEVICE(0x07D1, 0x3302)},
126 {USB_DEVICE(0x07D1, 0x3300)},
127 {USB_DEVICE(0x07D1, 0x3303)},
129 {USB_DEVICE(0x7392, 0x7612)},
131 {USB_DEVICE(0x1740, 0x9605)},
133 {USB_DEVICE(0x06F8, 0xE031)},
135 {USB_DEVICE(0x0E66, 0x0015)},
137 {USB_DEVICE(0x13D3, 0x3306)},
139 {USB_DEVICE(0x2019, 0xED18)},
140 {USB_DEVICE(0x2019, 0x4901)},
142 {USB_DEVICE(0x0DF6, 0x0058)},
143 {USB_DEVICE(0x0DF6, 0x0049)},
144 {USB_DEVICE(0x0DF6, 0x004C)},
145 {USB_DEVICE(0x0DF6, 0x0064)},
147 {USB_DEVICE(0x14b2, 0x3300)},
148 {USB_DEVICE(0x14b2, 0x3301)},
149 {USB_DEVICE(0x14B2, 0x3302)},
151 {USB_DEVICE(0x04F2, 0xAFF2)},
152 {USB_DEVICE(0x04F2, 0xAFF5)},
153 {USB_DEVICE(0x04F2, 0xAFF6)},
154 {USB_DEVICE(0x13D3, 0x3339)},
155 {USB_DEVICE(0x13D3, 0x3340)},
156 {USB_DEVICE(0x13D3, 0x3341)},
157 {USB_DEVICE(0x13D3, 0x3310)},
158 {USB_DEVICE(0x13D3, 0x3325)},
162 {USB_DEVICE(0x0BDA, 0x8174)},
164 {USB_DEVICE(0x050D, 0x845A)},
166 {USB_DEVICE(0x07AA, 0x0051)},
168 {USB_DEVICE(0x7392, 0x7622)},
170 {USB_DEVICE(0x0409, 0x02B6)},
177 {.idVendor = 0x0b05, .idProduct = 0x1791,
179 {.idVendor = 0x0df6, .idProduct = 0x0059,
181 {.idVendor = 0x13d3, .idProduct = 0x3306,
183 {.idVendor = 0x13D3, .idProduct = 0x3311,
185 {.idVendor = 0x13d3, .idProduct = 0x3335,
187 {.idVendor = 0x13d3, .idProduct = 0x3336,
189 {.idVendor = 0x13d3, .idProduct = 0x3340,
191 {.idVendor = 0x13d3, .idProduct = 0x3341,
204 struct net_device *pnetdev = usb_get_intfdata(pusb_intf);
207 if (!pnetdev || !netif_running(pnetdev)) {
220 struct net_device *pnetdev = usb_get_intfdata(pusb_intf);
223 if (!pnetdev || !netif_running(pnetdev)) {
233 static int r871x_reset_resume(
struct usb_interface *pusb_intf)
242 .r871xu_drv.name =
"r8712u",
243 .r871xu_drv.id_table = rtl871x_usb_id_tbl,
244 .r871xu_drv.probe = r871xu_drv_init,
245 .r871xu_drv.disconnect = r871xu_dev_remove,
247 .r871xu_drv.suspend = r871x_suspend,
248 .r871xu_drv.resume = r871x_resume,
249 .r871xu_drv.reset_resume = r871x_reset_resume,
253 static uint r8712_usb_dvobj_init(
struct _adapter *padapter)
257 struct usb_host_config *phost_conf;
259 struct usb_host_interface *phost_iface;
262 struct usb_device *pusbd = pdvobjpriv->
pusbdev;
266 pdev_desc = &pusbd->descriptor;
267 phost_conf = pusbd->actconfig;
268 pconf_desc = &phost_conf->desc;
269 phost_iface = &pintf->altsetting[0];
270 piface_desc = &phost_iface->desc;
286 static void r8712_usb_dvobj_deinit(
struct _adapter *padapter)
300 padapter->
dvobjpriv.inirp_deinit(padapter);
308 if (padapter->
bup ==
true) {
327 padapter->
bup =
false;
331 static void disable_ht_for_spec_devid(
const struct usb_device_id *pdid,
337 int num =
sizeof(specific_device_id_tbl) /
340 for (i = 0; i < num; i++) {
341 vid = specific_device_id_tbl[
i].
idVendor;
343 flags = specific_device_id_tbl[
i].
flags;
354 static u8 key_2char2num(
u8 hch,
u8 lch)
372 struct usb_device *
udev;
379 udev = interface_to_usbdev(pusb_intf);
386 padapter = netdev_priv(pnetdev);
387 disable_ht_for_spec_devid(pdid, padapter);
392 usb_set_intfdata(pusb_intf, pnetdev);
418 u8 tmpU1b, AutoloadFail, eeprom_CustomerID;
425 (tmpU1b &
_9356SEL) ?
"EEPROM" :
"EFUSE",
438 (tmpU1b & (~
BIT(7))));
462 for (i = 0, offset = 0; i < 128; i += 8, offset++)
479 memcpy(mac, &pdata[0x12], ETH_ALEN);
481 eeprom_CustomerID = pdata[0x52];
482 switch (eeprom_CustomerID) {
542 padapter->
ledpriv.bRegUseLed =
true;
546 padapter->
ledpriv.bRegUseLed =
true;
551 padapter->
ledpriv.bRegUseLed =
true;
555 padapter->
ledpriv.bRegUseLed =
true;
559 padapter->
ledpriv.bRegUseLed =
true;
563 padapter->
ledpriv.bRegUseLed =
true;
567 padapter->
ledpriv.bRegUseLed =
false;
571 AutoloadFail =
false;
572 if (((mac[0] == 0xff) && (mac[1] == 0xff) &&
573 (mac[2] == 0xff) && (mac[3] == 0xff) &&
574 (mac[4] == 0xff) && (mac[5] == 0xff)) ||
575 ((mac[0] == 0x00) && (mac[1] == 0x00) &&
576 (mac[2] == 0x00) && (mac[3] == 0x00) &&
577 (mac[4] == 0x00) && (mac[5] == 0x00)) ||
578 (AutoloadFail ==
false)) {
606 usb_set_intfdata(pusb_intf,
NULL);
616 static void r871xu_dev_remove(
struct usb_interface *pusb_intf)
618 struct net_device *pnetdev = usb_get_intfdata(pusb_intf);
619 struct _adapter *padapter = netdev_priv(pnetdev);
620 struct usb_device *udev = interface_to_usbdev(pusb_intf);
622 usb_set_intfdata(pusb_intf,
NULL);
629 if (pnetdev !=
NULL) {
640 usb_set_intfdata(pusb_intf,
NULL);
652 static int __init r8712u_drv_entry(
void)
658 static void __exit r8712u_drv_halt(
void)