Lines Matching +full:lock +full:- +full:status

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
6 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
117 while (ep->type && ep->type != type)
120 if (ep->desc)
122 device_set_desc(device, ep->desc);
136 struct ISCI_PCI_BAR *pci_bar = &isci->pci_bar[i];
138 pci_bar->resource_id = PCIR_BAR(i*2);
139 pci_bar->resource = bus_alloc_resource_any(isci->device,
140 SYS_RES_MEMORY, &pci_bar->resource_id,
143 if(pci_bar->resource == NULL)
147 pci_bar->bus_tag = rman_get_bustag(pci_bar->resource);
148 pci_bar->bus_handle =
149 rman_get_bushandle(pci_bar->resource);
163 isci->device = device;
188 for (i = 0; i < isci->controller_count; i++) {
189 struct ISCI_CONTROLLER *controller = &isci->controllers[i];
190 SCI_STATUS status;
193 if (controller->scif_controller_handle != NULL) {
195 scif_controller_get_scic_handle(controller->scif_controller_handle));
197 mtx_lock(&controller->lock);
198 status = scif_controller_stop(controller->scif_controller_handle, 0);
199 mtx_unlock(&controller->lock);
201 while (controller->is_started == TRUE) {
205 mtx_lock(&controller->lock);
207 mtx_unlock(&controller->lock);
211 if(controller->sim != NULL) {
212 mtx_lock(&controller->lock);
213 xpt_free_path(controller->path);
214 xpt_bus_deregister(cam_sim_path(controller->sim));
215 cam_sim_free(controller->sim, TRUE);
216 mtx_unlock(&controller->lock);
220 if (controller->timer_memory != NULL)
221 free(controller->timer_memory, M_ISCI);
223 if (controller->remote_device_memory != NULL)
224 free(controller->remote_device_memory, M_ISCI);
227 if (controller->phys[phy].cdev_fault)
228 led_destroy(controller->phys[phy].cdev_fault);
230 if (controller->phys[phy].cdev_locate)
231 led_destroy(controller->phys[phy].cdev_locate);
235 sci_pool_get(controller->unmap_buffer_pool, unmap_buffer);
245 if (isci->sci_library_memory != NULL)
246 free(isci->sci_library_memory, M_ISCI);
250 struct ISCI_PCI_BAR *pci_bar = &isci->pci_bar[i];
252 if (pci_bar->resource != NULL)
254 pci_bar->resource_id, pci_bar->resource);
257 for (i = 0; i < isci->num_interrupts; i++)
261 interrupt_info = &isci->interrupt_info[i];
263 if(interrupt_info->tag != NULL)
264 bus_teardown_intr(device, interrupt_info->res,
265 interrupt_info->tag);
267 if(interrupt_info->res != NULL)
269 rman_get_rid(interrupt_info->res),
270 interrupt_info->res);
283 uint32_t status = 0;
292 isci->sci_library_memory =
295 isci->sci_library_handle = scif_library_construct(
296 isci->sci_library_memory, SCI_MAX_CONTROLLERS);
298 sci_object_set_association( isci->sci_library_handle, (void *)isci);
317 sci_logger_enable(sci_object_get_logger(isci->sci_library_handle),
321 scif_library_get_scic_handle(isci->sci_library_handle)),
324 header_buffer = (uint8_t *)&isci->pci_common_header;
325 for (uint8_t i = 0; i < sizeof(isci->pci_common_header); i++)
326 header_buffer[i] = pci_read_config(isci->device, i, 1);
329 scif_library_get_scic_handle(isci->sci_library_handle),
330 &isci->pci_common_header);
332 isci->oem_parameters_found = FALSE;
337 isci->coalesce_number = 32;
342 isci->coalesce_timeout = 2;
344 isci->controller_count = scic_library_get_pci_device_controller_count(
345 scif_library_get_scic_handle(isci->sci_library_handle));
347 for (int index = 0; index < isci->controller_count; index++) {
348 struct ISCI_CONTROLLER *controller = &isci->controllers[index];
351 controller->index = index;
354 scif_controller_handle = controller->scif_controller_handle;
356 status = isci_controller_initialize(controller);
358 if(status != SCI_SUCCESS) {
361 status);
362 return (status);
371 scif_controller_handle, isci->coalesce_number,
372 isci->coalesce_timeout);
381 isci->config_hook.ich_func = &isci_controller_start;
382 isci->config_hook.ich_arg = &isci->controllers[0];
384 if (config_intrhook_establish(&isci->config_hook) != 0)
388 return (status);
397 memory->error = error;
403 memory->physical_address = seg->ds_addr;
410 uint32_t status;
412 status = bus_dma_tag_create(bus_get_dma_tag(device),
415 BUS_SPACE_MAXADDR, NULL, NULL, memory->size,
417 memory->size, 0, busdma_lock_mutex, &controller->lock,
418 &memory->dma_tag);
420 if(status == ENOMEM) {
422 return (status);
425 status = bus_dmamem_alloc(memory->dma_tag,
426 (void **)&memory->virtual_address, BUS_DMA_ZERO, &memory->dma_map);
428 if(status == ENOMEM)
431 return (status);
434 status = bus_dmamap_load(memory->dma_tag, memory->dma_map,
435 (void *)memory->virtual_address, memory->size,
438 if(status == EINVAL)
441 return (status);
449 * lock with an operating environment specific locking construct.
452 * which this lock is to be associated.
453 * @param[in] lock This parameter specifies the lock for which the
463 SCI_LOCK_HANDLE_T lock)
469 * @brief This callback method asks the user to de-associate the supplied
470 * lock with an operating environment specific locking construct.
473 * which this lock is to be de-associated.
474 * @param[in] lock This parameter specifies the lock for which the
475 * user should de-associate an operating environment specific
484 SCI_LOCK_HANDLE_T lock)
491 * @brief This callback method asks the user to acquire/get the lock.
492 * This method should pend until the lock has been acquired.
495 * which this lock is associated.
496 * @param[in] lock This parameter specifies the lock to be acquired.
502 SCI_LOCK_HANDLE_T lock)
508 * @brief This callback method asks the user to release a lock.
511 * which this lock is associated.
512 * @param[in] lock This parameter specifies the lock to be released.
518 SCI_LOCK_HANDLE_T lock)
584 struct isci_softc *isci = isci_controller->isci;
588 bus_space_write_4(isci->pci_bar[bar].bus_tag,
589 isci->pci_bar[bar].bus_handle, offset, write_value);
611 struct isci_softc *isci = isci_controller->isci;
615 return (bus_space_read_4(isci->pci_bar[bar].bus_tag,
616 isci->pci_bar[bar].bus_handle, offset));
622 * or non-performance paths only.