Lines Matching defs:controller

62  * @brief This user callback will inform the user that the controller has
65 * complete. Subsequently, the user should reset the controller.
67 * @param[in] controller This parameter specifies the controller that had
72 void scif_cb_controller_error(SCI_CONTROLLER_HANDLE_T controller,
81 * @brief This user callback will inform the user that the controller has
84 * @param[in] controller This parameter specifies the controller that was
92 void scif_cb_controller_start_complete(SCI_CONTROLLER_HANDLE_T controller,
97 sci_object_get_association(controller);
104 * the controller with CAM.
128 * @brief This user callback will inform the user that the controller has
130 * scif_controller_stop(), before user receives this controller stop
134 * @param[in] controller This parameter specifies the controller that was
142 void scif_cb_controller_stop_complete(SCI_CONTROLLER_HANDLE_T controller,
146 sci_object_get_association(controller);
162 * @param[in] controller This parameter represents the controller
170 void scif_cb_controller_allocate_memory(SCI_CONTROLLER_HANDLE_T controller,
174 sci_object_get_association(controller);
180 * We first try to pull a buffer from the controller's pool, and only
201 * @param[in] controller This parameter represents the controller
209 void scif_cb_controller_free_memory(SCI_CONTROLLER_HANDLE_T controller,
213 sci_object_get_association(controller);
216 * Put the buffer back into the controller's buffer pool, rather
224 void isci_controller_construct(struct ISCI_CONTROLLER *controller,
235 controller->isci = isci;
236 controller->scif_controller_handle = scif_controller_handle;
242 sci_object_set_association(scif_controller_handle, (void *)controller);
244 controller->is_started = FALSE;
245 controller->is_frozen = FALSE;
246 controller->release_queued_ccbs = FALSE;
247 controller->sim = NULL;
248 controller->initial_discovery_mask = 0;
250 sci_fast_list_init(&controller->pending_device_reset_list);
252 mtx_init(&controller->lock, "isci", NULL, MTX_DEF);
257 isci_domain_construct( &controller->domain[domain_index],
258 domain_index, controller);
261 controller->timer_memory = malloc(
265 sci_pool_initialize(controller->timer_pool);
268 controller->timer_memory;
271 sci_pool_put(controller->timer_pool, timer++);
274 sci_pool_initialize(controller->unmap_buffer_pool);
297 SCI_STATUS isci_controller_initialize(struct ISCI_CONTROLLER *controller)
308 scif_controller_get_scic_handle(controller->scif_controller_handle);
310 if (controller->isci->oem_parameters_found == TRUE)
314 &controller->oem_parameters,
315 (uint8_t)(controller->oem_parameters_version));
350 controller->queue_depth = SCI_MAX_IO_REQUESTS - SCI_MAX_DOMAINS;
353 &controller->queue_depth)) {
354 controller->queue_depth = max(1, min(controller->queue_depth,
361 controller->sim_queue_depth = controller->queue_depth - 1;
365 * while at the same time having CAM fill our controller queue. To
372 controller->sim_queue_depth += io_shortage;
376 controller->fail_on_task_timeout = fail_on_timeout;
382 controller->has_been_scanned = FALSE;
383 mtx_lock(&controller->lock);
384 isci_controller_attach_to_cam(controller);
385 xpt_freeze_simq(controller->sim, 1);
386 mtx_unlock(&controller->lock);
389 controller->phys[i].handle = scic_controller_handle;
390 controller->phys[i].index = i;
393 controller->phys[i].led_fault = 0;
394 sprintf(led_name, "isci.bus%d.port%d.fault", controller->index, i);
395 controller->phys[i].cdev_fault = led_create(isci_led_fault_func,
396 &controller->phys[i], led_name);
399 controller->phys[i].led_locate = 0;
400 sprintf(led_name, "isci.bus%d.port%d.locate", controller->index, i);
401 controller->phys[i].cdev_locate = led_create(isci_led_locate_func,
402 &controller->phys[i], led_name);
405 return (scif_controller_initialize(controller->scif_controller_handle));
408 int isci_controller_allocate_memory(struct ISCI_CONTROLLER *controller)
411 device_t device = controller->isci->device;
415 &controller->uncached_controller_memory;
417 &controller->cached_controller_memory;
419 &controller->request_memory;
423 controller->mdl = sci_controller_get_memory_descriptor_list_handle(
424 controller->scif_controller_handle);
427 controller->mdl, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS);
434 sci_mdl_decorator_assign_memory( controller->mdl,
440 controller->mdl,
449 sci_mdl_decorator_assign_memory(controller->mdl,
455 controller->queue_depth * isci_io_request_get_object_size();
480 &controller->buffer_dma_tag);
482 sci_pool_initialize(controller->request_pool);
487 for (int i = 0; i < controller->queue_depth; i++) {
492 controller->scif_controller_handle,
493 controller->buffer_dma_tag, physical_address);
495 sci_pool_put(controller->request_pool, request);
504 controller->remote_device_memory = (uint8_t *) malloc(
508 sci_pool_initialize(controller->remote_device_pool);
510 uint8_t *remote_device_memory_ptr = controller->remote_device_memory;
516 controller->remote_device[i] = NULL;
533 controller->domain[i].da_remote_device = remote_device;
535 sci_pool_put(controller->remote_device_pool,
545 struct ISCI_CONTROLLER *controller =
548 controller->scif_controller_handle;
554 scif_controller_get_scic_handle(controller->scif_controller_handle));
617 int isci_controller_attach_to_cam(struct ISCI_CONTROLLER *controller)
619 struct isci_softc *isci = controller->isci;
622 struct cam_devq *isci_devq = cam_simq_alloc(controller->sim_queue_depth);
629 controller->sim = cam_sim_alloc(isci_action, isci_poll, "isci",
630 controller, unit, &controller->lock, controller->sim_queue_depth,
631 controller->sim_queue_depth, isci_devq);
633 if(controller->sim == NULL) {
639 if(xpt_bus_register(controller->sim, parent, controller->index)
642 cam_sim_free(controller->sim, TRUE);
643 mtx_unlock(&controller->lock);
647 if(xpt_create_path(&controller->path, NULL,
648 cam_sim_path(controller->sim), CAM_TARGET_WILDCARD,
651 xpt_bus_deregister(cam_sim_path(controller->sim));
652 cam_sim_free(controller->sim, TRUE);
653 mtx_unlock(&controller->lock);
662 struct ISCI_CONTROLLER *controller =
665 isci_interrupt_poll_handler(controller);
670 struct ISCI_CONTROLLER *controller =
714 remote_device = controller->remote_device[ccb->ccb_h.target_id];
748 isci_io_request_execute_scsi_io(ccb, controller);
752 isci_io_request_execute_smp_io(ccb, controller);
767 controller->remote_device[ccb->ccb_h.target_id];
806 isci_controller_release_queued_ccbs(struct ISCI_CONTROLLER *controller)
813 KASSERT(mtx_owned(&controller->lock), ("controller lock not owned"));
815 controller->release_queued_ccbs = FALSE;
820 dev = controller->remote_device[dev_idx];
835 (union ccb *)ccb_h, controller);