Lines Matching full:fifo

693 		conhdlc = 8;	/* enable FIFO */  in hfcsusb_setup_bch()
799 hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, in hfcsusb_rx_frame() argument
802 struct hfcsusb *hw = fifo->hw; in hfcsusb_rx_frame()
805 int fifon = fifo->fifonum; in hfcsusb_rx_frame()
811 printk(KERN_DEBUG "%s: %s: fifo(%i) len(%i) " in hfcsusb_rx_frame()
814 fifo->dch, fifo->bch, fifo->ech); in hfcsusb_rx_frame()
819 if ((!!fifo->dch + !!fifo->bch + !!fifo->ech) != 1) { in hfcsusb_rx_frame()
826 if (fifo->dch) { in hfcsusb_rx_frame()
827 rx_skb = fifo->dch->rx_skb; in hfcsusb_rx_frame()
828 maxlen = fifo->dch->maxlen; in hfcsusb_rx_frame()
831 if (fifo->bch) { in hfcsusb_rx_frame()
832 if (test_bit(FLG_RX_OFF, &fifo->bch->Flags)) { in hfcsusb_rx_frame()
833 fifo->bch->dropcnt += len; in hfcsusb_rx_frame()
837 maxlen = bchannel_get_rxbuf(fifo->bch, len); in hfcsusb_rx_frame()
838 rx_skb = fifo->bch->rx_skb; in hfcsusb_rx_frame()
843 hw->name, fifo->bch->nr, len); in hfcsusb_rx_frame()
847 maxlen = fifo->bch->maxlen; in hfcsusb_rx_frame()
848 hdlc = test_bit(FLG_HDLC, &fifo->bch->Flags); in hfcsusb_rx_frame()
850 if (fifo->ech) { in hfcsusb_rx_frame()
851 rx_skb = fifo->ech->rx_skb; in hfcsusb_rx_frame()
852 maxlen = fifo->ech->maxlen; in hfcsusb_rx_frame()
856 if (fifo->dch || fifo->ech) { in hfcsusb_rx_frame()
860 if (fifo->dch) in hfcsusb_rx_frame()
861 fifo->dch->rx_skb = rx_skb; in hfcsusb_rx_frame()
862 if (fifo->ech) in hfcsusb_rx_frame()
863 fifo->ech->rx_skb = rx_skb; in hfcsusb_rx_frame()
875 "for fifo(%d) HFCUSB_D_RX\n", in hfcsusb_rx_frame()
905 if (fifo->dch) in hfcsusb_rx_frame()
906 recv_Dchannel(fifo->dch); in hfcsusb_rx_frame()
907 if (fifo->bch) in hfcsusb_rx_frame()
908 recv_Bchannel(fifo->bch, MISDN_ID_ANY, in hfcsusb_rx_frame()
910 if (fifo->ech) in hfcsusb_rx_frame()
911 recv_Echannel(fifo->ech, in hfcsusb_rx_frame()
930 recv_Bchannel(fifo->bch, MISDN_ID_ANY, false); in hfcsusb_rx_frame()
962 struct usb_fifo *fifo = context_iso_urb->owner_fifo; in rx_iso_complete() local
963 struct hfcsusb *hw = fifo->hw; in rx_iso_complete()
971 fifon = fifo->fifonum; in rx_iso_complete()
975 if (fifo->stop_gracefull) { in rx_iso_complete()
976 fifo->stop_gracefull = 0; in rx_iso_complete()
977 fifo->active = 0; in rx_iso_complete()
998 if (fifo->active && !status) { in rx_iso_complete()
1000 maxlen = fifo->usb_packet_maxlen; in rx_iso_complete()
1028 if (fifo->last_urblen != maxlen) { in rx_iso_complete()
1030 * save fifo fill-level threshold bits in rx_iso_complete()
1041 hfcsusb_rx_frame(fifo, buf + 2, in rx_iso_complete()
1045 hfcsusb_rx_frame(fifo, buf, len, in rx_iso_complete()
1048 fifo->last_urblen = len; in rx_iso_complete()
1059 fill_isoc_urb(urb, fifo->hw->dev, fifo->pipe, in rx_iso_complete()
1061 fifo->usb_packet_maxlen, fifo->intervall, in rx_iso_complete()
1084 struct usb_fifo *fifo = (struct usb_fifo *) urb->context; in rx_int_complete() local
1085 struct hfcsusb *hw = fifo->hw; in rx_int_complete()
1090 if (fifo->stop_gracefull) { in rx_int_complete()
1091 fifo->stop_gracefull = 0; in rx_int_complete()
1092 fifo->active = 0; in rx_int_complete()
1098 fifon = fifo->fifonum; in rx_int_complete()
1099 if ((!fifo->active) || (urb->status)) { in rx_int_complete()
1102 "%s: %s: RX-Fifo %i is going down (%i)\n", in rx_int_complete()
1105 fifo->urb->interval = 0; /* cancel automatic rescheduling */ in rx_int_complete()
1109 buf = fifo->buffer; in rx_int_complete()
1110 maxlen = fifo->usb_packet_maxlen; in rx_int_complete()
1121 if (fifo->last_urblen != fifo->usb_packet_maxlen) { in rx_int_complete()
1134 hfcsusb_rx_frame(fifo, buf + 2, in rx_int_complete()
1138 hfcsusb_rx_frame(fifo, buf, urb->actual_length, in rx_int_complete()
1141 fifo->last_urblen = urb->actual_length; in rx_int_complete()
1156 struct usb_fifo *fifo = context_iso_urb->owner_fifo; in tx_iso_complete() local
1157 struct hfcsusb *hw = fifo->hw; in tx_iso_complete()
1167 if (fifo->stop_gracefull) { in tx_iso_complete()
1168 fifo->stop_gracefull = 0; in tx_iso_complete()
1169 fifo->active = 0; in tx_iso_complete()
1174 if (fifo->dch) { in tx_iso_complete()
1175 tx_skb = fifo->dch->tx_skb; in tx_iso_complete()
1176 tx_idx = &fifo->dch->tx_idx; in tx_iso_complete()
1178 } else if (fifo->bch) { in tx_iso_complete()
1179 tx_skb = fifo->bch->tx_skb; in tx_iso_complete()
1180 tx_idx = &fifo->bch->tx_idx; in tx_iso_complete()
1181 hdlc = test_bit(FLG_HDLC, &fifo->bch->Flags); in tx_iso_complete()
1183 test_bit(FLG_FILLEMPTY, &fifo->bch->Flags)) in tx_iso_complete()
1192 fifon = fifo->fifonum; in tx_iso_complete()
1211 if (fifo->active && !status) { in tx_iso_complete()
1216 /* predict dataflow to avoid fifo overflow */ in tx_iso_complete()
1221 fill_isoc_urb(urb, fifo->hw->dev, fifo->pipe, in tx_iso_complete()
1223 fifo->usb_packet_maxlen, fifo->intervall, in tx_iso_complete()
1249 fifo->bit_line -= sink; in tx_iso_complete()
1250 current_len = (0 - fifo->bit_line) / 8; in tx_iso_complete()
1259 fifo->bit_line += current_len * 8; in tx_iso_complete()
1269 fifo->bit_line += 32; in tx_iso_complete()
1277 memset(p, fifo->bch->fill[0], in tx_iso_complete()
1313 fifo->bit_line -= sink; in tx_iso_complete()
1314 if (fifo->bit_line < BITLINE_INF) in tx_iso_complete()
1315 fifo->bit_line = BITLINE_INF; in tx_iso_complete()
1335 if (fifo->dch && get_next_dframe(fifo->dch)) in tx_iso_complete()
1336 tx_skb = fifo->dch->tx_skb; in tx_iso_complete()
1337 else if (fifo->bch && in tx_iso_complete()
1338 get_next_bframe(fifo->bch)) in tx_iso_complete()
1339 tx_skb = fifo->bch->tx_skb; in tx_iso_complete()
1353 * fifo->intervall (ms) in tx_iso_complete()
1376 start_isoc_chain(struct usb_fifo *fifo, int num_packets_per_urb, in start_isoc_chain() argument
1379 struct hfcsusb *hw = fifo->hw; in start_isoc_chain()
1383 printk(KERN_DEBUG "%s: %s: fifo %i\n", in start_isoc_chain()
1384 hw->name, __func__, fifo->fifonum); in start_isoc_chain()
1388 if (!(fifo->iso[i].urb)) { in start_isoc_chain()
1389 fifo->iso[i].urb = in start_isoc_chain()
1391 if (!(fifo->iso[i].urb)) { in start_isoc_chain()
1393 "%s: %s: alloc urb for fifo %i failed", in start_isoc_chain()
1394 hw->name, __func__, fifo->fifonum); in start_isoc_chain()
1397 fifo->iso[i].owner_fifo = (struct usb_fifo *) fifo; in start_isoc_chain()
1398 fifo->iso[i].indx = i; in start_isoc_chain()
1402 (fifo->usb_packet_maxlen * in start_isoc_chain()
1404 fill_isoc_urb(fifo->iso[i].urb, in start_isoc_chain()
1405 fifo->hw->dev, fifo->pipe, in start_isoc_chain()
1406 fifo->iso[i].buffer, in start_isoc_chain()
1408 fifo->usb_packet_maxlen, in start_isoc_chain()
1409 fifo->intervall, complete, in start_isoc_chain()
1410 &fifo->iso[i]); in start_isoc_chain()
1411 memset(fifo->iso[i].buffer, 0, in start_isoc_chain()
1412 sizeof(fifo->iso[i].buffer)); in start_isoc_chain()
1415 fifo->iso[i].urb-> in start_isoc_chain()
1418 fifo->iso[i].urb-> in start_isoc_chain()
1428 fifo->bit_line = BITLINE_INF; in start_isoc_chain()
1430 errcode = usb_submit_urb(fifo->iso[i].urb, GFP_KERNEL); in start_isoc_chain()
1431 fifo->active = (errcode >= 0) ? 1 : 0; in start_isoc_chain()
1432 fifo->stop_gracefull = 0; in start_isoc_chain()
1439 return fifo->active; in start_isoc_chain()
1443 stop_iso_gracefull(struct usb_fifo *fifo) in stop_iso_gracefull() argument
1445 struct hfcsusb *hw = fifo->hw; in stop_iso_gracefull()
1452 printk(KERN_DEBUG "%s: %s for fifo %i.%i\n", in stop_iso_gracefull()
1453 hw->name, __func__, fifo->fifonum, i); in stop_iso_gracefull()
1454 fifo->stop_gracefull = 1; in stop_iso_gracefull()
1460 while (fifo->stop_gracefull && timeout--) in stop_iso_gracefull()
1462 if (debug && fifo->stop_gracefull) in stop_iso_gracefull()
1463 printk(KERN_DEBUG "%s: ERROR %s for fifo %i.%i\n", in stop_iso_gracefull()
1464 hw->name, __func__, fifo->fifonum, i); in stop_iso_gracefull()
1469 stop_int_gracefull(struct usb_fifo *fifo) in stop_int_gracefull() argument
1471 struct hfcsusb *hw = fifo->hw; in stop_int_gracefull()
1477 printk(KERN_DEBUG "%s: %s for fifo %i\n", in stop_int_gracefull()
1478 hw->name, __func__, fifo->fifonum); in stop_int_gracefull()
1479 fifo->stop_gracefull = 1; in stop_int_gracefull()
1483 while (fifo->stop_gracefull && timeout--) in stop_int_gracefull()
1485 if (debug && fifo->stop_gracefull) in stop_int_gracefull()
1486 printk(KERN_DEBUG "%s: ERROR %s for fifo %i\n", in stop_int_gracefull()
1487 hw->name, __func__, fifo->fifonum); in stop_int_gracefull()
1490 /* start the interrupt transfer for the given fifo */
1492 start_int_fifo(struct usb_fifo *fifo) in start_int_fifo() argument
1494 struct hfcsusb *hw = fifo->hw; in start_int_fifo()
1498 printk(KERN_DEBUG "%s: %s: INT IN fifo:%d\n", in start_int_fifo()
1499 hw->name, __func__, fifo->fifonum); in start_int_fifo()
1501 if (!fifo->urb) { in start_int_fifo()
1502 fifo->urb = usb_alloc_urb(0, GFP_KERNEL); in start_int_fifo()
1503 if (!fifo->urb) in start_int_fifo()
1506 usb_fill_int_urb(fifo->urb, fifo->hw->dev, fifo->pipe, in start_int_fifo()
1507 fifo->buffer, fifo->usb_packet_maxlen, in start_int_fifo()
1508 (usb_complete_t)rx_int_complete, fifo, fifo->intervall); in start_int_fifo()
1509 fifo->active = 1; in start_int_fifo()
1510 fifo->stop_gracefull = 0; in start_int_fifo()
1511 errcode = usb_submit_urb(fifo->urb, GFP_KERNEL); in start_int_fifo()
1515 fifo->active = 0; in start_int_fifo()
1544 struct usb_fifo *fifo; in reset_hfcsusb() local
1571 fifo = hw->fifos; in reset_hfcsusb()
1573 write_reg(hw, HFCUSB_FIFO, i); /* select the desired fifo */ in reset_hfcsusb()
1574 fifo[i].max_size = in reset_hfcsusb()
1576 fifo[i].last_urblen = 0; in reset_hfcsusb()
1587 write_reg(hw, HFCUSB_INC_RES_F, 2); /* reset the fifo */ in reset_hfcsusb()