Lines Matching +full:odd +full:- +full:numbered
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
136 return sysfs_emit(buf, "%d\n", ihost->id); in isci_show_id()
184 /* ata recovery called from ata-eh */
206 * isci_register_sas_ha() - This method initializes various lldd
219 struct sas_ha_struct *sas_ha = &(isci_host->sas_ha); in isci_register_sas_ha()
223 sas_phys = devm_kcalloc(&isci_host->pdev->dev, in isci_register_sas_ha()
227 return -ENOMEM; in isci_register_sas_ha()
229 sas_ports = devm_kcalloc(&isci_host->pdev->dev, in isci_register_sas_ha()
233 return -ENOMEM; in isci_register_sas_ha()
235 sas_ha->sas_ha_name = DRV_NAME; in isci_register_sas_ha()
236 sas_ha->sas_addr = &isci_host->phys[0].sas_addr[0]; in isci_register_sas_ha()
239 sas_phys[i] = &isci_host->phys[i].sas_phy; in isci_register_sas_ha()
240 sas_ports[i] = &isci_host->sas_ports[i]; in isci_register_sas_ha()
243 sas_ha->sas_phy = sas_phys; in isci_register_sas_ha()
244 sas_ha->sas_port = sas_ports; in isci_register_sas_ha()
245 sas_ha->num_phys = SCI_MAX_PHYS; in isci_register_sas_ha()
247 sas_ha->strict_wide_ports = 1; in isci_register_sas_ha()
260 sas_unregister_ha(&isci_host->sas_ha); in isci_unregister()
273 dev_err(&pdev->dev, in isci_pci_init()
288 return -ENOMEM; in isci_pci_init()
292 err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); in isci_pci_init()
294 err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); in isci_pci_init()
334 ihost = pci_info->hosts[id]; in isci_setup_interrupts()
335 /* odd numbered vectors are error interrupts */ in isci_setup_interrupts()
341 err = devm_request_irq(&pdev->dev, pci_irq_vector(pdev, i), in isci_setup_interrupts()
342 isr, 0, DRV_NAME"-msix", ihost); in isci_setup_interrupts()
346 dev_info(&pdev->dev, "msix setup failed falling back to intx\n"); in isci_setup_interrupts()
347 while (i--) { in isci_setup_interrupts()
349 ihost = pci_info->hosts[id]; in isci_setup_interrupts()
350 devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), in isci_setup_interrupts()
360 err = devm_request_irq(&pdev->dev, pci_irq_vector(pdev, 0), in isci_setup_interrupts()
361 isci_intx_isr, IRQF_SHARED, DRV_NAME"-intx", in isci_setup_interrupts()
374 struct sci_phy_user_params *u_phy = &u->phys[i]; in isci_user_parameters_get()
376 u_phy->max_speed_generation = phy_gen; in isci_user_parameters_get()
379 u_phy->align_insertion_frequency = 0x7f; in isci_user_parameters_get()
380 u_phy->in_connection_align_insertion_frequency = 0xff; in isci_user_parameters_get()
381 u_phy->notify_enable_spin_up_insertion_frequency = 0x33; in isci_user_parameters_get()
384 u->stp_inactivity_timeout = stp_inactive_to; in isci_user_parameters_get()
385 u->ssp_inactivity_timeout = ssp_inactive_to; in isci_user_parameters_get()
386 u->stp_max_occupancy_timeout = stp_max_occ_to; in isci_user_parameters_get()
387 u->ssp_max_occupancy_timeout = ssp_max_occ_to; in isci_user_parameters_get()
388 u->no_outbound_task_timeout = no_outbound_task_to; in isci_user_parameters_get()
389 u->max_concurr_spinup = max_concurr_spinup; in isci_user_parameters_get()
404 u = &sci_parms->phys[index]; in sci_user_parameters_set()
406 if (!((u->max_speed_generation <= SCIC_SDS_PARM_MAX_SPEED) && in sci_user_parameters_set()
407 (u->max_speed_generation > SCIC_SDS_PARM_NO_SPEED))) in sci_user_parameters_set()
410 if ((u->in_connection_align_insertion_frequency < 3) || in sci_user_parameters_set()
411 (u->align_insertion_frequency == 0) || in sci_user_parameters_set()
412 (u->notify_enable_spin_up_insertion_frequency == 0)) in sci_user_parameters_set()
416 if ((sci_parms->stp_inactivity_timeout == 0) || in sci_user_parameters_set()
417 (sci_parms->ssp_inactivity_timeout == 0) || in sci_user_parameters_set()
418 (sci_parms->stp_max_occupancy_timeout == 0) || in sci_user_parameters_set()
419 (sci_parms->ssp_max_occupancy_timeout == 0) || in sci_user_parameters_set()
420 (sci_parms->no_outbound_task_timeout == 0)) in sci_user_parameters_set()
423 memcpy(&ihost->user_parameters, sci_parms, sizeof(*sci_parms)); in sci_user_parameters_set()
431 struct sci_user_parameters *user = &ihost->user_parameters; in sci_oem_defaults()
432 struct sci_oem_params *oem = &ihost->oem_parameters; in sci_oem_defaults()
436 oem->controller.mode_type = SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE; in sci_oem_defaults()
439 oem->controller.max_concurr_spin_up = 1; in sci_oem_defaults()
442 oem->controller.do_enable_ssc = false; in sci_oem_defaults()
445 oem->controller.cable_selection_mask = 0; in sci_oem_defaults()
449 oem->ports[i].phy_mask = 0; in sci_oem_defaults()
454 user->phys[i].max_speed_generation = SCIC_SDS_PARM_GEN2_SPEED; in sci_oem_defaults()
457 user->phys[i].align_insertion_frequency = 0x7f; in sci_oem_defaults()
458 user->phys[i].in_connection_align_insertion_frequency = 0xff; in sci_oem_defaults()
459 user->phys[i].notify_enable_spin_up_insertion_frequency = 0x33; in sci_oem_defaults()
462 * is worked around by having the upper 32-bits of SAS address in sci_oem_defaults()
466 oem->phys[i].sas_address.low = 0x1 + ihost->id; in sci_oem_defaults()
467 oem->phys[i].sas_address.high = 0x5FCFFFFF; in sci_oem_defaults()
470 user->stp_inactivity_timeout = 5; in sci_oem_defaults()
471 user->ssp_inactivity_timeout = 5; in sci_oem_defaults()
472 user->stp_max_occupancy_timeout = 5; in sci_oem_defaults()
473 user->ssp_max_occupancy_timeout = 20; in sci_oem_defaults()
474 user->no_outbound_task_timeout = 2; in sci_oem_defaults()
479 struct isci_orom *orom = to_pci_info(pdev)->orom; in isci_host_alloc()
486 ihost = devm_kzalloc(&pdev->dev, sizeof(*ihost), GFP_KERNEL); in isci_host_alloc()
490 ihost->pdev = pdev; in isci_host_alloc()
491 ihost->id = id; in isci_host_alloc()
492 spin_lock_init(&ihost->scic_lock); in isci_host_alloc()
493 init_waitqueue_head(&ihost->eventq); in isci_host_alloc()
494 ihost->sas_ha.dev = &ihost->pdev->dev; in isci_host_alloc()
495 ihost->sas_ha.lldd_ha = ihost; in isci_host_alloc()
496 tasklet_init(&ihost->completion_tasklet, in isci_host_alloc()
504 dev_warn(&pdev->dev, in isci_host_alloc()
511 if (id < 0 || id >= SCI_MAX_CONTROLLERS || id > orom->hdr.num_elements) { in isci_host_alloc()
512 dev_warn(&pdev->dev, "parsing firmware oem parameters failed\n"); in isci_host_alloc()
515 ihost->oem_parameters = orom->ctrl[id]; in isci_host_alloc()
516 oem_version = orom->hdr.version; in isci_host_alloc()
519 /* validate oem parameters (platform, firmware, or built-in defaults) */ in isci_host_alloc()
520 if (sci_oem_parameters_validate(&ihost->oem_parameters, oem_version)) { in isci_host_alloc()
521 dev_warn(&pdev->dev, "oem parameter validation failed\n"); in isci_host_alloc()
526 struct isci_port *iport = &ihost->ports[i]; in isci_host_alloc()
528 INIT_LIST_HEAD(&iport->remote_dev_list); in isci_host_alloc()
529 iport->isci_host = ihost; in isci_host_alloc()
533 isci_phy_init(&ihost->phys[i], ihost, i); in isci_host_alloc()
536 struct isci_remote_device *idev = &ihost->devices[i]; in isci_host_alloc()
538 INIT_LIST_HEAD(&idev->node); in isci_host_alloc()
545 dev_info(&pdev->dev, "%sSCU controller %d: phy 3-0 cables: " in isci_host_alloc()
547 (is_cable_select_overridden() ? "* " : ""), ihost->id, in isci_host_alloc()
557 SHOST_TO_SAS_HA(shost) = &ihost->sas_ha; in isci_host_alloc()
558 ihost->sas_ha.shost = shost; in isci_host_alloc()
559 shost->transportt = isci_transport_template; in isci_host_alloc()
561 shost->max_id = ~0; in isci_host_alloc()
562 shost->max_lun = ~0; in isci_host_alloc()
563 shost->max_cmd_len = MAX_COMMAND_SIZE; in isci_host_alloc()
572 err = scsi_add_host(shost, &pdev->dev); in isci_host_alloc()
599 dev_info(&pdev->dev, "driver configured for rev: %d silicon\n", in isci_pci_probe()
600 pdev->revision); in isci_pci_probe()
602 pci_info = devm_kzalloc(&pdev->dev, sizeof(*pci_info), GFP_KERNEL); in isci_pci_probe()
604 return -ENOMEM; in isci_pci_probe()
614 if (sci_oem_parameters_validate(&orom->ctrl[i], in isci_pci_probe()
615 orom->hdr.version)) { in isci_pci_probe()
616 dev_warn(&pdev->dev, in isci_pci_probe()
630 dev_warn(&pdev->dev, in isci_pci_probe()
633 dev_warn(&pdev->dev, in isci_pci_probe()
640 dev_info(&pdev->dev, in isci_pci_probe()
642 (orom->hdr.version & 0xf0) >> 4, in isci_pci_probe()
643 (orom->hdr.version & 0xf), source); in isci_pci_probe()
645 pci_info->orom = orom; in isci_pci_probe()
655 err = -ENOMEM; in isci_pci_probe()
658 pci_info->hosts[i] = h; in isci_pci_probe()
696 sas_suspend_ha(&ihost->sas_ha); in isci_suspend()
710 sas_prep_resume_ha(&ihost->sas_ha); in isci_resume()
713 isci_host_start(ihost->sas_ha.shost); in isci_resume()
716 sas_resume_ha(&ihost->sas_ha); in isci_resume()
737 pr_info("%s: Intel(R) C600 SAS Controller Driver - version %s\n", in isci_init()
742 return -ENOMEM; in isci_init()