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);
901 static void free_scq(ns_dev *card, scq_info *scq, struct atm_vcc *vcc) in free_scq() argument
908 vcc = ATM_SKB(scq->skb[i])->vcc; in free_scq()
909 if (vcc->pop != NULL) in free_scq()
910 vcc->pop(vcc, scq->skb[i]); in free_scq()
916 if (vcc == NULL) { in free_scq()
924 if (vcc->pop != NULL) in free_scq()
925 vcc->pop(vcc, scq->skb[i]); in free_scq()
1227 static int ns_open(struct atm_vcc *vcc) in ns_open() argument
1241 short vpi = vcc->vpi; in ns_open()
1242 int vci = vcc->vci; in ns_open()
1244 card = (ns_dev *) vcc->dev->dev_data; in ns_open()
1247 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in ns_open()
1253 vcc->dev_data = vc; in ns_open()
1256 if (vcc->qos.txtp.traffic_class != ATM_NONE && vc->tx) in ns_open()
1258 if (vcc->qos.rxtp.traffic_class != ATM_NONE && vc->rx) in ns_open()
1266 set_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1271 if (!test_bit(ATM_VF_PARTIAL, &vcc->flags)) { in ns_open()
1274 set_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1275 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_open()
1277 if (vcc->qos.txtp.max_pcr == 0 && vcc->qos.txtp.pcr == 0 in ns_open()
1278 && vcc->qos.txtp.min_pcr == 0) { in ns_open()
1282 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1283 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1287 tcr = atm_pcr_goal(&(vcc->qos.txtp)); in ns_open()
1291 card->index, vcc->qos.txtp.max_pcr); in ns_open()
1309 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1310 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1319 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1320 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1328 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1329 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1347 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1348 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1360 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1361 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1372 } else if (vcc->qos.txtp.traffic_class == ATM_UBR) { in ns_open()
1377 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_open()
1379 vc->tx_vcc = vcc; in ns_open()
1382 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_open()
1386 vc->rx_vcc = vcc; in ns_open()
1390 if (vcc->qos.aal == ATM_AAL5) in ns_open()
1405 set_bit(ATM_VF_READY, &vcc->flags); in ns_open()
1409 static void ns_close(struct atm_vcc *vcc) in ns_close() argument
1416 vc = vcc->dev_data; in ns_close()
1417 card = vcc->dev->dev_data; in ns_close()
1419 (int)vcc->vpi, vcc->vci); in ns_close()
1421 clear_bit(ATM_VF_READY, &vcc->flags); in ns_close()
1423 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_close()
1429 (vcc->vpi << card->vcibits | vcc->vci) * NS_RCT_ENTRY_SIZE; in ns_close()
1459 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1463 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_close()
1521 free_scq(card, vc->scq, vcc); in ns_close()
1525 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1532 if (scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) { in ns_close()
1533 ATM_SKB(scq->skb[i])->vcc = NULL; in ns_close()
1534 atm_return(vcc, scq->skb[i]->truesize); in ns_close()
1543 vcc->dev_data = NULL; in ns_close()
1544 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_close()
1545 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_close()
1622 static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) in ns_send() argument
1631 card = vcc->dev->dev_data; in ns_send()
1633 if ((vc = (vc_map *) vcc->dev_data) == NULL) { in ns_send()
1636 atomic_inc(&vcc->stats->tx_err); in ns_send()
1644 atomic_inc(&vcc->stats->tx_err); in ns_send()
1649 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in ns_send()
1652 atomic_inc(&vcc->stats->tx_err); in ns_send()
1659 atomic_inc(&vcc->stats->tx_err); in ns_send()
1664 ATM_SKB(skb)->vcc = vcc; in ns_send()
1669 if (vcc->qos.aal == ATM_AAL5) { in ns_send()
1675 ns_tbd_mkword_4(0, (u32) vcc->vpi, (u32) vcc->vci, 0, in ns_send()
1691 cpu_to_le32((((u32) vcc-> in ns_send()
1692 vpi) << NS_TBD_VPI_SHIFT | ((u32) vcc-> in ns_send()
1697 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_send()
1699 scq = ((vc_map *) vcc->dev_data)->scq; in ns_send()
1707 atomic_inc(&vcc->stats->tx_err); in ns_send()
1711 atomic_inc(&vcc->stats->tx); in ns_send()
1905 struct atm_vcc *vcc; in drain_scq() local
1930 vcc = ATM_SKB(skb)->vcc; in drain_scq()
1931 if (vcc && vcc->pop != NULL) { in drain_scq()
1932 vcc->pop(vcc, skb); in drain_scq()
1969 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()
2028 atomic_add(i, &vcc->stats->rx_drop); in dequeue_rx()
2031 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2035 atomic_add(i - 1, &vcc->stats->rx_drop); /* already increased by 1 */ in dequeue_rx()
2047 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2049 vcc->push(vcc, sb); in dequeue_rx()
2050 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2067 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2091 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2111 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2124 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2147 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2159 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2161 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2165 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2167 vcc->push(vcc, skb); in dequeue_rx()
2168 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2177 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2179 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2183 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2185 vcc->push(vcc, sb); in dequeue_rx()
2186 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2193 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2195 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2202 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2204 vcc->push(vcc, skb); in dequeue_rx()
2205 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2226 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2269 if (!atm_charge(vcc, hb->truesize)) { in dequeue_rx()
2277 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2308 ATM_SKB(hb)->vcc = vcc; in dequeue_rx()
2310 vcc->push(vcc, hb); in dequeue_rx()
2311 atomic_inc(&vcc->stats->rx); in dequeue_rx()