Lines Matching refs:vcc
126 static void free_scq(ns_dev *card, scq_info * scq, struct atm_vcc *vcc);
129 static int ns_open(struct atm_vcc *vcc);
130 static void ns_close(struct atm_vcc *vcc);
132 static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb);
904 static void free_scq(ns_dev *card, scq_info *scq, struct atm_vcc *vcc) in free_scq() argument
911 vcc = ATM_SKB(scq->skb[i])->vcc; in free_scq()
912 if (vcc->pop != NULL) in free_scq()
913 vcc->pop(vcc, scq->skb[i]); in free_scq()
919 if (vcc == NULL) { in free_scq()
927 if (vcc->pop != NULL) in free_scq()
928 vcc->pop(vcc, scq->skb[i]); in free_scq()
1230 static int ns_open(struct atm_vcc *vcc) in ns_open() argument
1244 short vpi = vcc->vpi; in ns_open()
1245 int vci = vcc->vci; in ns_open()
1247 card = (ns_dev *) vcc->dev->dev_data; in ns_open()
1250 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in ns_open()
1256 vcc->dev_data = vc; in ns_open()
1259 if (vcc->qos.txtp.traffic_class != ATM_NONE && vc->tx) in ns_open()
1261 if (vcc->qos.rxtp.traffic_class != ATM_NONE && vc->rx) in ns_open()
1269 set_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1274 if (!test_bit(ATM_VF_PARTIAL, &vcc->flags)) { in ns_open()
1277 set_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1278 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_open()
1280 if (vcc->qos.txtp.max_pcr == 0 && vcc->qos.txtp.pcr == 0 in ns_open()
1281 && vcc->qos.txtp.min_pcr == 0) { in ns_open()
1285 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1286 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1290 tcr = atm_pcr_goal(&(vcc->qos.txtp)); in ns_open()
1294 card->index, vcc->qos.txtp.max_pcr); in ns_open()
1312 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1313 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1322 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1323 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1331 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1332 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1350 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1351 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1363 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1364 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1375 } else if (vcc->qos.txtp.traffic_class == ATM_UBR) { in ns_open()
1380 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_open()
1382 vc->tx_vcc = vcc; in ns_open()
1385 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_open()
1389 vc->rx_vcc = vcc; in ns_open()
1393 if (vcc->qos.aal == ATM_AAL5) in ns_open()
1408 set_bit(ATM_VF_READY, &vcc->flags); in ns_open()
1412 static void ns_close(struct atm_vcc *vcc) in ns_close() argument
1419 vc = vcc->dev_data; in ns_close()
1420 card = vcc->dev->dev_data; in ns_close()
1422 (int)vcc->vpi, vcc->vci); in ns_close()
1424 clear_bit(ATM_VF_READY, &vcc->flags); in ns_close()
1426 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_close()
1432 (vcc->vpi << card->vcibits | vcc->vci) * NS_RCT_ENTRY_SIZE; in ns_close()
1462 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1466 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_close()
1524 free_scq(card, vc->scq, vcc); in ns_close()
1528 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1535 if (scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) { in ns_close()
1536 ATM_SKB(scq->skb[i])->vcc = NULL; in ns_close()
1537 atm_return(vcc, scq->skb[i]->truesize); in ns_close()
1546 vcc->dev_data = NULL; in ns_close()
1547 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_close()
1548 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_close()
1625 static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) in ns_send() argument
1634 card = vcc->dev->dev_data; in ns_send()
1636 if ((vc = (vc_map *) vcc->dev_data) == NULL) { in ns_send()
1639 atomic_inc(&vcc->stats->tx_err); in ns_send()
1647 atomic_inc(&vcc->stats->tx_err); in ns_send()
1652 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in ns_send()
1655 atomic_inc(&vcc->stats->tx_err); in ns_send()
1662 atomic_inc(&vcc->stats->tx_err); in ns_send()
1667 ATM_SKB(skb)->vcc = vcc; in ns_send()
1672 if (vcc->qos.aal == ATM_AAL5) { in ns_send()
1678 ns_tbd_mkword_4(0, (u32) vcc->vpi, (u32) vcc->vci, 0, in ns_send()
1694 cpu_to_le32((((u32) vcc-> in ns_send()
1695 vpi) << NS_TBD_VPI_SHIFT | ((u32) vcc-> in ns_send()
1700 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_send()
1702 scq = ((vc_map *) vcc->dev_data)->scq; in ns_send()
1710 atomic_inc(&vcc->stats->tx_err); in ns_send()
1716 atomic_inc(&vcc->stats->tx); in ns_send()
1910 struct atm_vcc *vcc; in drain_scq() local
1935 vcc = ATM_SKB(skb)->vcc; in drain_scq()
1936 if (vcc && vcc->pop != NULL) { in drain_scq()
1937 vcc->pop(vcc, skb); in drain_scq()
1974 struct atm_vcc *vcc; in dequeue_rx() local
2019 vcc = vc->rx_vcc; in dequeue_rx()
2021 if (vcc->qos.aal == ATM_AAL0) { in dequeue_rx()
2033 atomic_add(i, &vcc->stats->rx_drop); in dequeue_rx()
2036 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2040 atomic_add(i - 1, &vcc->stats->rx_drop); /* already increased by 1 */ in dequeue_rx()
2052 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2054 vcc->push(vcc, sb); in dequeue_rx()
2055 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2072 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2096 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2116 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2129 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2152 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2164 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2166 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2170 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2172 vcc->push(vcc, skb); in dequeue_rx()
2173 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2182 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2184 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2188 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2190 vcc->push(vcc, sb); in dequeue_rx()
2191 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2198 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2200 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2207 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2209 vcc->push(vcc, skb); in dequeue_rx()
2210 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2231 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2274 if (!atm_charge(vcc, hb->truesize)) { in dequeue_rx()
2282 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2313 ATM_SKB(hb)->vcc = vcc; in dequeue_rx()
2315 vcc->push(vcc, hb); in dequeue_rx()
2316 atomic_inc(&vcc->stats->rx); in dequeue_rx()