Lines Matching refs:aac

392 	struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata;  in aac_sdev_configure()  local
402 if (chn < AAC_MAX_BUSES && tid < AAC_MAX_TARGETS && aac->sa_firmware) { in aac_sdev_configure()
403 devtype = aac->hba_map[chn][tid].devtype; in aac_sdev_configure()
406 depth = aac->hba_map[chn][tid].qd_limit; in aac_sdev_configure()
417 if (aac->jbod && (sdev->type == TYPE_DISK)) in aac_sdev_configure()
422 && (!aac->jbod || sdev->inq_periph_qual) in aac_sdev_configure()
423 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2))) { in aac_sdev_configure()
434 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_sdev_configure()
445 for (cid = 0; cid < aac->maximum_num_containers; ++cid) in aac_sdev_configure()
446 if (aac->fsa_dev[cid].valid) in aac_sdev_configure()
452 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_sdev_configure()
455 || !aac->fsa_dev[sdev_id(dev)].valid) { in aac_sdev_configure()
493 timeout = aac->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT; in aac_sdev_configure()
520 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_change_queue_depth() local
526 aac->hba_map[chn][tid].devtype == AAC_DEVTYPE_NATIVE_RAW) in aac_change_queue_depth()
551 scsi_change_queue_depth(sdev, aac->hba_map[chn][tid].qd_limit); in aac_change_queue_depth()
561 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_show_raid_level() local
565 ((aac->jbod && (sdev->type == TYPE_DISK)) ? "JBOD\n" : "")); in aac_show_raid_level()
567 get_container_type(aac->fsa_dev[sdev_id(sdev)].type)); in aac_show_raid_level()
582 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_show_unique_id() local
588 memcpy(sn, aac->fsa_dev[sdev_id(sdev)].identifier, sizeof(sn)); in aac_show_unique_id()
662 static int get_num_of_incomplete_fibs(struct aac_dev *aac) in get_num_of_incomplete_fibs() argument
664 struct Scsi_Host *shost = aac->scsi_host_ptr; in get_num_of_incomplete_fibs()
670 ctrl_dev = &aac->pdev->dev; in get_num_of_incomplete_fibs()
686 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_abort() local
691 if (aac_adapter_check_health(aac)) in aac_eh_abort()
696 if (aac->hba_map[bus][cid].devtype == AAC_DEVTYPE_NATIVE_RAW) { in aac_eh_abort()
708 fib = &aac->fibs[count]; in aac_eh_abort()
720 fib = aac_fib_alloc(aac); in aac_eh_abort()
727 tmf->it_nexus = aac->hba_map[bus][cid].rmw_nexus; in aac_eh_abort()
767 if (!(aac->raw_io_interface) || in aac_eh_abort()
768 !(aac->raw_io_64) || in aac_eh_abort()
781 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
803 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
907 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_dev_reset() local
922 info = &aac->hba_map[bus][cid]; in aac_eh_dev_reset()
931 fib = aac_fib_alloc(aac); in aac_eh_dev_reset()
970 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_target_reset() local
985 info = &aac->hba_map[bus][cid]; in aac_eh_target_reset()
994 fib = aac_fib_alloc(aac); in aac_eh_target_reset()
1036 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_bus_reset() local
1045 struct fib *fib = &aac->fibs[count]; in aac_eh_bus_reset()
1058 info = &aac->hba_map[bus][cid]; in aac_eh_bus_reset()
1072 status = aac_adapter_check_health(aac); in aac_eh_bus_reset()
1074 dev_err(&aac->pdev->dev, "Adapter health - %d\n", status); in aac_eh_bus_reset()
1076 count = get_num_of_incomplete_fibs(aac); in aac_eh_bus_reset()
1089 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_host_reset() local
1099 supported_options2 = aac->supplement_adapter_info.supported_options2; in aac_eh_host_reset()
1112 if (aac_reset_adapter(aac, 2, IOP_HWSOFT_RESET) == 0) in aac_eh_host_reset()
1124 info = &aac->hba_map[bus][cid]; in aac_eh_host_reset()
1147 struct aac_dev *aac; in aac_cfg_open() local
1152 list_for_each_entry(aac, &aac_devices, entry) { in aac_cfg_open()
1153 if (aac->id == minor_number) { in aac_cfg_open()
1154 file->private_data = aac; in aac_cfg_open()
1180 struct aac_dev *aac = (struct aac_dev *)file->private_data; in aac_cfg_ioctl() local
1185 return aac_do_ioctl(aac, cmd, (void __user *)arg); in aac_cfg_ioctl()
1514 static void __aac_shutdown(struct aac_dev * aac) in __aac_shutdown() argument
1518 mutex_lock(&aac->ioctl_mutex); in __aac_shutdown()
1519 aac->adapter_shutdown = 1; in __aac_shutdown()
1520 mutex_unlock(&aac->ioctl_mutex); in __aac_shutdown()
1522 if (aac->aif_thread) { in __aac_shutdown()
1525 for (i = 0; i < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); i++) { in __aac_shutdown()
1526 struct fib *fib = &aac->fibs[i]; in __aac_shutdown()
1531 kthread_stop(aac->thread); in __aac_shutdown()
1532 aac->thread = NULL; in __aac_shutdown()
1535 aac_send_shutdown(aac); in __aac_shutdown()
1537 aac_adapter_disable_int(aac); in __aac_shutdown()
1539 if (aac_is_src(aac)) { in __aac_shutdown()
1540 if (aac->max_msix > 1) { in __aac_shutdown()
1541 for (i = 0; i < aac->max_msix; i++) { in __aac_shutdown()
1542 free_irq(pci_irq_vector(aac->pdev, i), in __aac_shutdown()
1543 &(aac->aac_msix[i])); in __aac_shutdown()
1546 free_irq(aac->pdev->irq, in __aac_shutdown()
1547 &(aac->aac_msix[0])); in __aac_shutdown()
1550 free_irq(aac->pdev->irq, aac); in __aac_shutdown()
1552 if (aac->msi) in __aac_shutdown()
1553 pci_disable_msi(aac->pdev); in __aac_shutdown()
1554 else if (aac->max_msix > 1) in __aac_shutdown()
1555 pci_disable_msix(aac->pdev); in __aac_shutdown()
1565 void aac_reinit_aif(struct aac_dev *aac, unsigned int index) in aac_reinit_aif() argument
1574 aac_intr_normal(aac, 0, 2, 0, NULL); in aac_reinit_aif()
1582 struct aac_dev *aac; in aac_probe_one() local
1596 list_for_each_entry(aac, &aac_devices, entry) { in aac_probe_one()
1597 if (aac->id > unique_id) in aac_probe_one()
1599 insert = &aac->entry; in aac_probe_one()
1652 aac = (struct aac_dev *)shost->hostdata; in aac_probe_one()
1653 aac->base_start = pci_resource_start(pdev, 0); in aac_probe_one()
1654 aac->scsi_host_ptr = shost; in aac_probe_one()
1655 aac->pdev = pdev; in aac_probe_one()
1656 aac->name = aac_driver_template.name; in aac_probe_one()
1657 aac->id = shost->unique_id; in aac_probe_one()
1658 aac->cardtype = index; in aac_probe_one()
1659 INIT_LIST_HEAD(&aac->entry); in aac_probe_one()
1662 aac->init_reset = true; in aac_probe_one()
1664 aac->fibs = kcalloc(shost->can_queue + AAC_NUM_MGT_FIB, in aac_probe_one()
1667 if (!aac->fibs) { in aac_probe_one()
1672 spin_lock_init(&aac->fib_lock); in aac_probe_one()
1674 mutex_init(&aac->ioctl_mutex); in aac_probe_one()
1675 mutex_init(&aac->scan_mutex); in aac_probe_one()
1677 INIT_DELAYED_WORK(&aac->safw_rescan_work, aac_safw_rescan_worker); in aac_probe_one()
1678 INIT_DELAYED_WORK(&aac->src_reinit_aif_worker, in aac_probe_one()
1683 aac->base_size = AAC_MIN_FOOTPRINT_SIZE; in aac_probe_one()
1684 if ((*aac_drivers[index].init)(aac)) { in aac_probe_one()
1689 if (aac->sync_mode) { in aac_probe_one()
1694 aac->name, in aac_probe_one()
1695 aac->id); in aac_probe_one()
1700 aac->name, in aac_probe_one()
1701 aac->id); in aac_probe_one()
1707 aac->thread = kthread_run(aac_command_thread, aac, AAC_DRIVERNAME); in aac_probe_one()
1708 if (IS_ERR(aac->thread)) { in aac_probe_one()
1710 error = PTR_ERR(aac->thread); in aac_probe_one()
1711 aac->thread = NULL; in aac_probe_one()
1715 aac->maximum_num_channels = aac_drivers[index].channels; in aac_probe_one()
1716 error = aac_get_adapter_info(aac); in aac_probe_one()
1735 if (aac->adapter_info.options & AAC_OPT_NEW_COMM) in aac_probe_one()
1744 aac->printf_enabled = 1; in aac_probe_one()
1746 aac->printf_enabled = 0; in aac_probe_one()
1753 if (aac->nondasd_support || expose_physicals || aac->jbod) in aac_probe_one()
1754 shost->max_channel = aac->maximum_num_channels; in aac_probe_one()
1758 aac_get_config_status(aac, 0); in aac_probe_one()
1759 aac_get_containers(aac); in aac_probe_one()
1760 list_add(&aac->entry, insert); in aac_probe_one()
1762 shost->max_id = aac->maximum_num_containers; in aac_probe_one()
1763 if (shost->max_id < aac->maximum_num_physicals) in aac_probe_one()
1764 shost->max_id = aac->maximum_num_physicals; in aac_probe_one()
1770 if (!aac->sa_firmware && aac_drivers[index].quirks & AAC_QUIRK_SRC) in aac_probe_one()
1771 aac_intr_normal(aac, 0, 2, 0, NULL); in aac_probe_one()
1785 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()
1952 aac_adapter_ioremap(aac, 0); in aac_pci_error_detected()
1956 aac->handle_pci_error = 1; in aac_pci_error_detected()
1999 struct aac_dev *aac = (struct aac_dev *)shost_priv(shost); in aac_pci_resume() local
2001 if (aac_adapter_ioremap(aac, aac->base_size)) { in aac_pci_resume()
2005 aac->comm_interface = AAC_COMM_PRODUCER; in aac_pci_resume()
2006 if (aac_adapter_ioremap(aac, AAC_MIN_FOOTPRINT_SIZE)) { in aac_pci_resume()
2016 aac_acquire_resources(aac); in aac_pci_resume()
2022 aac->adapter_shutdown = 0; in aac_pci_resume()
2023 aac->handle_pci_error = 0; in aac_pci_resume()
2026 aac_scan_host(aac); in aac_pci_resume()