Lines Matching defs: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);
460 struct buf_info *buf_info;
471 while ((buf_info = virtqueue_detach_unused_buf(cfv->vq_tx)))
472 free_buf_info(cfv, buf_info);
481 static struct buf_info *cfv_alloc_and_copy_to_shm(struct cfv_info *cfv,
486 struct buf_info *buf_info = NULL;
498 buf_info = kmalloc(sizeof(struct buf_info), GFP_ATOMIC);
499 if (unlikely(!buf_info))
505 buf_info->size = cfv->tx_hr + skb->len + cfv->tx_tr + pad_len;
508 buf_info->vaddr = (void *)gen_pool_alloc(cfv->genpool, buf_info->size);
509 if (unlikely(!buf_info->vaddr))
513 skb_copy_bits(skb, 0, buf_info->vaddr + cfv->tx_hr + pad_len, skb->len);
514 sg_init_one(sg, buf_info->vaddr + pad_len,
517 return buf_info;
519 kfree(buf_info);
527 struct buf_info *buf_info;
550 buf_info = cfv_alloc_and_copy_to_shm(cfv, skb, &sg);
551 if (unlikely(!buf_info)) {
559 buf_info = cfv_alloc_and_copy_to_shm(cfv, skb, &sg);
571 if (unlikely(!buf_info)) {
577 ret = virtqueue_add_outbuf(cfv->vq_tx, &sg, 1, buf_info, GFP_ATOMIC);
598 free_buf_info(cfv, buf_info);