Lines Matching refs:hf
506 const struct gs_host_frame *hf) in gs_usb_set_timestamp() argument
513 if (hf->flags & GS_CAN_FLAG_FD) in gs_usb_set_timestamp()
514 timestamp = le32_to_cpu(hf->canfd_ts->timestamp_us); in gs_usb_set_timestamp()
516 timestamp = le32_to_cpu(hf->classic_can_ts->timestamp_us); in gs_usb_set_timestamp()
530 struct gs_host_frame *hf = urb->transfer_buffer; in gs_usb_receive_bulk_callback() local
550 if (hf->channel >= GS_MAX_INTF) in gs_usb_receive_bulk_callback()
553 dev = usbcan->canch[hf->channel]; in gs_usb_receive_bulk_callback()
561 if (hf->echo_id == -1) { /* normal rx */ in gs_usb_receive_bulk_callback()
562 if (hf->flags & GS_CAN_FLAG_FD) { in gs_usb_receive_bulk_callback()
567 cfd->can_id = le32_to_cpu(hf->can_id); in gs_usb_receive_bulk_callback()
568 cfd->len = can_fd_dlc2len(hf->can_dlc); in gs_usb_receive_bulk_callback()
569 if (hf->flags & GS_CAN_FLAG_BRS) in gs_usb_receive_bulk_callback()
571 if (hf->flags & GS_CAN_FLAG_ESI) in gs_usb_receive_bulk_callback()
574 memcpy(cfd->data, hf->canfd->data, cfd->len); in gs_usb_receive_bulk_callback()
580 cf->can_id = le32_to_cpu(hf->can_id); in gs_usb_receive_bulk_callback()
581 can_frame_set_cc_len(cf, hf->can_dlc, dev->can.ctrlmode); in gs_usb_receive_bulk_callback()
583 memcpy(cf->data, hf->classic_can->data, 8); in gs_usb_receive_bulk_callback()
586 if (le32_to_cpu(hf->can_id) & CAN_ERR_FLAG) in gs_usb_receive_bulk_callback()
590 gs_usb_set_timestamp(dev, skb, hf); in gs_usb_receive_bulk_callback()
593 netdev->stats.rx_bytes += hf->can_dlc; in gs_usb_receive_bulk_callback()
597 if (hf->echo_id >= GS_MAX_TX_URBS) { in gs_usb_receive_bulk_callback()
600 hf->echo_id); in gs_usb_receive_bulk_callback()
604 txc = gs_get_tx_context(dev, hf->echo_id); in gs_usb_receive_bulk_callback()
610 hf->echo_id); in gs_usb_receive_bulk_callback()
614 skb = dev->can.echo_skb[hf->echo_id]; in gs_usb_receive_bulk_callback()
615 gs_usb_set_timestamp(dev, skb, hf); in gs_usb_receive_bulk_callback()
618 netdev->stats.tx_bytes += can_get_echo_skb(netdev, hf->echo_id, in gs_usb_receive_bulk_callback()
628 if (hf->flags & GS_CAN_FLAG_OVERFLOW) { in gs_usb_receive_bulk_callback()
644 hf, dev->parent->hf_size_rx, in gs_usb_receive_bulk_callback()
719 struct gs_host_frame *hf; in gs_can_start_xmit() local
739 hf = kmalloc(dev->hf_size_tx, GFP_ATOMIC); in gs_can_start_xmit()
740 if (!hf) { in gs_can_start_xmit()
752 hf->echo_id = idx; in gs_can_start_xmit()
753 hf->channel = dev->channel; in gs_can_start_xmit()
754 hf->flags = 0; in gs_can_start_xmit()
755 hf->reserved = 0; in gs_can_start_xmit()
760 hf->can_id = cpu_to_le32(cfd->can_id); in gs_can_start_xmit()
761 hf->can_dlc = can_fd_len2dlc(cfd->len); in gs_can_start_xmit()
762 hf->flags |= GS_CAN_FLAG_FD; in gs_can_start_xmit()
764 hf->flags |= GS_CAN_FLAG_BRS; in gs_can_start_xmit()
766 hf->flags |= GS_CAN_FLAG_ESI; in gs_can_start_xmit()
768 memcpy(hf->canfd->data, cfd->data, cfd->len); in gs_can_start_xmit()
772 hf->can_id = cpu_to_le32(cf->can_id); in gs_can_start_xmit()
773 hf->can_dlc = can_get_cc_dlc(cf, dev->can.ctrlmode); in gs_can_start_xmit()
775 memcpy(hf->classic_can->data, cf->data, cf->len); in gs_can_start_xmit()
780 hf, dev->hf_size_tx, in gs_can_start_xmit()
817 kfree(hf); in gs_can_start_xmit()
835 struct gs_host_frame *hf; in gs_can_open() local
849 dev->hf_size_tx = struct_size(hf, canfd_quirk, 1); in gs_can_open()
851 dev->hf_size_tx = struct_size(hf, canfd, 1); in gs_can_open()
854 dev->hf_size_tx = struct_size(hf, classic_can_quirk, 1); in gs_can_open()
856 dev->hf_size_tx = struct_size(hf, classic_can, 1); in gs_can_open()
1314 struct gs_host_frame *hf; in gs_usb_probe() local
1391 hf_size_rx = struct_size(hf, canfd_ts, 1); in gs_usb_probe()
1393 hf_size_rx = struct_size(hf, canfd, 1); in gs_usb_probe()
1396 hf_size_rx = struct_size(hf, classic_can_ts, 1); in gs_usb_probe()
1398 hf_size_rx = struct_size(hf, classic_can, 1); in gs_usb_probe()