Lines Matching full:io
13 spinlock_t lock; /* IO pool lock */
25 struct efct_io *io; in efct_io_pool_create() local
27 /* Allocate the IO pool */ in efct_io_pool_create()
34 /* initialize IO pool lock */ in efct_io_pool_create()
38 io = kzalloc(sizeof(*io), GFP_KERNEL); in efct_io_pool_create()
39 if (!io) in efct_io_pool_create()
43 io_pool->ios[i] = io; in efct_io_pool_create()
44 io->tag = i; in efct_io_pool_create()
45 io->instance_index = i; in efct_io_pool_create()
48 io->rspbuf.size = SCSI_RSP_BUF_LENGTH; in efct_io_pool_create()
49 io->rspbuf.virt = dma_alloc_coherent(&efct->pci->dev, in efct_io_pool_create()
50 io->rspbuf.size, in efct_io_pool_create()
51 &io->rspbuf.phys, GFP_KERNEL); in efct_io_pool_create()
52 if (!io->rspbuf.virt) { in efct_io_pool_create()
59 io->sgl = kzalloc(sizeof(*io->sgl) * num_sgl, GFP_KERNEL); in efct_io_pool_create()
60 if (!io->sgl) { in efct_io_pool_create()
65 io->sgl_allocated = num_sgl; in efct_io_pool_create()
66 io->sgl_count = 0; in efct_io_pool_create()
68 INIT_LIST_HEAD(&io->list_entry); in efct_io_pool_create()
69 list_add_tail(&io->list_entry, &io_pool->freelist); in efct_io_pool_create()
80 struct efct_io *io; in efct_io_pool_free() local
86 io = io_pool->ios[i]; in efct_io_pool_free()
87 if (!io) in efct_io_pool_free()
90 kfree(io->sgl); in efct_io_pool_free()
92 io->rspbuf.size, io->rspbuf.virt, in efct_io_pool_free()
93 io->rspbuf.phys); in efct_io_pool_free()
94 memset(&io->rspbuf, 0, sizeof(struct efc_dma)); in efct_io_pool_free()
107 struct efct_io *io = NULL; in efct_io_pool_io_alloc() local
116 io = list_first_entry(&io_pool->freelist, struct efct_io, in efct_io_pool_io_alloc()
118 list_del_init(&io->list_entry); in efct_io_pool_io_alloc()
123 if (!io) in efct_io_pool_io_alloc()
126 io->io_type = EFCT_IO_TYPE_MAX; in efct_io_pool_io_alloc()
127 io->hio_type = EFCT_HW_IO_MAX; in efct_io_pool_io_alloc()
128 io->hio = NULL; in efct_io_pool_io_alloc()
129 io->transferred = 0; in efct_io_pool_io_alloc()
130 io->efct = efct; in efct_io_pool_io_alloc()
131 io->timeout = 0; in efct_io_pool_io_alloc()
132 io->sgl_count = 0; in efct_io_pool_io_alloc()
133 io->tgt_task_tag = 0; in efct_io_pool_io_alloc()
134 io->init_task_tag = 0; in efct_io_pool_io_alloc()
135 io->hw_tag = 0; in efct_io_pool_io_alloc()
136 io->display_name = "pending"; in efct_io_pool_io_alloc()
137 io->seq_init = 0; in efct_io_pool_io_alloc()
138 io->io_free = 0; in efct_io_pool_io_alloc()
139 io->release = NULL; in efct_io_pool_io_alloc()
142 return io; in efct_io_pool_io_alloc()
145 /* Free an object used to track an IO */
147 efct_io_pool_io_free(struct efct_io_pool *io_pool, struct efct_io *io) in efct_io_pool_io_free() argument
156 hio = io->hio; in efct_io_pool_io_free()
157 io->hio = NULL; in efct_io_pool_io_free()
158 io->io_free = 1; in efct_io_pool_io_free()
159 INIT_LIST_HEAD(&io->list_entry); in efct_io_pool_io_free()
160 list_add(&io->list_entry, &io_pool->freelist); in efct_io_pool_io_free()
175 struct efct_io *io = NULL; in efct_io_find_tgt_io() local
180 list_for_each_entry(io, &node->active_ios, list_entry) { in efct_io_find_tgt_io()
181 if ((io->cmd_tgt && io->init_task_tag == ox_id) && in efct_io_find_tgt_io()
182 (rx_id == 0xffff || io->tgt_task_tag == rx_id)) { in efct_io_find_tgt_io()
183 if (kref_get_unless_zero(&io->ref)) in efct_io_find_tgt_io()
189 return found ? io : NULL; in efct_io_find_tgt_io()