ucan.c (c95baf12f5077419db01313ab61c2aac007d40cd) ucan.c (88bfb9a713563550b1febb1a89b3a192efe2d091)
1// SPDX-License-Identifier: GPL-2.0
2
3/* Driver for Theobroma Systems UCAN devices, Protocol Version 3
4 *
5 * Copyright (C) 2018 Theobroma Systems Design und Consulting GmbH
6 *
7 *
8 * General Description:

--- 1431 unchanged lines hidden (view full) ---

1440 dev_err(&udev->dev,
1441 "%s: device protocol version %d is not supported\n",
1442 UCAN_DRIVER_NAME, protocol_version);
1443 goto err_firmware_needs_update;
1444 }
1445
1446 /* request the device information and store it in ctl_msg_buffer
1447 *
1// SPDX-License-Identifier: GPL-2.0
2
3/* Driver for Theobroma Systems UCAN devices, Protocol Version 3
4 *
5 * Copyright (C) 2018 Theobroma Systems Design und Consulting GmbH
6 *
7 *
8 * General Description:

--- 1431 unchanged lines hidden (view full) ---

1440 dev_err(&udev->dev,
1441 "%s: device protocol version %d is not supported\n",
1442 UCAN_DRIVER_NAME, protocol_version);
1443 goto err_firmware_needs_update;
1444 }
1445
1446 /* request the device information and store it in ctl_msg_buffer
1447 *
1448 * note: ucan_ctrl_command_* wrappers connot be used yet
1448 * note: ucan_ctrl_command_* wrappers cannot be used yet
1449 * because `up` is initialised in Stage 3
1450 */
1451 ret = usb_control_msg(udev,
1452 usb_rcvctrlpipe(udev, 0),
1453 UCAN_COMMAND_GET,
1454 USB_DIR_IN | USB_TYPE_VENDOR |
1455 USB_RECIP_INTERFACE,
1456 UCAN_COMMAND_GET_INFO,

--- 32 unchanged lines hidden (view full) ---

1489 if (!netdev) {
1490 dev_err(&udev->dev,
1491 "%s: cannot allocate candev\n", UCAN_DRIVER_NAME);
1492 return -ENOMEM;
1493 }
1494
1495 up = netdev_priv(netdev);
1496
1449 * because `up` is initialised in Stage 3
1450 */
1451 ret = usb_control_msg(udev,
1452 usb_rcvctrlpipe(udev, 0),
1453 UCAN_COMMAND_GET,
1454 USB_DIR_IN | USB_TYPE_VENDOR |
1455 USB_RECIP_INTERFACE,
1456 UCAN_COMMAND_GET_INFO,

--- 32 unchanged lines hidden (view full) ---

1489 if (!netdev) {
1490 dev_err(&udev->dev,
1491 "%s: cannot allocate candev\n", UCAN_DRIVER_NAME);
1492 return -ENOMEM;
1493 }
1494
1495 up = netdev_priv(netdev);
1496
1497 /* initialze data */
1497 /* initialize data */
1498 up->udev = udev;
1499 up->intf = intf;
1500 up->netdev = netdev;
1501 up->intf_index = iface_desc->desc.bInterfaceNumber;
1502 up->in_ep_addr = in_ep_addr;
1503 up->out_ep_addr = out_ep_addr;
1504 up->in_ep_size = in_ep_size;
1505 up->ctl_msg_buffer = ctl_msg_buffer;

--- 101 unchanged lines hidden ---
1498 up->udev = udev;
1499 up->intf = intf;
1500 up->netdev = netdev;
1501 up->intf_index = iface_desc->desc.bInterfaceNumber;
1502 up->in_ep_addr = in_ep_addr;
1503 up->out_ep_addr = out_ep_addr;
1504 up->in_ep_size = in_ep_size;
1505 up->ctl_msg_buffer = ctl_msg_buffer;

--- 101 unchanged lines hidden ---