diff options
author | James.Smart@Emulex.Com <James.Smart@Emulex.Com> | 2005-06-25 16:34:13 +0200 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-07-03 00:07:03 +0200 |
commit | 87f6eaffd732bc20b5a02e9f36b86f67310d8129 (patch) | |
tree | 8f2efa960a64c503fe4a945f3e514cd689bd1daa | |
parent | [SCSI] lpfc: Fixes in mbox_timeout_handler (diff) | |
download | linux-87f6eaffd732bc20b5a02e9f36b86f67310d8129.tar.xz linux-87f6eaffd732bc20b5a02e9f36b86f67310d8129.zip |
[SCSI] lpfc: Fix error loading on sparc
Bug reported via SourceForge - lpfc does not load on sparc. The lpfc
driver must byteswap all FCP IOCBs to recover the data into cpu native
format.
Also correct issue of "iotag not found" messages
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 46e062dafd85..e01428895823 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -904,6 +904,7 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, { struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[pring->ringno]; IOCB_t *irsp = NULL; + IOCB_t *entry = NULL; struct lpfc_iocbq *cmdiocbq = NULL; struct lpfc_iocbq rspiocbq; uint32_t status; @@ -948,7 +949,17 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, rmb(); while (pring->rspidx != portRspPut) { - irsp = (IOCB_t *) IOCB_ENTRY(pring->rspringaddr, pring->rspidx); + /* + * Fetch an entry off the ring and copy it into a local data + * structure. The copy involves a byte-swap since the + * network byte order and pci byte orders are different. + */ + entry = (IOCB_t *) IOCB_ENTRY(pring->rspringaddr, pring->rspidx); + lpfc_sli_pcimem_bcopy((uint32_t *) entry, + (uint32_t *) &rspiocbq.iocb, + sizeof (IOCB_t)); + irsp = &rspiocbq.iocb; + type = lpfc_sli_iocb_cmd_type(irsp->ulpCommand & CMD_IOCB_MASK); pring->stats.iocb_rsp++; rsp_cmpl++; @@ -980,10 +991,6 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, break; } - rspiocbq.iocb.un.ulpWord[4] = irsp->un.ulpWord[4]; - rspiocbq.iocb.ulpStatus = irsp->ulpStatus; - rspiocbq.iocb.ulpContext = irsp->ulpContext; - rspiocbq.iocb.ulpIoTag = irsp->ulpIoTag; cmdiocbq = lpfc_sli_txcmpl_ring_iotag_lookup(phba, pring, &rspiocbq); |