diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 8d14b28c80b9..9493ec1b17e1 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -225,8 +225,7 @@ lpfc_sli_ringtx_get(struct lpfc_hba * phba, struct lpfc_sli_ring * pring) | |||
225 | static IOCB_t * | 225 | static IOCB_t * |
226 | lpfc_sli_next_iocb_slot (struct lpfc_hba *phba, struct lpfc_sli_ring *pring) | 226 | lpfc_sli_next_iocb_slot (struct lpfc_hba *phba, struct lpfc_sli_ring *pring) |
227 | { | 227 | { |
228 | MAILBOX_t *mbox = (MAILBOX_t *)phba->sli.MBhostaddr; | 228 | struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[pring->ringno]; |
229 | PGP *pgp = (PGP *)&mbox->us.s2.port[pring->ringno]; | ||
230 | uint32_t max_cmd_idx = pring->numCiocb; | 229 | uint32_t max_cmd_idx = pring->numCiocb; |
231 | IOCB_t *iocb = NULL; | 230 | IOCB_t *iocb = NULL; |
232 | 231 | ||
@@ -411,9 +410,7 @@ lpfc_sli_resume_iocb(struct lpfc_hba * phba, struct lpfc_sli_ring * pring) | |||
411 | static void | 410 | static void |
412 | lpfc_sli_turn_on_ring(struct lpfc_hba * phba, int ringno) | 411 | lpfc_sli_turn_on_ring(struct lpfc_hba * phba, int ringno) |
413 | { | 412 | { |
414 | PGP *pgp = | 413 | struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[ringno]; |
415 | ((PGP *) & | ||
416 | (((MAILBOX_t *)phba->sli.MBhostaddr)->us.s2.port[ringno])); | ||
417 | 414 | ||
418 | /* If the ring is active, flag it */ | 415 | /* If the ring is active, flag it */ |
419 | if (phba->sli.ring[ringno].cmdringaddr) { | 416 | if (phba->sli.ring[ringno].cmdringaddr) { |
@@ -537,7 +534,7 @@ lpfc_sli_handle_mb_event(struct lpfc_hba * phba) | |||
537 | /* Get a Mailbox buffer to setup mailbox commands for callback */ | 534 | /* Get a Mailbox buffer to setup mailbox commands for callback */ |
538 | if ((pmb = phba->sli.mbox_active)) { | 535 | if ((pmb = phba->sli.mbox_active)) { |
539 | pmbox = &pmb->mb; | 536 | pmbox = &pmb->mb; |
540 | mbox = (MAILBOX_t *) phba->sli.MBhostaddr; | 537 | mbox = &phba->slim2p->mbx; |
541 | 538 | ||
542 | /* First check out the status word */ | 539 | /* First check out the status word */ |
543 | lpfc_sli_pcimem_bcopy(mbox, pmbox, sizeof (uint32_t)); | 540 | lpfc_sli_pcimem_bcopy(mbox, pmbox, sizeof (uint32_t)); |
@@ -905,10 +902,10 @@ static int | |||
905 | lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, | 902 | lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, |
906 | struct lpfc_sli_ring * pring, uint32_t mask) | 903 | struct lpfc_sli_ring * pring, uint32_t mask) |
907 | { | 904 | { |
905 | struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[pring->ringno]; | ||
908 | IOCB_t *irsp = NULL; | 906 | IOCB_t *irsp = NULL; |
909 | struct lpfc_iocbq *cmdiocbq = NULL; | 907 | struct lpfc_iocbq *cmdiocbq = NULL; |
910 | struct lpfc_iocbq rspiocbq; | 908 | struct lpfc_iocbq rspiocbq; |
911 | PGP *pgp; | ||
912 | uint32_t status; | 909 | uint32_t status; |
913 | uint32_t portRspPut, portRspMax; | 910 | uint32_t portRspPut, portRspMax; |
914 | int rc = 1; | 911 | int rc = 1; |
@@ -920,10 +917,6 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, | |||
920 | spin_lock_irqsave(phba->host->host_lock, iflag); | 917 | spin_lock_irqsave(phba->host->host_lock, iflag); |
921 | pring->stats.iocb_event++; | 918 | pring->stats.iocb_event++; |
922 | 919 | ||
923 | /* The driver assumes SLI-2 mode */ | ||
924 | pgp = (PGP *) &((MAILBOX_t *) phba->sli.MBhostaddr) | ||
925 | ->us.s2.port[pring->ringno]; | ||
926 | |||
927 | /* | 920 | /* |
928 | * The next available response entry should never exceed the maximum | 921 | * The next available response entry should never exceed the maximum |
929 | * entries. If it does, treat it as an adapter hardware error. | 922 | * entries. If it does, treat it as an adapter hardware error. |
@@ -1075,9 +1068,7 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba * phba, | |||
1075 | struct lpfc_iocbq *cmdiocbp; | 1068 | struct lpfc_iocbq *cmdiocbp; |
1076 | struct lpfc_iocbq *saveq; | 1069 | struct lpfc_iocbq *saveq; |
1077 | struct list_head *lpfc_iocb_list = &phba->lpfc_iocb_list; | 1070 | struct list_head *lpfc_iocb_list = &phba->lpfc_iocb_list; |
1078 | HGP *hgp; | 1071 | struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[pring->ringno]; |
1079 | PGP *pgp; | ||
1080 | MAILBOX_t *mbox; | ||
1081 | uint8_t iocb_cmd_type; | 1072 | uint8_t iocb_cmd_type; |
1082 | lpfc_iocb_type type; | 1073 | lpfc_iocb_type type; |
1083 | uint32_t status, free_saveq; | 1074 | uint32_t status, free_saveq; |
@@ -1089,11 +1080,6 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba * phba, | |||
1089 | spin_lock_irqsave(phba->host->host_lock, iflag); | 1080 | spin_lock_irqsave(phba->host->host_lock, iflag); |
1090 | pring->stats.iocb_event++; | 1081 | pring->stats.iocb_event++; |
1091 | 1082 | ||
1092 | /* The driver assumes SLI-2 mode */ | ||
1093 | mbox = (MAILBOX_t *) phba->sli.MBhostaddr; | ||
1094 | pgp = (PGP *) & mbox->us.s2.port[pring->ringno]; | ||
1095 | hgp = (HGP *) & mbox->us.s2.host[pring->ringno]; | ||
1096 | |||
1097 | /* | 1083 | /* |
1098 | * The next available response entry should never exceed the maximum | 1084 | * The next available response entry should never exceed the maximum |
1099 | * entries. If it does, treat it as an adapter hardware error. | 1085 | * entries. If it does, treat it as an adapter hardware error. |
@@ -1771,7 +1757,6 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) | |||
1771 | int | 1757 | int |
1772 | lpfc_sli_issue_mbox(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmbox, uint32_t flag) | 1758 | lpfc_sli_issue_mbox(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmbox, uint32_t flag) |
1773 | { | 1759 | { |
1774 | MAILBOX_t *mbox; | ||
1775 | MAILBOX_t *mb; | 1760 | MAILBOX_t *mb; |
1776 | struct lpfc_sli *psli; | 1761 | struct lpfc_sli *psli; |
1777 | uint32_t status, evtctr; | 1762 | uint32_t status, evtctr; |
@@ -1901,15 +1886,13 @@ lpfc_sli_issue_mbox(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmbox, uint32_t flag) | |||
1901 | mb->mbxOwner = OWN_CHIP; | 1886 | mb->mbxOwner = OWN_CHIP; |
1902 | 1887 | ||
1903 | if (psli->sli_flag & LPFC_SLI2_ACTIVE) { | 1888 | if (psli->sli_flag & LPFC_SLI2_ACTIVE) { |
1904 | |||
1905 | /* First copy command data to host SLIM area */ | 1889 | /* First copy command data to host SLIM area */ |
1906 | mbox = (MAILBOX_t *) psli->MBhostaddr; | 1890 | lpfc_sli_pcimem_bcopy(mb, &phba->slim2p->mbx, MAILBOX_CMD_SIZE); |
1907 | lpfc_sli_pcimem_bcopy(mb, mbox, MAILBOX_CMD_SIZE); | ||
1908 | } else { | 1891 | } else { |
1909 | if (mb->mbxCommand == MBX_CONFIG_PORT) { | 1892 | if (mb->mbxCommand == MBX_CONFIG_PORT) { |
1910 | /* copy command data into host mbox for cmpl */ | 1893 | /* copy command data into host mbox for cmpl */ |
1911 | mbox = (MAILBOX_t *) psli->MBhostaddr; | 1894 | lpfc_sli_pcimem_bcopy(mb, &phba->slim2p->mbx, |
1912 | lpfc_sli_pcimem_bcopy(mb, mbox, MAILBOX_CMD_SIZE); | 1895 | MAILBOX_CMD_SIZE); |
1913 | } | 1896 | } |
1914 | 1897 | ||
1915 | /* First copy mbox command data to HBA SLIM, skip past first | 1898 | /* First copy mbox command data to HBA SLIM, skip past first |
@@ -1946,8 +1929,7 @@ lpfc_sli_issue_mbox(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmbox, uint32_t flag) | |||
1946 | psli->mbox_active = NULL; | 1929 | psli->mbox_active = NULL; |
1947 | if (psli->sli_flag & LPFC_SLI2_ACTIVE) { | 1930 | if (psli->sli_flag & LPFC_SLI2_ACTIVE) { |
1948 | /* First read mbox status word */ | 1931 | /* First read mbox status word */ |
1949 | mbox = (MAILBOX_t *) psli->MBhostaddr; | 1932 | word0 = *((volatile uint32_t *)&phba->slim2p->mbx); |
1950 | word0 = *((volatile uint32_t *)mbox); | ||
1951 | word0 = le32_to_cpu(word0); | 1933 | word0 = le32_to_cpu(word0); |
1952 | } else { | 1934 | } else { |
1953 | /* First read mbox status word */ | 1935 | /* First read mbox status word */ |
@@ -1984,8 +1966,8 @@ lpfc_sli_issue_mbox(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmbox, uint32_t flag) | |||
1984 | 1966 | ||
1985 | if (psli->sli_flag & LPFC_SLI2_ACTIVE) { | 1967 | if (psli->sli_flag & LPFC_SLI2_ACTIVE) { |
1986 | /* First copy command data */ | 1968 | /* First copy command data */ |
1987 | mbox = (MAILBOX_t *) psli->MBhostaddr; | 1969 | word0 = *((volatile uint32_t *) |
1988 | word0 = *((volatile uint32_t *)mbox); | 1970 | &phba->slim2p->mbx); |
1989 | word0 = le32_to_cpu(word0); | 1971 | word0 = le32_to_cpu(word0); |
1990 | if (mb->mbxCommand == MBX_CONFIG_PORT) { | 1972 | if (mb->mbxCommand == MBX_CONFIG_PORT) { |
1991 | MAILBOX_t *slimmb; | 1973 | MAILBOX_t *slimmb; |
@@ -2009,10 +1991,9 @@ lpfc_sli_issue_mbox(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmbox, uint32_t flag) | |||
2009 | } | 1991 | } |
2010 | 1992 | ||
2011 | if (psli->sli_flag & LPFC_SLI2_ACTIVE) { | 1993 | if (psli->sli_flag & LPFC_SLI2_ACTIVE) { |
2012 | /* First copy command data */ | ||
2013 | mbox = (MAILBOX_t *) psli->MBhostaddr; | ||
2014 | /* copy results back to user */ | 1994 | /* copy results back to user */ |
2015 | lpfc_sli_pcimem_bcopy(mbox, mb, MAILBOX_CMD_SIZE); | 1995 | lpfc_sli_pcimem_bcopy(&phba->slim2p->mbx, mb, |
1996 | MAILBOX_CMD_SIZE); | ||
2016 | } else { | 1997 | } else { |
2017 | /* First copy command data */ | 1998 | /* First copy command data */ |
2018 | lpfc_memcpy_from_slim(mb, phba->MBslimaddr, | 1999 | lpfc_memcpy_from_slim(mb, phba->MBslimaddr, |