Lines Matching refs:hf

518 				const struct gs_host_frame *hf)  in gs_usb_set_timestamp()  argument
522 if (hf->flags & GS_CAN_FLAG_FD) in gs_usb_set_timestamp()
523 timestamp = le32_to_cpu(hf->canfd_ts->timestamp_us); in gs_usb_set_timestamp()
525 timestamp = le32_to_cpu(hf->classic_can_ts->timestamp_us); in gs_usb_set_timestamp()
534 const struct gs_host_frame *hf) in gs_usb_rx_offload() argument
540 const u32 ts = gs_usb_set_timestamp(dev, skb, hf); in gs_usb_rx_offload()
553 const struct gs_host_frame *hf) in gs_usb_get_echo_skb() argument
556 const u32 echo_id = hf->echo_id; in gs_usb_get_echo_skb()
560 const u32 ts = gs_usb_set_timestamp(dev, skb, hf); in gs_usb_get_echo_skb()
579 struct gs_host_frame *hf = urb->transfer_buffer; in gs_usb_receive_bulk_callback() local
599 if (hf->channel >= GS_MAX_INTF) in gs_usb_receive_bulk_callback()
602 dev = parent->canch[hf->channel]; in gs_usb_receive_bulk_callback()
613 if (hf->echo_id == -1) { /* normal rx */ in gs_usb_receive_bulk_callback()
614 if (hf->flags & GS_CAN_FLAG_FD) { in gs_usb_receive_bulk_callback()
619 cfd->can_id = le32_to_cpu(hf->can_id); in gs_usb_receive_bulk_callback()
620 cfd->len = can_fd_dlc2len(hf->can_dlc); in gs_usb_receive_bulk_callback()
621 if (hf->flags & GS_CAN_FLAG_BRS) in gs_usb_receive_bulk_callback()
623 if (hf->flags & GS_CAN_FLAG_ESI) in gs_usb_receive_bulk_callback()
626 memcpy(cfd->data, hf->canfd->data, cfd->len); in gs_usb_receive_bulk_callback()
632 cf->can_id = le32_to_cpu(hf->can_id); in gs_usb_receive_bulk_callback()
633 can_frame_set_cc_len(cf, hf->can_dlc, dev->can.ctrlmode); in gs_usb_receive_bulk_callback()
635 memcpy(cf->data, hf->classic_can->data, 8); in gs_usb_receive_bulk_callback()
638 if (le32_to_cpu(hf->can_id) & CAN_ERR_FLAG) in gs_usb_receive_bulk_callback()
642 gs_usb_rx_offload(dev, skb, hf); in gs_usb_receive_bulk_callback()
644 if (hf->echo_id >= GS_MAX_TX_URBS) { in gs_usb_receive_bulk_callback()
647 hf->echo_id); in gs_usb_receive_bulk_callback()
651 txc = gs_get_tx_context(dev, hf->echo_id); in gs_usb_receive_bulk_callback()
657 hf->echo_id); in gs_usb_receive_bulk_callback()
661 skb = dev->can.echo_skb[hf->echo_id]; in gs_usb_receive_bulk_callback()
663 stats->tx_bytes += gs_usb_get_echo_skb(dev, skb, hf); in gs_usb_receive_bulk_callback()
671 if (hf->flags & GS_CAN_FLAG_OVERFLOW) { in gs_usb_receive_bulk_callback()
683 gs_usb_rx_offload(dev, skb, hf); in gs_usb_receive_bulk_callback()
691 hf, dev->parent->hf_size_rx, in gs_usb_receive_bulk_callback()
764 struct gs_host_frame *hf; in gs_can_start_xmit() local
784 hf = kmalloc(dev->hf_size_tx, GFP_ATOMIC); in gs_can_start_xmit()
785 if (!hf) in gs_can_start_xmit()
795 hf->echo_id = idx; in gs_can_start_xmit()
796 hf->channel = dev->channel; in gs_can_start_xmit()
797 hf->flags = 0; in gs_can_start_xmit()
798 hf->reserved = 0; in gs_can_start_xmit()
803 hf->can_id = cpu_to_le32(cfd->can_id); in gs_can_start_xmit()
804 hf->can_dlc = can_fd_len2dlc(cfd->len); in gs_can_start_xmit()
805 hf->flags |= GS_CAN_FLAG_FD; in gs_can_start_xmit()
807 hf->flags |= GS_CAN_FLAG_BRS; in gs_can_start_xmit()
809 hf->flags |= GS_CAN_FLAG_ESI; in gs_can_start_xmit()
811 memcpy(hf->canfd->data, cfd->data, cfd->len); in gs_can_start_xmit()
815 hf->can_id = cpu_to_le32(cf->can_id); in gs_can_start_xmit()
816 hf->can_dlc = can_get_cc_dlc(cf, dev->can.ctrlmode); in gs_can_start_xmit()
818 memcpy(hf->classic_can->data, cf->data, cf->len); in gs_can_start_xmit()
823 hf, dev->hf_size_tx, in gs_can_start_xmit()
860 kfree(hf); in gs_can_start_xmit()
878 struct gs_host_frame *hf; in gs_can_open() local
891 dev->hf_size_tx = struct_size(hf, canfd_quirk, 1); in gs_can_open()
893 dev->hf_size_tx = struct_size(hf, canfd, 1); in gs_can_open()
896 dev->hf_size_tx = struct_size(hf, classic_can_quirk, 1); in gs_can_open()
898 dev->hf_size_tx = struct_size(hf, classic_can, 1); in gs_can_open()
1416 struct gs_host_frame *hf; in gs_usb_probe() local
1493 hf_size_rx = struct_size(hf, canfd_ts, 1); in gs_usb_probe()
1495 hf_size_rx = struct_size(hf, canfd, 1); in gs_usb_probe()
1498 hf_size_rx = struct_size(hf, classic_can_ts, 1); in gs_usb_probe()
1500 hf_size_rx = struct_size(hf, classic_can, 1); in gs_usb_probe()