• 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()
702 push_on_scq(struct idt77252_dev *card, struct vc_map *vc, struct sk_buff *skb) in push_on_scq() argument
704 struct scq_info *scq = vc->scq; in push_on_scq()
720 spin_lock_irqsave(&vc->lock, flags); in push_on_scq()
721 if (vc->estimator) { in push_on_scq()
722 struct atm_vcc *vcc = vc->tx_vcc; in push_on_scq()
725 vc->estimator->cells += (skb->len + 47) / 48; in push_on_scq()
728 u32 cps = vc->estimator->maxcps; in push_on_scq()
730 vc->estimator->cps = cps; in push_on_scq()
731 vc->estimator->avcps = cps << 5; in push_on_scq()
732 if (vc->lacr < vc->init_er) { in push_on_scq()
733 vc->lacr = vc->init_er; in push_on_scq()
734 writel(TCMDQ_LACR | (vc->lacr << 16) | in push_on_scq()
735 vc->index, SAR_REG_TCMDQ); in push_on_scq()
739 spin_unlock_irqrestore(&vc->lock, flags); in push_on_scq()
762 if (test_and_clear_bit(VCF_IDLE, &vc->flags)) { in push_on_scq()
763 writel(TCMDQ_START_LACR | (vc->lacr << 16) | vc->index, in push_on_scq()
778 card->name, vc->tx_vcc->vpi, vc->tx_vcc->vci); in push_on_scq()
790 drain_scq(struct idt77252_dev *card, struct vc_map *vc) in drain_scq() argument
792 struct scq_info *scq = vc->scq; in drain_scq()
820 if (push_on_scq(card, vc, skb)) { in drain_scq()
821 skb_queue_head(&vc->scq->pending, skb); in drain_scq()
829 queue_skb(struct idt77252_dev *card, struct vc_map *vc, in queue_skb() argument
864 if (test_bit(VCF_RSV, &vc->flags)) in queue_skb()
865 vc = card->vcs[0]; in queue_skb()
870 if (test_bit(VCF_RSV, &vc->flags)) { in queue_skb()
913 spin_lock_irqsave(&vc->scq->skblock, flags); in queue_skb()
914 skb_queue_tail(&vc->scq->pending, skb); in queue_skb()
916 while ((skb = skb_dequeue(&vc->scq->pending))) { in queue_skb()
917 if (push_on_scq(card, vc, skb)) { in queue_skb()
918 skb_queue_head(&vc->scq->pending, skb); in queue_skb()
922 spin_unlock_irqrestore(&vc->scq->skblock, flags); in queue_skb()
933 get_free_scd(struct idt77252_dev *card, struct vc_map *vc) in get_free_scd() argument
939 card->scd2vc[i] = vc; in get_free_scd()
940 vc->scd_index = i; in get_free_scd()
1014 struct vc_map *vc; in dequeue_rx() local
1050 vc = card->vcs[VPCI2VC(card, vpi, vci)]; in dequeue_rx()
1051 if (!vc || !test_bit(VCF_RX, &vc->flags)) { in dequeue_rx()
1058 vcc = vc->rx_vcc; in dequeue_rx()
1114 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()
1410 struct vc_map *vc; in idt77252_tx() local
1453 vc = card->vcs[conn & 0x1fff]; in idt77252_tx()
1454 if (!vc) { in idt77252_tx()
1461 card->name, vc->index); in idt77252_tx()
1463 set_bit(VCF_IDLE, &vc->flags); in idt77252_tx()
1470 vc = card->vcs[conn & 0x1fff]; in idt77252_tx()
1471 if (!vc) { in idt77252_tx()
1478 drain_scq(card, vc); in idt77252_tx()
1496 vc = card->vcs[VPCI2VC(card, vpi, vci)]; in idt77252_tx()
1497 if (!vc) { in idt77252_tx()
1504 drain_scq(card, vc); in idt77252_tx()
1596 __fill_tst(struct idt77252_dev *card, struct vc_map *vc, in __fill_tst() argument
1606 if (card->soft_tst[e].vc == NULL) in __fill_tst()
1615 card->name, vc ? vc->index : -1, e); in __fill_tst()
1620 if (vc && (opc != TSTE_OPC_NULL)) in __fill_tst()
1621 data = opc | vc->index; in __fill_tst()
1629 if ((cl >= avail) && (card->soft_tst[e].vc == NULL)) { in __fill_tst()
1630 if (vc) in __fill_tst()
1631 card->soft_tst[e].vc = vc; in __fill_tst()
1633 card->soft_tst[e].vc = (void *)-1; in __fill_tst()
1656 fill_tst(struct idt77252_dev *card, struct vc_map *vc, int n, unsigned int opc) in fill_tst() argument
1663 res = __fill_tst(card, vc, n, opc); in fill_tst()
1674 __clear_tst(struct idt77252_dev *card, struct vc_map *vc) in __clear_tst() argument
1682 if (card->soft_tst[e].vc == vc) { in __clear_tst()
1683 card->soft_tst[e].vc = NULL; in __clear_tst()
1699 clear_tst(struct idt77252_dev *card, struct vc_map *vc) in clear_tst() argument
1706 res = __clear_tst(card, vc); in clear_tst()
1717 change_tst(struct idt77252_dev *card, struct vc_map *vc, in change_tst() argument
1725 __clear_tst(card, vc); in change_tst()
1726 res = __fill_tst(card, vc, n, opc); in change_tst()
1738 set_tct(struct idt77252_dev *card, struct vc_map *vc) in set_tct() argument
1742 tct = (unsigned long) (card->tct_base + vc->index * SAR_SRAM_TCT_SIZE); in set_tct()
1744 switch (vc->class) { in set_tct()
1747 card->name, tct, vc->scq->scd); in set_tct()
1749 write_sram(card, tct + 0, TCT_CBR | vc->scq->scd); in set_tct()
1761 card->name, tct, vc->scq->scd); in set_tct()
1763 write_sram(card, tct + 0, TCT_UBR | vc->scq->scd); in set_tct()
1768 write_sram(card, tct + 5, vc->init_er); in set_tct()
1950 struct vc_map *vc = vcc->dev_data; in idt77252_send_skb() local
1953 if (vc == NULL) { in idt77252_send_skb()
1959 if (!test_bit(VCF_TX, &vc->flags)) { in idt77252_send_skb()
1986 err = queue_skb(card, vc, skb, oam); in idt77252_send_skb()
2080 struct vc_map *vc = (struct vc_map *)data; in idt77252_est_timer() local
2081 struct idt77252_dev *card = vc->card; in idt77252_est_timer()
2088 spin_lock_irqsave(&vc->lock, flags); in idt77252_est_timer()
2089 est = vc->estimator; in idt77252_est_timer()
2105 if (lacr > vc->max_er) in idt77252_est_timer()
2106 lacr = vc->max_er; in idt77252_est_timer()
2108 if (lacr != vc->lacr) { in idt77252_est_timer()
2109 vc->lacr = lacr; in idt77252_est_timer()
2110 writel(TCMDQ_LACR|(vc->lacr << 16)|vc->index, SAR_REG_TCMDQ); in idt77252_est_timer()
2117 spin_unlock_irqrestore(&vc->lock, flags); in idt77252_est_timer()
2121 idt77252_init_est(struct vc_map *vc, int pcr) in idt77252_init_est() argument
2135 est->timer.data = (unsigned long)vc; in idt77252_init_est()
2145 idt77252_init_cbr(struct idt77252_dev *card, struct vc_map *vc, in idt77252_init_cbr() argument
2161 if (test_bit(VCF_TX, &vc->flags)) in idt77252_init_cbr()
2162 tst_used = vc->ntste; in idt77252_init_cbr()
2196 vc->ntste = tst_entries; in idt77252_init_cbr()
2199 if (test_bit(VCF_TX, &vc->flags)) { in idt77252_init_cbr()
2205 change_tst(card, vc, tst_entries, TSTE_OPC_CBR); in idt77252_init_cbr()
2210 fill_tst(card, vc, tst_entries, TSTE_OPC_CBR); in idt77252_init_cbr()
2215 idt77252_init_ubr(struct idt77252_dev *card, struct vc_map *vc, in idt77252_init_ubr() argument
2221 spin_lock_irqsave(&vc->lock, flags); in idt77252_init_ubr()
2222 if (vc->estimator) { in idt77252_init_ubr()
2223 del_timer(&vc->estimator->timer); in idt77252_init_ubr()
2224 kfree(vc->estimator); in idt77252_init_ubr()
2225 vc->estimator = NULL; in idt77252_init_ubr()
2227 spin_unlock_irqrestore(&vc->lock, flags); in idt77252_init_ubr()
2233 vc->estimator = idt77252_init_est(vc, tcr); in idt77252_init_ubr()
2235 vc->class = SCHED_UBR; in idt77252_init_ubr()
2236 vc->init_er = idt77252_rate_logindex(card, tcr); in idt77252_init_ubr()
2237 vc->lacr = vc->init_er; in idt77252_init_ubr()
2239 vc->max_er = vc->init_er; in idt77252_init_ubr()
2241 vc->max_er = 0xff; in idt77252_init_ubr()
2247 idt77252_init_tx(struct idt77252_dev *card, struct vc_map *vc, in idt77252_init_tx() argument
2252 if (test_bit(VCF_TX, &vc->flags)) in idt77252_init_tx()
2257 vc->class = SCHED_CBR; in idt77252_init_tx()
2261 vc->class = SCHED_UBR; in idt77252_init_tx()
2270 vc->scq = alloc_scq(card, vc->class); in idt77252_init_tx()
2271 if (!vc->scq) { in idt77252_init_tx()
2276 vc->scq->scd = get_free_scd(card, vc); in idt77252_init_tx()
2277 if (vc->scq->scd == 0) { in idt77252_init_tx()
2279 free_scq(card, vc->scq); in idt77252_init_tx()
2283 fill_scd(card, vc->scq, vc->class); in idt77252_init_tx()
2285 if (set_tct(card, vc)) { 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 switch (vc->class) { in idt77252_init_tx()
2296 error = idt77252_init_cbr(card, vc, vcc, qos); in idt77252_init_tx()
2298 card->scd2vc[vc->scd_index] = NULL; in idt77252_init_tx()
2299 free_scq(card, vc->scq); in idt77252_init_tx()
2303 clear_bit(VCF_IDLE, &vc->flags); in idt77252_init_tx()
2304 writel(TCMDQ_START | vc->index, SAR_REG_TCMDQ); in idt77252_init_tx()
2308 error = idt77252_init_ubr(card, vc, vcc, qos); in idt77252_init_tx()
2310 card->scd2vc[vc->scd_index] = NULL; in idt77252_init_tx()
2311 free_scq(card, vc->scq); in idt77252_init_tx()
2315 set_bit(VCF_IDLE, &vc->flags); in idt77252_init_tx()
2319 vc->tx_vcc = vcc; in idt77252_init_tx()
2320 set_bit(VCF_TX, &vc->flags); in idt77252_init_tx()
2325 idt77252_init_rx(struct idt77252_dev *card, struct vc_map *vc, in idt77252_init_rx() argument
2332 if (test_bit(VCF_RX, &vc->flags)) in idt77252_init_rx()
2335 vc->rx_vcc = vcc; in idt77252_init_rx()
2336 set_bit(VCF_RX, &vc->flags); in idt77252_init_rx()
2341 flush_rx_pool(card, &vc->rcv.rx_pool); in idt77252_init_rx()
2375 addr = card->rct_base + (vc->index << 2); in idt77252_init_rx()
2393 struct vc_map *vc; in idt77252_open() local
2443 vc = card->vcs[index]; in idt77252_open()
2445 vcc->dev_data = vc; in idt77252_open()
2448 card->name, vc->index, vcc->vpi, vcc->vci, in idt77252_open()
2455 test_bit(VCF_TX, &vc->flags)) in idt77252_open()
2458 test_bit(VCF_RX, &vc->flags)) in idt77252_open()
2469 error = idt77252_init_tx(card, vc, vcc, &vcc->qos); in idt77252_open()
2477 error = idt77252_init_rx(card, vc, vcc, &vcc->qos); in idt77252_open()
2495 struct vc_map *vc = vcc->dev_data; in idt77252_close() local
2503 card->name, vc->index, vcc->vpi, vcc->vci); in idt77252_close()
2509 spin_lock_irqsave(&vc->lock, flags); in idt77252_close()
2510 clear_bit(VCF_RX, &vc->flags); in idt77252_close()
2511 vc->rx_vcc = NULL; in idt77252_close()
2512 spin_unlock_irqrestore(&vc->lock, flags); in idt77252_close()
2517 addr = card->rct_base + vc->index * SAR_SRAM_RCT_SIZE; in idt77252_close()
2524 if (skb_queue_len(&vc->rcv.rx_pool.queue) != 0) { in idt77252_close()
2528 recycle_rx_pool_skb(card, &vc->rcv.rx_pool); in idt77252_close()
2535 spin_lock_irqsave(&vc->lock, flags); in idt77252_close()
2536 clear_bit(VCF_TX, &vc->flags); in idt77252_close()
2537 clear_bit(VCF_IDLE, &vc->flags); in idt77252_close()
2538 clear_bit(VCF_RSV, &vc->flags); in idt77252_close()
2539 vc->tx_vcc = NULL; in idt77252_close()
2541 if (vc->estimator) { in idt77252_close()
2542 del_timer(&vc->estimator->timer); in idt77252_close()
2543 kfree(vc->estimator); in idt77252_close()
2544 vc->estimator = NULL; in idt77252_close()
2546 spin_unlock_irqrestore(&vc->lock, flags); in idt77252_close()
2549 while (atomic_read(&vc->scq->used) > 0) { in idt77252_close()
2553 card->name, atomic_read(&vc->scq->used)); in idt77252_close()
2558 writel(TCMDQ_HALT | vc->index, SAR_REG_TCMDQ); in idt77252_close()
2559 clear_scd(card, vc->scq, vc->class); in idt77252_close()
2561 if (vc->class == SCHED_CBR) { in idt77252_close()
2562 clear_tst(card, vc); in idt77252_close()
2563 card->tst_free += vc->ntste; in idt77252_close()
2564 vc->ntste = 0; in idt77252_close()
2567 card->scd2vc[vc->scd_index] = NULL; in idt77252_close()
2568 free_scq(card, vc->scq); in idt77252_close()
2579 struct vc_map *vc = vcc->dev_data; in idt77252_change_qos() local
2585 if (!test_bit(VCF_TX, &vc->flags)) { in idt77252_change_qos()
2586 error = idt77252_init_tx(card, vc, vcc, qos); in idt77252_change_qos()
2592 error = idt77252_init_cbr(card, vc, vcc, qos); in idt77252_change_qos()
2598 error = idt77252_init_ubr(card, vc, vcc, qos); in idt77252_change_qos()
2602 if (!test_bit(VCF_IDLE, &vc->flags)) { in idt77252_change_qos()
2603 writel(TCMDQ_LACR | (vc->lacr << 16) | in idt77252_change_qos()
2604 vc->index, SAR_REG_TCMDQ); in idt77252_change_qos()
2617 !test_bit(VCF_RX, &vc->flags)) { in idt77252_change_qos()
2618 error = idt77252_init_rx(card, vc, vcc, qos); in idt77252_change_qos()
2673 struct vc_map *vc; in idt77252_proc_read() local
2676 vc = card->vcs[i]; in idt77252_proc_read()
2677 if (!vc) in idt77252_proc_read()
2681 if (vc->tx_vcc) in idt77252_proc_read()
2682 vcc = vc->tx_vcc; in idt77252_proc_read()
2854 struct vc_map *vc; in open_card_oam() local
2863 vc = kzalloc(sizeof(struct vc_map), GFP_KERNEL); in open_card_oam()
2864 if (!vc) { in open_card_oam()
2868 vc->index = index; in open_card_oam()
2869 card->vcs[index] = vc; in open_card_oam()
2871 flush_rx_pool(card, &vc->rcv.rx_pool); in open_card_oam()
2878 addr = card->rct_base + (vc->index << 2); in open_card_oam()
2897 struct vc_map *vc; in close_card_oam() local
2904 vc = card->vcs[index]; in close_card_oam()
2906 addr = card->rct_base + vc->index * SAR_SRAM_RCT_SIZE; in close_card_oam()
2914 if (skb_queue_len(&vc->rcv.rx_pool.queue) != 0) { in close_card_oam()
2919 recycle_rx_pool_skb(card, &vc->rcv.rx_pool); in close_card_oam()
2928 struct vc_map *vc; in open_card_ubr0() local
2930 vc = kzalloc(sizeof(struct vc_map), GFP_KERNEL); in open_card_ubr0()
2931 if (!vc) { in open_card_ubr0()
2935 card->vcs[0] = vc; in open_card_ubr0()
2936 vc->class = SCHED_UBR0; in open_card_ubr0()
2938 vc->scq = alloc_scq(card, vc->class); in open_card_ubr0()
2939 if (!vc->scq) { in open_card_ubr0()
2944 card->scd2vc[0] = vc; in open_card_ubr0()
2945 vc->scd_index = 0; in open_card_ubr0()
2946 vc->scq->scd = card->scd_base; in open_card_ubr0()
2948 fill_scd(card, vc->scq, vc->class); in open_card_ubr0()
2959 clear_bit(VCF_IDLE, &vc->flags); in open_card_ubr0()
3442 card->soft_tst[i].vc = NULL; in init_card()