Lines Matching defs:tpd
1442 he_dev->tpd_pool = pci_pool_create("tpd", he_dev->pci_dev,
1445 hprintk("unable to create tpd pci_pool\n");
1630 struct he_tpd *tpd;
1633 tpd = pci_pool_alloc(he_dev->tpd_pool, GFP_ATOMIC|GFP_DMA, &mapping);
1634 if (tpd == NULL)
1637 tpd->status = TPD_ADDR(mapping);
1638 tpd->reserved = 0;
1639 tpd->iovec[0].addr = 0; tpd->iovec[0].len = 0;
1640 tpd->iovec[1].addr = 0; tpd->iovec[1].len = 0;
1641 tpd->iovec[2].addr = 0; tpd->iovec[2].len = 0;
1643 return tpd;
1826 struct he_tpd *tpd;
1840 tpd = NULL;
1843 tpd = __tpd;
1849 if (tpd == NULL) {
1850 hprintk("unable to locate tpd for dma buffer %x\n",
1857 he_mkcid(he_dev, tpd->vcc->vpi, tpd->vcc->vci));
1858 if (tpd->vcc)
1859 wake_up(&HE_VCC(tpd->vcc)->tx_waitq);
1865 if (tpd->iovec[slot].addr)
1867 tpd->iovec[slot].addr,
1868 tpd->iovec[slot].len & TPD_LEN_MASK,
1870 if (tpd->iovec[slot].len & TPD_LST)
1875 if (tpd->skb) { /* && !TBRQ_MULTIPLE(he_dev->tbrq_head) */
1876 if (tpd->vcc && tpd->vcc->pop)
1877 tpd->vcc->pop(tpd->vcc, tpd->skb);
1879 dev_kfree_skb_any(tpd->skb);
1883 if (tpd)
1884 pci_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status));
2072 __enqueue_tpd(struct he_dev *he_dev, struct he_tpd *tpd, unsigned cid)
2077 tpd, cid, he_dev->tpdrq_tail);
2100 if (tpd->iovec[slot].addr)
2102 tpd->iovec[slot].addr,
2103 tpd->iovec[slot].len & TPD_LEN_MASK,
2106 if (tpd->skb) {
2107 if (tpd->vcc->pop)
2108 tpd->vcc->pop(tpd->vcc, tpd->skb);
2110 dev_kfree_skb_any(tpd->skb);
2111 atomic_inc(&tpd->vcc->stats->tx_err);
2113 pci_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status));
2119 list_add_tail(&tpd->entry, &he_dev->outstanding_tpds);
2120 he_dev->tpdrq_tail->tpd = TPD_ADDR(tpd->status);
2349 struct he_tpd *tpd;
2440 tpd = __alloc_tpd(he_dev);
2441 if (tpd == NULL) {
2445 tpd->status |= TPD_EOS | TPD_INT;
2446 tpd->skb = NULL;
2447 tpd->vcc = vcc;
2452 __enqueue_tpd(he_dev, tpd, cid);
2507 struct he_tpd *tpd;
2540 tpd = __alloc_tpd(he_dev);
2541 if (tpd == NULL) {
2552 tpd->status |= TPD_CELLTYPE(TPD_USERCELL);
2559 tpd->status |= TPD_CELLTYPE(pti);
2561 tpd->status |= TPD_CLP;
2567 tpd->iovec[slot].addr = pci_map_single(he_dev->pci_dev, skb->data,
2569 tpd->iovec[slot].len = skb_headlen(skb);
2575 if (slot == TPD_MAXIOV) { /* queue tpd; start new tpd */
2576 tpd->vcc = vcc;
2577 tpd->skb = NULL; /* not the last fragment
2581 __enqueue_tpd(he_dev, tpd, cid);
2582 tpd = __alloc_tpd(he_dev);
2583 if (tpd == NULL) {
2592 tpd->status |= TPD_USERCELL;
2596 tpd->iovec[slot].addr = pci_map_single(he_dev->pci_dev,
2599 tpd->iovec[slot].len = frag->size;
2604 tpd->iovec[slot - 1].len |= TPD_LST;
2606 tpd->address0 = pci_map_single(he_dev->pci_dev, skb->data, skb->len, PCI_DMA_TODEVICE);
2607 tpd->length0 = skb->len | TPD_LST;
2609 tpd->status |= TPD_INT;
2611 tpd->vcc = vcc;
2612 tpd->skb = skb;
2616 __enqueue_tpd(he_dev, tpd, cid);