Lines Matching full:fifo

694 		conhdlc = 8;	/* enable FIFO */  in hfcsusb_setup_bch()
801 hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, in hfcsusb_rx_frame() argument
804 struct hfcsusb *hw = fifo->hw; in hfcsusb_rx_frame()
807 int fifon = fifo->fifonum; in hfcsusb_rx_frame()
813 printk(KERN_DEBUG "%s: %s: fifo(%i) len(%i) " in hfcsusb_rx_frame()
816 fifo->dch, fifo->bch, fifo->ech); in hfcsusb_rx_frame()
821 if ((!!fifo->dch + !!fifo->bch + !!fifo->ech) != 1) { in hfcsusb_rx_frame()
828 if (fifo->dch) { in hfcsusb_rx_frame()
829 rx_skb = fifo->dch->rx_skb; in hfcsusb_rx_frame()
830 maxlen = fifo->dch->maxlen; in hfcsusb_rx_frame()
833 if (fifo->bch) { in hfcsusb_rx_frame()
834 if (test_bit(FLG_RX_OFF, &fifo->bch->Flags)) { in hfcsusb_rx_frame()
835 fifo->bch->dropcnt += len; in hfcsusb_rx_frame()
839 maxlen = bchannel_get_rxbuf(fifo->bch, len); in hfcsusb_rx_frame()
840 rx_skb = fifo->bch->rx_skb; in hfcsusb_rx_frame()
845 hw->name, fifo->bch->nr, len); in hfcsusb_rx_frame()
849 maxlen = fifo->bch->maxlen; in hfcsusb_rx_frame()
850 hdlc = test_bit(FLG_HDLC, &fifo->bch->Flags); in hfcsusb_rx_frame()
852 if (fifo->ech) { in hfcsusb_rx_frame()
853 rx_skb = fifo->ech->rx_skb; in hfcsusb_rx_frame()
854 maxlen = fifo->ech->maxlen; in hfcsusb_rx_frame()
858 if (fifo->dch || fifo->ech) { in hfcsusb_rx_frame()
862 if (fifo->dch) in hfcsusb_rx_frame()
863 fifo->dch->rx_skb = rx_skb; in hfcsusb_rx_frame()
864 if (fifo->ech) in hfcsusb_rx_frame()
865 fifo->ech->rx_skb = rx_skb; in hfcsusb_rx_frame()
877 "for fifo(%d) HFCUSB_D_RX\n", in hfcsusb_rx_frame()
907 if (fifo->dch) in hfcsusb_rx_frame()
908 recv_Dchannel(fifo->dch); in hfcsusb_rx_frame()
909 if (fifo->bch) in hfcsusb_rx_frame()
910 recv_Bchannel(fifo->bch, MISDN_ID_ANY, in hfcsusb_rx_frame()
912 if (fifo->ech) in hfcsusb_rx_frame()
913 recv_Echannel(fifo->ech, in hfcsusb_rx_frame()
932 recv_Bchannel(fifo->bch, MISDN_ID_ANY, false); in hfcsusb_rx_frame()
964 struct usb_fifo *fifo = context_iso_urb->owner_fifo; in rx_iso_complete() local
965 struct hfcsusb *hw = fifo->hw; in rx_iso_complete()
973 fifon = fifo->fifonum; in rx_iso_complete()
977 if (fifo->stop_gracefull) { in rx_iso_complete()
978 fifo->stop_gracefull = 0; in rx_iso_complete()
979 fifo->active = 0; in rx_iso_complete()
1000 if (fifo->active && !status) { in rx_iso_complete()
1002 maxlen = fifo->usb_packet_maxlen; in rx_iso_complete()
1030 if (fifo->last_urblen != maxlen) { in rx_iso_complete()
1032 * save fifo fill-level threshold bits in rx_iso_complete()
1043 hfcsusb_rx_frame(fifo, buf + 2, in rx_iso_complete()
1047 hfcsusb_rx_frame(fifo, buf, len, in rx_iso_complete()
1050 fifo->last_urblen = len; in rx_iso_complete()
1061 fill_isoc_urb(urb, fifo->hw->dev, fifo->pipe, in rx_iso_complete()
1063 fifo->usb_packet_maxlen, fifo->intervall, in rx_iso_complete()
1086 struct usb_fifo *fifo = (struct usb_fifo *) urb->context; in rx_int_complete() local
1087 struct hfcsusb *hw = fifo->hw; in rx_int_complete()
1092 if (fifo->stop_gracefull) { in rx_int_complete()
1093 fifo->stop_gracefull = 0; in rx_int_complete()
1094 fifo->active = 0; in rx_int_complete()
1100 fifon = fifo->fifonum; in rx_int_complete()
1101 if ((!fifo->active) || (urb->status)) { in rx_int_complete()
1104 "%s: %s: RX-Fifo %i is going down (%i)\n", in rx_int_complete()
1107 fifo->urb->interval = 0; /* cancel automatic rescheduling */ in rx_int_complete()
1111 buf = fifo->buffer; in rx_int_complete()
1112 maxlen = fifo->usb_packet_maxlen; in rx_int_complete()
1123 if (fifo->last_urblen != fifo->usb_packet_maxlen) { in rx_int_complete()
1136 hfcsusb_rx_frame(fifo, buf + 2, in rx_int_complete()
1140 hfcsusb_rx_frame(fifo, buf, urb->actual_length, in rx_int_complete()
1143 fifo->last_urblen = urb->actual_length; in rx_int_complete()
1158 struct usb_fifo *fifo = context_iso_urb->owner_fifo; in tx_iso_complete() local
1159 struct hfcsusb *hw = fifo->hw; in tx_iso_complete()
1169 if (fifo->stop_gracefull) { in tx_iso_complete()
1170 fifo->stop_gracefull = 0; in tx_iso_complete()
1171 fifo->active = 0; in tx_iso_complete()
1176 if (fifo->dch) { in tx_iso_complete()
1177 tx_skb = fifo->dch->tx_skb; in tx_iso_complete()
1178 tx_idx = &fifo->dch->tx_idx; in tx_iso_complete()
1180 } else if (fifo->bch) { in tx_iso_complete()
1181 tx_skb = fifo->bch->tx_skb; in tx_iso_complete()
1182 tx_idx = &fifo->bch->tx_idx; in tx_iso_complete()
1183 hdlc = test_bit(FLG_HDLC, &fifo->bch->Flags); in tx_iso_complete()
1185 test_bit(FLG_FILLEMPTY, &fifo->bch->Flags)) in tx_iso_complete()
1194 fifon = fifo->fifonum; in tx_iso_complete()
1213 if (fifo->active && !status) { in tx_iso_complete()
1218 /* predict dataflow to avoid fifo overflow */ in tx_iso_complete()
1223 fill_isoc_urb(urb, fifo->hw->dev, fifo->pipe, in tx_iso_complete()
1225 fifo->usb_packet_maxlen, fifo->intervall, in tx_iso_complete()
1251 fifo->bit_line -= sink; in tx_iso_complete()
1252 current_len = (0 - fifo->bit_line) / 8; in tx_iso_complete()
1261 fifo->bit_line += current_len * 8; in tx_iso_complete()
1271 fifo->bit_line += 32; in tx_iso_complete()
1279 memset(p, fifo->bch->fill[0], in tx_iso_complete()
1315 fifo->bit_line -= sink; in tx_iso_complete()
1316 if (fifo->bit_line < BITLINE_INF) in tx_iso_complete()
1317 fifo->bit_line = BITLINE_INF; in tx_iso_complete()
1337 if (fifo->dch && get_next_dframe(fifo->dch)) in tx_iso_complete()
1338 tx_skb = fifo->dch->tx_skb; in tx_iso_complete()
1339 else if (fifo->bch && in tx_iso_complete()
1340 get_next_bframe(fifo->bch)) in tx_iso_complete()
1341 tx_skb = fifo->bch->tx_skb; in tx_iso_complete()
1355 * fifo->intervall (ms) in tx_iso_complete()
1378 start_isoc_chain(struct usb_fifo *fifo, int num_packets_per_urb, in start_isoc_chain() argument
1381 struct hfcsusb *hw = fifo->hw; in start_isoc_chain()
1385 printk(KERN_DEBUG "%s: %s: fifo %i\n", in start_isoc_chain()
1386 hw->name, __func__, fifo->fifonum); in start_isoc_chain()
1390 if (!(fifo->iso[i].urb)) { in start_isoc_chain()
1391 fifo->iso[i].urb = in start_isoc_chain()
1393 if (!(fifo->iso[i].urb)) { in start_isoc_chain()
1395 "%s: %s: alloc urb for fifo %i failed", in start_isoc_chain()
1396 hw->name, __func__, fifo->fifonum); in start_isoc_chain()
1399 fifo->iso[i].owner_fifo = (struct usb_fifo *) fifo; in start_isoc_chain()
1400 fifo->iso[i].indx = i; in start_isoc_chain()
1404 (fifo->usb_packet_maxlen * in start_isoc_chain()
1406 fill_isoc_urb(fifo->iso[i].urb, in start_isoc_chain()
1407 fifo->hw->dev, fifo->pipe, in start_isoc_chain()
1408 fifo->iso[i].buffer, in start_isoc_chain()
1410 fifo->usb_packet_maxlen, in start_isoc_chain()
1411 fifo->intervall, complete, in start_isoc_chain()
1412 &fifo->iso[i]); in start_isoc_chain()
1413 memset(fifo->iso[i].buffer, 0, in start_isoc_chain()
1414 sizeof(fifo->iso[i].buffer)); in start_isoc_chain()
1417 fifo->iso[i].urb-> in start_isoc_chain()
1420 fifo->iso[i].urb-> in start_isoc_chain()
1430 fifo->bit_line = BITLINE_INF; in start_isoc_chain()
1432 errcode = usb_submit_urb(fifo->iso[i].urb, GFP_KERNEL); in start_isoc_chain()
1433 fifo->active = (errcode >= 0) ? 1 : 0; in start_isoc_chain()
1434 fifo->stop_gracefull = 0; in start_isoc_chain()
1441 return fifo->active; in start_isoc_chain()
1445 stop_iso_gracefull(struct usb_fifo *fifo) in stop_iso_gracefull() argument
1447 struct hfcsusb *hw = fifo->hw; in stop_iso_gracefull()
1454 printk(KERN_DEBUG "%s: %s for fifo %i.%i\n", in stop_iso_gracefull()
1455 hw->name, __func__, fifo->fifonum, i); in stop_iso_gracefull()
1456 fifo->stop_gracefull = 1; in stop_iso_gracefull()
1462 while (fifo->stop_gracefull && timeout--) in stop_iso_gracefull()
1464 if (debug && fifo->stop_gracefull) in stop_iso_gracefull()
1465 printk(KERN_DEBUG "%s: ERROR %s for fifo %i.%i\n", in stop_iso_gracefull()
1466 hw->name, __func__, fifo->fifonum, i); in stop_iso_gracefull()
1471 stop_int_gracefull(struct usb_fifo *fifo) in stop_int_gracefull() argument
1473 struct hfcsusb *hw = fifo->hw; in stop_int_gracefull()
1479 printk(KERN_DEBUG "%s: %s for fifo %i\n", in stop_int_gracefull()
1480 hw->name, __func__, fifo->fifonum); in stop_int_gracefull()
1481 fifo->stop_gracefull = 1; in stop_int_gracefull()
1485 while (fifo->stop_gracefull && timeout--) in stop_int_gracefull()
1487 if (debug && fifo->stop_gracefull) in stop_int_gracefull()
1488 printk(KERN_DEBUG "%s: ERROR %s for fifo %i\n", in stop_int_gracefull()
1489 hw->name, __func__, fifo->fifonum); in stop_int_gracefull()
1492 /* start the interrupt transfer for the given fifo */
1494 start_int_fifo(struct usb_fifo *fifo) in start_int_fifo() argument
1496 struct hfcsusb *hw = fifo->hw; in start_int_fifo()
1500 printk(KERN_DEBUG "%s: %s: INT IN fifo:%d\n", in start_int_fifo()
1501 hw->name, __func__, fifo->fifonum); in start_int_fifo()
1503 if (!fifo->urb) { in start_int_fifo()
1504 fifo->urb = usb_alloc_urb(0, GFP_KERNEL); in start_int_fifo()
1505 if (!fifo->urb) in start_int_fifo()
1508 usb_fill_int_urb(fifo->urb, fifo->hw->dev, fifo->pipe, in start_int_fifo()
1509 fifo->buffer, fifo->usb_packet_maxlen, in start_int_fifo()
1510 (usb_complete_t)rx_int_complete, fifo, fifo->intervall); in start_int_fifo()
1511 fifo->active = 1; in start_int_fifo()
1512 fifo->stop_gracefull = 0; in start_int_fifo()
1513 errcode = usb_submit_urb(fifo->urb, GFP_KERNEL); in start_int_fifo()
1517 fifo->active = 0; in start_int_fifo()
1546 struct usb_fifo *fifo; in reset_hfcsusb() local
1573 fifo = hw->fifos; in reset_hfcsusb()
1575 write_reg(hw, HFCUSB_FIFO, i); /* select the desired fifo */ in reset_hfcsusb()
1576 fifo[i].max_size = in reset_hfcsusb()
1578 fifo[i].last_urblen = 0; in reset_hfcsusb()
1589 write_reg(hw, HFCUSB_INC_RES_F, 2); /* reset the fifo */ in reset_hfcsusb()