Lines Matching full:aac

3  *	Adaptec AAC series RAID controller driver
216 …{ aac_sa_init, "aacraid", "ADAPTEC ", "AAC-364 ", 4, AAC_QUIRK_34SG }, /* Adaptec 5400S (…
390 struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata; in aac_slave_configure() local
400 if (chn < AAC_MAX_BUSES && tid < AAC_MAX_TARGETS && aac->sa_firmware) { in aac_slave_configure()
401 devtype = aac->hba_map[chn][tid].devtype; in aac_slave_configure()
404 depth = aac->hba_map[chn][tid].qd_limit; in aac_slave_configure()
415 if (aac->jbod && (sdev->type == TYPE_DISK)) in aac_slave_configure()
420 && (!aac->jbod || sdev->inq_periph_qual) in aac_slave_configure()
421 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2))) { in aac_slave_configure()
432 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_slave_configure()
443 for (cid = 0; cid < aac->maximum_num_containers; ++cid) in aac_slave_configure()
444 if (aac->fsa_dev[cid].valid) in aac_slave_configure()
450 && (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) in aac_slave_configure()
453 || !aac->fsa_dev[sdev_id(dev)].valid) { in aac_slave_configure()
491 timeout = aac->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT; in aac_slave_configure()
518 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_change_queue_depth() local
524 aac->hba_map[chn][tid].devtype == AAC_DEVTYPE_NATIVE_RAW) in aac_change_queue_depth()
549 scsi_change_queue_depth(sdev, aac->hba_map[chn][tid].qd_limit); in aac_change_queue_depth()
559 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_show_raid_level() local
563 ((aac->jbod && (sdev->type == TYPE_DISK)) ? "JBOD\n" : "")); in aac_show_raid_level()
565 get_container_type(aac->fsa_dev[sdev_id(sdev)].type)); in aac_show_raid_level()
580 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); in aac_show_unique_id() local
586 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()
684 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_abort() local
689 if (aac_adapter_check_health(aac)) in aac_eh_abort()
694 if (aac->hba_map[bus][cid].devtype == AAC_DEVTYPE_NATIVE_RAW) { in aac_eh_abort()
706 fib = &aac->fibs[count]; in aac_eh_abort()
718 fib = aac_fib_alloc(aac); in aac_eh_abort()
725 tmf->it_nexus = aac->hba_map[bus][cid].rmw_nexus; in aac_eh_abort()
765 if (!(aac->raw_io_interface) || in aac_eh_abort()
766 !(aac->raw_io_64) || in aac_eh_abort()
779 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
801 struct fib *fib = &aac->fibs[count]; in aac_eh_abort()
905 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_dev_reset() local
920 info = &aac->hba_map[bus][cid]; in aac_eh_dev_reset()
929 fib = aac_fib_alloc(aac); in aac_eh_dev_reset()
968 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_target_reset() local
983 info = &aac->hba_map[bus][cid]; in aac_eh_target_reset()
992 fib = aac_fib_alloc(aac); in aac_eh_target_reset()
1034 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_bus_reset() local
1043 struct fib *fib = &aac->fibs[count]; in aac_eh_bus_reset()
1056 info = &aac->hba_map[bus][cid]; in aac_eh_bus_reset()
1070 status = aac_adapter_check_health(aac); in aac_eh_bus_reset()
1072 dev_err(&aac->pdev->dev, "Adapter health - %d\n", status); in aac_eh_bus_reset()
1074 count = get_num_of_incomplete_fibs(aac); in aac_eh_bus_reset()
1087 struct aac_dev * aac = (struct aac_dev *)host->hostdata; in aac_eh_host_reset() local
1097 supported_options2 = aac->supplement_adapter_info.supported_options2; in aac_eh_host_reset()
1110 if (aac_reset_adapter(aac, 2, IOP_HWSOFT_RESET) == 0) in aac_eh_host_reset()
1122 info = &aac->hba_map[bus][cid]; in aac_eh_host_reset()
1145 struct aac_dev *aac; in aac_cfg_open() local
1150 list_for_each_entry(aac, &aac_devices, entry) { in aac_cfg_open()
1151 if (aac->id == minor_number) { in aac_cfg_open()
1152 file->private_data = aac; in aac_cfg_open()
1163 * aac_cfg_ioctl - AAC configuration request
1178 struct aac_dev *aac = (struct aac_dev *)file->private_data; in aac_cfg_ioctl() local
1183 return aac_do_ioctl(aac, cmd, (void __user *)arg); in aac_cfg_ioctl()
1480 .name = "AAC",
1512 static void __aac_shutdown(struct aac_dev * aac) in __aac_shutdown() argument
1516 mutex_lock(&aac->ioctl_mutex); in __aac_shutdown()
1517 aac->adapter_shutdown = 1; in __aac_shutdown()
1518 mutex_unlock(&aac->ioctl_mutex); in __aac_shutdown()
1520 if (aac->aif_thread) { in __aac_shutdown()
1523 for (i = 0; i < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); i++) { in __aac_shutdown()
1524 struct fib *fib = &aac->fibs[i]; in __aac_shutdown()
1529 kthread_stop(aac->thread); in __aac_shutdown()
1530 aac->thread = NULL; in __aac_shutdown()
1533 aac_send_shutdown(aac); in __aac_shutdown()
1535 aac_adapter_disable_int(aac); in __aac_shutdown()
1537 if (aac_is_src(aac)) { in __aac_shutdown()
1538 if (aac->max_msix > 1) { in __aac_shutdown()
1539 for (i = 0; i < aac->max_msix; i++) { in __aac_shutdown()
1540 free_irq(pci_irq_vector(aac->pdev, i), in __aac_shutdown()
1541 &(aac->aac_msix[i])); in __aac_shutdown()
1544 free_irq(aac->pdev->irq, in __aac_shutdown()
1545 &(aac->aac_msix[0])); in __aac_shutdown()
1548 free_irq(aac->pdev->irq, aac); in __aac_shutdown()
1550 if (aac->msi) in __aac_shutdown()
1551 pci_disable_msi(aac->pdev); in __aac_shutdown()
1552 else if (aac->max_msix > 1) in __aac_shutdown()
1553 pci_disable_msix(aac->pdev); in __aac_shutdown()
1557 aac_cfg_major = register_chrdev(0, "aac", &aac_cfg_fops); in aac_init_char()
1559 pr_err("aacraid: unable to register \"aac\" device.\n"); in aac_init_char()
1563 void aac_reinit_aif(struct aac_dev *aac, unsigned int index) in aac_reinit_aif() argument
1572 aac_intr_normal(aac, 0, 2, 0, NULL); in aac_reinit_aif()
1580 struct aac_dev *aac; in aac_probe_one() local
1594 list_for_each_entry(aac, &aac_devices, entry) { in aac_probe_one()
1595 if (aac->id > unique_id) in aac_probe_one()
1597 insert = &aac->entry; in aac_probe_one()
1650 aac = (struct aac_dev *)shost->hostdata; in aac_probe_one()
1651 aac->base_start = pci_resource_start(pdev, 0); in aac_probe_one()
1652 aac->scsi_host_ptr = shost; in aac_probe_one()
1653 aac->pdev = pdev; in aac_probe_one()
1654 aac->name = aac_driver_template.name; in aac_probe_one()
1655 aac->id = shost->unique_id; in aac_probe_one()
1656 aac->cardtype = index; in aac_probe_one()
1657 INIT_LIST_HEAD(&aac->entry); in aac_probe_one()
1660 aac->init_reset = true; in aac_probe_one()
1662 aac->fibs = kcalloc(shost->can_queue + AAC_NUM_MGT_FIB, in aac_probe_one()
1665 if (!aac->fibs) { in aac_probe_one()
1670 spin_lock_init(&aac->fib_lock); in aac_probe_one()
1672 mutex_init(&aac->ioctl_mutex); in aac_probe_one()
1673 mutex_init(&aac->scan_mutex); in aac_probe_one()
1675 INIT_DELAYED_WORK(&aac->safw_rescan_work, aac_safw_rescan_worker); in aac_probe_one()
1676 INIT_DELAYED_WORK(&aac->src_reinit_aif_worker, in aac_probe_one()
1681 aac->base_size = AAC_MIN_FOOTPRINT_SIZE; in aac_probe_one()
1682 if ((*aac_drivers[index].init)(aac)) { in aac_probe_one()
1687 if (aac->sync_mode) { in aac_probe_one()
1692 aac->name, in aac_probe_one()
1693 aac->id); in aac_probe_one()
1698 aac->name, in aac_probe_one()
1699 aac->id); in aac_probe_one()
1705 aac->thread = kthread_run(aac_command_thread, aac, AAC_DRIVERNAME); in aac_probe_one()
1706 if (IS_ERR(aac->thread)) { in aac_probe_one()
1708 error = PTR_ERR(aac->thread); in aac_probe_one()
1709 aac->thread = NULL; in aac_probe_one()
1713 aac->maximum_num_channels = aac_drivers[index].channels; in aac_probe_one()
1714 error = aac_get_adapter_info(aac); in aac_probe_one()
1733 if (aac->adapter_info.options & AAC_OPT_NEW_COMM) in aac_probe_one()
1742 aac->printf_enabled = 1; in aac_probe_one()
1744 aac->printf_enabled = 0; in aac_probe_one()
1751 if (aac->nondasd_support || expose_physicals || aac->jbod) in aac_probe_one()
1752 shost->max_channel = aac->maximum_num_channels; in aac_probe_one()
1756 aac_get_config_status(aac, 0); in aac_probe_one()
1757 aac_get_containers(aac); in aac_probe_one()
1758 list_add(&aac->entry, insert); in aac_probe_one()
1760 shost->max_id = aac->maximum_num_containers; in aac_probe_one()
1761 if (shost->max_id < aac->maximum_num_physicals) in aac_probe_one()
1762 shost->max_id = aac->maximum_num_physicals; in aac_probe_one()
1768 if (!aac->sa_firmware && aac_drivers[index].quirks & AAC_QUIRK_SRC) in aac_probe_one()
1769 aac_intr_normal(aac, 0, 2, 0, NULL); in aac_probe_one()
1783 aac_scan_host(aac); in aac_probe_one()
1790 __aac_shutdown(aac); in aac_probe_one()
1792 aac_fib_map_free(aac); in aac_probe_one()
1793 if (aac->comm_addr) in aac_probe_one()
1794 dma_free_coherent(&aac->pdev->dev, aac->comm_size, in aac_probe_one()
1795 aac->comm_addr, aac->comm_phys); in aac_probe_one()
1796 kfree(aac->queues); in aac_probe_one()
1797 aac_adapter_ioremap(aac, 0); in aac_probe_one()
1798 kfree(aac->fibs); in aac_probe_one()
1799 kfree(aac->fsa_dev); in aac_probe_one()
1808 static void aac_release_resources(struct aac_dev *aac) in aac_release_resources() argument
1810 aac_adapter_disable_int(aac); in aac_release_resources()
1811 aac_free_irq(aac); in aac_release_resources()
1862 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_suspend() local
1865 aac_cancel_rescan_worker(aac); in aac_suspend()
1866 aac_send_shutdown(aac); in aac_suspend()
1868 aac_release_resources(aac); in aac_suspend()
1876 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_resume() local
1878 if (aac_acquire_resources(aac)) in aac_resume()
1884 aac->adapter_shutdown = 0; in aac_resume()
1890 printk(KERN_INFO "%s%d: resume failed.\n", aac->name, aac->id); in aac_resume()
1906 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; in aac_remove_one() local
1908 aac_cancel_rescan_worker(aac); in aac_remove_one()
1911 __aac_shutdown(aac); in aac_remove_one()
1912 aac_fib_map_free(aac); in aac_remove_one()
1913 dma_free_coherent(&aac->pdev->dev, aac->comm_size, aac->comm_addr, in aac_remove_one()
1914 aac->comm_phys); in aac_remove_one()
1915 kfree(aac->queues); in aac_remove_one()
1917 aac_adapter_ioremap(aac, 0); in aac_remove_one()
1919 kfree(aac->fibs); in aac_remove_one()
1920 kfree(aac->fsa_dev); in aac_remove_one()
1922 list_del(&aac->entry); in aac_remove_one()
1926 unregister_chrdev(aac_cfg_major, "aac"); in aac_remove_one()
1935 struct aac_dev *aac = shost_priv(shost); in aac_pci_error_detected() local
1943 aac->handle_pci_error = 1; in aac_pci_error_detected()
1946 aac_cancel_rescan_worker(aac); in aac_pci_error_detected()
1948 aac_release_resources(aac); in aac_pci_error_detected()
1950 aac_adapter_ioremap(aac, 0); in aac_pci_error_detected()
1954 aac->handle_pci_error = 1; in aac_pci_error_detected()
1997 struct aac_dev *aac = (struct aac_dev *)shost_priv(shost); in aac_pci_resume() local
1999 if (aac_adapter_ioremap(aac, aac->base_size)) { in aac_pci_resume()
2003 aac->comm_interface = AAC_COMM_PRODUCER; in aac_pci_resume()
2004 if (aac_adapter_ioremap(aac, AAC_MIN_FOOTPRINT_SIZE)) { in aac_pci_resume()
2014 aac_acquire_resources(aac); in aac_pci_resume()
2020 aac->adapter_shutdown = 0; in aac_pci_resume()
2021 aac->handle_pci_error = 0; in aac_pci_resume()
2024 aac_scan_host(aac); in aac_pci_resume()
2069 unregister_chrdev(aac_cfg_major, "aac"); in aac_exit()