Lines Matching refs:aac

390 	struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata;  in aac_slave_configure()  local
399 if (chn < AAC_MAX_BUSES && tid < AAC_MAX_TARGETS && aac->sa_firmware) { in aac_slave_configure()
400 devtype = aac->hba_map[chn][tid].devtype; in aac_slave_configure()
403 depth = aac->hba_map[chn][tid].qd_limit; in aac_slave_configure()
414 if (aac->jbod && (sdev->type == TYPE_DISK)) in aac_slave_configure()
419 && (!aac->jbod || sdev->inq_periph_qual) in aac_slave_configure()
420 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2))) { in aac_slave_configure()
431 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_slave_configure()
442 for (cid = 0; cid < aac->maximum_num_containers; ++cid) in aac_slave_configure()
443 if (aac->fsa_dev[cid].valid) in aac_slave_configure()
449 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_slave_configure()
452 || !aac->fsa_dev[sdev_id(dev)].valid) { in aac_slave_configure()
514 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_change_queue_depth() local
520 aac->hba_map[chn][tid].devtype == AAC_DEVTYPE_NATIVE_RAW) in aac_change_queue_depth()
545 scsi_change_queue_depth(sdev, aac->hba_map[chn][tid].qd_limit); in aac_change_queue_depth()
555 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_show_raid_level() local
559 ((aac->jbod && (sdev->type == TYPE_DISK)) ? "JBOD\n" : "")); in aac_show_raid_level()
561 get_container_type(aac->fsa_dev[sdev_id(sdev)].type)); in aac_show_raid_level()
576 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_show_unique_id() local
582 memcpy(sn, aac->fsa_dev[sdev_id(sdev)].identifier, sizeof(sn)); in aac_show_unique_id()
617 static int get_num_of_incomplete_fibs(struct aac_dev *aac) in get_num_of_incomplete_fibs() argument
622 struct Scsi_Host *shost = aac->scsi_host_ptr; in get_num_of_incomplete_fibs()
656 ctrl_dev = &aac->pdev->dev; in get_num_of_incomplete_fibs()
671 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_abort() local
676 if (aac_adapter_check_health(aac)) in aac_eh_abort()
681 if (aac->hba_map[bus][cid].devtype == AAC_DEVTYPE_NATIVE_RAW) { in aac_eh_abort()
693 fib = &aac->fibs[count]; in aac_eh_abort()
705 fib = aac_fib_alloc(aac); in aac_eh_abort()
712 tmf->it_nexus = aac->hba_map[bus][cid].rmw_nexus; in aac_eh_abort()
748 if (!(aac->raw_io_interface) || in aac_eh_abort()
749 !(aac->raw_io_64) || in aac_eh_abort()
762 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
784 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
888 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_dev_reset() local
903 info = &aac->hba_map[bus][cid]; in aac_eh_dev_reset()
912 fib = aac_fib_alloc(aac); in aac_eh_dev_reset()
946 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_target_reset() local
961 info = &aac->hba_map[bus][cid]; in aac_eh_target_reset()
970 fib = aac_fib_alloc(aac); in aac_eh_target_reset()
1005 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_bus_reset() local
1014 struct fib *fib = &aac->fibs[count]; in aac_eh_bus_reset()
1027 info = &aac->hba_map[bus][cid]; in aac_eh_bus_reset()
1041 status = aac_adapter_check_health(aac); in aac_eh_bus_reset()
1043 dev_err(&aac->pdev->dev, "Adapter health - %d\n", status); in aac_eh_bus_reset()
1045 count = get_num_of_incomplete_fibs(aac); in aac_eh_bus_reset()
1058 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_host_reset() local
1068 supported_options2 = aac->supplement_adapter_info.supported_options2; in aac_eh_host_reset()
1081 if (aac_reset_adapter(aac, 2, IOP_HWSOFT_RESET) == 0) in aac_eh_host_reset()
1093 info = &aac->hba_map[bus][cid]; in aac_eh_host_reset()
1116 struct aac_dev *aac; in aac_cfg_open() local
1121 list_for_each_entry(aac, &aac_devices, entry) { in aac_cfg_open()
1122 if (aac->id == minor_number) { in aac_cfg_open()
1123 file->private_data = aac; in aac_cfg_open()
1150 struct aac_dev *aac = (struct aac_dev *)file->private_data; in aac_cfg_ioctl() local
1155 return aac_do_ioctl(aac, cmd, (void __user *)arg); in aac_cfg_ioctl()
1537 static void __aac_shutdown(struct aac_dev * aac) in __aac_shutdown() argument
1541 mutex_lock(&aac->ioctl_mutex); in __aac_shutdown()
1542 aac->adapter_shutdown = 1; in __aac_shutdown()
1543 mutex_unlock(&aac->ioctl_mutex); in __aac_shutdown()
1545 if (aac->aif_thread) { in __aac_shutdown()
1548 for (i = 0; i < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); i++) { in __aac_shutdown()
1549 struct fib *fib = &aac->fibs[i]; in __aac_shutdown()
1554 kthread_stop(aac->thread); in __aac_shutdown()
1555 aac->thread = NULL; in __aac_shutdown()
1558 aac_send_shutdown(aac); in __aac_shutdown()
1560 aac_adapter_disable_int(aac); in __aac_shutdown()
1562 if (aac_is_src(aac)) { in __aac_shutdown()
1563 if (aac->max_msix > 1) { in __aac_shutdown()
1564 for (i = 0; i < aac->max_msix; i++) { in __aac_shutdown()
1565 free_irq(pci_irq_vector(aac->pdev, i), in __aac_shutdown()
1566 &(aac->aac_msix[i])); in __aac_shutdown()
1569 free_irq(aac->pdev->irq, in __aac_shutdown()
1570 &(aac->aac_msix[0])); in __aac_shutdown()
1573 free_irq(aac->pdev->irq, aac); in __aac_shutdown()
1575 if (aac->msi) in __aac_shutdown()
1576 pci_disable_msi(aac->pdev); in __aac_shutdown()
1577 else if (aac->max_msix > 1) in __aac_shutdown()
1578 pci_disable_msix(aac->pdev); in __aac_shutdown()
1592 struct aac_dev *aac; in aac_probe_one() local
1606 list_for_each_entry(aac, &aac_devices, entry) { in aac_probe_one()
1607 if (aac->id > unique_id) in aac_probe_one()
1609 insert = &aac->entry; in aac_probe_one()
1662 aac = (struct aac_dev *)shost->hostdata; in aac_probe_one()
1663 aac->base_start = pci_resource_start(pdev, 0); in aac_probe_one()
1664 aac->scsi_host_ptr = shost; in aac_probe_one()
1665 aac->pdev = pdev; in aac_probe_one()
1666 aac->name = aac_driver_template.name; in aac_probe_one()
1667 aac->id = shost->unique_id; in aac_probe_one()
1668 aac->cardtype = index; in aac_probe_one()
1669 INIT_LIST_HEAD(&aac->entry); in aac_probe_one()
1672 aac->init_reset = true; in aac_probe_one()
1674 aac->fibs = kcalloc(shost->can_queue + AAC_NUM_MGT_FIB, in aac_probe_one()
1677 if (!aac->fibs) in aac_probe_one()
1679 spin_lock_init(&aac->fib_lock); in aac_probe_one()
1681 mutex_init(&aac->ioctl_mutex); in aac_probe_one()
1682 mutex_init(&aac->scan_mutex); in aac_probe_one()
1684 INIT_DELAYED_WORK(&aac->safw_rescan_work, aac_safw_rescan_worker); in aac_probe_one()
1688 aac->base_size = AAC_MIN_FOOTPRINT_SIZE; in aac_probe_one()
1689 if ((*aac_drivers[index].init)(aac)) { in aac_probe_one()
1694 if (aac->sync_mode) { in aac_probe_one()
1699 aac->name, in aac_probe_one()
1700 aac->id); in aac_probe_one()
1705 aac->name, in aac_probe_one()
1706 aac->id); in aac_probe_one()
1712 aac->thread = kthread_run(aac_command_thread, aac, AAC_DRIVERNAME); in aac_probe_one()
1713 if (IS_ERR(aac->thread)) { in aac_probe_one()
1715 error = PTR_ERR(aac->thread); in aac_probe_one()
1716 aac->thread = NULL; in aac_probe_one()
1720 aac->maximum_num_channels = aac_drivers[index].channels; in aac_probe_one()
1721 error = aac_get_adapter_info(aac); in aac_probe_one()
1740 if (aac->adapter_info.options & AAC_OPT_NEW_COMM) in aac_probe_one()
1749 aac->printf_enabled = 1; in aac_probe_one()
1751 aac->printf_enabled = 0; in aac_probe_one()
1758 if (aac->nondasd_support || expose_physicals || aac->jbod) in aac_probe_one()
1759 shost->max_channel = aac->maximum_num_channels; in aac_probe_one()
1763 aac_get_config_status(aac, 0); in aac_probe_one()
1764 aac_get_containers(aac); in aac_probe_one()
1765 list_add(&aac->entry, insert); in aac_probe_one()
1767 shost->max_id = aac->maximum_num_containers; in aac_probe_one()
1768 if (shost->max_id < aac->maximum_num_physicals) in aac_probe_one()
1769 shost->max_id = aac->maximum_num_physicals; in aac_probe_one()
1775 if (!aac->sa_firmware && aac_drivers[index].quirks & AAC_QUIRK_SRC) in aac_probe_one()
1776 aac_intr_normal(aac, 0, 2, 0, NULL); in aac_probe_one()
1790 aac_scan_host(aac); in aac_probe_one()
1798 __aac_shutdown(aac); in aac_probe_one()
1800 aac_fib_map_free(aac); in aac_probe_one()
1801 if (aac->comm_addr) in aac_probe_one()
1802 dma_free_coherent(&aac->pdev->dev, aac->comm_size, in aac_probe_one()
1803 aac->comm_addr, aac->comm_phys); in aac_probe_one()
1804 kfree(aac->queues); in aac_probe_one()
1805 aac_adapter_ioremap(aac, 0); in aac_probe_one()
1806 kfree(aac->fibs); in aac_probe_one()
1807 kfree(aac->fsa_dev); in aac_probe_one()
1816 static void aac_release_resources(struct aac_dev *aac) in aac_release_resources() argument
1818 aac_adapter_disable_int(aac); in aac_release_resources()
1819 aac_free_irq(aac); in aac_release_resources()
1872 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_suspend() local
1875 aac_cancel_safw_rescan_worker(aac); in aac_suspend()
1876 aac_send_shutdown(aac); in aac_suspend()
1878 aac_release_resources(aac); in aac_suspend()
1891 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_resume() local
1903 if (aac_acquire_resources(aac)) in aac_resume()
1909 aac->adapter_shutdown = 0; in aac_resume()
1915 printk(KERN_INFO "%s%d: resume failed.\n", aac->name, aac->id); in aac_resume()
1932 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_remove_one() local
1934 aac_cancel_safw_rescan_worker(aac); in aac_remove_one()
1937 __aac_shutdown(aac); in aac_remove_one()
1938 aac_fib_map_free(aac); in aac_remove_one()
1939 dma_free_coherent(&aac->pdev->dev, aac->comm_size, aac->comm_addr, in aac_remove_one()
1940 aac->comm_phys); in aac_remove_one()
1941 kfree(aac->queues); in aac_remove_one()
1943 aac_adapter_ioremap(aac, 0); in aac_remove_one()
1945 kfree(aac->fibs); in aac_remove_one()
1946 kfree(aac->fsa_dev); in aac_remove_one()
1948 list_del(&aac->entry); in aac_remove_one()
1957 static void aac_flush_ios(struct aac_dev *aac) in aac_flush_ios() argument
1962 for (i = 0; i < aac->scsi_host_ptr->can_queue; i++) { in aac_flush_ios()
1963 cmd = (struct scsi_cmnd *)aac->fibs[i].callback_data; in aac_flush_ios()
1967 if (aac->handle_pci_error) in aac_flush_ios()
1981 struct aac_dev *aac = shost_priv(shost); in aac_pci_error_detected() local
1989 aac->handle_pci_error = 1; in aac_pci_error_detected()
1991 scsi_block_requests(aac->scsi_host_ptr); in aac_pci_error_detected()
1992 aac_cancel_safw_rescan_worker(aac); in aac_pci_error_detected()
1993 aac_flush_ios(aac); in aac_pci_error_detected()
1994 aac_release_resources(aac); in aac_pci_error_detected()
1997 aac_adapter_ioremap(aac, 0); in aac_pci_error_detected()
2001 aac->handle_pci_error = 1; in aac_pci_error_detected()
2003 aac_flush_ios(aac); in aac_pci_error_detected()
2045 struct aac_dev *aac = (struct aac_dev *)shost_priv(shost); in aac_pci_resume() local
2047 if (aac_adapter_ioremap(aac, aac->base_size)) { in aac_pci_resume()
2051 aac->comm_interface = AAC_COMM_PRODUCER; in aac_pci_resume()
2052 if (aac_adapter_ioremap(aac, AAC_MIN_FOOTPRINT_SIZE)) { in aac_pci_resume()
2062 aac_acquire_resources(aac); in aac_pci_resume()
2068 aac->adapter_shutdown = 0; in aac_pci_resume()
2069 aac->handle_pci_error = 0; in aac_pci_resume()
2074 scsi_unblock_requests(aac->scsi_host_ptr); in aac_pci_resume()
2075 aac_scan_host(aac); in aac_pci_resume()