Lines Matching full:aac

3  *	Adaptec AAC series RAID controller driver
217 …{ aac_sa_init, "aacraid", "ADAPTEC ", "AAC-364 ", 4, AAC_QUIRK_34SG }, /* Adaptec 5400S (…
392 struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata; in aac_slave_configure() local
402 if (chn < AAC_MAX_BUSES && tid < AAC_MAX_TARGETS && aac->sa_firmware) { in aac_slave_configure()
403 devtype = aac->hba_map[chn][tid].devtype; in aac_slave_configure()
406 depth = aac->hba_map[chn][tid].qd_limit; in aac_slave_configure()
417 if (aac->jbod && (sdev->type == TYPE_DISK)) in aac_slave_configure()
422 && (!aac->jbod || sdev->inq_periph_qual) in aac_slave_configure()
423 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2))) { in aac_slave_configure()
434 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_slave_configure()
445 for (cid = 0; cid < aac->maximum_num_containers; ++cid) in aac_slave_configure()
446 if (aac->fsa_dev[cid].valid) in aac_slave_configure()
452 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_slave_configure()
455 || !aac->fsa_dev[sdev_id(dev)].valid) { in aac_slave_configure()
493 timeout = aac->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT; in aac_slave_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()
660 static int get_num_of_incomplete_fibs(struct aac_dev *aac) in get_num_of_incomplete_fibs() argument
662 struct Scsi_Host *shost = aac->scsi_host_ptr; in get_num_of_incomplete_fibs()
668 ctrl_dev = &aac->pdev->dev; in get_num_of_incomplete_fibs()
683 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_abort() local
688 if (aac_adapter_check_health(aac)) in aac_eh_abort()
693 if (aac->hba_map[bus][cid].devtype == AAC_DEVTYPE_NATIVE_RAW) { in aac_eh_abort()
705 fib = &aac->fibs[count]; in aac_eh_abort()
717 fib = aac_fib_alloc(aac); in aac_eh_abort()
724 tmf->it_nexus = aac->hba_map[bus][cid].rmw_nexus; in aac_eh_abort()
764 if (!(aac->raw_io_interface) || in aac_eh_abort()
765 !(aac->raw_io_64) || in aac_eh_abort()
778 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
800 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
904 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_dev_reset() local
919 info = &aac->hba_map[bus][cid]; in aac_eh_dev_reset()
928 fib = aac_fib_alloc(aac); in aac_eh_dev_reset()
967 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_target_reset() local
982 info = &aac->hba_map[bus][cid]; in aac_eh_target_reset()
991 fib = aac_fib_alloc(aac); in aac_eh_target_reset()
1033 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_bus_reset() local
1042 struct fib *fib = &aac->fibs[count]; in aac_eh_bus_reset()
1055 info = &aac->hba_map[bus][cid]; in aac_eh_bus_reset()
1069 status = aac_adapter_check_health(aac); in aac_eh_bus_reset()
1071 dev_err(&aac->pdev->dev, "Adapter health - %d\n", status); in aac_eh_bus_reset()
1073 count = get_num_of_incomplete_fibs(aac); in aac_eh_bus_reset()
1086 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_host_reset() local
1096 supported_options2 = aac->supplement_adapter_info.supported_options2; in aac_eh_host_reset()
1109 if (aac_reset_adapter(aac, 2, IOP_HWSOFT_RESET) == 0) in aac_eh_host_reset()
1121 info = &aac->hba_map[bus][cid]; in aac_eh_host_reset()
1144 struct aac_dev *aac; in aac_cfg_open() local
1149 list_for_each_entry(aac, &aac_devices, entry) { in aac_cfg_open()
1150 if (aac->id == minor_number) { in aac_cfg_open()
1151 file->private_data = aac; in aac_cfg_open()
1162 * aac_cfg_ioctl - AAC configuration request
1177 struct aac_dev *aac = (struct aac_dev *)file->private_data; in aac_cfg_ioctl() local
1182 return aac_do_ioctl(aac, cmd, (void __user *)arg); in aac_cfg_ioctl()
1534 .name = "AAC",
1565 static void __aac_shutdown(struct aac_dev * aac) in __aac_shutdown() argument
1569 mutex_lock(&aac->ioctl_mutex); in __aac_shutdown()
1570 aac->adapter_shutdown = 1; in __aac_shutdown()
1571 mutex_unlock(&aac->ioctl_mutex); in __aac_shutdown()
1573 if (aac->aif_thread) { in __aac_shutdown()
1576 for (i = 0; i < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); i++) { in __aac_shutdown()
1577 struct fib *fib = &aac->fibs[i]; in __aac_shutdown()
1582 kthread_stop(aac->thread); in __aac_shutdown()
1583 aac->thread = NULL; in __aac_shutdown()
1586 aac_send_shutdown(aac); in __aac_shutdown()
1588 aac_adapter_disable_int(aac); in __aac_shutdown()
1590 if (aac_is_src(aac)) { in __aac_shutdown()
1591 if (aac->max_msix > 1) { in __aac_shutdown()
1592 for (i = 0; i < aac->max_msix; i++) { in __aac_shutdown()
1593 free_irq(pci_irq_vector(aac->pdev, i), in __aac_shutdown()
1594 &(aac->aac_msix[i])); in __aac_shutdown()
1597 free_irq(aac->pdev->irq, in __aac_shutdown()
1598 &(aac->aac_msix[0])); in __aac_shutdown()
1601 free_irq(aac->pdev->irq, aac); in __aac_shutdown()
1603 if (aac->msi) in __aac_shutdown()
1604 pci_disable_msi(aac->pdev); in __aac_shutdown()
1605 else if (aac->max_msix > 1) in __aac_shutdown()
1606 pci_disable_msix(aac->pdev); in __aac_shutdown()
1610 aac_cfg_major = register_chrdev(0, "aac", &aac_cfg_fops); in aac_init_char()
1612 pr_err("aacraid: unable to register \"aac\" device.\n"); in aac_init_char()
1616 void aac_reinit_aif(struct aac_dev *aac, unsigned int index) in aac_reinit_aif() argument
1625 aac_intr_normal(aac, 0, 2, 0, NULL); in aac_reinit_aif()
1633 struct aac_dev *aac; in aac_probe_one() local
1647 list_for_each_entry(aac, &aac_devices, entry) { in aac_probe_one()
1648 if (aac->id > unique_id) in aac_probe_one()
1650 insert = &aac->entry; in aac_probe_one()
1703 aac = (struct aac_dev *)shost->hostdata; in aac_probe_one()
1704 aac->base_start = pci_resource_start(pdev, 0); in aac_probe_one()
1705 aac->scsi_host_ptr = shost; in aac_probe_one()
1706 aac->pdev = pdev; in aac_probe_one()
1707 aac->name = aac_driver_template.name; in aac_probe_one()
1708 aac->id = shost->unique_id; in aac_probe_one()
1709 aac->cardtype = index; in aac_probe_one()
1710 INIT_LIST_HEAD(&aac->entry); in aac_probe_one()
1713 aac->init_reset = true; in aac_probe_one()
1715 aac->fibs = kcalloc(shost->can_queue + AAC_NUM_MGT_FIB, in aac_probe_one()
1718 if (!aac->fibs) { in aac_probe_one()
1723 spin_lock_init(&aac->fib_lock); in aac_probe_one()
1725 mutex_init(&aac->ioctl_mutex); in aac_probe_one()
1726 mutex_init(&aac->scan_mutex); in aac_probe_one()
1728 INIT_DELAYED_WORK(&aac->safw_rescan_work, aac_safw_rescan_worker); in aac_probe_one()
1729 INIT_DELAYED_WORK(&aac->src_reinit_aif_worker, in aac_probe_one()
1734 aac->base_size = AAC_MIN_FOOTPRINT_SIZE; in aac_probe_one()
1735 if ((*aac_drivers[index].init)(aac)) { in aac_probe_one()
1740 if (aac->sync_mode) { in aac_probe_one()
1745 aac->name, in aac_probe_one()
1746 aac->id); in aac_probe_one()
1751 aac->name, in aac_probe_one()
1752 aac->id); in aac_probe_one()
1758 aac->thread = kthread_run(aac_command_thread, aac, AAC_DRIVERNAME); in aac_probe_one()
1759 if (IS_ERR(aac->thread)) { in aac_probe_one()
1761 error = PTR_ERR(aac->thread); in aac_probe_one()
1762 aac->thread = NULL; in aac_probe_one()
1766 aac->maximum_num_channels = aac_drivers[index].channels; in aac_probe_one()
1767 error = aac_get_adapter_info(aac); in aac_probe_one()
1786 if (aac->adapter_info.options & AAC_OPT_NEW_COMM) in aac_probe_one()
1795 aac->printf_enabled = 1; in aac_probe_one()
1797 aac->printf_enabled = 0; in aac_probe_one()
1804 if (aac->nondasd_support || expose_physicals || aac->jbod) in aac_probe_one()
1805 shost->max_channel = aac->maximum_num_channels; in aac_probe_one()
1809 aac_get_config_status(aac, 0); in aac_probe_one()
1810 aac_get_containers(aac); in aac_probe_one()
1811 list_add(&aac->entry, insert); in aac_probe_one()
1813 shost->max_id = aac->maximum_num_containers; in aac_probe_one()
1814 if (shost->max_id < aac->maximum_num_physicals) in aac_probe_one()
1815 shost->max_id = aac->maximum_num_physicals; in aac_probe_one()
1821 if (!aac->sa_firmware && aac_drivers[index].quirks & AAC_QUIRK_SRC) in aac_probe_one()
1822 aac_intr_normal(aac, 0, 2, 0, NULL); in aac_probe_one()
1836 aac_scan_host(aac); in aac_probe_one()
1844 __aac_shutdown(aac); in aac_probe_one()
1846 aac_fib_map_free(aac); in aac_probe_one()
1847 if (aac->comm_addr) in aac_probe_one()
1848 dma_free_coherent(&aac->pdev->dev, aac->comm_size, in aac_probe_one()
1849 aac->comm_addr, aac->comm_phys); in aac_probe_one()
1850 kfree(aac->queues); in aac_probe_one()
1851 aac_adapter_ioremap(aac, 0); in aac_probe_one()
1852 kfree(aac->fibs); in aac_probe_one()
1853 kfree(aac->fsa_dev); in aac_probe_one()
1862 static void aac_release_resources(struct aac_dev *aac) in aac_release_resources() argument
1864 aac_adapter_disable_int(aac); in aac_release_resources()
1865 aac_free_irq(aac); in aac_release_resources()
1918 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_suspend() local
1921 aac_cancel_rescan_worker(aac); in aac_suspend()
1922 aac_send_shutdown(aac); in aac_suspend()
1924 aac_release_resources(aac); in aac_suspend()
1937 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_resume() local
1949 if (aac_acquire_resources(aac)) in aac_resume()
1955 aac->adapter_shutdown = 0; in aac_resume()
1961 printk(KERN_INFO "%s%d: resume failed.\n", aac->name, aac->id); in aac_resume()
1979 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_remove_one() local
1981 aac_cancel_rescan_worker(aac); in aac_remove_one()
1984 __aac_shutdown(aac); in aac_remove_one()
1985 aac_fib_map_free(aac); in aac_remove_one()
1986 dma_free_coherent(&aac->pdev->dev, aac->comm_size, aac->comm_addr, in aac_remove_one()
1987 aac->comm_phys); in aac_remove_one()
1988 kfree(aac->queues); in aac_remove_one()
1990 aac_adapter_ioremap(aac, 0); in aac_remove_one()
1992 kfree(aac->fibs); in aac_remove_one()
1993 kfree(aac->fsa_dev); in aac_remove_one()
1995 list_del(&aac->entry); in aac_remove_one()
1999 unregister_chrdev(aac_cfg_major, "aac"); in aac_remove_one()
2008 struct aac_dev *aac = shost_priv(shost); in aac_pci_error_detected() local
2016 aac->handle_pci_error = 1; in aac_pci_error_detected()
2019 aac_cancel_rescan_worker(aac); in aac_pci_error_detected()
2021 aac_release_resources(aac); in aac_pci_error_detected()
2024 aac_adapter_ioremap(aac, 0); in aac_pci_error_detected()
2028 aac->handle_pci_error = 1; in aac_pci_error_detected()
2071 struct aac_dev *aac = (struct aac_dev *)shost_priv(shost); in aac_pci_resume() local
2073 if (aac_adapter_ioremap(aac, aac->base_size)) { in aac_pci_resume()
2077 aac->comm_interface = AAC_COMM_PRODUCER; in aac_pci_resume()
2078 if (aac_adapter_ioremap(aac, AAC_MIN_FOOTPRINT_SIZE)) { in aac_pci_resume()
2088 aac_acquire_resources(aac); in aac_pci_resume()
2094 aac->adapter_shutdown = 0; in aac_pci_resume()
2095 aac->handle_pci_error = 0; in aac_pci_resume()
2098 aac_scan_host(aac); in aac_pci_resume()
2144 unregister_chrdev(aac_cfg_major, "aac"); in aac_exit()