aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_hbadisc.c
diff options
context:
space:
mode:
authorJamie Wellnitz <Jamie.Wellnitz@emulex.com>2006-02-28 19:25:31 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-02-28 20:02:47 -0500
commit2fe165b65089925292122e9772321738627f325c (patch)
tree275ed8dc03c43545576cbbb4d0a2707d2b981ed3 /drivers/scsi/lpfc/lpfc_hbadisc.c
parent082c02667d98d3060f63382e7a695d58d4c8c5e4 (diff)
[SCSI] lpfc 8.1.2: Code style changes for Discovery code
Code style changes for Discovery code Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c103
1 files changed, 48 insertions, 55 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 710efec1221f..b2aec79eed80 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -108,7 +108,7 @@ lpfc_work_list_done(struct lpfc_hba * phba)
108 evt_listp); 108 evt_listp);
109 spin_unlock_irq(phba->host->host_lock); 109 spin_unlock_irq(phba->host->host_lock);
110 free_evt = 1; 110 free_evt = 1;
111 switch(evtp->evt) { 111 switch (evtp->evt) {
112 case LPFC_EVT_NODEV_TMO: 112 case LPFC_EVT_NODEV_TMO:
113 ndlp = (struct lpfc_nodelist *)(evtp->evt_arg1); 113 ndlp = (struct lpfc_nodelist *)(evtp->evt_arg1);
114 lpfc_process_nodev_timeout(phba, ndlp); 114 lpfc_process_nodev_timeout(phba, ndlp);
@@ -173,13 +173,13 @@ lpfc_work_done(struct lpfc_hba * phba)
173 work_hba_events=phba->work_hba_events; 173 work_hba_events=phba->work_hba_events;
174 spin_unlock_irq(phba->host->host_lock); 174 spin_unlock_irq(phba->host->host_lock);
175 175
176 if(ha_copy & HA_ERATT) 176 if (ha_copy & HA_ERATT)
177 lpfc_handle_eratt(phba); 177 lpfc_handle_eratt(phba);
178 178
179 if(ha_copy & HA_MBATT) 179 if (ha_copy & HA_MBATT)
180 lpfc_sli_handle_mb_event(phba); 180 lpfc_sli_handle_mb_event(phba);
181 181
182 if(ha_copy & HA_LATT) 182 if (ha_copy & HA_LATT)
183 lpfc_handle_latt(phba); 183 lpfc_handle_latt(phba);
184 184
185 if (work_hba_events & WORKER_DISC_TMO) 185 if (work_hba_events & WORKER_DISC_TMO)
@@ -357,8 +357,7 @@ lpfc_linkdown(struct lpfc_hba * phba)
357 /* Check config parameter use-adisc or FCP-2 */ 357 /* Check config parameter use-adisc or FCP-2 */
358 if ((rc != NLP_STE_FREED_NODE) && 358 if ((rc != NLP_STE_FREED_NODE) &&
359 (phba->cfg_use_adisc == 0) && 359 (phba->cfg_use_adisc == 0) &&
360 !(ndlp->nlp_fcp_info & 360 !(ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE)) {
361 NLP_FCP_2_DEVICE)) {
362 /* We know we will have to relogin, so 361 /* We know we will have to relogin, so
363 * unreglogin the rpi right now to fail 362 * unreglogin the rpi right now to fail
364 * any outstanding I/Os quickly. 363 * any outstanding I/Os quickly.
@@ -398,7 +397,7 @@ lpfc_linkdown(struct lpfc_hba * phba)
398 lpfc_can_disctmo(phba); 397 lpfc_can_disctmo(phba);
399 398
400 /* Must process IOCBs on all rings to handle ABORTed I/Os */ 399 /* Must process IOCBs on all rings to handle ABORTed I/Os */
401 return (0); 400 return 0;
402} 401}
403 402
404static int 403static int
@@ -497,7 +496,7 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
497 lpfc_els_disc_plogi(phba); 496 lpfc_els_disc_plogi(phba);
498 } 497 }
499 498
500 if(!phba->num_disc_nodes) { 499 if (!phba->num_disc_nodes) {
501 spin_lock_irq(phba->host->host_lock); 500 spin_lock_irq(phba->host->host_lock);
502 phba->fc_flag &= ~FC_NDISC_ACTIVE; 501 phba->fc_flag &= ~FC_NDISC_ACTIVE;
503 spin_unlock_irq(phba->host->host_lock); 502 spin_unlock_irq(phba->host->host_lock);
@@ -685,7 +684,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
685 cfglink_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 684 cfglink_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
686 685
687 spin_lock_irq(phba->host->host_lock); 686 spin_lock_irq(phba->host->host_lock);
688 switch(la->UlnkSpeed) { 687 switch (la->UlnkSpeed) {
689 case LA_1GHZ_LINK: 688 case LA_1GHZ_LINK:
690 phba->fc_linkspeed = LA_1GHZ_LINK; 689 phba->fc_linkspeed = LA_1GHZ_LINK;
691 break; 690 break;
@@ -1115,12 +1114,11 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
1115 1114
1116 psli = &phba->sli; 1115 psli = &phba->sli;
1117 /* Sanity check to ensure we are not moving to / from the same list */ 1116 /* Sanity check to ensure we are not moving to / from the same list */
1118 if ((nlp->nlp_flag & NLP_LIST_MASK) == list) { 1117 if ((nlp->nlp_flag & NLP_LIST_MASK) == list)
1119 if (list != NLP_NO_LIST) 1118 if (list != NLP_NO_LIST)
1120 return(0); 1119 return 0;
1121 }
1122 1120
1123 switch(nlp->nlp_flag & NLP_LIST_MASK) { 1121 switch (nlp->nlp_flag & NLP_LIST_MASK) {
1124 case NLP_NO_LIST: /* Not on any list */ 1122 case NLP_NO_LIST: /* Not on any list */
1125 break; 1123 break;
1126 case NLP_UNUSED_LIST: 1124 case NLP_UNUSED_LIST:
@@ -1190,7 +1188,7 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
1190 phba->brd_no, 1188 phba->brd_no,
1191 nlp->nlp_DID, list, nlp->nlp_flag); 1189 nlp->nlp_DID, list, nlp->nlp_flag);
1192 1190
1193 switch(list) { 1191 switch (list) {
1194 case NLP_NO_LIST: /* No list, just remove it */ 1192 case NLP_NO_LIST: /* No list, just remove it */
1195 lpfc_nlp_remove(phba, nlp); 1193 lpfc_nlp_remove(phba, nlp);
1196 /* as node removed - stop further transport calls */ 1194 /* as node removed - stop further transport calls */
@@ -1287,10 +1285,10 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
1287 list_add_tail(&nlp->nlp_listp, &phba->fc_npr_list); 1285 list_add_tail(&nlp->nlp_listp, &phba->fc_npr_list);
1288 phba->fc_npr_cnt++; 1286 phba->fc_npr_cnt++;
1289 1287
1290 if (!(nlp->nlp_flag & NLP_NODEV_TMO)) { 1288 if (!(nlp->nlp_flag & NLP_NODEV_TMO))
1291 mod_timer(&nlp->nlp_tmofunc, 1289 mod_timer(&nlp->nlp_tmofunc,
1292 jiffies + HZ * phba->cfg_nodev_tmo); 1290 jiffies + HZ * phba->cfg_nodev_tmo);
1293 } 1291
1294 spin_lock_irq(phba->host->host_lock); 1292 spin_lock_irq(phba->host->host_lock);
1295 nlp->nlp_flag |= NLP_NODEV_TMO; 1293 nlp->nlp_flag |= NLP_NODEV_TMO;
1296 nlp->nlp_flag &= ~NLP_RCV_PLOGI; 1294 nlp->nlp_flag &= ~NLP_RCV_PLOGI;
@@ -1342,7 +1340,7 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
1342 } 1340 }
1343 } 1341 }
1344 } 1342 }
1345 return (0); 1343 return 0;
1346} 1344}
1347 1345
1348/* 1346/*
@@ -1401,7 +1399,7 @@ lpfc_can_disctmo(struct lpfc_hba * phba)
1401 phba->brd_no, phba->hba_state, phba->fc_flag, 1399 phba->brd_no, phba->hba_state, phba->fc_flag,
1402 phba->fc_plogi_cnt, phba->fc_adisc_cnt); 1400 phba->fc_plogi_cnt, phba->fc_adisc_cnt);
1403 1401
1404 return (0); 1402 return 0;
1405} 1403}
1406 1404
1407/* 1405/*
@@ -1422,11 +1420,11 @@ lpfc_check_sli_ndlp(struct lpfc_hba * phba,
1422 switch (icmd->ulpCommand) { 1420 switch (icmd->ulpCommand) {
1423 case CMD_GEN_REQUEST64_CR: 1421 case CMD_GEN_REQUEST64_CR:
1424 if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi) 1422 if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi)
1425 return (1); 1423 return 1;
1426 case CMD_ELS_REQUEST64_CR: 1424 case CMD_ELS_REQUEST64_CR:
1427 case CMD_XMIT_ELS_RSP64_CX: 1425 case CMD_XMIT_ELS_RSP64_CX:
1428 if (iocb->context1 == (uint8_t *) ndlp) 1426 if (iocb->context1 == (uint8_t *) ndlp)
1429 return (1); 1427 return 1;
1430 } 1428 }
1431 } else if (pring->ringno == psli->ip_ring) { 1429 } else if (pring->ringno == psli->ip_ring) {
1432 1430
@@ -1434,15 +1432,15 @@ lpfc_check_sli_ndlp(struct lpfc_hba * phba,
1434 /* Skip match check if waiting to relogin to FCP target */ 1432 /* Skip match check if waiting to relogin to FCP target */
1435 if ((ndlp->nlp_type & NLP_FCP_TARGET) && 1433 if ((ndlp->nlp_type & NLP_FCP_TARGET) &&
1436 (ndlp->nlp_flag & NLP_DELAY_TMO)) { 1434 (ndlp->nlp_flag & NLP_DELAY_TMO)) {
1437 return (0); 1435 return 0;
1438 } 1436 }
1439 if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi) { 1437 if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi) {
1440 return (1); 1438 return 1;
1441 } 1439 }
1442 } else if (pring->ringno == psli->next_ring) { 1440 } else if (pring->ringno == psli->next_ring) {
1443 1441
1444 } 1442 }
1445 return (0); 1443 return 0;
1446} 1444}
1447 1445
1448/* 1446/*
@@ -1503,7 +1501,7 @@ lpfc_no_rpi(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
1503 1501
1504 } 1502 }
1505 } 1503 }
1506 return (0); 1504 return 0;
1507} 1505}
1508 1506
1509/* 1507/*
@@ -1604,7 +1602,7 @@ lpfc_freenode(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
1604 1602
1605 lpfc_unreg_rpi(phba, ndlp); 1603 lpfc_unreg_rpi(phba, ndlp);
1606 1604
1607 return (0); 1605 return 0;
1608} 1606}
1609 1607
1610/* 1608/*
@@ -1640,12 +1638,11 @@ lpfc_nlp_remove(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
1640 spin_lock_irq(phba->host->host_lock); 1638 spin_lock_irq(phba->host->host_lock);
1641 ndlp->nlp_flag |= NLP_DELAY_REMOVE; 1639 ndlp->nlp_flag |= NLP_DELAY_REMOVE;
1642 spin_unlock_irq(phba->host->host_lock); 1640 spin_unlock_irq(phba->host->host_lock);
1643 } 1641 } else {
1644 else {
1645 lpfc_freenode(phba, ndlp); 1642 lpfc_freenode(phba, ndlp);
1646 mempool_free( ndlp, phba->nlp_mem_pool); 1643 mempool_free( ndlp, phba->nlp_mem_pool);
1647 } 1644 }
1648 return(0); 1645 return 0;
1649} 1646}
1650 1647
1651static int 1648static int
@@ -1656,20 +1653,20 @@ lpfc_matchdid(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, uint32_t did)
1656 D_ID matchdid; 1653 D_ID matchdid;
1657 1654
1658 if (did == Bcast_DID) 1655 if (did == Bcast_DID)
1659 return (0); 1656 return 0;
1660 1657
1661 if (ndlp->nlp_DID == 0) { 1658 if (ndlp->nlp_DID == 0) {
1662 return (0); 1659 return 0;
1663 } 1660 }
1664 1661
1665 /* First check for Direct match */ 1662 /* First check for Direct match */
1666 if (ndlp->nlp_DID == did) 1663 if (ndlp->nlp_DID == did)
1667 return (1); 1664 return 1;
1668 1665
1669 /* Next check for area/domain identically equals 0 match */ 1666 /* Next check for area/domain identically equals 0 match */
1670 mydid.un.word = phba->fc_myDID; 1667 mydid.un.word = phba->fc_myDID;
1671 if ((mydid.un.b.domain == 0) && (mydid.un.b.area == 0)) { 1668 if ((mydid.un.b.domain == 0) && (mydid.un.b.area == 0)) {
1672 return (0); 1669 return 0;
1673 } 1670 }
1674 1671
1675 matchdid.un.word = did; 1672 matchdid.un.word = did;
@@ -1680,9 +1677,9 @@ lpfc_matchdid(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, uint32_t did)
1680 if ((ndlpdid.un.b.domain == 0) && 1677 if ((ndlpdid.un.b.domain == 0) &&
1681 (ndlpdid.un.b.area == 0)) { 1678 (ndlpdid.un.b.area == 0)) {
1682 if (ndlpdid.un.b.id) 1679 if (ndlpdid.un.b.id)
1683 return (1); 1680 return 1;
1684 } 1681 }
1685 return (0); 1682 return 0;
1686 } 1683 }
1687 1684
1688 matchdid.un.word = ndlp->nlp_DID; 1685 matchdid.un.word = ndlp->nlp_DID;
@@ -1691,11 +1688,11 @@ lpfc_matchdid(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, uint32_t did)
1691 if ((matchdid.un.b.domain == 0) && 1688 if ((matchdid.un.b.domain == 0) &&
1692 (matchdid.un.b.area == 0)) { 1689 (matchdid.un.b.area == 0)) {
1693 if (matchdid.un.b.id) 1690 if (matchdid.un.b.id)
1694 return (1); 1691 return 1;
1695 } 1692 }
1696 } 1693 }
1697 } 1694 }
1698 return (0); 1695 return 0;
1699} 1696}
1700 1697
1701/* Search for a nodelist entry on a specific list */ 1698/* Search for a nodelist entry on a specific list */
@@ -1720,7 +1717,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
1720 phba->brd_no, 1717 phba->brd_no,
1721 ndlp, ndlp->nlp_DID, 1718 ndlp, ndlp->nlp_DID,
1722 ndlp->nlp_flag, data1); 1719 ndlp->nlp_flag, data1);
1723 return (ndlp); 1720 return ndlp;
1724 } 1721 }
1725 } 1722 }
1726 } 1723 }
@@ -1741,7 +1738,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
1741 phba->brd_no, 1738 phba->brd_no,
1742 ndlp, ndlp->nlp_DID, 1739 ndlp, ndlp->nlp_DID,
1743 ndlp->nlp_flag, data1); 1740 ndlp->nlp_flag, data1);
1744 return (ndlp); 1741 return ndlp;
1745 } 1742 }
1746 } 1743 }
1747 } 1744 }
@@ -1763,7 +1760,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
1763 phba->brd_no, 1760 phba->brd_no,
1764 ndlp, ndlp->nlp_DID, 1761 ndlp, ndlp->nlp_DID,
1765 ndlp->nlp_flag, data1); 1762 ndlp->nlp_flag, data1);
1766 return (ndlp); 1763 return ndlp;
1767 } 1764 }
1768 } 1765 }
1769 } 1766 }
@@ -1785,7 +1782,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
1785 phba->brd_no, 1782 phba->brd_no,
1786 ndlp, ndlp->nlp_DID, 1783 ndlp, ndlp->nlp_DID,
1787 ndlp->nlp_flag, data1); 1784 ndlp->nlp_flag, data1);
1788 return (ndlp); 1785 return ndlp;
1789 } 1786 }
1790 } 1787 }
1791 } 1788 }
@@ -1807,7 +1804,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
1807 phba->brd_no, 1804 phba->brd_no,
1808 ndlp, ndlp->nlp_DID, 1805 ndlp, ndlp->nlp_DID,
1809 ndlp->nlp_flag, data1); 1806 ndlp->nlp_flag, data1);
1810 return (ndlp); 1807 return ndlp;
1811 } 1808 }
1812 } 1809 }
1813 } 1810 }
@@ -1829,7 +1826,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
1829 phba->brd_no, 1826 phba->brd_no,
1830 ndlp, ndlp->nlp_DID, 1827 ndlp, ndlp->nlp_DID,
1831 ndlp->nlp_flag, data1); 1828 ndlp->nlp_flag, data1);
1832 return (ndlp); 1829 return ndlp;
1833 } 1830 }
1834 } 1831 }
1835 } 1832 }
@@ -1851,7 +1848,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
1851 phba->brd_no, 1848 phba->brd_no,
1852 ndlp, ndlp->nlp_DID, 1849 ndlp, ndlp->nlp_DID,
1853 ndlp->nlp_flag, data1); 1850 ndlp->nlp_flag, data1);
1854 return (ndlp); 1851 return ndlp;
1855 } 1852 }
1856 } 1853 }
1857 } 1854 }
@@ -1873,7 +1870,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
1873 phba->brd_no, 1870 phba->brd_no,
1874 ndlp, ndlp->nlp_DID, 1871 ndlp, ndlp->nlp_DID,
1875 ndlp->nlp_flag, data1); 1872 ndlp->nlp_flag, data1);
1876 return (ndlp); 1873 return ndlp;
1877 } 1874 }
1878 } 1875 }
1879 } 1876 }
@@ -1923,17 +1920,15 @@ lpfc_setup_disc_node(struct lpfc_hba * phba, uint32_t did)
1923 del_timer_sync(&ndlp->nlp_delayfunc); 1920 del_timer_sync(&ndlp->nlp_delayfunc);
1924 spin_lock_irq(phba->host->host_lock); 1921 spin_lock_irq(phba->host->host_lock);
1925 if (!list_empty(&ndlp->els_retry_evt. 1922 if (!list_empty(&ndlp->els_retry_evt.
1926 evt_listp)) 1923 evt_listp))
1927 list_del_init(&ndlp->els_retry_evt. 1924 list_del_init(&ndlp->els_retry_evt.
1928 evt_listp); 1925 evt_listp);
1929 } 1926 }
1930 } 1927 } else {
1931 else {
1932 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 1928 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC;
1933 ndlp = NULL; 1929 ndlp = NULL;
1934 } 1930 }
1935 } 1931 } else {
1936 else {
1937 flg = ndlp->nlp_flag & NLP_LIST_MASK; 1932 flg = ndlp->nlp_flag & NLP_LIST_MASK;
1938 if ((flg == NLP_ADISC_LIST) || (flg == NLP_PLOGI_LIST)) 1933 if ((flg == NLP_ADISC_LIST) || (flg == NLP_PLOGI_LIST))
1939 return NULL; 1934 return NULL;
@@ -2084,8 +2079,7 @@ lpfc_disc_start(struct lpfc_hba * phba)
2084 spin_lock_irq(phba->host->host_lock); 2079 spin_lock_irq(phba->host->host_lock);
2085 phba->fc_flag &= ~FC_RSCN_MODE; 2080 phba->fc_flag &= ~FC_RSCN_MODE;
2086 spin_unlock_irq(phba->host->host_lock); 2081 spin_unlock_irq(phba->host->host_lock);
2087 } 2082 } else
2088 else
2089 lpfc_els_handle_rscn(phba); 2083 lpfc_els_handle_rscn(phba);
2090 } 2084 }
2091 } 2085 }
@@ -2268,8 +2262,7 @@ lpfc_disc_timeout_handler(struct lpfc_hba *phba)
2268 if (ndlp->nlp_type & NLP_FABRIC) { 2262 if (ndlp->nlp_type & NLP_FABRIC) {
2269 /* Clean up the ndlp on Fabric connections */ 2263 /* Clean up the ndlp on Fabric connections */
2270 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); 2264 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
2271 } 2265 } else if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) {
2272 else if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) {
2273 /* Fail outstanding IO now since device 2266 /* Fail outstanding IO now since device
2274 * is marked for PLOGI. 2267 * is marked for PLOGI.
2275 */ 2268 */
@@ -2544,7 +2537,7 @@ lpfc_findnode_rpi(struct lpfc_hba * phba, uint16_t rpi)
2544 for (i = 0; i < ARRAY_SIZE(lists); i++ ) 2537 for (i = 0; i < ARRAY_SIZE(lists); i++ )
2545 list_for_each_entry(ndlp, lists[i], nlp_listp) 2538 list_for_each_entry(ndlp, lists[i], nlp_listp)
2546 if (ndlp->nlp_rpi == rpi) 2539 if (ndlp->nlp_rpi == rpi)
2547 return (ndlp); 2540 return ndlp;
2548 2541
2549 return NULL; 2542 return NULL;
2550} 2543}