aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2008-12-04 22:39:19 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-12-29 12:24:26 -0500
commit97207482fcdd120a60a44e9eb6bbad8da6f81c9d (patch)
tree505eaae602772597da496232efe787e485dda718 /drivers/scsi/lpfc/lpfc_init.c
parenteada272dfc32ba3dcd33e7ca5875337defb13c54 (diff)
[SCSI] lpfc 8.3.0 : Added 3 small features and improve PCI EEH support
- Added FC_REG_VPORTRSCN_EVENT to lpfc_nl.h - Added code to provide option ROM version from HBA and via sysfs - Added support for HPS bit in config port mailbox command to tell HBA that host group pointers are in host memory. - Bugfix for Extended Error Handling (EEH) support on IBM PowerPC P6 platform with MSI enabled Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c61
1 files changed, 60 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 56ed5282117c..64e3d344f4dd 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -236,6 +236,48 @@ lpfc_config_async_cmpl(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq)
236} 236}
237 237
238/** 238/**
239 * lpfc_dump_wakeup_param_cmpl: Completion handler for dump memory mailbox
240 * command used for getting wake up parameters.
241 * @phba: pointer to lpfc hba data structure.
242 * @pmboxq: pointer to the driver internal queue element for mailbox command.
243 *
244 * This is the completion handler for dump mailbox command for getting
245 * wake up parameters. When this command complete, the response contain
246 * Option rom version of the HBA. This function translate the version number
247 * into a human readable string and store it in OptionROMVersion.
248 **/
249static void
250lpfc_dump_wakeup_param_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)
251{
252 struct prog_id *prg;
253 uint32_t prog_id_word;
254 char dist = ' ';
255 /* character array used for decoding dist type. */
256 char dist_char[] = "nabx";
257
258 if (pmboxq->mb.mbxStatus != MBX_SUCCESS)
259 return;
260
261 prg = (struct prog_id *) &prog_id_word;
262
263 /* word 7 contain option rom version */
264 prog_id_word = pmboxq->mb.un.varWords[7];
265
266 /* Decode the Option rom version word to a readable string */
267 if (prg->dist < 4)
268 dist = dist_char[prg->dist];
269
270 if ((prg->dist == 3) && (prg->num == 0))
271 sprintf(phba->OptionROMVersion, "%d.%d%d",
272 prg->ver, prg->rev, prg->lev);
273 else
274 sprintf(phba->OptionROMVersion, "%d.%d%d%c%d",
275 prg->ver, prg->rev, prg->lev,
276 dist, prg->num);
277 return;
278}
279
280/**
239 * lpfc_config_port_post: Perform lpfc initialization after config port. 281 * lpfc_config_port_post: Perform lpfc initialization after config port.
240 * @phba: pointer to lpfc hba data structure. 282 * @phba: pointer to lpfc hba data structure.
241 * 283 *
@@ -482,6 +524,20 @@ lpfc_config_port_post(struct lpfc_hba *phba)
482 rc); 524 rc);
483 mempool_free(pmb, phba->mbox_mem_pool); 525 mempool_free(pmb, phba->mbox_mem_pool);
484 } 526 }
527
528 /* Get Option rom version */
529 pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
530 lpfc_dump_wakeup_param(phba, pmb);
531 pmb->mbox_cmpl = lpfc_dump_wakeup_param_cmpl;
532 pmb->vport = phba->pport;
533 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
534
535 if ((rc != MBX_BUSY) && (rc != MBX_SUCCESS)) {
536 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, "0435 Adapter failed "
537 "to get Option ROM version status x%x\n.", rc);
538 mempool_free(pmb, phba->mbox_mem_pool);
539 }
540
485 return 0; 541 return 0;
486} 542}
487 543
@@ -2406,6 +2462,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
2406 phba->eratt_poll.data = (unsigned long) phba; 2462 phba->eratt_poll.data = (unsigned long) phba;
2407 2463
2408 pci_set_master(pdev); 2464 pci_set_master(pdev);
2465 pci_save_state(pdev);
2409 pci_try_set_mwi(pdev); 2466 pci_try_set_mwi(pdev);
2410 2467
2411 if (pci_set_dma_mask(phba->pcidev, DMA_64BIT_MASK) != 0) 2468 if (pci_set_dma_mask(phba->pcidev, DMA_64BIT_MASK) != 0)
@@ -2982,7 +3039,9 @@ static pci_ers_result_t lpfc_io_slot_reset(struct pci_dev *pdev)
2982 return PCI_ERS_RESULT_DISCONNECT; 3039 return PCI_ERS_RESULT_DISCONNECT;
2983 } 3040 }
2984 3041
2985 pci_set_master(pdev); 3042 pci_restore_state(pdev);
3043 if (pdev->is_busmaster)
3044 pci_set_master(pdev);
2986 3045
2987 spin_lock_irq(&phba->hbalock); 3046 spin_lock_irq(&phba->hbalock);
2988 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 3047 psli->sli_flag &= ~LPFC_SLI2_ACTIVE;