Lines Matching refs:parent
303 struct gs_usb *parent;
397 static inline int gs_usb_get_timestamp(const struct gs_usb *parent,
403 rc = usb_control_msg_recv(parent->udev, 0, GS_USB_BREQ_TIMESTAMP,
419 struct gs_usb *parent = container_of(cc, struct gs_usb, cc);
423 lockdep_assert_held(&parent->tc_lock);
426 spin_unlock_bh(&parent->tc_lock);
427 err = gs_usb_get_timestamp(parent, ×tamp);
428 spin_lock_bh(&parent->tc_lock);
430 dev_err(&parent->udev->dev,
440 struct gs_usb *parent;
442 parent = container_of(delayed_work, struct gs_usb, timestamp);
443 spin_lock_bh(&parent->tc_lock);
444 timecounter_read(&parent->tc);
445 spin_unlock_bh(&parent->tc_lock);
447 schedule_delayed_work(&parent->timestamp,
455 struct gs_usb *parent = dev->parent;
458 spin_lock_bh(&parent->tc_lock);
459 ns = timecounter_cyc2time(&parent->tc, timestamp);
460 spin_unlock_bh(&parent->tc_lock);
465 static void gs_usb_timestamp_init(struct gs_usb *parent)
467 struct cyclecounter *cc = &parent->cc;
474 spin_lock_init(&parent->tc_lock);
475 spin_lock_bh(&parent->tc_lock);
476 timecounter_init(&parent->tc, &parent->cc, ktime_get_real_ns());
477 spin_unlock_bh(&parent->tc_lock);
479 INIT_DELAYED_WORK(&parent->timestamp, gs_usb_timestamp_work);
480 schedule_delayed_work(&parent->timestamp,
484 static void gs_usb_timestamp_stop(struct gs_usb *parent)
486 cancel_delayed_work_sync(&parent->timestamp);
571 struct gs_usb *parent = urb->context;
582 BUG_ON(!parent);
599 dev = parent->canch[hf->channel];
686 usb_fill_bulk_urb(urb, parent->udev,
687 usb_rcvbulkpipe(parent->udev, GS_USB_ENDPOINT_IN),
688 hf, dev->parent->hf_size_rx,
689 gs_usb_receive_bulk_callback, parent);
697 if (parent->canch[rc])
698 netif_device_detach(parent->canch[rc]->netdev);
871 struct gs_usb *parent = dev->parent;
900 if (!parent->active_channels) {
902 gs_usb_timestamp_init(parent);
915 buf = kmalloc(dev->parent->hf_size_rx,
928 dev->parent->hf_size_rx,
929 gs_usb_receive_bulk_callback, parent);
932 usb_anchor_urb(urb, &parent->rx_submitted);
990 parent->active_channels++;
1001 if (!parent->active_channels) {
1005 gs_usb_timestamp_stop(parent);
1053 struct gs_usb *parent = dev->parent;
1058 parent->active_channels--;
1059 if (!parent->active_channels) {
1060 usb_kill_anchored_urbs(&parent->rx_submitted);
1063 gs_usb_timestamp_stop(parent);
1414 struct gs_usb *parent;
1457 parent = kzalloc(sizeof(*parent), GFP_KERNEL);
1458 if (!parent)
1461 init_usb_anchor(&parent->rx_submitted);
1463 usb_set_intfdata(intf, parent);
1464 parent->udev = udev;
1469 parent->canch[i] = gs_make_candev(i, intf, &dconf);
1470 if (IS_ERR_OR_NULL(parent->canch[i])) {
1472 rc = PTR_ERR(parent->canch[i]);
1477 gs_destroy_candev(parent->canch[i]);
1479 usb_kill_anchored_urbs(&parent->rx_submitted);
1480 kfree(parent);
1483 parent->canch[i]->parent = parent;
1488 if (parent->canch[i]->can.ctrlmode_supported & CAN_CTRLMODE_FD) {
1489 if (parent->canch[i]->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
1494 if (parent->canch[i]->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
1499 parent->hf_size_rx = max(parent->hf_size_rx, hf_size_rx);
1507 struct gs_usb *parent = usb_get_intfdata(intf);
1512 if (!parent) {
1518 if (parent->canch[i])
1519 gs_destroy_candev(parent->canch[i]);
1521 kfree(parent);