• Home
  • Raw
  • Download

Lines Matching refs:vc

550 	struct vc_map *vc;  in idt77252_tx_dump()  local
555 vc = card->vcs[i]; in idt77252_tx_dump()
556 if (!vc) in idt77252_tx_dump()
560 if (vc->rx_vcc) in idt77252_tx_dump()
561 vcc = vc->rx_vcc; in idt77252_tx_dump()
562 else if (vc->tx_vcc) in idt77252_tx_dump()
563 vcc = vc->tx_vcc; in idt77252_tx_dump()
568 printk("%s: Connection %d:\n", card->name, vc->index); in idt77252_tx_dump()
569 dump_tct(card, vc->index); in idt77252_tx_dump()
703 push_on_scq(struct idt77252_dev *card, struct vc_map *vc, struct sk_buff *skb) in push_on_scq() argument
705 struct scq_info *scq = vc->scq; in push_on_scq()
721 spin_lock_irqsave(&vc->lock, flags); in push_on_scq()
722 if (vc->estimator) { in push_on_scq()
723 struct atm_vcc *vcc = vc->tx_vcc; in push_on_scq()
726 vc->estimator->cells += (skb->len + 47) / 48; in push_on_scq()
729 u32 cps = vc->estimator->maxcps; in push_on_scq()
731 vc->estimator->cps = cps; in push_on_scq()
732 vc->estimator->avcps = cps << 5; in push_on_scq()
733 if (vc->lacr < vc->init_er) { in push_on_scq()
734 vc->lacr = vc->init_er; in push_on_scq()
735 writel(TCMDQ_LACR | (vc->lacr << 16) | in push_on_scq()
736 vc->index, SAR_REG_TCMDQ); in push_on_scq()
740 spin_unlock_irqrestore(&vc->lock, flags); in push_on_scq()
763 if (test_and_clear_bit(VCF_IDLE, &vc->flags)) { in push_on_scq()
764 writel(TCMDQ_START_LACR | (vc->lacr << 16) | vc->index, in push_on_scq()
779 card->name, vc->tx_vcc->vpi, vc->tx_vcc->vci); in push_on_scq()
791 drain_scq(struct idt77252_dev *card, struct vc_map *vc) in drain_scq() argument
793 struct scq_info *scq = vc->scq; in drain_scq()
821 if (push_on_scq(card, vc, skb)) { in drain_scq()
822 skb_queue_head(&vc->scq->pending, skb); in drain_scq()
830 queue_skb(struct idt77252_dev *card, struct vc_map *vc, in queue_skb() argument
867 if (test_bit(VCF_RSV, &vc->flags)) in queue_skb()
868 vc = card->vcs[0]; in queue_skb()
873 if (test_bit(VCF_RSV, &vc->flags)) { in queue_skb()
915 spin_lock_irqsave(&vc->scq->skblock, flags); in queue_skb()
916 skb_queue_tail(&vc->scq->pending, skb); in queue_skb()
918 while ((skb = skb_dequeue(&vc->scq->pending))) { in queue_skb()
919 if (push_on_scq(card, vc, skb)) { in queue_skb()
920 skb_queue_head(&vc->scq->pending, skb); in queue_skb()
924 spin_unlock_irqrestore(&vc->scq->skblock, flags); in queue_skb()
935 get_free_scd(struct idt77252_dev *card, struct vc_map *vc) in get_free_scd() argument
941 card->scd2vc[i] = vc; in get_free_scd()
942 vc->scd_index = i; in get_free_scd()
1016 struct vc_map *vc; in dequeue_rx() local
1052 vc = card->vcs[VPCI2VC(card, vpi, vci)]; in dequeue_rx()
1053 if (!vc || !test_bit(VCF_RX, &vc->flags)) { in dequeue_rx()
1060 vcc = vc->rx_vcc; in dequeue_rx()
1115 rpp = &vc->rcv.rx_pool; in dequeue_rx()
1242 struct vc_map *vc; in idt77252_rx_raw() local
1292 vc = card->vcs[VPCI2VC(card, vpi, vci)]; in idt77252_rx_raw()
1293 if (!vc || !test_bit(VCF_RX, &vc->flags)) { in idt77252_rx_raw()
1299 vcc = vc->rx_vcc; in idt77252_rx_raw()
1408 struct vc_map *vc; in idt77252_tx() local
1451 vc = card->vcs[conn & 0x1fff]; in idt77252_tx()
1452 if (!vc) { in idt77252_tx()
1459 card->name, vc->index); in idt77252_tx()
1461 set_bit(VCF_IDLE, &vc->flags); in idt77252_tx()
1468 vc = card->vcs[conn & 0x1fff]; in idt77252_tx()
1469 if (!vc) { in idt77252_tx()
1476 drain_scq(card, vc); in idt77252_tx()
1494 vc = card->vcs[VPCI2VC(card, vpi, vci)]; in idt77252_tx()
1495 if (!vc) { in idt77252_tx()
1502 drain_scq(card, vc); in idt77252_tx()
1594 __fill_tst(struct idt77252_dev *card, struct vc_map *vc, in __fill_tst() argument
1604 if (card->soft_tst[e].vc == NULL) in __fill_tst()
1613 card->name, vc ? vc->index : -1, e); in __fill_tst()
1618 if (vc && (opc != TSTE_OPC_NULL)) in __fill_tst()
1619 data = opc | vc->index; in __fill_tst()
1627 if ((cl >= avail) && (card->soft_tst[e].vc == NULL)) { in __fill_tst()
1628 if (vc) in __fill_tst()
1629 card->soft_tst[e].vc = vc; in __fill_tst()
1631 card->soft_tst[e].vc = (void *)-1; in __fill_tst()
1654 fill_tst(struct idt77252_dev *card, struct vc_map *vc, int n, unsigned int opc) in fill_tst() argument
1661 res = __fill_tst(card, vc, n, opc); in fill_tst()
1672 __clear_tst(struct idt77252_dev *card, struct vc_map *vc) in __clear_tst() argument
1680 if (card->soft_tst[e].vc == vc) { in __clear_tst()
1681 card->soft_tst[e].vc = NULL; in __clear_tst()
1697 clear_tst(struct idt77252_dev *card, struct vc_map *vc) in clear_tst() argument
1704 res = __clear_tst(card, vc); in clear_tst()
1715 change_tst(struct idt77252_dev *card, struct vc_map *vc, in change_tst() argument
1723 __clear_tst(card, vc); in change_tst()
1724 res = __fill_tst(card, vc, n, opc); in change_tst()
1736 set_tct(struct idt77252_dev *card, struct vc_map *vc) in set_tct() argument
1740 tct = (unsigned long) (card->tct_base + vc->index * SAR_SRAM_TCT_SIZE); in set_tct()
1742 switch (vc->class) { in set_tct()
1745 card->name, tct, vc->scq->scd); in set_tct()
1747 write_sram(card, tct + 0, TCT_CBR | vc->scq->scd); in set_tct()
1759 card->name, tct, vc->scq->scd); in set_tct()
1761 write_sram(card, tct + 0, TCT_UBR | vc->scq->scd); in set_tct()
1766 write_sram(card, tct + 5, vc->init_er); in set_tct()
1942 struct vc_map *vc = vcc->dev_data; in idt77252_send_skb() local
1945 if (vc == NULL) { in idt77252_send_skb()
1951 if (!test_bit(VCF_TX, &vc->flags)) { in idt77252_send_skb()
1978 err = queue_skb(card, vc, skb, oam); in idt77252_send_skb()
2073 struct vc_map *vc = est->vc; in idt77252_est_timer() local
2074 struct idt77252_dev *card = vc->card; in idt77252_est_timer()
2080 spin_lock_irqsave(&vc->lock, flags); in idt77252_est_timer()
2081 if (!vc->estimator) in idt77252_est_timer()
2095 if (lacr > vc->max_er) in idt77252_est_timer()
2096 lacr = vc->max_er; in idt77252_est_timer()
2098 if (lacr != vc->lacr) { in idt77252_est_timer()
2099 vc->lacr = lacr; in idt77252_est_timer()
2100 writel(TCMDQ_LACR|(vc->lacr << 16)|vc->index, SAR_REG_TCMDQ); in idt77252_est_timer()
2107 spin_unlock_irqrestore(&vc->lock, flags); in idt77252_est_timer()
2111 idt77252_init_est(struct vc_map *vc, int pcr) in idt77252_init_est() argument
2121 est->vc = vc; in idt77252_init_est()
2132 idt77252_init_cbr(struct idt77252_dev *card, struct vc_map *vc, in idt77252_init_cbr() argument
2148 if (test_bit(VCF_TX, &vc->flags)) in idt77252_init_cbr()
2149 tst_used = vc->ntste; in idt77252_init_cbr()
2183 vc->ntste = tst_entries; in idt77252_init_cbr()
2186 if (test_bit(VCF_TX, &vc->flags)) { in idt77252_init_cbr()
2192 change_tst(card, vc, tst_entries, TSTE_OPC_CBR); in idt77252_init_cbr()
2197 fill_tst(card, vc, tst_entries, TSTE_OPC_CBR); in idt77252_init_cbr()
2202 idt77252_init_ubr(struct idt77252_dev *card, struct vc_map *vc, in idt77252_init_ubr() argument
2209 spin_lock_irqsave(&vc->lock, flags); in idt77252_init_ubr()
2210 if (vc->estimator) { in idt77252_init_ubr()
2211 est = vc->estimator; in idt77252_init_ubr()
2212 vc->estimator = NULL; in idt77252_init_ubr()
2214 spin_unlock_irqrestore(&vc->lock, flags); in idt77252_init_ubr()
2224 vc->estimator = idt77252_init_est(vc, tcr); in idt77252_init_ubr()
2226 vc->class = SCHED_UBR; in idt77252_init_ubr()
2227 vc->init_er = idt77252_rate_logindex(card, tcr); in idt77252_init_ubr()
2228 vc->lacr = vc->init_er; in idt77252_init_ubr()
2230 vc->max_er = vc->init_er; in idt77252_init_ubr()
2232 vc->max_er = 0xff; in idt77252_init_ubr()
2238 idt77252_init_tx(struct idt77252_dev *card, struct vc_map *vc, in idt77252_init_tx() argument
2243 if (test_bit(VCF_TX, &vc->flags)) in idt77252_init_tx()
2248 vc->class = SCHED_CBR; in idt77252_init_tx()
2252 vc->class = SCHED_UBR; in idt77252_init_tx()
2261 vc->scq = alloc_scq(card, vc->class); in idt77252_init_tx()
2262 if (!vc->scq) { in idt77252_init_tx()
2267 vc->scq->scd = get_free_scd(card, vc); in idt77252_init_tx()
2268 if (vc->scq->scd == 0) { in idt77252_init_tx()
2270 free_scq(card, vc->scq); in idt77252_init_tx()
2274 fill_scd(card, vc->scq, vc->class); in idt77252_init_tx()
2276 if (set_tct(card, vc)) { in idt77252_init_tx()
2280 card->scd2vc[vc->scd_index] = NULL; in idt77252_init_tx()
2281 free_scq(card, vc->scq); in idt77252_init_tx()
2285 switch (vc->class) { in idt77252_init_tx()
2287 error = idt77252_init_cbr(card, vc, vcc, qos); in idt77252_init_tx()
2289 card->scd2vc[vc->scd_index] = NULL; in idt77252_init_tx()
2290 free_scq(card, vc->scq); in idt77252_init_tx()
2294 clear_bit(VCF_IDLE, &vc->flags); in idt77252_init_tx()
2295 writel(TCMDQ_START | vc->index, SAR_REG_TCMDQ); in idt77252_init_tx()
2299 error = idt77252_init_ubr(card, vc, vcc, qos); in idt77252_init_tx()
2301 card->scd2vc[vc->scd_index] = NULL; in idt77252_init_tx()
2302 free_scq(card, vc->scq); in idt77252_init_tx()
2306 set_bit(VCF_IDLE, &vc->flags); in idt77252_init_tx()
2310 vc->tx_vcc = vcc; in idt77252_init_tx()
2311 set_bit(VCF_TX, &vc->flags); in idt77252_init_tx()
2316 idt77252_init_rx(struct idt77252_dev *card, struct vc_map *vc, in idt77252_init_rx() argument
2323 if (test_bit(VCF_RX, &vc->flags)) in idt77252_init_rx()
2326 vc->rx_vcc = vcc; in idt77252_init_rx()
2327 set_bit(VCF_RX, &vc->flags); in idt77252_init_rx()
2332 flush_rx_pool(card, &vc->rcv.rx_pool); in idt77252_init_rx()
2366 addr = card->rct_base + (vc->index << 2); in idt77252_init_rx()
2384 struct vc_map *vc; in idt77252_open() local
2434 vc = card->vcs[index]; in idt77252_open()
2436 vcc->dev_data = vc; in idt77252_open()
2439 card->name, vc->index, vcc->vpi, vcc->vci, in idt77252_open()
2446 test_bit(VCF_TX, &vc->flags)) in idt77252_open()
2449 test_bit(VCF_RX, &vc->flags)) in idt77252_open()
2460 error = idt77252_init_tx(card, vc, vcc, &vcc->qos); in idt77252_open()
2468 error = idt77252_init_rx(card, vc, vcc, &vcc->qos); in idt77252_open()
2486 struct vc_map *vc = vcc->dev_data; in idt77252_close() local
2494 card->name, vc->index, vcc->vpi, vcc->vci); in idt77252_close()
2500 spin_lock_irqsave(&vc->lock, flags); in idt77252_close()
2501 clear_bit(VCF_RX, &vc->flags); in idt77252_close()
2502 vc->rx_vcc = NULL; in idt77252_close()
2503 spin_unlock_irqrestore(&vc->lock, flags); in idt77252_close()
2508 addr = card->rct_base + vc->index * SAR_SRAM_RCT_SIZE; in idt77252_close()
2515 if (skb_queue_len(&vc->rcv.rx_pool.queue) != 0) { in idt77252_close()
2519 recycle_rx_pool_skb(card, &vc->rcv.rx_pool); in idt77252_close()
2526 spin_lock_irqsave(&vc->lock, flags); in idt77252_close()
2527 clear_bit(VCF_TX, &vc->flags); in idt77252_close()
2528 clear_bit(VCF_IDLE, &vc->flags); in idt77252_close()
2529 clear_bit(VCF_RSV, &vc->flags); in idt77252_close()
2530 vc->tx_vcc = NULL; in idt77252_close()
2532 if (vc->estimator) { in idt77252_close()
2533 del_timer(&vc->estimator->timer); in idt77252_close()
2534 kfree(vc->estimator); in idt77252_close()
2535 vc->estimator = NULL; in idt77252_close()
2537 spin_unlock_irqrestore(&vc->lock, flags); in idt77252_close()
2540 while (atomic_read(&vc->scq->used) > 0) { in idt77252_close()
2544 card->name, atomic_read(&vc->scq->used)); in idt77252_close()
2549 writel(TCMDQ_HALT | vc->index, SAR_REG_TCMDQ); in idt77252_close()
2550 clear_scd(card, vc->scq, vc->class); in idt77252_close()
2552 if (vc->class == SCHED_CBR) { in idt77252_close()
2553 clear_tst(card, vc); in idt77252_close()
2554 card->tst_free += vc->ntste; in idt77252_close()
2555 vc->ntste = 0; in idt77252_close()
2558 card->scd2vc[vc->scd_index] = NULL; in idt77252_close()
2559 free_scq(card, vc->scq); in idt77252_close()
2570 struct vc_map *vc = vcc->dev_data; in idt77252_change_qos() local
2576 if (!test_bit(VCF_TX, &vc->flags)) { in idt77252_change_qos()
2577 error = idt77252_init_tx(card, vc, vcc, qos); in idt77252_change_qos()
2583 error = idt77252_init_cbr(card, vc, vcc, qos); in idt77252_change_qos()
2589 error = idt77252_init_ubr(card, vc, vcc, qos); in idt77252_change_qos()
2593 if (!test_bit(VCF_IDLE, &vc->flags)) { in idt77252_change_qos()
2594 writel(TCMDQ_LACR | (vc->lacr << 16) | in idt77252_change_qos()
2595 vc->index, SAR_REG_TCMDQ); in idt77252_change_qos()
2608 !test_bit(VCF_RX, &vc->flags)) { in idt77252_change_qos()
2609 error = idt77252_init_rx(card, vc, vcc, qos); in idt77252_change_qos()
2664 struct vc_map *vc; in idt77252_proc_read() local
2667 vc = card->vcs[i]; in idt77252_proc_read()
2668 if (!vc) in idt77252_proc_read()
2672 if (vc->tx_vcc) in idt77252_proc_read()
2673 vcc = vc->tx_vcc; in idt77252_proc_read()
2845 struct vc_map *vc; in open_card_oam() local
2854 vc = kzalloc(sizeof(struct vc_map), GFP_KERNEL); in open_card_oam()
2855 if (!vc) { in open_card_oam()
2859 vc->index = index; in open_card_oam()
2860 card->vcs[index] = vc; in open_card_oam()
2862 flush_rx_pool(card, &vc->rcv.rx_pool); in open_card_oam()
2869 addr = card->rct_base + (vc->index << 2); in open_card_oam()
2888 struct vc_map *vc; in close_card_oam() local
2895 vc = card->vcs[index]; in close_card_oam()
2897 addr = card->rct_base + vc->index * SAR_SRAM_RCT_SIZE; in close_card_oam()
2905 if (skb_queue_len(&vc->rcv.rx_pool.queue) != 0) { in close_card_oam()
2910 recycle_rx_pool_skb(card, &vc->rcv.rx_pool); in close_card_oam()
2912 kfree(vc); in close_card_oam()
2920 struct vc_map *vc; in open_card_ubr0() local
2922 vc = kzalloc(sizeof(struct vc_map), GFP_KERNEL); in open_card_ubr0()
2923 if (!vc) { in open_card_ubr0()
2927 card->vcs[0] = vc; in open_card_ubr0()
2928 vc->class = SCHED_UBR0; in open_card_ubr0()
2930 vc->scq = alloc_scq(card, vc->class); in open_card_ubr0()
2931 if (!vc->scq) { in open_card_ubr0()
2938 card->scd2vc[0] = vc; in open_card_ubr0()
2939 vc->scd_index = 0; in open_card_ubr0()
2940 vc->scq->scd = card->scd_base; in open_card_ubr0()
2942 fill_scd(card, vc->scq, vc->class); in open_card_ubr0()
2953 clear_bit(VCF_IDLE, &vc->flags); in open_card_ubr0()
2961 struct vc_map *vc = card->vcs[0]; in close_card_ubr0() local
2963 free_scq(card, vc->scq); in close_card_ubr0()
2964 kfree(vc); in close_card_ubr0()
3443 card->soft_tst[i].vc = NULL; in init_card()