diff options
author | James.Smart@Emulex.Com <James.Smart@Emulex.Com> | 2005-06-25 10:34:13 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-07-02 18:07:03 -0400 |
commit | 87f6eaffd732bc20b5a02e9f36b86f67310d8129 (patch) | |
tree | 8f2efa960a64c503fe4a945f3e514cd689bd1daa /drivers/scsi | |
parent | db468d108abc0bb348bcfc54b8e06145922fb6b1 (diff) |
[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>
Diffstat (limited to 'drivers/scsi')
-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, | |||
904 | { | 904 | { |
905 | struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[pring->ringno]; | 905 | struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[pring->ringno]; |
906 | IOCB_t *irsp = NULL; | 906 | IOCB_t *irsp = NULL; |
907 | IOCB_t *entry = NULL; | ||
907 | struct lpfc_iocbq *cmdiocbq = NULL; | 908 | struct lpfc_iocbq *cmdiocbq = NULL; |
908 | struct lpfc_iocbq rspiocbq; | 909 | struct lpfc_iocbq rspiocbq; |
909 | uint32_t status; | 910 | uint32_t status; |
@@ -948,7 +949,17 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, | |||
948 | 949 | ||
949 | rmb(); | 950 | rmb(); |
950 | while (pring->rspidx != portRspPut) { | 951 | while (pring->rspidx != portRspPut) { |
951 | irsp = (IOCB_t *) IOCB_ENTRY(pring->rspringaddr, pring->rspidx); | 952 | /* |
953 | * Fetch an entry off the ring and copy it into a local data | ||
954 | * structure. The copy involves a byte-swap since the | ||
955 | * network byte order and pci byte orders are different. | ||
956 | */ | ||
957 | entry = (IOCB_t *) IOCB_ENTRY(pring->rspringaddr, pring->rspidx); | ||
958 | lpfc_sli_pcimem_bcopy((uint32_t *) entry, | ||
959 | (uint32_t *) &rspiocbq.iocb, | ||
960 | sizeof (IOCB_t)); | ||
961 | irsp = &rspiocbq.iocb; | ||
962 | |||
952 | type = lpfc_sli_iocb_cmd_type(irsp->ulpCommand & CMD_IOCB_MASK); | 963 | type = lpfc_sli_iocb_cmd_type(irsp->ulpCommand & CMD_IOCB_MASK); |
953 | pring->stats.iocb_rsp++; | 964 | pring->stats.iocb_rsp++; |
954 | rsp_cmpl++; | 965 | rsp_cmpl++; |
@@ -980,10 +991,6 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, | |||
980 | break; | 991 | break; |
981 | } | 992 | } |
982 | 993 | ||
983 | rspiocbq.iocb.un.ulpWord[4] = irsp->un.ulpWord[4]; | ||
984 | rspiocbq.iocb.ulpStatus = irsp->ulpStatus; | ||
985 | rspiocbq.iocb.ulpContext = irsp->ulpContext; | ||
986 | rspiocbq.iocb.ulpIoTag = irsp->ulpIoTag; | ||
987 | cmdiocbq = lpfc_sli_txcmpl_ring_iotag_lookup(phba, | 994 | cmdiocbq = lpfc_sli_txcmpl_ring_iotag_lookup(phba, |
988 | pring, | 995 | pring, |
989 | &rspiocbq); | 996 | &rspiocbq); |