Lines Matching +full:armv4t +full:- +full:based

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * CDC Ethernet based networking peripherals
4 * Copyright (C) 2003-2005 by David Brownell
26 return (desc->bInterfaceClass == USB_CLASS_COMM && in is_rndis()
27 desc->bInterfaceSubClass == 2 && in is_rndis()
28 desc->bInterfaceProtocol == 0xff); in is_rndis()
33 return (desc->bInterfaceClass == USB_CLASS_MISC && in is_activesync()
34 desc->bInterfaceSubClass == 1 && in is_activesync()
35 desc->bInterfaceProtocol == 1); in is_activesync()
40 return (desc->bInterfaceClass == USB_CLASS_WIRELESS_CONTROLLER && in is_wireless_rndis()
41 desc->bInterfaceSubClass == 1 && in is_wireless_rndis()
42 desc->bInterfaceProtocol == 3); in is_wireless_rndis()
47 return (desc->bInterfaceClass == USB_CLASS_MISC && in is_novatel_rndis()
48 desc->bInterfaceSubClass == 4 && in is_novatel_rndis()
49 desc->bInterfaceProtocol == 1); in is_novatel_rndis()
68 struct net_device *net = dev->net; in usbnet_cdc_update_filter()
77 if (net->flags & IFF_PROMISC) in usbnet_cdc_update_filter()
79 if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI)) in usbnet_cdc_update_filter()
82 usb_control_msg(dev->udev, in usbnet_cdc_update_filter()
83 usb_sndctrlpipe(dev->udev, 0), in usbnet_cdc_update_filter()
87 dev->intf->cur_altsetting->desc.bInterfaceNumber, in usbnet_cdc_update_filter()
114 u8 *buf = intf->cur_altsetting->extra; in usbnet_generic_cdc_bind()
115 int len = intf->cur_altsetting->extralen; in usbnet_generic_cdc_bind()
117 struct cdc_state *info = (void *) &dev->data; in usbnet_generic_cdc_bind()
124 if (sizeof(dev->data) < sizeof(*info)) in usbnet_generic_cdc_bind()
125 return -EDOM; in usbnet_generic_cdc_bind()
130 if (len == 0 && dev->udev->actconfig->extralen) { in usbnet_generic_cdc_bind()
134 buf = dev->udev->actconfig->extra; in usbnet_generic_cdc_bind()
135 len = dev->udev->actconfig->extralen; in usbnet_generic_cdc_bind()
136 dev_dbg(&intf->dev, "CDC descriptors on config\n"); in usbnet_generic_cdc_bind()
140 * been seen on some 2Wire Inc RNDIS-ish products. in usbnet_generic_cdc_bind()
145 hep = intf->cur_altsetting->endpoint; in usbnet_generic_cdc_bind()
147 buf = hep->extra; in usbnet_generic_cdc_bind()
148 len = hep->extralen; in usbnet_generic_cdc_bind()
151 dev_dbg(&intf->dev, in usbnet_generic_cdc_bind()
155 /* this assumes that if there's a non-RNDIS vendor variant in usbnet_generic_cdc_bind()
156 * of cdc-acm, it'll fail RNDIS requests cleanly. in usbnet_generic_cdc_bind()
158 rndis = (is_rndis(&intf->cur_altsetting->desc) || in usbnet_generic_cdc_bind()
159 is_activesync(&intf->cur_altsetting->desc) || in usbnet_generic_cdc_bind()
160 is_wireless_rndis(&intf->cur_altsetting->desc) || in usbnet_generic_cdc_bind()
161 is_novatel_rndis(&intf->cur_altsetting->desc)); in usbnet_generic_cdc_bind()
164 info->control = intf; in usbnet_generic_cdc_bind()
168 info->u = header.usb_cdc_union_desc; in usbnet_generic_cdc_bind()
169 info->header = header.usb_cdc_header_desc; in usbnet_generic_cdc_bind()
170 info->ether = header.usb_cdc_ether_desc; in usbnet_generic_cdc_bind()
171 if (!info->u) { in usbnet_generic_cdc_bind()
181 info->control = usb_ifnum_to_if(dev->udev, info->u->bMasterInterface0); in usbnet_generic_cdc_bind()
182 info->data = usb_ifnum_to_if(dev->udev, info->u->bSlaveInterface0); in usbnet_generic_cdc_bind()
183 if (!info->control || !info->data) { in usbnet_generic_cdc_bind()
184 dev_dbg(&intf->dev, in usbnet_generic_cdc_bind()
186 info->u->bMasterInterface0, in usbnet_generic_cdc_bind()
187 info->control, in usbnet_generic_cdc_bind()
188 info->u->bSlaveInterface0, in usbnet_generic_cdc_bind()
189 info->data); in usbnet_generic_cdc_bind()
190 /* fall back to hard-wiring for RNDIS */ in usbnet_generic_cdc_bind()
197 if (info->control != intf) { in usbnet_generic_cdc_bind()
198 dev_dbg(&intf->dev, "bogus CDC Union\n"); in usbnet_generic_cdc_bind()
202 if (info->data == intf) { in usbnet_generic_cdc_bind()
203 info->data = info->control; in usbnet_generic_cdc_bind()
204 info->control = intf; in usbnet_generic_cdc_bind()
209 /* some devices merge these - skip class check */ in usbnet_generic_cdc_bind()
210 if (info->control == info->data) in usbnet_generic_cdc_bind()
214 d = &info->data->cur_altsetting->desc; in usbnet_generic_cdc_bind()
215 if (d->bInterfaceClass != USB_CLASS_CDC_DATA) { in usbnet_generic_cdc_bind()
216 dev_dbg(&intf->dev, "slave class %u\n", d->bInterfaceClass); in usbnet_generic_cdc_bind()
227 if (rndis && is_rndis(&intf->cur_altsetting->desc) && in usbnet_generic_cdc_bind()
229 header.usb_cdc_acm_descriptor->bmCapabilities) { in usbnet_generic_cdc_bind()
230 dev_dbg(&intf->dev, in usbnet_generic_cdc_bind()
232 header.usb_cdc_acm_descriptor->bmCapabilities); in usbnet_generic_cdc_bind()
236 if (header.usb_cdc_ether_desc && info->ether->wMaxSegmentSize) { in usbnet_generic_cdc_bind()
237 dev->hard_mtu = le16_to_cpu(info->ether->wMaxSegmentSize); in usbnet_generic_cdc_bind()
244 memcmp(header.usb_cdc_mdlm_desc->bGUID, mbm_guid, 16)) { in usbnet_generic_cdc_bind()
245 dev_dbg(&intf->dev, "GUID doesn't match\n"); in usbnet_generic_cdc_bind()
250 header.usb_cdc_mdlm_detail_desc->bLength < in usbnet_generic_cdc_bind()
252 dev_dbg(&intf->dev, "Descriptor too short\n"); in usbnet_generic_cdc_bind()
258 /* Microsoft ActiveSync based and some regular RNDIS devices lack the in usbnet_generic_cdc_bind()
259 * CDC descriptors, so we'll hard-wire the interfaces and not check in usbnet_generic_cdc_bind()
263 * to non-existing interfaces. Ignore that and attempt the same in usbnet_generic_cdc_bind()
264 * hard-wired 0 and 1 interfaces. in usbnet_generic_cdc_bind()
266 if (rndis && (!info->u || android_rndis_quirk)) { in usbnet_generic_cdc_bind()
267 info->control = usb_ifnum_to_if(dev->udev, 0); in usbnet_generic_cdc_bind()
268 info->data = usb_ifnum_to_if(dev->udev, 1); in usbnet_generic_cdc_bind()
269 if (!info->control || !info->data || info->control != intf) { in usbnet_generic_cdc_bind()
270 dev_dbg(&intf->dev, in usbnet_generic_cdc_bind()
272 info->control, in usbnet_generic_cdc_bind()
273 info->data); in usbnet_generic_cdc_bind()
277 } else if (!info->header || (!rndis && !info->ether)) { in usbnet_generic_cdc_bind()
278 dev_dbg(&intf->dev, "missing cdc %s%s%sdescriptor\n", in usbnet_generic_cdc_bind()
279 info->header ? "" : "header ", in usbnet_generic_cdc_bind()
280 info->u ? "" : "union ", in usbnet_generic_cdc_bind()
281 info->ether ? "" : "ether "); in usbnet_generic_cdc_bind()
288 if (info->data != info->control) { in usbnet_generic_cdc_bind()
289 status = usb_driver_claim_interface(driver, info->data, dev); in usbnet_generic_cdc_bind()
293 status = usbnet_get_endpoints(dev, info->data); in usbnet_generic_cdc_bind()
296 usb_set_intfdata(info->data, NULL); in usbnet_generic_cdc_bind()
297 if (info->data != info->control) in usbnet_generic_cdc_bind()
298 usb_driver_release_interface(driver, info->data); in usbnet_generic_cdc_bind()
303 if (info->data != info->control) in usbnet_generic_cdc_bind()
304 dev->status = NULL; in usbnet_generic_cdc_bind()
305 if (info->control->cur_altsetting->desc.bNumEndpoints == 1) { in usbnet_generic_cdc_bind()
308 dev->status = &info->control->cur_altsetting->endpoint[0]; in usbnet_generic_cdc_bind()
309 desc = &dev->status->desc; in usbnet_generic_cdc_bind()
311 (le16_to_cpu(desc->wMaxPacketSize) in usbnet_generic_cdc_bind()
313 !desc->bInterval) { in usbnet_generic_cdc_bind()
314 dev_dbg(&intf->dev, "bad notification endpoint\n"); in usbnet_generic_cdc_bind()
315 dev->status = NULL; in usbnet_generic_cdc_bind()
318 if (rndis && !dev->status) { in usbnet_generic_cdc_bind()
319 dev_dbg(&intf->dev, "missing RNDIS status endpoint\n"); in usbnet_generic_cdc_bind()
320 usb_set_intfdata(info->data, NULL); in usbnet_generic_cdc_bind()
321 usb_driver_release_interface(driver, info->data); in usbnet_generic_cdc_bind()
322 return -ENODEV; in usbnet_generic_cdc_bind()
326 dev->net->ethtool_ops = &cdc_ether_ethtool_ops; in usbnet_generic_cdc_bind()
331 dev_info(&dev->udev->dev, "bad CDC descriptors\n"); in usbnet_generic_cdc_bind()
332 return -ENODEV; in usbnet_generic_cdc_bind()
362 struct cdc_state *info = (void *) &dev->data; in usbnet_cdc_unbind()
365 /* combined interface - nothing to do */ in usbnet_cdc_unbind()
366 if (info->data == info->control) in usbnet_cdc_unbind()
369 /* disconnect master --> disconnect slave */ in usbnet_cdc_unbind()
370 if (intf == info->control && info->data) { in usbnet_cdc_unbind()
372 usb_set_intfdata(info->data, NULL); in usbnet_cdc_unbind()
373 usb_driver_release_interface(driver, info->data); in usbnet_cdc_unbind()
374 info->data = NULL; in usbnet_cdc_unbind()
378 else if (intf == info->data && info->control) { in usbnet_cdc_unbind()
380 usb_set_intfdata(info->control, NULL); in usbnet_cdc_unbind()
381 usb_driver_release_interface(driver, info->control); in usbnet_cdc_unbind()
382 info->control = NULL; in usbnet_cdc_unbind()
399 dev->tx_speed = __le32_to_cpu(speeds[0]); in speed_change()
400 dev->rx_speed = __le32_to_cpu(speeds[1]); in speed_change()
407 if (urb->actual_length < sizeof(*event)) in usbnet_cdc_status()
410 /* SPEED_CHANGE can get split into two 8-byte packets */ in usbnet_cdc_status()
411 if (test_and_clear_bit(EVENT_STS_SPLIT, &dev->flags)) { in usbnet_cdc_status()
412 speed_change(dev, (__le32 *) urb->transfer_buffer); in usbnet_cdc_status()
416 event = urb->transfer_buffer; in usbnet_cdc_status()
417 switch (event->bNotificationType) { in usbnet_cdc_status()
419 netif_dbg(dev, timer, dev->net, "CDC: carrier %s\n", in usbnet_cdc_status()
420 event->wValue ? "on" : "off"); in usbnet_cdc_status()
421 if (netif_carrier_ok(dev->net) != !!event->wValue) in usbnet_cdc_status()
422 usbnet_link_change(dev, !!event->wValue, 0); in usbnet_cdc_status()
425 netif_dbg(dev, timer, dev->net, "CDC: speed change (len %d)\n", in usbnet_cdc_status()
426 urb->actual_length); in usbnet_cdc_status()
427 if (urb->actual_length != (sizeof(*event) + 8)) in usbnet_cdc_status()
428 set_bit(EVENT_STS_SPLIT, &dev->flags); in usbnet_cdc_status()
436 netdev_err(dev->net, "CDC: unexpected notification %02x!\n", in usbnet_cdc_status()
437 event->bNotificationType); in usbnet_cdc_status()
446 struct cdc_state *info = (void *) &dev->data; in usbnet_cdc_bind()
448 BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) in usbnet_cdc_bind()
455 status = usbnet_get_ethernet_addr(dev, info->ether->iMACAddress); in usbnet_cdc_bind()
457 usb_set_intfdata(info->data, NULL); in usbnet_cdc_bind()
458 usb_driver_release_interface(driver_of(intf), info->data); in usbnet_cdc_bind()
470 if (!status && (dev->net->dev_addr[0] & 0x02)) in usbnet_cdc_zte_bind()
471 eth_hw_addr_random(dev->net); in usbnet_cdc_zte_bind()
485 if (skb->len < ETH_HLEN || !(skb->data[0] & 0x02)) in usbnet_cdc_zte_rx_fixup()
489 ether_addr_copy(eth_hdr(skb)->h_dest, dev->net->dev_addr); in usbnet_cdc_zte_rx_fixup()
505 if (urb->actual_length < sizeof(*event)) in usbnet_cdc_zte_status()
508 event = urb->transfer_buffer; in usbnet_cdc_zte_status()
510 if (event->bNotificationType != USB_CDC_NOTIFY_NETWORK_CONNECTION) { in usbnet_cdc_zte_status()
515 netif_dbg(dev, timer, dev->net, "CDC: carrier %s\n", in usbnet_cdc_zte_status()
516 event->wValue ? "on" : "off"); in usbnet_cdc_zte_status()
518 if (event->wValue && in usbnet_cdc_zte_status()
519 netif_carrier_ok(dev->net)) in usbnet_cdc_zte_status()
520 netif_carrier_off(dev->net); in usbnet_cdc_zte_status()
522 usbnet_link_change(dev, !!event->wValue, 0); in usbnet_cdc_zte_status()
556 /*-------------------------------------------------------------------------*/
593 /* SA-1100 based Sharp Zaurus ("collie"), or compatible;
594 * wire-incompatible with true CDC Ethernet implementations.
606 /* PXA-25x based Sharp Zaurii. Note that it seems some of these
615 .idProduct = 0x8005, /* A-300 */
622 .idProduct = 0x8005, /* A-300 */
629 .idProduct = 0x8006, /* B-500/SL-5600 */
636 .idProduct = 0x8006, /* B-500/SL-5600 */
643 .idProduct = 0x8007, /* C-700 */
650 .idProduct = 0x8007, /* C-700 */
657 .idProduct = 0x9031, /* C-750 C-760 */
664 .idProduct = 0x9032, /* SL-6000 */
671 .idProduct = 0x9032, /* SL-6000 */
679 .idProduct = 0x9050, /* C-860 */
684 /* Olympus has some models with a Zaurus-compatible option.
685 * R-1000 uses a FreeScale i.MXL cpu (ARMv4T)
691 .idProduct = 0x0F02, /* R-1000 */
703 /* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */
710 /* Novatel USB551L and MC551 - handled by qmi_wwan */
717 /* Novatel E362 - handled by qmi_wwan */
724 /* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */
731 /* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */
738 /* Dell Wireless 5804 (Novatel E371) - handled by qmi_wwan */
745 /* Novatel Expedite E371 - handled by qmi_wwan */
752 /* HP lt2523 (Novatel E371) - handled by qmi_wwan */
759 /* AnyDATA ADU960S - handled by qmi_wwan */
766 /* Huawei E1820 - handled by qmi_wwan */
772 /* Realtek RTL8153 Based USB 3.0 Ethernet Adapters */
779 /* Lenovo Powered USB-C Travel Hub (4X90S92381, based on Realtek RTL8153) */
786 /* Aquantia AQtion USB to 5GbE Controller (based on AQC111U) */
794 /* ASIX USB 3.1 Gen1 to 5G Multi-Gigabit Ethernet Adapter(based on AQC111U) */
802 /* ASIX USB 3.1 Gen1 to 2.5G Multi-Gigabit Ethernet Adapter(based on AQC112U) */
810 /* USB-C 3.1 to 5GBASE-T Ethernet Adapter (based on AQC111U) */
818 /* QNAP QNA-UC5G1T USB to 5GbE Adapter (based on AQC111U) */
837 /* ZTE (Vodafone) K3805-Z */
843 /* ZTE (Vodafone) K3806-Z */
849 /* ZTE (Vodafone) K4510-Z */
855 /* ZTE (Vodafone) K3770-Z */
861 /* ZTE (Vodafone) K3772-Z */
889 /* U-blox TOBY-L2 */
895 /* U-blox SARA-U2 */
901 /* U-blox LARA-R6 01B */
907 /* U-blox LARA-L6 */
925 /* Cinterion PLS62-W modem by GEMALTO/THALES */