Lines Matching full:vcc

307 static void rx_ident_err(struct atm_vcc *vcc)  in rx_ident_err()  argument
313 dev = vcc->dev; in rx_ident_err()
319 eni_vcc = ENI_VCC(vcc); in rx_ident_err()
322 printk(KERN_ALERT " VCI %d, rxing %d, words %ld\n",vcc->vci, in rx_ident_err()
338 static int do_rx_dma(struct atm_vcc *vcc,struct sk_buff *skb, in do_rx_dma() argument
349 eni_dev = ENI_DEV(vcc->dev); in do_rx_dma()
350 eni_vcc = ENI_VCC(vcc); in do_rx_dma()
360 "mis-aligned RX data (0x%lx)\n",vcc->dev->number, in do_rx_dma()
361 vcc->vci,(unsigned long) paddr); in do_rx_dma()
364 ATM_SKB(skb)->vcc = vcc; in do_rx_dma()
369 dma[j++] = (here << MID_DMA_COUNT_SHIFT) | (vcc->vci in do_rx_dma()
390 (vcc->vci << MID_DMA_VCI_SHIFT); in do_rx_dma()
398 MID_DMA_COUNT_SHIFT) | (vcc->vci << in do_rx_dma()
408 MID_DMA_COUNT_SHIFT) | (vcc->vci << in do_rx_dma()
418 MID_DMA_COUNT_SHIFT) | (vcc->vci << in do_rx_dma()
428 MID_DMA_COUNT_SHIFT) | (vcc->vci << in do_rx_dma()
437 | (vcc->vci << MID_DMA_VCI_SHIFT); in do_rx_dma()
443 (vcc->vci << MID_DMA_VCI_SHIFT) | MID_DT_JK; in do_rx_dma()
460 vcc->dev->number); in do_rx_dma()
488 static void discard(struct atm_vcc *vcc,unsigned long size) in discard() argument
492 eni_vcc = ENI_VCC(vcc); in discard()
494 while (do_rx_dma(vcc,NULL,1,size,0)) EVENT("BUSY LOOP",0,0); in discard()
506 static int rx_aal0(struct atm_vcc *vcc) in rx_aal0() argument
514 eni_vcc = ENI_VCC(vcc); in rx_aal0()
517 rx_ident_err(vcc); in rx_aal0()
522 vcc->dev->number); in rx_aal0()
524 atomic_inc(&vcc->stats->rx_err); in rx_aal0()
529 skb = length ? atm_alloc_charge(vcc,length,GFP_ATOMIC) : NULL; in rx_aal0()
531 discard(vcc,length >> 2); in rx_aal0()
537 if (do_rx_dma(vcc,skb,1,length >> 2,length >> 2)) return 1; in rx_aal0()
543 static int rx_aal5(struct atm_vcc *vcc) in rx_aal5() argument
552 eni_vcc = ENI_VCC(vcc); in rx_aal5()
555 rx_ident_err(vcc); in rx_aal5()
562 vcc->dev->number); in rx_aal5()
571 vcc->dev->number); in rx_aal5()
579 atomic_inc(&vcc->stats->rx_err); in rx_aal5()
594 vcc->dev->number,vcc->vci,length,size << 2,descr); in rx_aal5()
596 atomic_inc(&vcc->stats->rx_err); in rx_aal5()
599 skb = eff ? atm_alloc_charge(vcc,eff << 2,GFP_ATOMIC) : NULL; in rx_aal5()
601 discard(vcc,size); in rx_aal5()
606 if (do_rx_dma(vcc,skb,1,size,eff)) return 1; in rx_aal5()
612 static inline int rx_vcc(struct atm_vcc *vcc) in rx_vcc() argument
618 eni_vcc = ENI_VCC(vcc); in rx_vcc()
619 vci_dsc = ENI_DEV(vcc->dev)->vci+vcc->vci*16; in rx_vcc()
625 DPRINTK("CB_DESCR %ld REG_DESCR %d\n",ENI_VCC(vcc)->descr, in rx_vcc()
628 if (ENI_VCC(vcc)->rx(vcc)) return 1; in rx_vcc()
638 while (ENI_VCC(vcc)->descr != (tmp = (readl(vci_dsc+4) & MID_VCI_DESCR) in rx_vcc()
642 DPRINTK("CB_DESCR %ld REG_DESCR %d\n",ENI_VCC(vcc)->descr, in rx_vcc()
645 if (ENI_VCC(vcc)->rx(vcc)) return 1; in rx_vcc()
679 struct atm_vcc *vcc; in get_service() local
687 vcc = eni_dev->rx_map[vci & 1023]; in get_service()
688 if (!vcc) { in get_service()
695 if (ENI_VCC(vcc)->next != ENI_VCC_NOS) { in get_service()
697 DPRINTK("Grr, servicing VCC %ld twice\n",vci); in get_service()
700 ENI_VCC(vcc)->timestamp = ktime_get_real(); in get_service()
701 ENI_VCC(vcc)->next = NULL; in get_service()
702 if (vcc->qos.rxtp.traffic_class == ATM_CBR) { in get_service()
704 ENI_VCC(eni_dev->last_fast)->next = vcc; in get_service()
705 else eni_dev->fast = vcc; in get_service()
706 eni_dev->last_fast = vcc; in get_service()
710 ENI_VCC(eni_dev->last_slow)->next = vcc; in get_service()
711 else eni_dev->slow = vcc; in get_service()
712 eni_dev->last_slow = vcc; in get_service()
715 ENI_VCC(vcc)->servicing++; in get_service()
724 struct atm_vcc *vcc; in dequeue_rx() local
744 vcc = ATM_SKB(skb)->vcc; in dequeue_rx()
745 eni_vcc = ENI_VCC(vcc); in dequeue_rx()
747 vci_dsc = eni_dev->vci+vcc->vci*16; in dequeue_rx()
762 if (vcc->qos.aal == ATM_AAL0) in dequeue_rx()
766 vcc->push(vcc,skb); in dequeue_rx()
769 atomic_inc(&vcc->stats->rx); in dequeue_rx()
775 static int open_rx_first(struct atm_vcc *vcc) in open_rx_first() argument
782 eni_dev = ENI_DEV(vcc->dev); in open_rx_first()
783 eni_vcc = ENI_VCC(vcc); in open_rx_first()
785 if (vcc->qos.rxtp.traffic_class == ATM_NONE) return 0; in open_rx_first()
786 size = vcc->qos.rxtp.max_sdu*eni_dev->rx_mult/100; in open_rx_first()
787 if (size > MID_MAX_BUF_SIZE && vcc->qos.rxtp.max_sdu <= in open_rx_first()
794 eni_vcc->rx = vcc->qos.aal == ATM_AAL5 ? rx_aal5 : rx_aal0; in open_rx_first()
804 static int open_rx_second(struct atm_vcc *vcc) in open_rx_second() argument
813 eni_dev = ENI_DEV(vcc->dev); in open_rx_second()
814 eni_vcc = ENI_VCC(vcc); in open_rx_second()
817 here = eni_dev->vci+vcc->vci*16; in open_rx_second()
823 if (eni_dev->rx_map[vcc->vci]) in open_rx_second()
825 "in use\n",vcc->dev->number,vcc->vci); in open_rx_second()
826 eni_dev->rx_map[vcc->vci] = vcc; /* now it counts */ in open_rx_second()
827 writel(((vcc->qos.aal != ATM_AAL5 ? MID_MODE_RAW : MID_MODE_AAL5) << in open_rx_second()
835 static void close_rx(struct atm_vcc *vcc) in close_rx() argument
842 eni_vcc = ENI_VCC(vcc); in close_rx()
844 eni_dev = ENI_DEV(vcc->dev); in close_rx()
845 if (vcc->vpi != ATM_VPI_UNSPEC && vcc->vci != ATM_VCI_UNSPEC) { in close_rx()
846 here = eni_dev->vci+vcc->vci*16; in close_rx()
855 eni_dev->rx_map[vcc->vci] = NULL; in close_rx()
880 tmp = readl(eni_dev->vci+vcc->vci*16+4) & MID_VCI_READ; in close_rx()
1029 struct atm_vcc *vcc; in do_tx() local
1042 vcc = ATM_SKB(skb)->vcc; in do_tx()
1043 NULLCHECK(vcc); in do_tx()
1044 eni_dev = ENI_DEV(vcc->dev); in do_tx()
1046 eni_vcc = ENI_VCC(vcc); in do_tx()
1062 "TX data\n",vcc->dev->number,vcc->vci); in do_tx()
1070 aal5 = vcc->qos.aal == ATM_AAL5; in do_tx()
1090 vcc->dev->number,size); in do_tx()
1103 "(got only %d)\n",vcc->dev->number,dma_size,TX_DMA_BUF); in do_tx()
1109 vcc->dev->number); in do_tx()
1156 writel((vcc->vci << MID_SEG_VCI_SHIFT) | in do_tx()
1172 ENI_VCC(vcc)->txing += size; in do_tx()
1209 struct atm_vcc *vcc; in dequeue_tx() local
1217 vcc = ATM_SKB(skb)->vcc; in dequeue_tx()
1218 NULLCHECK(vcc); in dequeue_tx()
1219 tx = ENI_VCC(vcc)->tx; in dequeue_tx()
1220 NULLCHECK(ENI_VCC(vcc)->tx); in dequeue_tx()
1223 if (ENI_VCC(vcc)->txing < tx->words && ENI_PRV_POS(skb) == in dequeue_tx()
1228 ENI_VCC(vcc)->txing -= ENI_PRV_SIZE(skb); in dequeue_tx()
1231 if (vcc->pop) vcc->pop(vcc,skb); in dequeue_tx()
1233 atomic_inc(&vcc->stats->tx); in dequeue_tx()
1287 static int reserve_or_set_tx(struct atm_vcc *vcc,struct atm_trafprm *txtp, in reserve_or_set_tx() argument
1290 struct eni_dev *eni_dev = ENI_DEV(vcc->dev); in reserve_or_set_tx()
1291 struct eni_vcc *eni_vcc = ENI_VCC(vcc); in reserve_or_set_tx()
1375 static int open_tx_first(struct atm_vcc *vcc) in open_tx_first() argument
1377 ENI_VCC(vcc)->tx = NULL; in open_tx_first()
1378 if (vcc->qos.txtp.traffic_class == ATM_NONE) return 0; in open_tx_first()
1379 ENI_VCC(vcc)->txing = 0; in open_tx_first()
1380 return reserve_or_set_tx(vcc,&vcc->qos.txtp,1,1); in open_tx_first()
1384 static int open_tx_second(struct atm_vcc *vcc) in open_tx_second() argument
1390 static void close_tx(struct atm_vcc *vcc) in close_tx() argument
1396 eni_vcc = ENI_VCC(vcc); in close_tx()
1398 eni_dev = ENI_DEV(vcc->dev); in close_tx()
1894 static void eni_close(struct atm_vcc *vcc) in eni_close() argument
1897 if (!ENI_VCC(vcc)) return; in eni_close()
1898 clear_bit(ATM_VF_READY,&vcc->flags); in eni_close()
1899 close_rx(vcc); in eni_close()
1900 close_tx(vcc); in eni_close()
1903 kfree(ENI_VCC(vcc)); in eni_close()
1904 vcc->dev_data = NULL; in eni_close()
1905 clear_bit(ATM_VF_ADDR,&vcc->flags); in eni_close()
1910 static int eni_open(struct atm_vcc *vcc) in eni_open() argument
1914 short vpi = vcc->vpi; in eni_open()
1915 int vci = vcc->vci; in eni_open()
1919 if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) in eni_open()
1920 vcc->dev_data = NULL; in eni_open()
1922 set_bit(ATM_VF_ADDR,&vcc->flags); in eni_open()
1923 if (vcc->qos.aal != ATM_AAL0 && vcc->qos.aal != ATM_AAL5) in eni_open()
1925 DPRINTK(DEV_LABEL "(itf %d): open %d.%d\n",vcc->dev->number,vcc->vpi, in eni_open()
1926 vcc->vci); in eni_open()
1927 if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) { in eni_open()
1930 vcc->dev_data = eni_vcc; in eni_open()
1932 if ((error = open_rx_first(vcc))) { in eni_open()
1933 eni_close(vcc); in eni_open()
1936 if ((error = open_tx_first(vcc))) { in eni_open()
1937 eni_close(vcc); in eni_open()
1942 if ((error = open_rx_second(vcc))) { in eni_open()
1943 eni_close(vcc); in eni_open()
1946 if ((error = open_tx_second(vcc))) { in eni_open()
1947 eni_close(vcc); in eni_open()
1950 set_bit(ATM_VF_READY,&vcc->flags); in eni_open()
1956 static int eni_change_qos(struct atm_vcc *vcc,struct atm_qos *qos,int flgs) in eni_change_qos() argument
1958 struct eni_dev *eni_dev = ENI_DEV(vcc->dev); in eni_change_qos()
1959 struct eni_tx *tx = ENI_VCC(vcc)->tx; in eni_change_qos()
1973 error = reserve_or_set_tx(vcc,&qos->txtp,rsv,shp); in eni_change_qos()
1978 * segmentation buffer descriptors of this VCC. in eni_change_qos()
1984 if (ATM_SKB(skb)->vcc != vcc) continue; in eni_change_qos()
2034 static int eni_send(struct atm_vcc *vcc,struct sk_buff *skb) in eni_send() argument
2039 if (!ENI_VCC(vcc)->tx) { in eni_send()
2040 if (vcc->pop) vcc->pop(vcc,skb); in eni_send()
2046 if (vcc->pop) vcc->pop(vcc,skb); in eni_send()
2049 if (vcc->qos.aal == ATM_AAL0) { in eni_send()
2051 if (vcc->pop) vcc->pop(vcc,skb); in eni_send()
2058 ATM_SKB(skb)->vcc = vcc; in eni_send()
2059 tasklet_disable_in_atomic(&ENI_DEV(vcc->dev)->task); in eni_send()
2061 tasklet_enable(&ENI_DEV(vcc->dev)->task); in eni_send()
2063 skb_queue_tail(&ENI_VCC(vcc)->tx->backlog,skb); in eni_send()
2065 tasklet_schedule(&ENI_DEV(vcc->dev)->task); in eni_send()
2088 struct atm_vcc *vcc; in eni_proc_read() local
2166 vcc = atm_sk(s); in eni_proc_read()
2167 if (vcc->dev != dev) in eni_proc_read()
2169 eni_vcc = ENI_VCC(vcc); in eni_proc_read()
2171 length = sprintf(page,"vcc %4d: ",vcc->vci); in eni_proc_read()