Lines Matching refs:aac
404 struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata; in aac_slave_configure() local
413 if (chn < AAC_MAX_BUSES && tid < AAC_MAX_TARGETS && aac->sa_firmware) { in aac_slave_configure()
414 devtype = aac->hba_map[chn][tid].devtype; in aac_slave_configure()
417 depth = aac->hba_map[chn][tid].qd_limit; in aac_slave_configure()
425 if (aac->jbod && (sdev->type == TYPE_DISK)) in aac_slave_configure()
430 && (!aac->jbod || sdev->inq_periph_qual) in aac_slave_configure()
431 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2))) { in aac_slave_configure()
442 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_slave_configure()
453 for (cid = 0; cid < aac->maximum_num_containers; ++cid) in aac_slave_configure()
454 if (aac->fsa_dev[cid].valid) in aac_slave_configure()
460 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_slave_configure()
463 || !aac->fsa_dev[sdev_id(dev)].valid) { in aac_slave_configure()
525 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_change_queue_depth() local
531 aac->hba_map[chn][tid].devtype == AAC_DEVTYPE_NATIVE_RAW) in aac_change_queue_depth()
556 scsi_change_queue_depth(sdev, aac->hba_map[chn][tid].qd_limit); in aac_change_queue_depth()
566 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_show_raid_level() local
570 ((aac->jbod && (sdev->type == TYPE_DISK)) ? "JBOD\n" : "")); in aac_show_raid_level()
572 get_container_type(aac->fsa_dev[sdev_id(sdev)].type)); in aac_show_raid_level()
587 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_show_unique_id() local
593 memcpy(sn, aac->fsa_dev[sdev_id(sdev)].identifier, sizeof(sn)); in aac_show_unique_id()
627 static int get_num_of_incomplete_fibs(struct aac_dev *aac) in get_num_of_incomplete_fibs() argument
632 struct Scsi_Host *shost = aac->scsi_host_ptr; in get_num_of_incomplete_fibs()
666 ctrl_dev = &aac->pdev->dev; in get_num_of_incomplete_fibs()
681 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_abort() local
686 if (aac_adapter_check_health(aac)) in aac_eh_abort()
691 if (aac->hba_map[bus][cid].devtype == AAC_DEVTYPE_NATIVE_RAW) { in aac_eh_abort()
703 fib = &aac->fibs[count]; in aac_eh_abort()
715 fib = aac_fib_alloc(aac); in aac_eh_abort()
722 tmf->it_nexus = aac->hba_map[bus][cid].rmw_nexus; in aac_eh_abort()
758 if (!(aac->raw_io_interface) || in aac_eh_abort()
759 !(aac->raw_io_64) || in aac_eh_abort()
771 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
793 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
898 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_dev_reset() local
913 info = &aac->hba_map[bus][cid]; in aac_eh_dev_reset()
922 fib = aac_fib_alloc(aac); in aac_eh_dev_reset()
956 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_target_reset() local
971 info = &aac->hba_map[bus][cid]; in aac_eh_target_reset()
980 fib = aac_fib_alloc(aac); in aac_eh_target_reset()
1015 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_bus_reset() local
1024 struct fib *fib = &aac->fibs[count]; in aac_eh_bus_reset()
1037 info = &aac->hba_map[bus][cid]; in aac_eh_bus_reset()
1051 status = aac_adapter_check_health(aac); in aac_eh_bus_reset()
1053 dev_err(&aac->pdev->dev, "Adapter health - %d\n", status); in aac_eh_bus_reset()
1055 count = get_num_of_incomplete_fibs(aac); in aac_eh_bus_reset()
1068 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_host_reset() local
1078 supported_options2 = aac->supplement_adapter_info.supported_options2; in aac_eh_host_reset()
1091 if (aac_reset_adapter(aac, 2, IOP_HWSOFT_RESET) == 0) in aac_eh_host_reset()
1103 info = &aac->hba_map[bus][cid]; in aac_eh_host_reset()
1126 struct aac_dev *aac; in aac_cfg_open() local
1131 list_for_each_entry(aac, &aac_devices, entry) { in aac_cfg_open()
1132 if (aac->id == minor_number) { in aac_cfg_open()
1133 file->private_data = aac; in aac_cfg_open()
1160 struct aac_dev *aac = (struct aac_dev *)file->private_data; in aac_cfg_ioctl() local
1165 return aac_do_ioctl(aac, cmd, (void __user *)arg); in aac_cfg_ioctl()
1547 static void __aac_shutdown(struct aac_dev * aac) in __aac_shutdown() argument
1551 mutex_lock(&aac->ioctl_mutex); in __aac_shutdown()
1552 aac->adapter_shutdown = 1; in __aac_shutdown()
1553 mutex_unlock(&aac->ioctl_mutex); in __aac_shutdown()
1555 if (aac->aif_thread) { in __aac_shutdown()
1558 for (i = 0; i < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); i++) { in __aac_shutdown()
1559 struct fib *fib = &aac->fibs[i]; in __aac_shutdown()
1564 kthread_stop(aac->thread); in __aac_shutdown()
1565 aac->thread = NULL; in __aac_shutdown()
1568 aac_send_shutdown(aac); in __aac_shutdown()
1570 aac_adapter_disable_int(aac); in __aac_shutdown()
1572 if (aac_is_src(aac)) { in __aac_shutdown()
1573 if (aac->max_msix > 1) { in __aac_shutdown()
1574 for (i = 0; i < aac->max_msix; i++) { in __aac_shutdown()
1575 free_irq(pci_irq_vector(aac->pdev, i), in __aac_shutdown()
1576 &(aac->aac_msix[i])); in __aac_shutdown()
1579 free_irq(aac->pdev->irq, in __aac_shutdown()
1580 &(aac->aac_msix[0])); in __aac_shutdown()
1583 free_irq(aac->pdev->irq, aac); in __aac_shutdown()
1585 if (aac->msi) in __aac_shutdown()
1586 pci_disable_msi(aac->pdev); in __aac_shutdown()
1587 else if (aac->max_msix > 1) in __aac_shutdown()
1588 pci_disable_msix(aac->pdev); in __aac_shutdown()
1602 struct aac_dev *aac; in aac_probe_one() local
1616 list_for_each_entry(aac, &aac_devices, entry) { in aac_probe_one()
1617 if (aac->id > unique_id) in aac_probe_one()
1619 insert = &aac->entry; in aac_probe_one()
1672 aac = (struct aac_dev *)shost->hostdata; in aac_probe_one()
1673 aac->base_start = pci_resource_start(pdev, 0); in aac_probe_one()
1674 aac->scsi_host_ptr = shost; in aac_probe_one()
1675 aac->pdev = pdev; in aac_probe_one()
1676 aac->name = aac_driver_template.name; in aac_probe_one()
1677 aac->id = shost->unique_id; in aac_probe_one()
1678 aac->cardtype = index; in aac_probe_one()
1679 INIT_LIST_HEAD(&aac->entry); in aac_probe_one()
1682 aac->init_reset = true; in aac_probe_one()
1684 aac->fibs = kcalloc(shost->can_queue + AAC_NUM_MGT_FIB, in aac_probe_one()
1687 if (!aac->fibs) in aac_probe_one()
1689 spin_lock_init(&aac->fib_lock); in aac_probe_one()
1691 mutex_init(&aac->ioctl_mutex); in aac_probe_one()
1692 mutex_init(&aac->scan_mutex); in aac_probe_one()
1694 INIT_DELAYED_WORK(&aac->safw_rescan_work, aac_safw_rescan_worker); in aac_probe_one()
1698 aac->base_size = AAC_MIN_FOOTPRINT_SIZE; in aac_probe_one()
1699 if ((*aac_drivers[index].init)(aac)) { in aac_probe_one()
1704 if (aac->sync_mode) { in aac_probe_one()
1709 aac->name, in aac_probe_one()
1710 aac->id); in aac_probe_one()
1715 aac->name, in aac_probe_one()
1716 aac->id); in aac_probe_one()
1722 aac->thread = kthread_run(aac_command_thread, aac, AAC_DRIVERNAME); in aac_probe_one()
1723 if (IS_ERR(aac->thread)) { in aac_probe_one()
1725 error = PTR_ERR(aac->thread); in aac_probe_one()
1726 aac->thread = NULL; in aac_probe_one()
1730 aac->maximum_num_channels = aac_drivers[index].channels; in aac_probe_one()
1731 error = aac_get_adapter_info(aac); in aac_probe_one()
1751 (aac->adapter_info.options & AAC_OPT_NEW_COMM) ? in aac_probe_one()
1760 aac->printf_enabled = 1; in aac_probe_one()
1762 aac->printf_enabled = 0; in aac_probe_one()
1769 if (aac->nondasd_support || expose_physicals || aac->jbod) in aac_probe_one()
1770 shost->max_channel = aac->maximum_num_channels; in aac_probe_one()
1774 aac_get_config_status(aac, 0); in aac_probe_one()
1775 aac_get_containers(aac); in aac_probe_one()
1776 list_add(&aac->entry, insert); in aac_probe_one()
1778 shost->max_id = aac->maximum_num_containers; in aac_probe_one()
1779 if (shost->max_id < aac->maximum_num_physicals) in aac_probe_one()
1780 shost->max_id = aac->maximum_num_physicals; in aac_probe_one()
1786 if (!aac->sa_firmware && aac_drivers[index].quirks & AAC_QUIRK_SRC) in aac_probe_one()
1787 aac_intr_normal(aac, 0, 2, 0, NULL); in aac_probe_one()
1801 aac_scan_host(aac); in aac_probe_one()
1809 __aac_shutdown(aac); in aac_probe_one()
1811 aac_fib_map_free(aac); in aac_probe_one()
1812 if (aac->comm_addr) in aac_probe_one()
1813 dma_free_coherent(&aac->pdev->dev, aac->comm_size, in aac_probe_one()
1814 aac->comm_addr, aac->comm_phys); in aac_probe_one()
1815 kfree(aac->queues); in aac_probe_one()
1816 aac_adapter_ioremap(aac, 0); in aac_probe_one()
1817 kfree(aac->fibs); in aac_probe_one()
1818 kfree(aac->fsa_dev); in aac_probe_one()
1827 static void aac_release_resources(struct aac_dev *aac) in aac_release_resources() argument
1829 aac_adapter_disable_int(aac); in aac_release_resources()
1830 aac_free_irq(aac); in aac_release_resources()
1883 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_suspend() local
1886 aac_cancel_safw_rescan_worker(aac); in aac_suspend()
1887 aac_send_shutdown(aac); in aac_suspend()
1889 aac_release_resources(aac); in aac_suspend()
1902 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_resume() local
1914 if (aac_acquire_resources(aac)) in aac_resume()
1920 aac->adapter_shutdown = 0; in aac_resume()
1926 printk(KERN_INFO "%s%d: resume failed.\n", aac->name, aac->id); in aac_resume()
1943 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_remove_one() local
1945 aac_cancel_safw_rescan_worker(aac); in aac_remove_one()
1948 __aac_shutdown(aac); in aac_remove_one()
1949 aac_fib_map_free(aac); in aac_remove_one()
1950 dma_free_coherent(&aac->pdev->dev, aac->comm_size, aac->comm_addr, in aac_remove_one()
1951 aac->comm_phys); in aac_remove_one()
1952 kfree(aac->queues); in aac_remove_one()
1954 aac_adapter_ioremap(aac, 0); in aac_remove_one()
1956 kfree(aac->fibs); in aac_remove_one()
1957 kfree(aac->fsa_dev); in aac_remove_one()
1959 list_del(&aac->entry); in aac_remove_one()
1968 static void aac_flush_ios(struct aac_dev *aac) in aac_flush_ios() argument
1973 for (i = 0; i < aac->scsi_host_ptr->can_queue; i++) { in aac_flush_ios()
1974 cmd = (struct scsi_cmnd *)aac->fibs[i].callback_data; in aac_flush_ios()
1978 if (aac->handle_pci_error) in aac_flush_ios()
1992 struct aac_dev *aac = shost_priv(shost); in aac_pci_error_detected() local
2000 aac->handle_pci_error = 1; in aac_pci_error_detected()
2002 scsi_block_requests(aac->scsi_host_ptr); in aac_pci_error_detected()
2003 aac_cancel_safw_rescan_worker(aac); in aac_pci_error_detected()
2004 aac_flush_ios(aac); in aac_pci_error_detected()
2005 aac_release_resources(aac); in aac_pci_error_detected()
2008 aac_adapter_ioremap(aac, 0); in aac_pci_error_detected()
2012 aac->handle_pci_error = 1; in aac_pci_error_detected()
2014 aac_flush_ios(aac); in aac_pci_error_detected()
2056 struct aac_dev *aac = (struct aac_dev *)shost_priv(shost); in aac_pci_resume() local
2060 if (aac_adapter_ioremap(aac, aac->base_size)) { in aac_pci_resume()
2064 aac->comm_interface = AAC_COMM_PRODUCER; in aac_pci_resume()
2065 if (aac_adapter_ioremap(aac, AAC_MIN_FOOTPRINT_SIZE)) { in aac_pci_resume()
2075 aac_acquire_resources(aac); in aac_pci_resume()
2081 aac->adapter_shutdown = 0; in aac_pci_resume()
2082 aac->handle_pci_error = 0; in aac_pci_resume()
2087 scsi_unblock_requests(aac->scsi_host_ptr); in aac_pci_resume()
2088 aac_scan_host(aac); in aac_pci_resume()