Lines Matching refs:fcnt
401 int new_z2, fcnt, maxlen; in hfcpci_empty_fifo_trans() local
408 if (!(fcnt = *z1r - *z2r)) in hfcpci_empty_fifo_trans()
411 if (fcnt <= 0) in hfcpci_empty_fifo_trans()
412 fcnt += B_FIFO_SIZE; /* bytes actually buffered */ in hfcpci_empty_fifo_trans()
413 if (fcnt > HFCPCI_BTRANS_THRESHOLD) in hfcpci_empty_fifo_trans()
414 fcnt = HFCPCI_BTRANS_THRESHOLD; /* limit size */ in hfcpci_empty_fifo_trans()
416 new_z2 = *z2r + fcnt; /* new position in fifo */ in hfcpci_empty_fifo_trans()
420 if (!(skb = dev_alloc_skb(fcnt))) in hfcpci_empty_fifo_trans()
423 ptr = skb_put(skb, fcnt); in hfcpci_empty_fifo_trans()
424 if (*z2r + fcnt <= B_FIFO_SIZE + B_SUB_VAL) in hfcpci_empty_fifo_trans()
425 maxlen = fcnt; /* complete transfer */ in hfcpci_empty_fifo_trans()
431 fcnt -= maxlen; in hfcpci_empty_fifo_trans()
433 if (fcnt) { /* rest remaining */ in hfcpci_empty_fifo_trans()
436 memcpy(ptr, ptr1, fcnt); /* rest */ in hfcpci_empty_fifo_trans()
520 int fcnt; in hfcpci_fill_dfifo() local
536 fcnt = df->f1 - df->f2; /* frame count actually buffered */ in hfcpci_fill_dfifo()
537 if (fcnt < 0) in hfcpci_fill_dfifo()
538 fcnt += (MAX_D_FRAMES + 1); /* if wrap around */ in hfcpci_fill_dfifo()
539 if (fcnt > (MAX_D_FRAMES - 1)) { in hfcpci_fill_dfifo()
591 int maxlen, fcnt; in hfcpci_fill_fifo() local
617 fcnt = *z2t - *z1t; in hfcpci_fill_fifo()
618 if (fcnt <= 0) in hfcpci_fill_fifo()
619 fcnt += B_FIFO_SIZE; /* fcnt contains available bytes in fifo */ in hfcpci_fill_fifo()
620 fcnt = B_FIFO_SIZE - fcnt; /* remaining bytes to send */ in hfcpci_fill_fifo()
622 while ((fcnt < 2 * HFCPCI_BTRANS_THRESHOLD) && (bcs->tx_skb)) { in hfcpci_fill_fifo()
623 if (bcs->tx_skb->len < B_FIFO_SIZE - fcnt) { in hfcpci_fill_fifo()
644 fcnt += bcs->tx_skb->len; in hfcpci_fill_fifo()
670 fcnt = bz->f1 - bz->f2; /* frame count actually buffered */ in hfcpci_fill_fifo()
671 if (fcnt < 0) in hfcpci_fill_fifo()
672 fcnt += (MAX_B_FRAMES + 1); /* if wrap around */ in hfcpci_fill_fifo()
673 if (fcnt > (MAX_B_FRAMES - 1)) { in hfcpci_fill_fifo()