Lines Matching refs:devq
240 static void xpt_run_devq(struct cam_devq *devq);
320 xpt_schedule_devq(struct cam_devq *devq, struct cam_ed *dev) in xpt_schedule_devq() argument
324 mtx_assert(&devq->send_mtx, MA_OWNED); in xpt_schedule_devq()
334 xpt_schedule_dev(&devq->send_queue, in xpt_schedule_devq()
882 struct cam_devq *devq; in xpt_init() local
909 devq = cam_simq_alloc(16); in xpt_init()
910 if (devq == NULL) in xpt_init()
920 devq); in xpt_init()
2592 struct cam_devq *devq; in xpt_action_default() local
2594 devq = path->bus->sim->devq; in xpt_action_default()
2595 mtx_lock(&devq->send_mtx); in xpt_action_default()
2597 if (xpt_schedule_devq(devq, path->device) != 0) in xpt_action_default()
2598 xpt_run_devq(devq); in xpt_action_default()
2599 mtx_unlock(&devq->send_mtx); in xpt_action_default()
2620 struct cam_devq *devq; in xpt_action_default() local
2623 devq = device->sim->devq; in xpt_action_default()
2625 mtx_lock(&devq->send_mtx); in xpt_action_default()
2631 mtx_unlock(&devq->send_mtx); in xpt_action_default()
2636 mtx_unlock(&devq->send_mtx); in xpt_action_default()
2731 struct cam_devq *devq = bus->sim->devq; in xpt_action_default() local
2733 mtx_lock(&devq->send_mtx); in xpt_action_default()
2744 mtx_unlock(&devq->send_mtx); in xpt_action_default()
2950 mtx_lock(&dev->sim->devq->send_mtx); in xpt_action_default()
2994 mtx_unlock(&dev->sim->devq->send_mtx); in xpt_action_default()
3103 struct cam_devq *devq; in xpt_poll_setup() local
3108 devq = sim->devq; in xpt_poll_setup()
3117 mtx_lock(&devq->send_mtx); in xpt_poll_setup()
3119 while((devq->send_openings <= 0 || dev->ccbq.dev_openings < 0) && in xpt_poll_setup()
3121 mtx_unlock(&devq->send_mtx); in xpt_poll_setup()
3124 mtx_lock(&devq->send_mtx); in xpt_poll_setup()
3127 mtx_unlock(&devq->send_mtx); in xpt_poll_setup()
3289 xpt_run_devq(struct cam_devq *devq) in xpt_run_devq() argument
3295 devq->send_queue.qfrozen_cnt++; in xpt_run_devq()
3296 while ((devq->send_queue.entries > 0) in xpt_run_devq()
3297 && (devq->send_openings > 0) in xpt_run_devq()
3298 && (devq->send_queue.qfrozen_cnt <= 1)) { in xpt_run_devq()
3304 device = (struct cam_ed *)camq_remove(&devq->send_queue, in xpt_run_devq()
3341 devq->send_openings--; in xpt_run_devq()
3342 devq->send_active++; in xpt_run_devq()
3343 xpt_schedule_devq(devq, device); in xpt_run_devq()
3344 mtx_unlock(&devq->send_mtx); in xpt_run_devq()
3389 mtx_lock(&devq->send_mtx); in xpt_run_devq()
3391 devq->send_queue.qfrozen_cnt--; in xpt_run_devq()
4344 struct cam_devq *devq; in xpt_freeze_devq_device() local
4347 devq = dev->sim->devq; in xpt_freeze_devq_device()
4348 mtx_assert(&devq->send_mtx, MA_OWNED); in xpt_freeze_devq_device()
4355 camq_remove(&devq->send_queue, dev->devq_entry.index); in xpt_freeze_devq_device()
4363 struct cam_devq *devq; in xpt_freeze_devq() local
4366 devq = dev->sim->devq; in xpt_freeze_devq()
4367 mtx_lock(&devq->send_mtx); in xpt_freeze_devq()
4370 mtx_unlock(&devq->send_mtx); in xpt_freeze_devq()
4377 struct cam_devq *devq; in xpt_freeze_simq() local
4380 devq = sim->devq; in xpt_freeze_simq()
4381 mtx_lock(&devq->send_mtx); in xpt_freeze_simq()
4382 freeze = (devq->send_queue.qfrozen_cnt += count); in xpt_freeze_simq()
4383 mtx_unlock(&devq->send_mtx); in xpt_freeze_simq()
4391 struct cam_devq *devq; in xpt_release_devq_timeout() local
4395 devq = dev->sim->devq; in xpt_release_devq_timeout()
4396 mtx_assert(&devq->send_mtx, MA_OWNED); in xpt_release_devq_timeout()
4398 xpt_run_devq(devq); in xpt_release_devq_timeout()
4405 struct cam_devq *devq; in xpt_release_devq() local
4410 devq = dev->sim->devq; in xpt_release_devq()
4411 mtx_lock(&devq->send_mtx); in xpt_release_devq()
4413 xpt_run_devq(dev->sim->devq); in xpt_release_devq()
4414 mtx_unlock(&devq->send_mtx); in xpt_release_devq()
4421 mtx_assert(&dev->sim->devq->send_mtx, MA_OWNED); in xpt_release_devq_device()
4452 xpt_schedule_devq(dev->sim->devq, dev); in xpt_release_devq_device()
4461 struct cam_devq *devq; in xpt_release_simq() local
4463 devq = sim->devq; in xpt_release_simq()
4464 mtx_lock(&devq->send_mtx); in xpt_release_simq()
4465 if (devq->send_queue.qfrozen_cnt <= 0) { in xpt_release_simq()
4468 devq->send_queue.qfrozen_cnt); in xpt_release_simq()
4471 devq->send_queue.qfrozen_cnt--; in xpt_release_simq()
4472 if (devq->send_queue.qfrozen_cnt == 0) { in xpt_release_simq()
4477 xpt_run_devq(sim->devq); in xpt_release_simq()
4480 mtx_unlock(&devq->send_mtx); in xpt_release_simq()
4765 struct cam_devq *devq; in xpt_alloc_device() local
4770 devq = bus->sim->devq; in xpt_alloc_device()
4771 mtx_lock(&devq->send_mtx); in xpt_alloc_device()
4772 status = cam_devq_resize(devq, devq->send_queue.array_size + 1); in xpt_alloc_device()
4773 mtx_unlock(&devq->send_mtx); in xpt_alloc_device()
4799 callout_init_mtx(&device->callout, &devq->send_mtx, 0); in xpt_alloc_device()
4832 struct cam_devq *devq; in xpt_release_device() local
4845 devq = bus->sim->devq; in xpt_release_device()
4846 mtx_lock(&devq->send_mtx); in xpt_release_device()
4847 cam_devq_resize(devq, devq->send_queue.array_size - 1); in xpt_release_device()
4858 mtx_unlock(&devq->send_mtx); in xpt_release_device()
4886 mtx_lock(&dev->sim->devq->send_mtx); in xpt_dev_ccbq_resize()
4888 mtx_unlock(&dev->sim->devq->send_mtx); in xpt_dev_ccbq_resize()
5260 struct cam_devq *devq = NULL; in xpt_done_process() local
5294 mtx_lock(&device->sim->devq->send_mtx); in xpt_done_process()
5297 mtx_unlock(&device->sim->devq->send_mtx); in xpt_done_process()
5326 devq = sim->devq; in xpt_done_process()
5327 KASSERT(devq, ("Periph disappeared with CCB %p %s request pending.", in xpt_done_process()
5330 mtx_lock(&devq->send_mtx); in xpt_done_process()
5331 devq->send_active--; in xpt_done_process()
5332 devq->send_openings++; in xpt_done_process()
5350 (void)xpt_schedule_devq(devq, dev); in xpt_done_process()
5351 xpt_run_devq(devq); in xpt_done_process()
5352 mtx_unlock(&devq->send_mtx); in xpt_done_process()