Lines Matching refs:aac
391 struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata; in aac_slave_configure() local
401 if (chn < AAC_MAX_BUSES && tid < AAC_MAX_TARGETS && aac->sa_firmware) { in aac_slave_configure()
402 devtype = aac->hba_map[chn][tid].devtype; in aac_slave_configure()
405 depth = aac->hba_map[chn][tid].qd_limit; in aac_slave_configure()
416 if (aac->jbod && (sdev->type == TYPE_DISK)) in aac_slave_configure()
421 && (!aac->jbod || sdev->inq_periph_qual) in aac_slave_configure()
422 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2))) { in aac_slave_configure()
433 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_slave_configure()
444 for (cid = 0; cid < aac->maximum_num_containers; ++cid) in aac_slave_configure()
445 if (aac->fsa_dev[cid].valid) in aac_slave_configure()
451 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_slave_configure()
454 || !aac->fsa_dev[sdev_id(dev)].valid) { in aac_slave_configure()
492 timeout = aac->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT; in aac_slave_configure()
519 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_change_queue_depth() local
525 aac->hba_map[chn][tid].devtype == AAC_DEVTYPE_NATIVE_RAW) in aac_change_queue_depth()
550 scsi_change_queue_depth(sdev, aac->hba_map[chn][tid].qd_limit); in aac_change_queue_depth()
560 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_show_raid_level() local
564 ((aac->jbod && (sdev->type == TYPE_DISK)) ? "JBOD\n" : "")); in aac_show_raid_level()
566 get_container_type(aac->fsa_dev[sdev_id(sdev)].type)); in aac_show_raid_level()
581 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_show_unique_id() local
587 memcpy(sn, aac->fsa_dev[sdev_id(sdev)].identifier, sizeof(sn)); in aac_show_unique_id()
661 static int get_num_of_incomplete_fibs(struct aac_dev *aac) in get_num_of_incomplete_fibs() argument
663 struct Scsi_Host *shost = aac->scsi_host_ptr; in get_num_of_incomplete_fibs()
669 ctrl_dev = &aac->pdev->dev; in get_num_of_incomplete_fibs()
685 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_abort() local
690 if (aac_adapter_check_health(aac)) in aac_eh_abort()
695 if (aac->hba_map[bus][cid].devtype == AAC_DEVTYPE_NATIVE_RAW) { in aac_eh_abort()
707 fib = &aac->fibs[count]; in aac_eh_abort()
719 fib = aac_fib_alloc(aac); in aac_eh_abort()
726 tmf->it_nexus = aac->hba_map[bus][cid].rmw_nexus; in aac_eh_abort()
766 if (!(aac->raw_io_interface) || in aac_eh_abort()
767 !(aac->raw_io_64) || in aac_eh_abort()
780 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
802 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
906 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_dev_reset() local
921 info = &aac->hba_map[bus][cid]; in aac_eh_dev_reset()
930 fib = aac_fib_alloc(aac); in aac_eh_dev_reset()
969 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_target_reset() local
984 info = &aac->hba_map[bus][cid]; in aac_eh_target_reset()
993 fib = aac_fib_alloc(aac); in aac_eh_target_reset()
1035 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_bus_reset() local
1044 struct fib *fib = &aac->fibs[count]; in aac_eh_bus_reset()
1057 info = &aac->hba_map[bus][cid]; in aac_eh_bus_reset()
1071 status = aac_adapter_check_health(aac); in aac_eh_bus_reset()
1073 dev_err(&aac->pdev->dev, "Adapter health - %d\n", status); in aac_eh_bus_reset()
1075 count = get_num_of_incomplete_fibs(aac); in aac_eh_bus_reset()
1088 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_host_reset() local
1098 supported_options2 = aac->supplement_adapter_info.supported_options2; in aac_eh_host_reset()
1111 if (aac_reset_adapter(aac, 2, IOP_HWSOFT_RESET) == 0) in aac_eh_host_reset()
1123 info = &aac->hba_map[bus][cid]; in aac_eh_host_reset()
1146 struct aac_dev *aac; in aac_cfg_open() local
1151 list_for_each_entry(aac, &aac_devices, entry) { in aac_cfg_open()
1152 if (aac->id == minor_number) { in aac_cfg_open()
1153 file->private_data = aac; in aac_cfg_open()
1179 struct aac_dev *aac = (struct aac_dev *)file->private_data; in aac_cfg_ioctl() local
1184 return aac_do_ioctl(aac, cmd, (void __user *)arg); in aac_cfg_ioctl()
1513 static void __aac_shutdown(struct aac_dev * aac) in __aac_shutdown() argument
1517 mutex_lock(&aac->ioctl_mutex); in __aac_shutdown()
1518 aac->adapter_shutdown = 1; in __aac_shutdown()
1519 mutex_unlock(&aac->ioctl_mutex); in __aac_shutdown()
1521 if (aac->aif_thread) { in __aac_shutdown()
1524 for (i = 0; i < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); i++) { in __aac_shutdown()
1525 struct fib *fib = &aac->fibs[i]; in __aac_shutdown()
1530 kthread_stop(aac->thread); in __aac_shutdown()
1531 aac->thread = NULL; in __aac_shutdown()
1534 aac_send_shutdown(aac); in __aac_shutdown()
1536 aac_adapter_disable_int(aac); in __aac_shutdown()
1538 if (aac_is_src(aac)) { in __aac_shutdown()
1539 if (aac->max_msix > 1) { in __aac_shutdown()
1540 for (i = 0; i < aac->max_msix; i++) { in __aac_shutdown()
1541 free_irq(pci_irq_vector(aac->pdev, i), in __aac_shutdown()
1542 &(aac->aac_msix[i])); in __aac_shutdown()
1545 free_irq(aac->pdev->irq, in __aac_shutdown()
1546 &(aac->aac_msix[0])); in __aac_shutdown()
1549 free_irq(aac->pdev->irq, aac); in __aac_shutdown()
1551 if (aac->msi) in __aac_shutdown()
1552 pci_disable_msi(aac->pdev); in __aac_shutdown()
1553 else if (aac->max_msix > 1) in __aac_shutdown()
1554 pci_disable_msix(aac->pdev); in __aac_shutdown()
1564 void aac_reinit_aif(struct aac_dev *aac, unsigned int index) in aac_reinit_aif() argument
1573 aac_intr_normal(aac, 0, 2, 0, NULL); in aac_reinit_aif()
1581 struct aac_dev *aac; in aac_probe_one() local
1595 list_for_each_entry(aac, &aac_devices, entry) { in aac_probe_one()
1596 if (aac->id > unique_id) in aac_probe_one()
1598 insert = &aac->entry; in aac_probe_one()
1651 aac = (struct aac_dev *)shost->hostdata; in aac_probe_one()
1652 aac->base_start = pci_resource_start(pdev, 0); in aac_probe_one()
1653 aac->scsi_host_ptr = shost; in aac_probe_one()
1654 aac->pdev = pdev; in aac_probe_one()
1655 aac->name = aac_driver_template.name; in aac_probe_one()
1656 aac->id = shost->unique_id; in aac_probe_one()
1657 aac->cardtype = index; in aac_probe_one()
1658 INIT_LIST_HEAD(&aac->entry); in aac_probe_one()
1661 aac->init_reset = true; in aac_probe_one()
1663 aac->fibs = kcalloc(shost->can_queue + AAC_NUM_MGT_FIB, in aac_probe_one()
1666 if (!aac->fibs) { in aac_probe_one()
1671 spin_lock_init(&aac->fib_lock); in aac_probe_one()
1673 mutex_init(&aac->ioctl_mutex); in aac_probe_one()
1674 mutex_init(&aac->scan_mutex); in aac_probe_one()
1676 INIT_DELAYED_WORK(&aac->safw_rescan_work, aac_safw_rescan_worker); in aac_probe_one()
1677 INIT_DELAYED_WORK(&aac->src_reinit_aif_worker, in aac_probe_one()
1682 aac->base_size = AAC_MIN_FOOTPRINT_SIZE; in aac_probe_one()
1683 if ((*aac_drivers[index].init)(aac)) { in aac_probe_one()
1688 if (aac->sync_mode) { in aac_probe_one()
1693 aac->name, in aac_probe_one()
1694 aac->id); in aac_probe_one()
1699 aac->name, in aac_probe_one()
1700 aac->id); in aac_probe_one()
1706 aac->thread = kthread_run(aac_command_thread, aac, AAC_DRIVERNAME); in aac_probe_one()
1707 if (IS_ERR(aac->thread)) { in aac_probe_one()
1709 error = PTR_ERR(aac->thread); in aac_probe_one()
1710 aac->thread = NULL; in aac_probe_one()
1714 aac->maximum_num_channels = aac_drivers[index].channels; in aac_probe_one()
1715 error = aac_get_adapter_info(aac); in aac_probe_one()
1734 if (aac->adapter_info.options & AAC_OPT_NEW_COMM) in aac_probe_one()
1743 aac->printf_enabled = 1; in aac_probe_one()
1745 aac->printf_enabled = 0; in aac_probe_one()
1752 if (aac->nondasd_support || expose_physicals || aac->jbod) in aac_probe_one()
1753 shost->max_channel = aac->maximum_num_channels; in aac_probe_one()
1757 aac_get_config_status(aac, 0); in aac_probe_one()
1758 aac_get_containers(aac); in aac_probe_one()
1759 list_add(&aac->entry, insert); in aac_probe_one()
1761 shost->max_id = aac->maximum_num_containers; in aac_probe_one()
1762 if (shost->max_id < aac->maximum_num_physicals) in aac_probe_one()
1763 shost->max_id = aac->maximum_num_physicals; in aac_probe_one()
1769 if (!aac->sa_firmware && aac_drivers[index].quirks & AAC_QUIRK_SRC) in aac_probe_one()
1770 aac_intr_normal(aac, 0, 2, 0, NULL); in aac_probe_one()
1784 aac_scan_host(aac); in aac_probe_one()
1792 __aac_shutdown(aac); in aac_probe_one()
1794 aac_fib_map_free(aac); in aac_probe_one()
1795 if (aac->comm_addr) in aac_probe_one()
1796 dma_free_coherent(&aac->pdev->dev, aac->comm_size, in aac_probe_one()
1797 aac->comm_addr, aac->comm_phys); in aac_probe_one()
1798 kfree(aac->queues); in aac_probe_one()
1799 aac_adapter_ioremap(aac, 0); in aac_probe_one()
1800 kfree(aac->fibs); in aac_probe_one()
1801 kfree(aac->fsa_dev); in aac_probe_one()
1810 static void aac_release_resources(struct aac_dev *aac) in aac_release_resources() argument
1812 aac_adapter_disable_int(aac); in aac_release_resources()
1813 aac_free_irq(aac); in aac_release_resources()
1864 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_suspend() local
1867 aac_cancel_rescan_worker(aac); in aac_suspend()
1868 aac_send_shutdown(aac); in aac_suspend()
1870 aac_release_resources(aac); in aac_suspend()
1878 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_resume() local
1880 if (aac_acquire_resources(aac)) in aac_resume()
1886 aac->adapter_shutdown = 0; in aac_resume()
1892 printk(KERN_INFO "%s%d: resume failed.\n", aac->name, aac->id); in aac_resume()
1908 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_remove_one() local
1910 aac_cancel_rescan_worker(aac); in aac_remove_one()
1913 __aac_shutdown(aac); in aac_remove_one()
1914 aac_fib_map_free(aac); in aac_remove_one()
1915 dma_free_coherent(&aac->pdev->dev, aac->comm_size, aac->comm_addr, in aac_remove_one()
1916 aac->comm_phys); in aac_remove_one()
1917 kfree(aac->queues); in aac_remove_one()
1919 aac_adapter_ioremap(aac, 0); in aac_remove_one()
1921 kfree(aac->fibs); in aac_remove_one()
1922 kfree(aac->fsa_dev); in aac_remove_one()
1924 list_del(&aac->entry); in aac_remove_one()
1937 struct aac_dev *aac = shost_priv(shost); in aac_pci_error_detected() local
1945 aac->handle_pci_error = 1; in aac_pci_error_detected()
1948 aac_cancel_rescan_worker(aac); in aac_pci_error_detected()
1950 aac_release_resources(aac); in aac_pci_error_detected()
1953 aac_adapter_ioremap(aac, 0); in aac_pci_error_detected()
1957 aac->handle_pci_error = 1; in aac_pci_error_detected()
2000 struct aac_dev *aac = (struct aac_dev *)shost_priv(shost); in aac_pci_resume() local
2002 if (aac_adapter_ioremap(aac, aac->base_size)) { in aac_pci_resume()
2006 aac->comm_interface = AAC_COMM_PRODUCER; in aac_pci_resume()
2007 if (aac_adapter_ioremap(aac, AAC_MIN_FOOTPRINT_SIZE)) { in aac_pci_resume()
2017 aac_acquire_resources(aac); in aac_pci_resume()
2023 aac->adapter_shutdown = 0; in aac_pci_resume()
2024 aac->handle_pci_error = 0; in aac_pci_resume()
2027 aac_scan_host(aac); in aac_pci_resume()