Lines Matching refs:ltb
117 struct ibmvnic_long_term_buff *ltb);
425 static bool reuse_ltb(struct ibmvnic_long_term_buff *ltb, int size) in reuse_ltb() argument
427 return (ltb->buff && ltb->size == size); in reuse_ltb()
452 struct ibmvnic_long_term_buff *ltb, int size) in alloc_long_term_buff() argument
458 if (!reuse_ltb(ltb, size)) { in alloc_long_term_buff()
461 ltb->size, size); in alloc_long_term_buff()
462 prev = ltb->size; in alloc_long_term_buff()
463 free_long_term_buff(adapter, ltb); in alloc_long_term_buff()
466 if (ltb->buff) { in alloc_long_term_buff()
468 ltb->map_id, ltb->size); in alloc_long_term_buff()
470 ltb->buff = dma_alloc_coherent(dev, size, <b->addr, in alloc_long_term_buff()
472 if (!ltb->buff) { in alloc_long_term_buff()
476 ltb->size = size; in alloc_long_term_buff()
478 ltb->map_id = find_first_zero_bit(adapter->map_ids, in alloc_long_term_buff()
480 bitmap_set(adapter->map_ids, ltb->map_id, 1); in alloc_long_term_buff()
484 ltb->map_id, ltb->size, prev); in alloc_long_term_buff()
488 memset(ltb->buff, 0, ltb->size); in alloc_long_term_buff()
494 rc = send_request_map(adapter, ltb->addr, ltb->size, ltb->map_id); in alloc_long_term_buff()
521 struct ibmvnic_long_term_buff *ltb) in free_long_term_buff() argument
525 if (!ltb->buff) in free_long_term_buff()
535 send_request_unmap(adapter, ltb->map_id); in free_long_term_buff()
537 dma_free_coherent(dev, ltb->size, ltb->buff, ltb->addr); in free_long_term_buff()
539 ltb->buff = NULL; in free_long_term_buff()
541 bitmap_clear(adapter->map_ids, ltb->map_id, 1); in free_long_term_buff()
542 ltb->map_id = 0; in free_long_term_buff()
696 struct ibmvnic_long_term_buff *ltb; in map_rxpool_buf_to_ltb() local
703 ltb = &rxpool->ltb_set.ltbs[i]; in map_rxpool_buf_to_ltb()
704 nbufs = ltb->size / rxpool->buff_size; in map_rxpool_buf_to_ltb()
710 *ltbp = ltb; in map_rxpool_buf_to_ltb()
729 struct ibmvnic_long_term_buff *ltb; in map_txpool_buf_to_ltb() local
736 ltb = &txpool->ltb_set.ltbs[i]; in map_txpool_buf_to_ltb()
737 nbufs = ltb->size / txpool->buf_size; in map_txpool_buf_to_ltb()
743 *ltbp = ltb; in map_txpool_buf_to_ltb()
763 struct ibmvnic_long_term_buff *ltb; in replenish_rx_pool() local
810 map_rxpool_buf_to_ltb(pool, bufidx, <b, &offset); in replenish_rx_pool()
811 dst = ltb->buff + offset; in replenish_rx_pool()
813 dma_addr = ltb->addr + offset; in replenish_rx_pool()
829 sub_crq->rx_add.map_id = ltb->map_id; in replenish_rx_pool()
2398 struct ibmvnic_long_term_buff *ltb; in ibmvnic_xmit() local
2467 map_txpool_buf_to_ltb(tx_pool, bufidx, <b, &offset); in ibmvnic_xmit()
2469 dst = ltb->buff + offset; in ibmvnic_xmit()
2471 data_dma_addr = ltb->addr + offset; in ibmvnic_xmit()
2538 tx_crq.v1.dma_reg = cpu_to_be16(ltb->map_id); in ibmvnic_xmit()