Lines Matching refs:vcc
125 static void free_scq(ns_dev *card, scq_info * scq, struct atm_vcc *vcc);
128 static int ns_open(struct atm_vcc *vcc);
129 static void ns_close(struct atm_vcc *vcc);
131 static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb);
900 static void free_scq(ns_dev *card, scq_info *scq, struct atm_vcc *vcc) in free_scq() argument
907 vcc = ATM_SKB(scq->skb[i])->vcc; in free_scq()
908 if (vcc->pop != NULL) in free_scq()
909 vcc->pop(vcc, scq->skb[i]); in free_scq()
915 if (vcc == NULL) { in free_scq()
923 if (vcc->pop != NULL) in free_scq()
924 vcc->pop(vcc, scq->skb[i]); in free_scq()
1226 static int ns_open(struct atm_vcc *vcc) in ns_open() argument
1240 short vpi = vcc->vpi; in ns_open()
1241 int vci = vcc->vci; in ns_open()
1243 card = (ns_dev *) vcc->dev->dev_data; in ns_open()
1246 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in ns_open()
1252 vcc->dev_data = vc; in ns_open()
1255 if (vcc->qos.txtp.traffic_class != ATM_NONE && vc->tx) in ns_open()
1257 if (vcc->qos.rxtp.traffic_class != ATM_NONE && vc->rx) in ns_open()
1265 set_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1270 if (!test_bit(ATM_VF_PARTIAL, &vcc->flags)) { in ns_open()
1273 set_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1274 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_open()
1276 if (vcc->qos.txtp.max_pcr == 0 && vcc->qos.txtp.pcr == 0 in ns_open()
1277 && vcc->qos.txtp.min_pcr == 0) { in ns_open()
1281 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1282 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1286 tcr = atm_pcr_goal(&(vcc->qos.txtp)); in ns_open()
1290 card->index, vcc->qos.txtp.max_pcr); in ns_open()
1308 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1309 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1318 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1319 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1327 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1328 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1346 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1347 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1359 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1360 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1371 } else if (vcc->qos.txtp.traffic_class == ATM_UBR) { in ns_open()
1376 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_open()
1378 vc->tx_vcc = vcc; in ns_open()
1381 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_open()
1385 vc->rx_vcc = vcc; in ns_open()
1389 if (vcc->qos.aal == ATM_AAL5) in ns_open()
1404 set_bit(ATM_VF_READY, &vcc->flags); in ns_open()
1408 static void ns_close(struct atm_vcc *vcc) in ns_close() argument
1415 vc = vcc->dev_data; in ns_close()
1416 card = vcc->dev->dev_data; in ns_close()
1418 (int)vcc->vpi, vcc->vci); in ns_close()
1420 clear_bit(ATM_VF_READY, &vcc->flags); in ns_close()
1422 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_close()
1428 (vcc->vpi << card->vcibits | vcc->vci) * NS_RCT_ENTRY_SIZE; in ns_close()
1458 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1462 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_close()
1520 free_scq(card, vc->scq, vcc); in ns_close()
1524 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1531 if (scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) { in ns_close()
1532 ATM_SKB(scq->skb[i])->vcc = NULL; in ns_close()
1533 atm_return(vcc, scq->skb[i]->truesize); in ns_close()
1542 vcc->dev_data = NULL; in ns_close()
1543 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_close()
1544 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_close()
1621 static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) in ns_send() argument
1630 card = vcc->dev->dev_data; in ns_send()
1632 if ((vc = (vc_map *) vcc->dev_data) == NULL) { in ns_send()
1635 atomic_inc(&vcc->stats->tx_err); in ns_send()
1643 atomic_inc(&vcc->stats->tx_err); in ns_send()
1648 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in ns_send()
1651 atomic_inc(&vcc->stats->tx_err); in ns_send()
1658 atomic_inc(&vcc->stats->tx_err); in ns_send()
1663 ATM_SKB(skb)->vcc = vcc; in ns_send()
1668 if (vcc->qos.aal == ATM_AAL5) { in ns_send()
1674 ns_tbd_mkword_4(0, (u32) vcc->vpi, (u32) vcc->vci, 0, in ns_send()
1690 cpu_to_le32((((u32) vcc-> in ns_send()
1691 vpi) << NS_TBD_VPI_SHIFT | ((u32) vcc-> in ns_send()
1696 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_send()
1698 scq = ((vc_map *) vcc->dev_data)->scq; in ns_send()
1706 atomic_inc(&vcc->stats->tx_err); in ns_send()
1710 atomic_inc(&vcc->stats->tx); in ns_send()
1904 struct atm_vcc *vcc; in drain_scq() local
1929 vcc = ATM_SKB(skb)->vcc; in drain_scq()
1930 if (vcc && vcc->pop != NULL) { in drain_scq()
1931 vcc->pop(vcc, skb); in drain_scq()
1968 struct atm_vcc *vcc; in dequeue_rx() local
2014 vcc = vc->rx_vcc; in dequeue_rx()
2016 if (vcc->qos.aal == ATM_AAL0) { in dequeue_rx()
2027 atomic_add(i, &vcc->stats->rx_drop); in dequeue_rx()
2030 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2034 atomic_add(i - 1, &vcc->stats->rx_drop); /* already increased by 1 */ in dequeue_rx()
2046 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2048 vcc->push(vcc, sb); in dequeue_rx()
2049 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2066 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2090 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2110 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2123 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2146 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2158 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2160 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2164 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2166 vcc->push(vcc, skb); in dequeue_rx()
2167 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2176 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2178 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2182 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2184 vcc->push(vcc, sb); in dequeue_rx()
2185 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2192 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2194 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2201 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2203 vcc->push(vcc, skb); in dequeue_rx()
2204 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2225 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2268 if (!atm_charge(vcc, hb->truesize)) { in dequeue_rx()
2276 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2307 ATM_SKB(hb)->vcc = vcc; in dequeue_rx()
2309 vcc->push(vcc, hb); in dequeue_rx()
2310 atomic_inc(&vcc->stats->rx); in dequeue_rx()