Lines Matching refs:vcc
128 static void free_scq(ns_dev *card, scq_info * scq, struct atm_vcc *vcc);
131 static int ns_open(struct atm_vcc *vcc);
132 static void ns_close(struct atm_vcc *vcc);
134 static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb);
908 static void free_scq(ns_dev *card, scq_info *scq, struct atm_vcc *vcc) in free_scq() argument
915 vcc = ATM_SKB(scq->skb[i])->vcc; in free_scq()
916 if (vcc->pop != NULL) in free_scq()
917 vcc->pop(vcc, scq->skb[i]); in free_scq()
923 if (vcc == NULL) { in free_scq()
931 if (vcc->pop != NULL) in free_scq()
932 vcc->pop(vcc, scq->skb[i]); in free_scq()
1234 static int ns_open(struct atm_vcc *vcc) in ns_open() argument
1248 short vpi = vcc->vpi; in ns_open()
1249 int vci = vcc->vci; in ns_open()
1251 card = (ns_dev *) vcc->dev->dev_data; in ns_open()
1254 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in ns_open()
1260 vcc->dev_data = vc; in ns_open()
1263 if (vcc->qos.txtp.traffic_class != ATM_NONE && vc->tx) in ns_open()
1265 if (vcc->qos.rxtp.traffic_class != ATM_NONE && vc->rx) in ns_open()
1273 set_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1278 if (!test_bit(ATM_VF_PARTIAL, &vcc->flags)) { in ns_open()
1281 set_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1282 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_open()
1284 if (vcc->qos.txtp.max_pcr == 0 && vcc->qos.txtp.pcr == 0 in ns_open()
1285 && vcc->qos.txtp.min_pcr == 0) { in ns_open()
1289 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1290 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1294 tcr = atm_pcr_goal(&(vcc->qos.txtp)); in ns_open()
1298 card->index, vcc->qos.txtp.max_pcr); in ns_open()
1316 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1317 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1326 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1327 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1335 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1336 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1354 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1355 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1367 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_open()
1368 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_open()
1379 } else if (vcc->qos.txtp.traffic_class == ATM_UBR) { in ns_open()
1384 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_open()
1386 vc->tx_vcc = vcc; in ns_open()
1389 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_open()
1393 vc->rx_vcc = vcc; in ns_open()
1397 if (vcc->qos.aal == ATM_AAL5) in ns_open()
1412 set_bit(ATM_VF_READY, &vcc->flags); in ns_open()
1416 static void ns_close(struct atm_vcc *vcc) in ns_close() argument
1423 vc = vcc->dev_data; in ns_close()
1424 card = vcc->dev->dev_data; in ns_close()
1426 (int)vcc->vpi, vcc->vci); in ns_close()
1428 clear_bit(ATM_VF_READY, &vcc->flags); in ns_close()
1430 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in ns_close()
1436 (vcc->vpi << card->vcibits | vcc->vci) * NS_RCT_ENTRY_SIZE; in ns_close()
1466 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1470 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_close()
1528 free_scq(card, vc->scq, vcc); in ns_close()
1532 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in ns_close()
1539 if (scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) { in ns_close()
1540 ATM_SKB(scq->skb[i])->vcc = NULL; in ns_close()
1541 atm_return(vcc, scq->skb[i]->truesize); in ns_close()
1550 vcc->dev_data = NULL; in ns_close()
1551 clear_bit(ATM_VF_PARTIAL, &vcc->flags); in ns_close()
1552 clear_bit(ATM_VF_ADDR, &vcc->flags); in ns_close()
1629 static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) in ns_send() argument
1638 card = vcc->dev->dev_data; in ns_send()
1640 if ((vc = (vc_map *) vcc->dev_data) == NULL) { in ns_send()
1643 atomic_inc(&vcc->stats->tx_err); in ns_send()
1651 atomic_inc(&vcc->stats->tx_err); in ns_send()
1656 if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { in ns_send()
1659 atomic_inc(&vcc->stats->tx_err); in ns_send()
1666 atomic_inc(&vcc->stats->tx_err); in ns_send()
1671 ATM_SKB(skb)->vcc = vcc; in ns_send()
1676 if (vcc->qos.aal == ATM_AAL5) { in ns_send()
1682 ns_tbd_mkword_4(0, (u32) vcc->vpi, (u32) vcc->vci, 0, in ns_send()
1698 cpu_to_le32((((u32) vcc-> in ns_send()
1699 vpi) << NS_TBD_VPI_SHIFT | ((u32) vcc-> in ns_send()
1704 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in ns_send()
1706 scq = ((vc_map *) vcc->dev_data)->scq; in ns_send()
1714 atomic_inc(&vcc->stats->tx_err); in ns_send()
1718 atomic_inc(&vcc->stats->tx); in ns_send()
1912 struct atm_vcc *vcc; in drain_scq() local
1937 vcc = ATM_SKB(skb)->vcc; in drain_scq()
1938 if (vcc && vcc->pop != NULL) { in drain_scq()
1939 vcc->pop(vcc, skb); in drain_scq()
1976 struct atm_vcc *vcc; in dequeue_rx() local
2022 vcc = vc->rx_vcc; in dequeue_rx()
2024 if (vcc->qos.aal == ATM_AAL0) { in dequeue_rx()
2035 atomic_add(i, &vcc->stats->rx_drop); in dequeue_rx()
2038 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2042 atomic_add(i - 1, &vcc->stats->rx_drop); /* already increased by 1 */ in dequeue_rx()
2054 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2056 vcc->push(vcc, sb); in dequeue_rx()
2057 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2074 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2098 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2118 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2131 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2154 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2166 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2168 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2175 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2177 vcc->push(vcc, skb); in dequeue_rx()
2178 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2187 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2189 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2196 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2198 vcc->push(vcc, sb); in dequeue_rx()
2199 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2206 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2208 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2218 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2220 vcc->push(vcc, skb); in dequeue_rx()
2221 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2242 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2285 if (!atm_charge(vcc, hb->truesize)) { in dequeue_rx()
2293 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2324 ATM_SKB(hb)->vcc = vcc; in dequeue_rx()
2329 vcc->push(vcc, hb); in dequeue_rx()
2330 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2347 card = (ns_dev *) ATM_SKB(sb)->vcc->dev->dev_data; in ns_sb_destructor()
2368 card = (ns_dev *) ATM_SKB(lb)->vcc->dev->dev_data; in ns_lb_destructor()
2388 card = (ns_dev *) ATM_SKB(hb)->vcc->dev->dev_data; in ns_hb_destructor()