Lines Matching full:fifo

693 		conhdlc = 8;	/* enable FIFO */  in hfcsusb_setup_bch()
800 hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, in hfcsusb_rx_frame() argument
803 struct hfcsusb *hw = fifo->hw; in hfcsusb_rx_frame()
806 int fifon = fifo->fifonum; in hfcsusb_rx_frame()
812 printk(KERN_DEBUG "%s: %s: fifo(%i) len(%i) " in hfcsusb_rx_frame()
815 fifo->dch, fifo->bch, fifo->ech); in hfcsusb_rx_frame()
820 if ((!!fifo->dch + !!fifo->bch + !!fifo->ech) != 1) { in hfcsusb_rx_frame()
827 if (fifo->dch) { in hfcsusb_rx_frame()
828 rx_skb = fifo->dch->rx_skb; in hfcsusb_rx_frame()
829 maxlen = fifo->dch->maxlen; in hfcsusb_rx_frame()
832 if (fifo->bch) { in hfcsusb_rx_frame()
833 if (test_bit(FLG_RX_OFF, &fifo->bch->Flags)) { in hfcsusb_rx_frame()
834 fifo->bch->dropcnt += len; in hfcsusb_rx_frame()
838 maxlen = bchannel_get_rxbuf(fifo->bch, len); in hfcsusb_rx_frame()
839 rx_skb = fifo->bch->rx_skb; in hfcsusb_rx_frame()
844 hw->name, fifo->bch->nr, len); in hfcsusb_rx_frame()
848 maxlen = fifo->bch->maxlen; in hfcsusb_rx_frame()
849 hdlc = test_bit(FLG_HDLC, &fifo->bch->Flags); in hfcsusb_rx_frame()
851 if (fifo->ech) { in hfcsusb_rx_frame()
852 rx_skb = fifo->ech->rx_skb; in hfcsusb_rx_frame()
853 maxlen = fifo->ech->maxlen; in hfcsusb_rx_frame()
857 if (fifo->dch || fifo->ech) { in hfcsusb_rx_frame()
861 if (fifo->dch) in hfcsusb_rx_frame()
862 fifo->dch->rx_skb = rx_skb; in hfcsusb_rx_frame()
863 if (fifo->ech) in hfcsusb_rx_frame()
864 fifo->ech->rx_skb = rx_skb; in hfcsusb_rx_frame()
876 "for fifo(%d) HFCUSB_D_RX\n", in hfcsusb_rx_frame()
906 if (fifo->dch) in hfcsusb_rx_frame()
907 recv_Dchannel(fifo->dch); in hfcsusb_rx_frame()
908 if (fifo->bch) in hfcsusb_rx_frame()
909 recv_Bchannel(fifo->bch, MISDN_ID_ANY, in hfcsusb_rx_frame()
911 if (fifo->ech) in hfcsusb_rx_frame()
912 recv_Echannel(fifo->ech, in hfcsusb_rx_frame()
931 recv_Bchannel(fifo->bch, MISDN_ID_ANY, false); in hfcsusb_rx_frame()
963 struct usb_fifo *fifo = context_iso_urb->owner_fifo; in rx_iso_complete() local
964 struct hfcsusb *hw = fifo->hw; in rx_iso_complete()
972 fifon = fifo->fifonum; in rx_iso_complete()
976 if (fifo->stop_gracefull) { in rx_iso_complete()
977 fifo->stop_gracefull = 0; in rx_iso_complete()
978 fifo->active = 0; in rx_iso_complete()
999 if (fifo->active && !status) { in rx_iso_complete()
1001 maxlen = fifo->usb_packet_maxlen; in rx_iso_complete()
1029 if (fifo->last_urblen != maxlen) { in rx_iso_complete()
1031 * save fifo fill-level threshold bits in rx_iso_complete()
1042 hfcsusb_rx_frame(fifo, buf + 2, in rx_iso_complete()
1046 hfcsusb_rx_frame(fifo, buf, len, in rx_iso_complete()
1049 fifo->last_urblen = len; in rx_iso_complete()
1060 fill_isoc_urb(urb, fifo->hw->dev, fifo->pipe, in rx_iso_complete()
1062 fifo->usb_packet_maxlen, fifo->intervall, in rx_iso_complete()
1085 struct usb_fifo *fifo = (struct usb_fifo *) urb->context; in rx_int_complete() local
1086 struct hfcsusb *hw = fifo->hw; in rx_int_complete()
1091 if (fifo->stop_gracefull) { in rx_int_complete()
1092 fifo->stop_gracefull = 0; in rx_int_complete()
1093 fifo->active = 0; in rx_int_complete()
1099 fifon = fifo->fifonum; in rx_int_complete()
1100 if ((!fifo->active) || (urb->status)) { in rx_int_complete()
1103 "%s: %s: RX-Fifo %i is going down (%i)\n", in rx_int_complete()
1106 fifo->urb->interval = 0; /* cancel automatic rescheduling */ in rx_int_complete()
1110 buf = fifo->buffer; in rx_int_complete()
1111 maxlen = fifo->usb_packet_maxlen; in rx_int_complete()
1122 if (fifo->last_urblen != fifo->usb_packet_maxlen) { in rx_int_complete()
1135 hfcsusb_rx_frame(fifo, buf + 2, in rx_int_complete()
1139 hfcsusb_rx_frame(fifo, buf, urb->actual_length, in rx_int_complete()
1142 fifo->last_urblen = urb->actual_length; in rx_int_complete()
1157 struct usb_fifo *fifo = context_iso_urb->owner_fifo; in tx_iso_complete() local
1158 struct hfcsusb *hw = fifo->hw; in tx_iso_complete()
1168 if (fifo->stop_gracefull) { in tx_iso_complete()
1169 fifo->stop_gracefull = 0; in tx_iso_complete()
1170 fifo->active = 0; in tx_iso_complete()
1175 if (fifo->dch) { in tx_iso_complete()
1176 tx_skb = fifo->dch->tx_skb; in tx_iso_complete()
1177 tx_idx = &fifo->dch->tx_idx; in tx_iso_complete()
1179 } else if (fifo->bch) { in tx_iso_complete()
1180 tx_skb = fifo->bch->tx_skb; in tx_iso_complete()
1181 tx_idx = &fifo->bch->tx_idx; in tx_iso_complete()
1182 hdlc = test_bit(FLG_HDLC, &fifo->bch->Flags); in tx_iso_complete()
1184 test_bit(FLG_FILLEMPTY, &fifo->bch->Flags)) in tx_iso_complete()
1193 fifon = fifo->fifonum; in tx_iso_complete()
1212 if (fifo->active && !status) { in tx_iso_complete()
1217 /* predict dataflow to avoid fifo overflow */ in tx_iso_complete()
1222 fill_isoc_urb(urb, fifo->hw->dev, fifo->pipe, in tx_iso_complete()
1224 fifo->usb_packet_maxlen, fifo->intervall, in tx_iso_complete()
1250 fifo->bit_line -= sink; in tx_iso_complete()
1251 current_len = (0 - fifo->bit_line) / 8; in tx_iso_complete()
1260 fifo->bit_line += current_len * 8; in tx_iso_complete()
1270 fifo->bit_line += 32; in tx_iso_complete()
1278 memset(p, fifo->bch->fill[0], in tx_iso_complete()
1314 fifo->bit_line -= sink; in tx_iso_complete()
1315 if (fifo->bit_line < BITLINE_INF) in tx_iso_complete()
1316 fifo->bit_line = BITLINE_INF; in tx_iso_complete()
1336 if (fifo->dch && get_next_dframe(fifo->dch)) in tx_iso_complete()
1337 tx_skb = fifo->dch->tx_skb; in tx_iso_complete()
1338 else if (fifo->bch && in tx_iso_complete()
1339 get_next_bframe(fifo->bch)) in tx_iso_complete()
1340 tx_skb = fifo->bch->tx_skb; in tx_iso_complete()
1354 * fifo->intervall (ms) in tx_iso_complete()
1377 start_isoc_chain(struct usb_fifo *fifo, int num_packets_per_urb, in start_isoc_chain() argument
1380 struct hfcsusb *hw = fifo->hw; in start_isoc_chain()
1384 printk(KERN_DEBUG "%s: %s: fifo %i\n", in start_isoc_chain()
1385 hw->name, __func__, fifo->fifonum); in start_isoc_chain()
1389 if (!(fifo->iso[i].urb)) { in start_isoc_chain()
1390 fifo->iso[i].urb = in start_isoc_chain()
1392 if (!(fifo->iso[i].urb)) { in start_isoc_chain()
1394 "%s: %s: alloc urb for fifo %i failed", in start_isoc_chain()
1395 hw->name, __func__, fifo->fifonum); in start_isoc_chain()
1398 fifo->iso[i].owner_fifo = (struct usb_fifo *) fifo; in start_isoc_chain()
1399 fifo->iso[i].indx = i; in start_isoc_chain()
1403 (fifo->usb_packet_maxlen * in start_isoc_chain()
1405 fill_isoc_urb(fifo->iso[i].urb, in start_isoc_chain()
1406 fifo->hw->dev, fifo->pipe, in start_isoc_chain()
1407 fifo->iso[i].buffer, in start_isoc_chain()
1409 fifo->usb_packet_maxlen, in start_isoc_chain()
1410 fifo->intervall, complete, in start_isoc_chain()
1411 &fifo->iso[i]); in start_isoc_chain()
1412 memset(fifo->iso[i].buffer, 0, in start_isoc_chain()
1413 sizeof(fifo->iso[i].buffer)); in start_isoc_chain()
1416 fifo->iso[i].urb-> in start_isoc_chain()
1419 fifo->iso[i].urb-> in start_isoc_chain()
1429 fifo->bit_line = BITLINE_INF; in start_isoc_chain()
1431 errcode = usb_submit_urb(fifo->iso[i].urb, GFP_KERNEL); in start_isoc_chain()
1432 fifo->active = (errcode >= 0) ? 1 : 0; in start_isoc_chain()
1433 fifo->stop_gracefull = 0; in start_isoc_chain()
1440 return fifo->active; in start_isoc_chain()
1444 stop_iso_gracefull(struct usb_fifo *fifo) in stop_iso_gracefull() argument
1446 struct hfcsusb *hw = fifo->hw; in stop_iso_gracefull()
1453 printk(KERN_DEBUG "%s: %s for fifo %i.%i\n", in stop_iso_gracefull()
1454 hw->name, __func__, fifo->fifonum, i); in stop_iso_gracefull()
1455 fifo->stop_gracefull = 1; in stop_iso_gracefull()
1461 while (fifo->stop_gracefull && timeout--) in stop_iso_gracefull()
1463 if (debug && fifo->stop_gracefull) in stop_iso_gracefull()
1464 printk(KERN_DEBUG "%s: ERROR %s for fifo %i.%i\n", in stop_iso_gracefull()
1465 hw->name, __func__, fifo->fifonum, i); in stop_iso_gracefull()
1470 stop_int_gracefull(struct usb_fifo *fifo) in stop_int_gracefull() argument
1472 struct hfcsusb *hw = fifo->hw; in stop_int_gracefull()
1478 printk(KERN_DEBUG "%s: %s for fifo %i\n", in stop_int_gracefull()
1479 hw->name, __func__, fifo->fifonum); in stop_int_gracefull()
1480 fifo->stop_gracefull = 1; in stop_int_gracefull()
1484 while (fifo->stop_gracefull && timeout--) in stop_int_gracefull()
1486 if (debug && fifo->stop_gracefull) in stop_int_gracefull()
1487 printk(KERN_DEBUG "%s: ERROR %s for fifo %i\n", in stop_int_gracefull()
1488 hw->name, __func__, fifo->fifonum); in stop_int_gracefull()
1491 /* start the interrupt transfer for the given fifo */
1493 start_int_fifo(struct usb_fifo *fifo) in start_int_fifo() argument
1495 struct hfcsusb *hw = fifo->hw; in start_int_fifo()
1499 printk(KERN_DEBUG "%s: %s: INT IN fifo:%d\n", in start_int_fifo()
1500 hw->name, __func__, fifo->fifonum); in start_int_fifo()
1502 if (!fifo->urb) { in start_int_fifo()
1503 fifo->urb = usb_alloc_urb(0, GFP_KERNEL); in start_int_fifo()
1504 if (!fifo->urb) in start_int_fifo()
1507 usb_fill_int_urb(fifo->urb, fifo->hw->dev, fifo->pipe, in start_int_fifo()
1508 fifo->buffer, fifo->usb_packet_maxlen, in start_int_fifo()
1509 (usb_complete_t)rx_int_complete, fifo, fifo->intervall); in start_int_fifo()
1510 fifo->active = 1; in start_int_fifo()
1511 fifo->stop_gracefull = 0; in start_int_fifo()
1512 errcode = usb_submit_urb(fifo->urb, GFP_KERNEL); in start_int_fifo()
1516 fifo->active = 0; in start_int_fifo()
1545 struct usb_fifo *fifo; in reset_hfcsusb() local
1572 fifo = hw->fifos; in reset_hfcsusb()
1574 write_reg(hw, HFCUSB_FIFO, i); /* select the desired fifo */ in reset_hfcsusb()
1575 fifo[i].max_size = in reset_hfcsusb()
1577 fifo[i].last_urblen = 0; in reset_hfcsusb()
1588 write_reg(hw, HFCUSB_INC_RES_F, 2); /* reset the fifo */ in reset_hfcsusb()