Lines Matching refs:vcc
316 static void exception(struct atm_vcc *vcc)
319 struct zatm_dev *zatm_dev = ZATM_DEV(vcc->dev);
320 struct zatm_vcc *zatm_vcc = ZATM_VCC(vcc);
372 struct atm_vcc *vcc; in poll_rx() local
420 vcc = zatm_dev->rx_map[chan]; in poll_rx()
421 pos = ZATM_VCC(vcc)->pool; in poll_rx()
430 vcc = NULL; in poll_rx()
462 if (vcc) atomic_inc(&vcc->stats->rx_err); in poll_rx()
465 if (!atm_charge(vcc,skb->truesize)) { in poll_rx()
470 ATM_SKB(skb)->vcc = vcc; in poll_rx()
471 vcc->push(vcc,skb); in poll_rx()
472 atomic_inc(&vcc->stats->rx); in poll_rx()
482 static int open_rx_first(struct atm_vcc *vcc) in open_rx_first() argument
491 zatm_dev = ZATM_DEV(vcc->dev); in open_rx_first()
492 zatm_vcc = ZATM_VCC(vcc); in open_rx_first()
494 if (vcc->qos.rxtp.traffic_class == ATM_NONE) return 0; in open_rx_first()
495 if (vcc->qos.aal == ATM_AAL5) { in open_rx_first()
496 if (vcc->qos.rxtp.max_sdu > 65464) in open_rx_first()
497 vcc->qos.rxtp.max_sdu = 65464; in open_rx_first()
500 cells = DIV_ROUND_UP(vcc->qos.rxtp.max_sdu + ATM_AAL5_TRAILER, in open_rx_first()
518 use_pool(vcc->dev,zatm_vcc->pool); in open_rx_first()
524 zpokel(zatm_dev,uPD98401_RXVC_OD | (vcc->qos.aal == ATM_AAL5 ? in open_rx_first()
528 zatm_dev->rx_map[chan] = vcc; in open_rx_first()
534 static int open_rx_second(struct atm_vcc *vcc) in open_rx_second() argument
542 zatm_dev = ZATM_DEV(vcc->dev); in open_rx_second()
543 zatm_vcc = ZATM_VCC(vcc); in open_rx_second()
547 pos = vcc->vci >> 1; in open_rx_second()
548 shift = (1-(vcc->vci & 1)) << 4; in open_rx_second()
556 static void close_rx(struct atm_vcc *vcc) in close_rx() argument
563 zatm_vcc = ZATM_VCC(vcc); in close_rx()
564 zatm_dev = ZATM_DEV(vcc->dev); in close_rx()
568 if (vcc->vpi != ATM_VPI_UNSPEC && vcc->vci != ATM_VCI_UNSPEC) { in close_rx()
570 pos = vcc->vci >> 1; in close_rx()
571 shift = (1-(vcc->vci & 1)) << 4; in close_rx()
590 "%d\n",vcc->dev->number,zatm_vcc->rx_chan); in close_rx()
594 unuse_pool(vcc->dev,zatm_vcc->pool); in close_rx()
631 struct atm_vcc *vcc; in do_tx() local
639 vcc = ATM_SKB(skb)->vcc; in do_tx()
640 zatm_dev = ZATM_DEV(vcc->dev); in do_tx()
641 zatm_vcc = ZATM_VCC(vcc); in do_tx()
658 | (vcc->qos.aal == ATM_AAL5 ? uPD98401_TXPD_AAL5 : 0 | in do_tx()
673 if (vcc->pop) in do_tx()
674 vcc->pop(vcc, skb); in do_tx()
682 (vcc->aal == ATM_AAL5 ? uPD98401_TXPD_AAL5 : 0 | in do_tx()
709 static inline void dequeue_tx(struct atm_vcc *vcc) in dequeue_tx() argument
715 zatm_vcc = ZATM_VCC(vcc); in dequeue_tx()
719 "txing\n",vcc->dev->number); in dequeue_tx()
729 if (vcc->pop) vcc->pop(vcc,skb); in dequeue_tx()
736 atomic_inc(&vcc->stats->tx); in dequeue_tx()
868 static void close_tx(struct atm_vcc *vcc) in close_tx() argument
875 zatm_vcc = ZATM_VCC(vcc); in close_tx()
876 zatm_dev = ZATM_DEV(vcc->dev); in close_tx()
900 "%d\n",vcc->dev->number,chan); in close_tx()
905 zatm_dev->tx_bw += vcc->qos.txtp.min_pcr; in close_tx()
906 dealloc_shaper(vcc->dev,zatm_vcc->shaper); in close_tx()
912 static int open_tx_first(struct atm_vcc *vcc) in open_tx_first() argument
922 zatm_dev = ZATM_DEV(vcc->dev); in open_tx_first()
923 zatm_vcc = ZATM_VCC(vcc); in open_tx_first()
925 if (vcc->qos.txtp.traffic_class == ATM_NONE) return 0; in open_tx_first()
935 unlimited = vcc->qos.txtp.traffic_class == ATM_UBR && in open_tx_first()
936 (!vcc->qos.txtp.max_pcr || vcc->qos.txtp.max_pcr == ATM_MAX_PCR || in open_tx_first()
937 vcc->qos.txtp.max_pcr >= ATM_OC3_PCR); in open_tx_first()
942 if (unlimited) vcc->qos.txtp.max_sdu = ATM_MAX_AAL5_PDU; in open_tx_first()
943 if ((zatm_vcc->shaper = alloc_shaper(vcc->dev,&pcr, in open_tx_first()
944 vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,unlimited)) in open_tx_first()
946 close_tx(vcc); in open_tx_first()
950 vcc->qos.txtp.min_pcr = vcc->qos.txtp.max_pcr = pcr; in open_tx_first()
971 static int open_tx_second(struct atm_vcc *vcc) in open_tx_second() argument
978 zatm_dev = ZATM_DEV(vcc->dev); in open_tx_second()
979 zatm_vcc = ZATM_VCC(vcc); in open_tx_second()
985 uPD98401_TXVC_SHP_SHIFT) | (vcc->vpi << uPD98401_TXVC_VPI_SHIFT) | in open_tx_second()
986 vcc->vci,zatm_vcc->tx_chan*VC_SIZE/4+1); in open_tx_second()
989 zatm_dev->tx_map[zatm_vcc->tx_chan] = vcc; in open_tx_second()
1367 static void zatm_close(struct atm_vcc *vcc) in zatm_close() argument
1370 if (!ZATM_VCC(vcc)) return; in zatm_close()
1371 clear_bit(ATM_VF_READY,&vcc->flags); in zatm_close()
1372 close_rx(vcc); in zatm_close()
1374 close_tx(vcc); in zatm_close()
1377 kfree(ZATM_VCC(vcc)); in zatm_close()
1378 vcc->dev_data = NULL; in zatm_close()
1379 clear_bit(ATM_VF_ADDR,&vcc->flags); in zatm_close()
1383 static int zatm_open(struct atm_vcc *vcc) in zatm_open() argument
1387 short vpi = vcc->vpi; in zatm_open()
1388 int vci = vcc->vci; in zatm_open()
1392 zatm_dev = ZATM_DEV(vcc->dev); in zatm_open()
1393 if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) in zatm_open()
1394 vcc->dev_data = NULL; in zatm_open()
1396 set_bit(ATM_VF_ADDR,&vcc->flags); in zatm_open()
1397 if (vcc->qos.aal != ATM_AAL5) return -EINVAL; /* @@@ AAL0 */ in zatm_open()
1398 DPRINTK(DEV_LABEL "(itf %d): open %d.%d\n",vcc->dev->number,vcc->vpi, in zatm_open()
1399 vcc->vci); in zatm_open()
1400 if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) { in zatm_open()
1403 clear_bit(ATM_VF_ADDR,&vcc->flags); in zatm_open()
1406 vcc->dev_data = zatm_vcc; in zatm_open()
1407 ZATM_VCC(vcc)->tx_chan = 0; /* for zatm_close after open_rx */ in zatm_open()
1408 if ((error = open_rx_first(vcc))) { in zatm_open()
1409 zatm_close(vcc); in zatm_open()
1412 if ((error = open_tx_first(vcc))) { in zatm_open()
1413 zatm_close(vcc); in zatm_open()
1418 if ((error = open_rx_second(vcc))) { in zatm_open()
1419 zatm_close(vcc); in zatm_open()
1422 if ((error = open_tx_second(vcc))) { in zatm_open()
1423 zatm_close(vcc); in zatm_open()
1426 set_bit(ATM_VF_READY,&vcc->flags); in zatm_open()
1431 static int zatm_change_qos(struct atm_vcc *vcc,struct atm_qos *qos,int flags) in zatm_change_qos() argument
1513 static int zatm_getsockopt(struct atm_vcc *vcc,int level,int optname, in zatm_getsockopt() argument
1520 static int zatm_setsockopt(struct atm_vcc *vcc,int level,int optname, in zatm_setsockopt() argument
1526 static int zatm_send(struct atm_vcc *vcc,struct sk_buff *skb) in zatm_send() argument
1531 if (!ZATM_VCC(vcc)->tx_chan || !test_bit(ATM_VF_READY,&vcc->flags)) { in zatm_send()
1532 if (vcc->pop) vcc->pop(vcc,skb); in zatm_send()
1538 if (vcc->pop) vcc->pop(vcc,skb); in zatm_send()
1541 ATM_SKB(skb)->vcc = vcc; in zatm_send()
1544 skb_queue_tail(&ZATM_VCC(vcc)->backlog,skb); in zatm_send()