Lines Matching refs:fifo

209 static void collect_rx_frame(usb_fifo *fifo, __u8 *data, int len,
452 start_isoc_chain(usb_fifo *fifo, int num_packets_per_urb, in start_isoc_chain() argument
458 fifo->fifonum); in start_isoc_chain()
462 if (!(fifo->iso[i].purb)) { in start_isoc_chain()
463 fifo->iso[i].purb = in start_isoc_chain()
465 if (!(fifo->iso[i].purb)) { in start_isoc_chain()
468 fifo->fifonum); in start_isoc_chain()
470 fifo->iso[i].owner_fifo = (struct usb_fifo *) fifo; in start_isoc_chain()
474 (fifo->usb_packet_maxlen * in start_isoc_chain()
476 fill_isoc_urb(fifo->iso[i].purb, in start_isoc_chain()
477 fifo->hfc->dev, fifo->pipe, in start_isoc_chain()
478 fifo->iso[i].buffer, in start_isoc_chain()
480 fifo->usb_packet_maxlen, in start_isoc_chain()
481 fifo->intervall, complete, in start_isoc_chain()
482 &fifo->iso[i]); in start_isoc_chain()
483 memset(fifo->iso[i].buffer, 0, in start_isoc_chain()
484 sizeof(fifo->iso[i].buffer)); in start_isoc_chain()
487 fifo->iso[i].purb-> in start_isoc_chain()
490 fifo->iso[i].purb-> in start_isoc_chain()
499 fifo->bit_line = BITLINE_INF; in start_isoc_chain()
501 errcode = usb_submit_urb(fifo->iso[i].purb, GFP_KERNEL); in start_isoc_chain()
502 fifo->active = (errcode >= 0) ? 1 : 0; in start_isoc_chain()
507 return (fifo->active); in start_isoc_chain()
512 stop_isoc_chain(usb_fifo *fifo) in stop_isoc_chain() argument
517 if (fifo->iso[i].purb) { in stop_isoc_chain()
520 fifo->fifonum, i); in stop_isoc_chain()
521 usb_kill_urb(fifo->iso[i].purb); in stop_isoc_chain()
522 usb_free_urb(fifo->iso[i].purb); in stop_isoc_chain()
523 fifo->iso[i].purb = NULL; in stop_isoc_chain()
527 usb_kill_urb(fifo->urb); in stop_isoc_chain()
528 usb_free_urb(fifo->urb); in stop_isoc_chain()
529 fifo->urb = NULL; in stop_isoc_chain()
530 fifo->active = 0; in stop_isoc_chain()
543 usb_fifo *fifo = context_iso_urb->owner_fifo; in tx_iso_complete() local
544 hfcusb_data *hfc = fifo->hfc; in tx_iso_complete()
550 fifon = fifo->fifonum; in tx_iso_complete()
574 if (fifo->active && !status) { in tx_iso_complete()
589 fill_isoc_urb(urb, fifo->hfc->dev, fifo->pipe, in tx_iso_complete()
591 fifo->usb_packet_maxlen, fifo->intervall, in tx_iso_complete()
599 if (fifo->skbuff) { in tx_iso_complete()
600 len = fifo->skbuff->len; in tx_iso_complete()
602 fifo->bit_line -= sink; in tx_iso_complete()
603 current_len = (0 - fifo->bit_line) / 8; in tx_iso_complete()
611 fifo->bit_line += current_len * 8; in tx_iso_complete()
620 fifo->bit_line += 32; in tx_iso_complete()
626 tx_offset + 1, fifo->skbuff->data, in tx_iso_complete()
628 skb_pull(fifo->skbuff, current_len); in tx_iso_complete()
641 fifo->bit_line -= sink; /* we lower data margin every msec */ in tx_iso_complete()
643 if (fifo->bit_line < BITLINE_INF) { in tx_iso_complete()
644 fifo->bit_line = BITLINE_INF; in tx_iso_complete()
649 fifo->delete_flg = 1; in tx_iso_complete()
650 fifo->hif->l1l2(fifo->hif, in tx_iso_complete()
652 (void *) (unsigned long) fifo->skbuff-> in tx_iso_complete()
654 if (fifo->skbuff && fifo->delete_flg) { in tx_iso_complete()
655 dev_kfree_skb_any(fifo->skbuff); in tx_iso_complete()
656 fifo->skbuff = NULL; in tx_iso_complete()
657 fifo->delete_flg = 0; in tx_iso_complete()
681 usb_fifo *fifo = context_iso_urb->owner_fifo; in rx_iso_complete() local
682 hfcusb_data *hfc = fifo->hfc; in rx_iso_complete()
689 fifon = fifo->fifonum; in rx_iso_complete()
707 if (fifo->active && !status) { in rx_iso_complete()
709 maxlen = fifo->usb_packet_maxlen; in rx_iso_complete()
726 fifo->last_urblen, len, maxlen, in rx_iso_complete()
732 if (fifo->last_urblen != maxlen) { in rx_iso_complete()
744 collect_rx_frame(fifo, buf + 2, in rx_iso_complete()
749 collect_rx_frame(fifo, buf, len, in rx_iso_complete()
754 fifo->last_urblen = len; in rx_iso_complete()
757 fill_isoc_urb(urb, fifo->hfc->dev, fifo->pipe, in rx_iso_complete()
759 fifo->usb_packet_maxlen, fifo->intervall, in rx_iso_complete()
779 collect_rx_frame(usb_fifo *fifo, __u8 *data, int len, int finish) in collect_rx_frame() argument
781 hfcusb_data *hfc = fifo->hfc; in collect_rx_frame()
784 fifon = fifo->fifonum; in collect_rx_frame()
789 if (!fifo->skbuff) { in collect_rx_frame()
790 fifo->skbuff = dev_alloc_skb(fifo->max_size + 3); in collect_rx_frame()
791 if (!fifo->skbuff) { in collect_rx_frame()
799 if (fifo->skbuff->len + len < fifo->max_size) { in collect_rx_frame()
800 skb_put_data(fifo->skbuff, data, len); in collect_rx_frame()
804 fifo->max_size, fifon); in collect_rx_frame()
805 DBG_SKB(HFCUSB_DBG_VERBOSE_USB, fifo->skbuff); in collect_rx_frame()
806 skb_trim(fifo->skbuff, 0); in collect_rx_frame()
809 if (transp_mode && fifo->skbuff->len >= 128) { in collect_rx_frame()
810 fifo->hif->l1l2(fifo->hif, PH_DATA | INDICATION, in collect_rx_frame()
811 fifo->skbuff); in collect_rx_frame()
812 fifo->skbuff = NULL; in collect_rx_frame()
817 if (fifo->skbuff->len > 3 && in collect_rx_frame()
818 !fifo->skbuff->data[fifo->skbuff->len - 1]) { in collect_rx_frame()
822 "HFC-S USB: D-RX len(%d)", fifo->skbuff->len); in collect_rx_frame()
823 DBG_SKB(HFCUSB_DBG_DCHANNEL, fifo->skbuff); in collect_rx_frame()
827 skb_trim(fifo->skbuff, fifo->skbuff->len - 3); in collect_rx_frame()
829 fifo->hif->l1l2(fifo->hif, in collect_rx_frame()
831 fifo->skbuff); in collect_rx_frame()
833 fifo->hif->l1l2(fifo->hif, in collect_rx_frame()
835 fifo->skbuff); in collect_rx_frame()
836 fifo->skbuff = NULL; /* buffer was freed from upper layer */ in collect_rx_frame()
840 fifo->skbuff->len, fifon); in collect_rx_frame()
841 DBG_SKB(HFCUSB_DBG_VERBOSE_USB, fifo->skbuff); in collect_rx_frame()
842 skb_trim(fifo->skbuff, 0); in collect_rx_frame()
853 usb_fifo *fifo = (usb_fifo *) urb->context; in rx_int_complete() local
854 hfcusb_data *hfc = fifo->hfc; in rx_int_complete()
859 fifon = fifo->fifonum; in rx_int_complete()
860 if ((!fifo->active) || (urb->status)) { in rx_int_complete()
864 fifo->urb->interval = 0; /* cancel automatic rescheduling */ in rx_int_complete()
865 if (fifo->skbuff) { in rx_int_complete()
866 dev_kfree_skb_any(fifo->skbuff); in rx_int_complete()
867 fifo->skbuff = NULL; in rx_int_complete()
872 buf = fifo->buffer; in rx_int_complete()
873 maxlen = fifo->usb_packet_maxlen; in rx_int_complete()
879 fifo->last_urblen, len, maxlen, in rx_int_complete()
884 if (fifo->last_urblen != fifo->usb_packet_maxlen) { in rx_int_complete()
892 collect_rx_frame(fifo, buf + 2, in rx_int_complete()
896 collect_rx_frame(fifo, buf, urb->actual_length, in rx_int_complete()
899 fifo->last_urblen = urb->actual_length; in rx_int_complete()
910 start_int_fifo(usb_fifo *fifo) in start_int_fifo() argument
915 fifo->fifonum); in start_int_fifo()
917 if (!fifo->urb) { in start_int_fifo()
918 fifo->urb = usb_alloc_urb(0, GFP_KERNEL); in start_int_fifo()
919 if (!fifo->urb) in start_int_fifo()
922 usb_fill_int_urb(fifo->urb, fifo->hfc->dev, fifo->pipe, in start_int_fifo()
923 fifo->buffer, fifo->usb_packet_maxlen, in start_int_fifo()
924 rx_int_complete, fifo, fifo->intervall); in start_int_fifo()
925 fifo->active = 1; /* must be marked active */ in start_int_fifo()
926 errcode = usb_submit_urb(fifo->urb, GFP_KERNEL); in start_int_fifo()
930 fifo->active = 0; in start_int_fifo()
931 fifo->skbuff = NULL; in start_int_fifo()
995 usb_fifo *fifo = my_hisax_if->priv; in hfc_usb_l2l1() local
996 hfcusb_data *hfc = fifo->hfc; in hfc_usb_l2l1()
1000 if (fifo->fifonum == HFCUSB_D_TX) { in hfc_usb_l2l1()
1051 (fifo->fifonum == in hfc_usb_l2l1()
1054 fifo->hif->l1l2(fifo->hif, in hfc_usb_l2l1()
1060 if (fifo->fifonum == HFCUSB_D_TX) { in hfc_usb_l2l1()
1067 (fifo->fifonum == in hfc_usb_l2l1()
1070 fifo->hif->l1l2(fifo->hif, in hfc_usb_l2l1()
1076 if (fifo->skbuff && fifo->delete_flg) { in hfc_usb_l2l1()
1077 dev_kfree_skb_any(fifo->skbuff); in hfc_usb_l2l1()
1078 fifo->skbuff = NULL; in hfc_usb_l2l1()
1079 fifo->delete_flg = 0; in hfc_usb_l2l1()
1081 fifo->skbuff = arg; /* we have a new buffer */ in hfc_usb_l2l1()
1094 usb_fifo *fifo; in hfc_usb_init() local
1133 fifo = hfc->fifos; in hfc_usb_init()
1136 fifo[i].skbuff = NULL; /* init buffer pointer */ in hfc_usb_init()
1137 fifo[i].max_size = in hfc_usb_init()
1139 fifo[i].last_urblen = 0; in hfc_usb_init()