Lines Matching defs:efc
10 * The critical sections protected by the efc's spinlock are quite broad and
15 * means that the entry points into the libefc library are protected by efc
21 #include "efc.h"
23 int efcport_init(struct efc *efc)
27 spin_lock_init(&efc->lock);
28 INIT_LIST_HEAD(&efc->vport_list);
29 efc->hold_frames = false;
30 spin_lock_init(&efc->pend_frames_lock);
31 INIT_LIST_HEAD(&efc->pend_frames);
34 efc->node_pool = mempool_create_kmalloc_pool(EFC_MAX_REMOTE_NODES,
36 if (!efc->node_pool) {
37 efc_log_err(efc, "Can't allocate node pool\n");
41 efc->node_dma_pool = dma_pool_create("node_dma_pool", &efc->pci->dev,
43 if (!efc->node_dma_pool) {
44 efc_log_err(efc, "Can't allocate node dma pool\n");
45 mempool_destroy(efc->node_pool);
49 efc->els_io_pool = mempool_create_kmalloc_pool(EFC_ELS_IO_POOL_SZ,
51 if (!efc->els_io_pool) {
52 efc_log_err(efc, "Can't allocate els io pool\n");
60 efc_purge_pending(struct efc *efc)
65 spin_lock_irqsave(&efc->pend_frames_lock, flags);
67 list_for_each_entry_safe(frame, next, &efc->pend_frames, list_entry) {
69 efc->tt.hw_seq_free(efc, frame);
72 spin_unlock_irqrestore(&efc->pend_frames_lock, flags);
75 void efcport_destroy(struct efc *efc)
77 efc_purge_pending(efc);
78 mempool_destroy(efc->els_io_pool);
79 mempool_destroy(efc->node_pool);
80 dma_pool_destroy(efc->node_dma_pool);