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);
133 static int ns_send_bh(struct atm_vcc *vcc, struct sk_buff *skb);
906 static void free_scq(ns_dev *card, scq_info *scq, struct atm_vcc *vcc) in free_scq() argument
913 vcc = ATM_SKB(scq->skb[i])->vcc; in free_scq()
914 if (vcc->pop != NULL) in free_scq()
915 vcc->pop(vcc, scq->skb[i]); in free_scq()
921 if (vcc == NULL) { in free_scq()
929 if (vcc->pop != NULL) in free_scq()
930 vcc->pop(vcc, scq->skb[i]); in free_scq()
1232 static int ns_open(struct atm_vcc *vcc) in ns_open() argument
1246 short vpi = vcc->vpi; in ns_open()
1247 int vci = vcc->vci; in ns_open()
1249 card = (ns_dev *) vcc->dev->dev_data; in ns_open()
1252 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in ns_open()
1258 vcc->dev_data = vc; in ns_open()
1261 if (vcc->qos.txtp.traffic_class != ATM_NONE && vc->tx) in ns_open()
1263 if (vcc->qos.rxtp.traffic_class != ATM_NONE && vc->rx) in ns_open()
1271 set_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1276 if (!test_bit(ATM_VF_PARTIAL, &vcc->flags)) { in ns_open()
1279 set_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1280 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_open()
1282 if (vcc->qos.txtp.max_pcr == 0 && vcc->qos.txtp.pcr == 0 in ns_open()
1283 && vcc->qos.txtp.min_pcr == 0) { in ns_open()
1287 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1288 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1292 tcr = atm_pcr_goal(&(vcc->qos.txtp)); in ns_open()
1296 card->index, vcc->qos.txtp.max_pcr); in ns_open()
1314 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1315 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1324 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1325 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1333 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1334 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1352 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1353 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1365 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1366 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1377 } else if (vcc->qos.txtp.traffic_class == ATM_UBR) { in ns_open()
1382 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_open()
1384 vc->tx_vcc = vcc; in ns_open()
1387 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_open()
1391 vc->rx_vcc = vcc; in ns_open()
1395 if (vcc->qos.aal == ATM_AAL5) in ns_open()
1410 set_bit(ATM_VF_READY, &vcc->flags); in ns_open()
1414 static void ns_close(struct atm_vcc *vcc) in ns_close() argument
1421 vc = vcc->dev_data; in ns_close()
1422 card = vcc->dev->dev_data; in ns_close()
1424 (int)vcc->vpi, vcc->vci); in ns_close()
1426 clear_bit(ATM_VF_READY, &vcc->flags); in ns_close()
1428 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_close()
1434 (vcc->vpi << card->vcibits | vcc->vci) * NS_RCT_ENTRY_SIZE; in ns_close()
1464 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1468 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_close()
1526 free_scq(card, vc->scq, vcc); in ns_close()
1530 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1537 if (scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) { in ns_close()
1538 ATM_SKB(scq->skb[i])->vcc = NULL; in ns_close()
1539 atm_return(vcc, scq->skb[i]->truesize); in ns_close()
1548 vcc->dev_data = NULL; in ns_close()
1549 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_close()
1550 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_close()
1627 static int _ns_send(struct atm_vcc *vcc, struct sk_buff *skb, bool may_sleep) in _ns_send() argument
1636 card = vcc->dev->dev_data; in _ns_send()
1638 if ((vc = (vc_map *) vcc->dev_data) == NULL) { in _ns_send()
1641 atomic_inc(&vcc->stats->tx_err); in _ns_send()
1649 atomic_inc(&vcc->stats->tx_err); in _ns_send()
1654 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in _ns_send()
1657 atomic_inc(&vcc->stats->tx_err); in _ns_send()
1664 atomic_inc(&vcc->stats->tx_err); in _ns_send()
1669 ATM_SKB(skb)->vcc = vcc; in _ns_send()
1674 if (vcc->qos.aal == ATM_AAL5) { in _ns_send()
1680 ns_tbd_mkword_4(0, (u32) vcc->vpi, (u32) vcc->vci, 0, in _ns_send()
1696 cpu_to_le32((((u32) vcc-> in _ns_send()
1697 vpi) << NS_TBD_VPI_SHIFT | ((u32) vcc-> in _ns_send()
1702 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in _ns_send()
1704 scq = ((vc_map *) vcc->dev_data)->scq; in _ns_send()
1712 atomic_inc(&vcc->stats->tx_err); in _ns_send()
1718 atomic_inc(&vcc->stats->tx); in _ns_send()
1723 static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) in ns_send() argument
1725 return _ns_send(vcc, skb, true); in ns_send()
1728 static int ns_send_bh(struct atm_vcc *vcc, struct sk_buff *skb) in ns_send_bh() argument
1730 return _ns_send(vcc, skb, false); in ns_send_bh()
1922 struct atm_vcc *vcc; in drain_scq() local
1947 vcc = ATM_SKB(skb)->vcc; in drain_scq()
1948 if (vcc && vcc->pop != NULL) { in drain_scq()
1949 vcc->pop(vcc, skb); in drain_scq()
1986 struct atm_vcc *vcc; in dequeue_rx() local
2031 vcc = vc->rx_vcc; in dequeue_rx()
2033 if (vcc->qos.aal == ATM_AAL0) { in dequeue_rx()
2045 atomic_add(i, &vcc->stats->rx_drop); in dequeue_rx()
2048 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2052 atomic_add(i - 1, &vcc->stats->rx_drop); /* already increased by 1 */ in dequeue_rx()
2064 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2066 vcc->push(vcc, sb); in dequeue_rx()
2067 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2084 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2108 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2128 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2141 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2164 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2176 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2178 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2182 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2184 vcc->push(vcc, skb); in dequeue_rx()
2185 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2194 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2196 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2200 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2202 vcc->push(vcc, sb); in dequeue_rx()
2203 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2210 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2212 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2219 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2221 vcc->push(vcc, skb); in dequeue_rx()
2222 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2243 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2286 if (!atm_charge(vcc, hb->truesize)) { in dequeue_rx()
2294 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2325 ATM_SKB(hb)->vcc = vcc; in dequeue_rx()
2327 vcc->push(vcc, hb); in dequeue_rx()
2328 atomic_inc(&vcc->stats->rx); in dequeue_rx()