Lines Matching refs:buf_info
129 /* struct buf_info - maintains transmit buffer data handle
134 struct buf_info {
148 static void free_buf_info(struct cfv_info *cfv, struct buf_info *buf_info)
150 if (!buf_info)
152 gen_pool_free(cfv->genpool, (unsigned long) buf_info->vaddr,
153 buf_info->size);
154 kfree(buf_info);
169 struct buf_info *buf_info;
173 buf_info = virtqueue_get_buf(vq_tx, &len);
177 if (!buf_info)
180 free_buf_info(cfv, buf_info);
458 struct buf_info *buf_info;
469 while ((buf_info = virtqueue_detach_unused_buf(cfv->vq_tx)))
470 free_buf_info(cfv, buf_info);
479 static struct buf_info *cfv_alloc_and_copy_to_shm(struct cfv_info *cfv,
484 struct buf_info *buf_info = NULL;
496 buf_info = kmalloc(sizeof(struct buf_info), GFP_ATOMIC);
497 if (unlikely(!buf_info))
503 buf_info->size = cfv->tx_hr + skb->len + cfv->tx_tr + pad_len;
506 buf_info->vaddr = (void *)gen_pool_alloc(cfv->genpool, buf_info->size);
507 if (unlikely(!buf_info->vaddr))
511 skb_copy_bits(skb, 0, buf_info->vaddr + cfv->tx_hr + pad_len, skb->len);
512 sg_init_one(sg, buf_info->vaddr + pad_len,
515 return buf_info;
517 kfree(buf_info);
525 struct buf_info *buf_info;
548 buf_info = cfv_alloc_and_copy_to_shm(cfv, skb, &sg);
549 if (unlikely(!buf_info)) {
557 buf_info = cfv_alloc_and_copy_to_shm(cfv, skb, &sg);
569 if (unlikely(!buf_info)) {
575 ret = virtqueue_add_outbuf(cfv->vq_tx, &sg, 1, buf_info, GFP_ATOMIC);
596 free_buf_info(cfv, buf_info);