Lines Matching refs:hf

515 				const struct gs_host_frame *hf)  in gs_usb_set_timestamp()  argument
519 if (hf->flags & GS_CAN_FLAG_FD) in gs_usb_set_timestamp()
520 timestamp = le32_to_cpu(hf->canfd_ts->timestamp_us); in gs_usb_set_timestamp()
522 timestamp = le32_to_cpu(hf->classic_can_ts->timestamp_us); in gs_usb_set_timestamp()
531 const struct gs_host_frame *hf) in gs_usb_rx_offload() argument
537 const u32 ts = gs_usb_set_timestamp(dev, skb, hf); in gs_usb_rx_offload()
550 const struct gs_host_frame *hf) in gs_usb_get_echo_skb() argument
553 const u32 echo_id = hf->echo_id; in gs_usb_get_echo_skb()
557 const u32 ts = gs_usb_set_timestamp(dev, skb, hf); in gs_usb_get_echo_skb()
576 struct gs_host_frame *hf = urb->transfer_buffer; in gs_usb_receive_bulk_callback() local
596 if (hf->channel >= GS_MAX_INTF) in gs_usb_receive_bulk_callback()
599 dev = parent->canch[hf->channel]; in gs_usb_receive_bulk_callback()
610 if (hf->echo_id == -1) { /* normal rx */ in gs_usb_receive_bulk_callback()
611 if (hf->flags & GS_CAN_FLAG_FD) { in gs_usb_receive_bulk_callback()
616 cfd->can_id = le32_to_cpu(hf->can_id); in gs_usb_receive_bulk_callback()
617 cfd->len = can_fd_dlc2len(hf->can_dlc); in gs_usb_receive_bulk_callback()
618 if (hf->flags & GS_CAN_FLAG_BRS) in gs_usb_receive_bulk_callback()
620 if (hf->flags & GS_CAN_FLAG_ESI) in gs_usb_receive_bulk_callback()
623 memcpy(cfd->data, hf->canfd->data, cfd->len); in gs_usb_receive_bulk_callback()
629 cf->can_id = le32_to_cpu(hf->can_id); in gs_usb_receive_bulk_callback()
630 can_frame_set_cc_len(cf, hf->can_dlc, dev->can.ctrlmode); in gs_usb_receive_bulk_callback()
632 memcpy(cf->data, hf->classic_can->data, 8); in gs_usb_receive_bulk_callback()
635 if (le32_to_cpu(hf->can_id) & CAN_ERR_FLAG) in gs_usb_receive_bulk_callback()
639 gs_usb_rx_offload(dev, skb, hf); in gs_usb_receive_bulk_callback()
641 if (hf->echo_id >= GS_MAX_TX_URBS) { in gs_usb_receive_bulk_callback()
644 hf->echo_id); in gs_usb_receive_bulk_callback()
648 txc = gs_get_tx_context(dev, hf->echo_id); in gs_usb_receive_bulk_callback()
654 hf->echo_id); in gs_usb_receive_bulk_callback()
658 skb = dev->can.echo_skb[hf->echo_id]; in gs_usb_receive_bulk_callback()
660 stats->tx_bytes += gs_usb_get_echo_skb(dev, skb, hf); in gs_usb_receive_bulk_callback()
668 if (hf->flags & GS_CAN_FLAG_OVERFLOW) { in gs_usb_receive_bulk_callback()
680 gs_usb_rx_offload(dev, skb, hf); in gs_usb_receive_bulk_callback()
688 hf, dev->parent->hf_size_rx, in gs_usb_receive_bulk_callback()
761 struct gs_host_frame *hf; in gs_can_start_xmit() local
781 hf = kmalloc(dev->hf_size_tx, GFP_ATOMIC); in gs_can_start_xmit()
782 if (!hf) in gs_can_start_xmit()
792 hf->echo_id = idx; in gs_can_start_xmit()
793 hf->channel = dev->channel; in gs_can_start_xmit()
794 hf->flags = 0; in gs_can_start_xmit()
795 hf->reserved = 0; in gs_can_start_xmit()
800 hf->can_id = cpu_to_le32(cfd->can_id); in gs_can_start_xmit()
801 hf->can_dlc = can_fd_len2dlc(cfd->len); in gs_can_start_xmit()
802 hf->flags |= GS_CAN_FLAG_FD; in gs_can_start_xmit()
804 hf->flags |= GS_CAN_FLAG_BRS; in gs_can_start_xmit()
806 hf->flags |= GS_CAN_FLAG_ESI; in gs_can_start_xmit()
808 memcpy(hf->canfd->data, cfd->data, cfd->len); in gs_can_start_xmit()
812 hf->can_id = cpu_to_le32(cf->can_id); in gs_can_start_xmit()
813 hf->can_dlc = can_get_cc_dlc(cf, dev->can.ctrlmode); in gs_can_start_xmit()
815 memcpy(hf->classic_can->data, cf->data, cf->len); in gs_can_start_xmit()
820 hf, dev->hf_size_tx, in gs_can_start_xmit()
857 kfree(hf); in gs_can_start_xmit()
875 struct gs_host_frame *hf; in gs_can_open() local
888 dev->hf_size_tx = struct_size(hf, canfd_quirk, 1); in gs_can_open()
890 dev->hf_size_tx = struct_size(hf, canfd, 1); in gs_can_open()
893 dev->hf_size_tx = struct_size(hf, classic_can_quirk, 1); in gs_can_open()
895 dev->hf_size_tx = struct_size(hf, classic_can, 1); in gs_can_open()
1413 struct gs_host_frame *hf; in gs_usb_probe() local
1490 hf_size_rx = struct_size(hf, canfd_ts, 1); in gs_usb_probe()
1492 hf_size_rx = struct_size(hf, canfd, 1); in gs_usb_probe()
1495 hf_size_rx = struct_size(hf, classic_can_ts, 1); in gs_usb_probe()
1497 hf_size_rx = struct_size(hf, classic_can, 1); in gs_usb_probe()