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);
902 static void free_scq(ns_dev *card, scq_info *scq, struct atm_vcc *vcc) in free_scq() argument
909 vcc = ATM_SKB(scq->skb[i])->vcc; in free_scq()
910 if (vcc->pop != NULL) in free_scq()
911 vcc->pop(vcc, scq->skb[i]); in free_scq()
917 if (vcc == NULL) { in free_scq()
925 if (vcc->pop != NULL) in free_scq()
926 vcc->pop(vcc, scq->skb[i]); in free_scq()
1228 static int ns_open(struct atm_vcc *vcc) in ns_open() argument
1242 short vpi = vcc->vpi; in ns_open()
1243 int vci = vcc->vci; in ns_open()
1245 card = (ns_dev *) vcc->dev->dev_data; in ns_open()
1248 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in ns_open()
1254 vcc->dev_data = vc; in ns_open()
1257 if (vcc->qos.txtp.traffic_class != ATM_NONE && vc->tx) in ns_open()
1259 if (vcc->qos.rxtp.traffic_class != ATM_NONE && vc->rx) in ns_open()
1267 set_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1272 if (!test_bit(ATM_VF_PARTIAL, &vcc->flags)) { in ns_open()
1275 set_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1276 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_open()
1278 if (vcc->qos.txtp.max_pcr == 0 && vcc->qos.txtp.pcr == 0 in ns_open()
1279 && vcc->qos.txtp.min_pcr == 0) { in ns_open()
1283 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1284 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1288 tcr = atm_pcr_goal(&(vcc->qos.txtp)); in ns_open()
1292 card->index, vcc->qos.txtp.max_pcr); in ns_open()
1310 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1311 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1320 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1321 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1329 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1330 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1348 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1349 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1361 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1362 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1373 } else if (vcc->qos.txtp.traffic_class == ATM_UBR) { in ns_open()
1378 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_open()
1380 vc->tx_vcc = vcc; in ns_open()
1383 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_open()
1387 vc->rx_vcc = vcc; in ns_open()
1391 if (vcc->qos.aal == ATM_AAL5) in ns_open()
1406 set_bit(ATM_VF_READY, &vcc->flags); in ns_open()
1410 static void ns_close(struct atm_vcc *vcc) in ns_close() argument
1417 vc = vcc->dev_data; in ns_close()
1418 card = vcc->dev->dev_data; in ns_close()
1420 (int)vcc->vpi, vcc->vci); in ns_close()
1422 clear_bit(ATM_VF_READY, &vcc->flags); in ns_close()
1424 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_close()
1430 (vcc->vpi << card->vcibits | vcc->vci) * NS_RCT_ENTRY_SIZE; in ns_close()
1460 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1464 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_close()
1522 free_scq(card, vc->scq, vcc); in ns_close()
1526 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1533 if (scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) { in ns_close()
1534 ATM_SKB(scq->skb[i])->vcc = NULL; in ns_close()
1535 atm_return(vcc, scq->skb[i]->truesize); in ns_close()
1544 vcc->dev_data = NULL; in ns_close()
1545 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_close()
1546 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_close()
1623 static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) in ns_send() argument
1632 card = vcc->dev->dev_data; in ns_send()
1634 if ((vc = (vc_map *) vcc->dev_data) == NULL) { in ns_send()
1637 atomic_inc(&vcc->stats->tx_err); in ns_send()
1645 atomic_inc(&vcc->stats->tx_err); in ns_send()
1650 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in ns_send()
1653 atomic_inc(&vcc->stats->tx_err); in ns_send()
1660 atomic_inc(&vcc->stats->tx_err); in ns_send()
1665 ATM_SKB(skb)->vcc = vcc; in ns_send()
1670 if (vcc->qos.aal == ATM_AAL5) { in ns_send()
1676 ns_tbd_mkword_4(0, (u32) vcc->vpi, (u32) vcc->vci, 0, in ns_send()
1692 cpu_to_le32((((u32) vcc-> in ns_send()
1693 vpi) << NS_TBD_VPI_SHIFT | ((u32) vcc-> in ns_send()
1698 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_send()
1700 scq = ((vc_map *) vcc->dev_data)->scq; in ns_send()
1708 atomic_inc(&vcc->stats->tx_err); in ns_send()
1712 atomic_inc(&vcc->stats->tx); in ns_send()
1906 struct atm_vcc *vcc; in drain_scq() local
1931 vcc = ATM_SKB(skb)->vcc; in drain_scq()
1932 if (vcc && vcc->pop != NULL) { in drain_scq()
1933 vcc->pop(vcc, skb); in drain_scq()
1970 struct atm_vcc *vcc; in dequeue_rx() local
2015 vcc = vc->rx_vcc; in dequeue_rx()
2017 if (vcc->qos.aal == ATM_AAL0) { in dequeue_rx()
2029 atomic_add(i, &vcc->stats->rx_drop); in dequeue_rx()
2032 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2036 atomic_add(i - 1, &vcc->stats->rx_drop); /* already increased by 1 */ in dequeue_rx()
2048 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2050 vcc->push(vcc, sb); in dequeue_rx()
2051 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2068 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2092 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2112 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2125 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2148 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2160 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2162 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2166 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2168 vcc->push(vcc, skb); in dequeue_rx()
2169 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2178 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2180 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2184 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2186 vcc->push(vcc, sb); in dequeue_rx()
2187 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2194 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2196 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2203 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2205 vcc->push(vcc, skb); in dequeue_rx()
2206 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2227 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2270 if (!atm_charge(vcc, hb->truesize)) { in dequeue_rx()
2278 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2309 ATM_SKB(hb)->vcc = vcc; in dequeue_rx()
2311 vcc->push(vcc, hb); in dequeue_rx()
2312 atomic_inc(&vcc->stats->rx); in dequeue_rx()