Lines Matching full: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);
899 /* For variable rate SCQ vcc must be NULL */
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()
913 } else { /* vcc must be != NULL */ in free_scq()
915 if (vcc == NULL) { in free_scq()
917 ("nicstar: free_scq() called with vcc == NULL for fixed rate scq."); 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
1239 int inuse; /* tx or rx vc already in use by another vcc */ in ns_open()
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()
1391 else /* vcc->qos.aal == ATM_AAL0 */ 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()
1523 /* remove all references to vcc before deleting it */ 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()
1535 ("nicstar: deleted pending vcc mapping\n"); 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, bool may_sleep) 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()
1633 printk("nicstar%d: vcc->dev_data == NULL on ns_send().\n", 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()
1678 } else { /* (vcc->qos.aal == ATM_AAL0) */ in _ns_send()
1688 /* Force the VPI/VCI to be the same as in VCC struct */ 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()
1712 atomic_inc(&vcc->stats->tx); in _ns_send()
1717 static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) in ns_send() argument
1719 return _ns_send(vcc, skb, true); in ns_send()
1722 static int ns_send_bh(struct atm_vcc *vcc, struct sk_buff *skb) in ns_send_bh() argument
1724 return _ns_send(vcc, skb, false); in ns_send_bh()
1916 struct atm_vcc *vcc; in drain_scq() local
1941 vcc = ATM_SKB(skb)->vcc; in drain_scq()
1942 if (vcc && vcc->pop != NULL) { in drain_scq()
1943 vcc->pop(vcc, skb); in drain_scq()
1980 struct atm_vcc *vcc; in dequeue_rx() local
2025 vcc = vc->rx_vcc; in dequeue_rx()
2027 if (vcc->qos.aal == ATM_AAL0) { in dequeue_rx()
2039 atomic_add(i, &vcc->stats->rx_drop); in dequeue_rx()
2042 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2046 atomic_add(i - 1, &vcc->stats->rx_drop); /* already increased by 1 */ in dequeue_rx()
2058 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2060 vcc->push(vcc, sb); in dequeue_rx()
2061 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2078 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2102 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2122 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2135 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2158 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2170 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2172 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2176 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2178 vcc->push(vcc, skb); in dequeue_rx()
2179 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2188 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2190 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2194 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2196 vcc->push(vcc, sb); in dequeue_rx()
2197 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2204 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2206 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2213 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2215 vcc->push(vcc, skb); in dequeue_rx()
2216 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2237 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2280 if (!atm_charge(vcc, hb->truesize)) { in dequeue_rx()
2288 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2319 ATM_SKB(hb)->vcc = vcc; in dequeue_rx()
2321 vcc->push(vcc, hb); in dequeue_rx()
2322 atomic_inc(&vcc->stats->rx); in dequeue_rx()