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);
900 /* For variable rate SCQ vcc must be NULL */
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()
914 } else { /* vcc must be != NULL */ in free_scq()
916 if (vcc == NULL) { in free_scq()
918 ("nicstar: free_scq() called with vcc == NULL for fixed rate scq."); 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
1240 int inuse; /* tx or rx vc already in use by another vcc */ in ns_open()
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()
1392 else /* vcc->qos.aal == ATM_AAL0 */ 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()
1524 /* remove all references to vcc before deleting it */ 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()
1536 ("nicstar: deleted pending vcc mapping\n"); 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, bool may_sleep) 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()
1634 printk("nicstar%d: vcc->dev_data == NULL on ns_send().\n", 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()
1679 } else { /* (vcc->qos.aal == ATM_AAL0) */ in _ns_send()
1689 /* Force the VPI/VCI to be the same as in VCC struct */ 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()
1713 atomic_inc(&vcc->stats->tx); in _ns_send()
1718 static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) in ns_send() argument
1720 return _ns_send(vcc, skb, true); in ns_send()
1723 static int ns_send_bh(struct atm_vcc *vcc, struct sk_buff *skb) in ns_send_bh() argument
1725 return _ns_send(vcc, skb, false); in ns_send_bh()
1917 struct atm_vcc *vcc; in drain_scq() local
1942 vcc = ATM_SKB(skb)->vcc; in drain_scq()
1943 if (vcc && vcc->pop != NULL) { in drain_scq()
1944 vcc->pop(vcc, skb); in drain_scq()
1981 struct atm_vcc *vcc; in dequeue_rx() local
2026 vcc = vc->rx_vcc; in dequeue_rx()
2028 if (vcc->qos.aal == ATM_AAL0) { in dequeue_rx()
2040 atomic_add(i, &vcc->stats->rx_drop); in dequeue_rx()
2043 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2047 atomic_add(i - 1, &vcc->stats->rx_drop); /* already increased by 1 */ in dequeue_rx()
2059 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2061 vcc->push(vcc, sb); in dequeue_rx()
2062 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2079 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2103 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2123 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2136 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2159 atomic_inc(&vcc->stats->rx_err); in dequeue_rx()
2171 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2173 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2177 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2179 vcc->push(vcc, skb); in dequeue_rx()
2180 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2189 if (!atm_charge(vcc, sb->truesize)) { in dequeue_rx()
2191 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2195 ATM_SKB(sb)->vcc = vcc; in dequeue_rx()
2197 vcc->push(vcc, sb); in dequeue_rx()
2198 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2205 if (!atm_charge(vcc, skb->truesize)) { in dequeue_rx()
2207 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2214 ATM_SKB(skb)->vcc = vcc; in dequeue_rx()
2216 vcc->push(vcc, skb); in dequeue_rx()
2217 atomic_inc(&vcc->stats->rx); in dequeue_rx()
2238 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2281 if (!atm_charge(vcc, hb->truesize)) { in dequeue_rx()
2289 atomic_inc(&vcc->stats->rx_drop); in dequeue_rx()
2320 ATM_SKB(hb)->vcc = vcc; in dequeue_rx()
2322 vcc->push(vcc, hb); in dequeue_rx()
2323 atomic_inc(&vcc->stats->rx); in dequeue_rx()