Lines Matching refs:mq
122 void (*callback) (struct mapleq *mq), in maple_getcond_callback()
140 struct mapleq *mq; in maple_release_device() local
143 mq = mdev->mq; in maple_release_device()
144 kmem_cache_free(maple_queue_cache, mq->recvbuf); in maple_release_device()
145 kfree(mq); in maple_release_device()
172 mdev->mq->command = command; in maple_add_packet()
173 mdev->mq->length = length; in maple_add_packet()
176 mdev->mq->sendbuf = sendbuf; in maple_add_packet()
179 list_add_tail(&mdev->mq->list, &maple_waitq); in maple_add_packet()
188 struct mapleq *mq; in maple_allocq() local
190 mq = kzalloc(sizeof(*mq), GFP_KERNEL); in maple_allocq()
191 if (!mq) in maple_allocq()
194 INIT_LIST_HEAD(&mq->list); in maple_allocq()
195 mq->dev = mdev; in maple_allocq()
196 mq->recvbuf = kmem_cache_zalloc(maple_queue_cache, GFP_KERNEL); in maple_allocq()
197 if (!mq->recvbuf) in maple_allocq()
199 mq->recvbuf->buf = &((mq->recvbuf->bufx)[0]); in maple_allocq()
201 return mq; in maple_allocq()
204 kfree(mq); in maple_allocq()
225 mdev->mq = maple_allocq(mdev); in maple_alloc_dev()
227 if (!mdev->mq) { in maple_alloc_dev()
239 kmem_cache_free(maple_queue_cache, mdev->mq->recvbuf); in maple_free_dev()
240 kfree(mdev->mq); in maple_free_dev()
247 static void maple_build_block(struct mapleq *mq) in maple_build_block() argument
250 unsigned long *lsendbuf = mq->sendbuf; in maple_build_block()
252 port = mq->dev->port & 3; in maple_build_block()
253 unit = mq->dev->unit; in maple_build_block()
254 len = mq->length; in maple_build_block()
262 *maple_sendptr++ = virt_to_phys(mq->recvbuf->buf); in maple_build_block()
264 mq->command | (to << 8) | (from << 16) | (len << 24); in maple_build_block()
273 struct mapleq *mq, *nmq; in maple_send() local
293 list_for_each_entry_safe(mq, nmq, &maple_waitq, list) { in maple_send()
294 maple_build_block(mq); in maple_send()
295 list_del_init(&mq->list); in maple_send()
296 list_add_tail(&mq->list, &maple_sentq); in maple_send()
337 recvbuf = mdev->mq->recvbuf->buf; in maple_attach_driver()
633 struct mapleq *mq, *nmq; in maple_dma_handler() local
642 list_for_each_entry_safe(mq, nmq, &maple_sentq, list) { in maple_dma_handler()
643 mdev = mq->dev; in maple_dma_handler()
644 recvbuf = mq->recvbuf->buf; in maple_dma_handler()
648 kfree(mq->sendbuf); in maple_dma_handler()
649 list_del_init(&mq->list); in maple_dma_handler()
662 mdev->callback(mq); in maple_dma_handler()