aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2009-05-22 14:53:12 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-06-08 12:26:01 -0400
commitf4b4c68f74dcd5da03df851090cad28ad4e8d7cc (patch)
treec9ae4867a01cbdb11c008c23830ddd7c7220bee8
parentd8e93df13c8f7bde45a7756944aab528c58df4cf (diff)
[SCSI] lpfc 8.3.2 : Miscellaneous Changes
Miscellaneous Changes: - Convert from SLI2_ACTIVE flag to more correct SLI_ACTIVE (generic) flag - Reposition log verbose messaging definitions - Update naming for vpi object name from vport slang name - Handle deferred error attention condition - Add 10G link support - Small bug fixup Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c55
-rw-r--r--drivers/scsi/lpfc/lpfc_ct.c7
-rw-r--r--drivers/scsi/lpfc/lpfc_disc.h1
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c3
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c20
-rw-r--r--drivers/scsi/lpfc/lpfc_logmsg.h52
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c8
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.h2
-rw-r--r--drivers/scsi/lpfc/lpfc_vport.c2
9 files changed, 91 insertions, 59 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index f032d8b7bb4b..46e032aa0bea 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -805,7 +805,7 @@ lpfc_get_hba_info(struct lpfc_hba *phba,
805 */ 805 */
806 if (phba->link_state < LPFC_LINK_DOWN || 806 if (phba->link_state < LPFC_LINK_DOWN ||
807 !phba->mbox_mem_pool || 807 !phba->mbox_mem_pool ||
808 (phba->sli.sli_flag & LPFC_SLI2_ACTIVE) == 0) 808 (phba->sli.sli_flag & LPFC_SLI_ACTIVE) == 0)
809 return 0; 809 return 0;
810 810
811 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) 811 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO)
@@ -822,7 +822,7 @@ lpfc_get_hba_info(struct lpfc_hba *phba,
822 pmboxq->context1 = NULL; 822 pmboxq->context1 = NULL;
823 823
824 if ((phba->pport->fc_flag & FC_OFFLINE_MODE) || 824 if ((phba->pport->fc_flag & FC_OFFLINE_MODE) ||
825 (!(psli->sli_flag & LPFC_SLI2_ACTIVE))) 825 (!(psli->sli_flag & LPFC_SLI_ACTIVE)))
826 rc = MBX_NOT_FINISHED; 826 rc = MBX_NOT_FINISHED;
827 else 827 else
828 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); 828 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2);
@@ -2045,22 +2045,9 @@ static DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR,
2045# lpfc_log_verbose: Only turn this flag on if you are willing to risk being 2045# lpfc_log_verbose: Only turn this flag on if you are willing to risk being
2046# deluged with LOTS of information. 2046# deluged with LOTS of information.
2047# You can set a bit mask to record specific types of verbose messages: 2047# You can set a bit mask to record specific types of verbose messages:
2048# 2048# See lpfc_logmsh.h for definitions.
2049# LOG_ELS 0x1 ELS events
2050# LOG_DISCOVERY 0x2 Link discovery events
2051# LOG_MBOX 0x4 Mailbox events
2052# LOG_INIT 0x8 Initialization events
2053# LOG_LINK_EVENT 0x10 Link events
2054# LOG_FCP 0x40 FCP traffic history
2055# LOG_NODE 0x80 Node table events
2056# LOG_BG 0x200 BlockBuard events
2057# LOG_MISC 0x400 Miscellaneous events
2058# LOG_SLI 0x800 SLI events
2059# LOG_FCP_ERROR 0x1000 Only log FCP errors
2060# LOG_LIBDFC 0x2000 LIBDFC events
2061# LOG_ALL_MSG 0xffff LOG all messages
2062*/ 2049*/
2063LPFC_VPORT_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0xffff, 2050LPFC_VPORT_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0xffffffff,
2064 "Verbose logging bit-mask"); 2051 "Verbose logging bit-mask");
2065 2052
2066/* 2053/*
@@ -2365,7 +2352,7 @@ lpfc_stat_data_ctrl_store(struct device *dev, struct device_attribute *attr,
2365 if (vports == NULL) 2352 if (vports == NULL)
2366 return -ENOMEM; 2353 return -ENOMEM;
2367 2354
2368 for (i = 0; i <= phba->max_vpi && vports[i] != NULL; i++) { 2355 for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
2369 v_shost = lpfc_shost_from_vport(vports[i]); 2356 v_shost = lpfc_shost_from_vport(vports[i]);
2370 spin_lock_irq(v_shost->host_lock); 2357 spin_lock_irq(v_shost->host_lock);
2371 /* Block and reset data collection */ 2358 /* Block and reset data collection */
@@ -2380,7 +2367,7 @@ lpfc_stat_data_ctrl_store(struct device *dev, struct device_attribute *attr,
2380 phba->bucket_base = base; 2367 phba->bucket_base = base;
2381 phba->bucket_step = step; 2368 phba->bucket_step = step;
2382 2369
2383 for (i = 0; i <= phba->max_vpi && vports[i] != NULL; i++) { 2370 for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
2384 v_shost = lpfc_shost_from_vport(vports[i]); 2371 v_shost = lpfc_shost_from_vport(vports[i]);
2385 2372
2386 /* Unblock data collection */ 2373 /* Unblock data collection */
@@ -2397,7 +2384,7 @@ lpfc_stat_data_ctrl_store(struct device *dev, struct device_attribute *attr,
2397 if (vports == NULL) 2384 if (vports == NULL)
2398 return -ENOMEM; 2385 return -ENOMEM;
2399 2386
2400 for (i = 0; i <= phba->max_vpi && vports[i] != NULL; i++) { 2387 for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
2401 v_shost = lpfc_shost_from_vport(vports[i]); 2388 v_shost = lpfc_shost_from_vport(vports[i]);
2402 spin_lock_irq(shost->host_lock); 2389 spin_lock_irq(shost->host_lock);
2403 vports[i]->stat_data_blocked = 1; 2390 vports[i]->stat_data_blocked = 1;
@@ -3418,7 +3405,7 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
3418 } 3405 }
3419 3406
3420 if ((vport->fc_flag & FC_OFFLINE_MODE) || 3407 if ((vport->fc_flag & FC_OFFLINE_MODE) ||
3421 (!(phba->sli.sli_flag & LPFC_SLI2_ACTIVE))){ 3408 (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE))) {
3422 3409
3423 spin_unlock_irq(&phba->hbalock); 3410 spin_unlock_irq(&phba->hbalock);
3424 rc = lpfc_sli_issue_mbox (phba, 3411 rc = lpfc_sli_issue_mbox (phba,
@@ -3646,6 +3633,9 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
3646 case LA_8GHZ_LINK: 3633 case LA_8GHZ_LINK:
3647 fc_host_speed(shost) = FC_PORTSPEED_8GBIT; 3634 fc_host_speed(shost) = FC_PORTSPEED_8GBIT;
3648 break; 3635 break;
3636 case LA_10GHZ_LINK:
3637 fc_host_speed(shost) = FC_PORTSPEED_10GBIT;
3638 break;
3649 default: 3639 default:
3650 fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; 3640 fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
3651 break; 3641 break;
@@ -3713,7 +3703,7 @@ lpfc_get_stats(struct Scsi_Host *shost)
3713 */ 3703 */
3714 if (phba->link_state < LPFC_LINK_DOWN || 3704 if (phba->link_state < LPFC_LINK_DOWN ||
3715 !phba->mbox_mem_pool || 3705 !phba->mbox_mem_pool ||
3716 (phba->sli.sli_flag & LPFC_SLI2_ACTIVE) == 0) 3706 (phba->sli.sli_flag & LPFC_SLI_ACTIVE) == 0)
3717 return NULL; 3707 return NULL;
3718 3708
3719 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) 3709 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO)
@@ -3756,7 +3746,7 @@ lpfc_get_stats(struct Scsi_Host *shost)
3756 pmboxq->vport = vport; 3746 pmboxq->vport = vport;
3757 3747
3758 if ((vport->fc_flag & FC_OFFLINE_MODE) || 3748 if ((vport->fc_flag & FC_OFFLINE_MODE) ||
3759 (!(psli->sli_flag & LPFC_SLI2_ACTIVE))) 3749 (!(psli->sli_flag & LPFC_SLI_ACTIVE)))
3760 rc = lpfc_sli_issue_mbox(phba, pmboxq, MBX_POLL); 3750 rc = lpfc_sli_issue_mbox(phba, pmboxq, MBX_POLL);
3761 else 3751 else
3762 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); 3752 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2);
@@ -3838,7 +3828,7 @@ lpfc_reset_stats(struct Scsi_Host *shost)
3838 pmboxq->vport = vport; 3828 pmboxq->vport = vport;
3839 3829
3840 if ((vport->fc_flag & FC_OFFLINE_MODE) || 3830 if ((vport->fc_flag & FC_OFFLINE_MODE) ||
3841 (!(psli->sli_flag & LPFC_SLI2_ACTIVE))) 3831 (!(psli->sli_flag & LPFC_SLI_ACTIVE)))
3842 rc = lpfc_sli_issue_mbox(phba, pmboxq, MBX_POLL); 3832 rc = lpfc_sli_issue_mbox(phba, pmboxq, MBX_POLL);
3843 else 3833 else
3844 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); 3834 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2);
@@ -3856,7 +3846,7 @@ lpfc_reset_stats(struct Scsi_Host *shost)
3856 pmboxq->vport = vport; 3846 pmboxq->vport = vport;
3857 3847
3858 if ((vport->fc_flag & FC_OFFLINE_MODE) || 3848 if ((vport->fc_flag & FC_OFFLINE_MODE) ||
3859 (!(psli->sli_flag & LPFC_SLI2_ACTIVE))) 3849 (!(psli->sli_flag & LPFC_SLI_ACTIVE)))
3860 rc = lpfc_sli_issue_mbox(phba, pmboxq, MBX_POLL); 3850 rc = lpfc_sli_issue_mbox(phba, pmboxq, MBX_POLL);
3861 else 3851 else
3862 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); 3852 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2);
@@ -4023,6 +4013,21 @@ lpfc_set_vport_symbolic_name(struct fc_vport *fc_vport)
4023 lpfc_ns_cmd(vport, SLI_CTNS_RSPN_ID, 0, 0); 4013 lpfc_ns_cmd(vport, SLI_CTNS_RSPN_ID, 0, 0);
4024} 4014}
4025 4015
4016/**
4017 * lpfc_hba_log_verbose_init - Set hba's log verbose level
4018 * @phba: Pointer to lpfc_hba struct.
4019 *
4020 * This function is called by the lpfc_get_cfgparam() routine to set the
4021 * module lpfc_log_verbose into the @phba cfg_log_verbose for use with
4022 * log messsage according to the module's lpfc_log_verbose parameter setting
4023 * before hba port or vport created.
4024 **/
4025static void
4026lpfc_hba_log_verbose_init(struct lpfc_hba *phba, uint32_t verbose)
4027{
4028 phba->cfg_log_verbose = verbose;
4029}
4030
4026struct fc_function_template lpfc_transport_functions = { 4031struct fc_function_template lpfc_transport_functions = {
4027 /* fixed attributes the driver supports */ 4032 /* fixed attributes the driver supports */
4028 .show_host_node_name = 1, 4033 .show_host_node_name = 1,
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 38c18518a5e2..1dbccfd3d022 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -1578,6 +1578,9 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
1578 case LA_8GHZ_LINK: 1578 case LA_8GHZ_LINK:
1579 ae->un.PortSpeed = HBA_PORTSPEED_8GBIT; 1579 ae->un.PortSpeed = HBA_PORTSPEED_8GBIT;
1580 break; 1580 break;
1581 case LA_10GHZ_LINK:
1582 ae->un.PortSpeed = HBA_PORTSPEED_10GBIT;
1583 break;
1581 default: 1584 default:
1582 ae->un.PortSpeed = 1585 ae->un.PortSpeed =
1583 HBA_PORTSPEED_UNKNOWN; 1586 HBA_PORTSPEED_UNKNOWN;
@@ -1730,7 +1733,7 @@ lpfc_decode_firmware_rev(struct lpfc_hba *phba, char *fwrevision, int flag)
1730 uint8_t *fwname; 1733 uint8_t *fwname;
1731 1734
1732 if (vp->rev.rBit) { 1735 if (vp->rev.rBit) {
1733 if (psli->sli_flag & LPFC_SLI2_ACTIVE) 1736 if (psli->sli_flag & LPFC_SLI_ACTIVE)
1734 rev = vp->rev.sli2FwRev; 1737 rev = vp->rev.sli2FwRev;
1735 else 1738 else
1736 rev = vp->rev.sli1FwRev; 1739 rev = vp->rev.sli1FwRev;
@@ -1756,7 +1759,7 @@ lpfc_decode_firmware_rev(struct lpfc_hba *phba, char *fwrevision, int flag)
1756 } 1759 }
1757 b4 = (rev & 0x0000000f); 1760 b4 = (rev & 0x0000000f);
1758 1761
1759 if (psli->sli_flag & LPFC_SLI2_ACTIVE) 1762 if (psli->sli_flag & LPFC_SLI_ACTIVE)
1760 fwname = vp->rev.sli2FwName; 1763 fwname = vp->rev.sli2FwName;
1761 else 1764 else
1762 fwname = vp->rev.sli1FwName; 1765 fwname = vp->rev.sli1FwName;
diff --git a/drivers/scsi/lpfc/lpfc_disc.h b/drivers/scsi/lpfc/lpfc_disc.h
index ffd108972072..1142070e9484 100644
--- a/drivers/scsi/lpfc/lpfc_disc.h
+++ b/drivers/scsi/lpfc/lpfc_disc.h
@@ -135,6 +135,7 @@ struct lpfc_nodelist {
135#define NLP_NODEV_REMOVE 0x08000000 /* Defer removal till discovery ends */ 135#define NLP_NODEV_REMOVE 0x08000000 /* Defer removal till discovery ends */
136#define NLP_TARGET_REMOVE 0x10000000 /* Target remove in process */ 136#define NLP_TARGET_REMOVE 0x10000000 /* Target remove in process */
137#define NLP_SC_REQ 0x20000000 /* Target requires authentication */ 137#define NLP_SC_REQ 0x20000000 /* Target requires authentication */
138#define NLP_RPI_VALID 0x80000000 /* nlp_rpi is valid */
138 139
139/* ndlp usage management macros */ 140/* ndlp usage management macros */
140#define NLP_CHK_NODE_ACT(ndlp) (((ndlp)->nlp_usg_map \ 141#define NLP_CHK_NODE_ACT(ndlp) (((ndlp)->nlp_usg_map \
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index d507a581b999..126323a4dcec 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -1647,6 +1647,9 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
1647 case LA_8GHZ_LINK: 1647 case LA_8GHZ_LINK:
1648 phba->fc_linkspeed = LA_8GHZ_LINK; 1648 phba->fc_linkspeed = LA_8GHZ_LINK;
1649 break; 1649 break;
1650 case LA_10GHZ_LINK:
1651 phba->fc_linkspeed = LA_10GHZ_LINK;
1652 break;
1650 default: 1653 default:
1651 phba->fc_linkspeed = LA_UNKNW_LINK; 1654 phba->fc_linkspeed = LA_UNKNW_LINK;
1652 break; 1655 break;
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 8c30f5707f95..65cd3fe62200 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -906,7 +906,7 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
906 "taking this port offline.\n"); 906 "taking this port offline.\n");
907 907
908 spin_lock_irq(&phba->hbalock); 908 spin_lock_irq(&phba->hbalock);
909 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 909 psli->sli_flag &= ~LPFC_SLI_ACTIVE;
910 spin_unlock_irq(&phba->hbalock); 910 spin_unlock_irq(&phba->hbalock);
911 911
912 lpfc_offline_prep(phba); 912 lpfc_offline_prep(phba);
@@ -931,13 +931,15 @@ lpfc_offline_eratt(struct lpfc_hba *phba)
931 struct lpfc_sli *psli = &phba->sli; 931 struct lpfc_sli *psli = &phba->sli;
932 932
933 spin_lock_irq(&phba->hbalock); 933 spin_lock_irq(&phba->hbalock);
934 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 934 psli->sli_flag &= ~LPFC_SLI_ACTIVE;
935 spin_unlock_irq(&phba->hbalock); 935 spin_unlock_irq(&phba->hbalock);
936 lpfc_offline_prep(phba); 936 lpfc_offline_prep(phba);
937 937
938 lpfc_offline(phba); 938 lpfc_offline(phba);
939 lpfc_reset_barrier(phba); 939 lpfc_reset_barrier(phba);
940 spin_lock_irq(&phba->hbalock);
940 lpfc_sli_brdreset(phba); 941 lpfc_sli_brdreset(phba);
942 spin_unlock_irq(&phba->hbalock);
941 lpfc_hba_down_post(phba); 943 lpfc_hba_down_post(phba);
942 lpfc_sli_brdready(phba, HS_MBRDY); 944 lpfc_sli_brdready(phba, HS_MBRDY);
943 lpfc_unblock_mgmt_io(phba); 945 lpfc_unblock_mgmt_io(phba);
@@ -980,6 +982,16 @@ lpfc_handle_deferred_eratt(struct lpfc_hba *phba)
980 struct lpfc_sli_ring *pring; 982 struct lpfc_sli_ring *pring;
981 struct lpfc_sli *psli = &phba->sli; 983 struct lpfc_sli *psli = &phba->sli;
982 984
985 /* If the pci channel is offline, ignore possible errors,
986 * since we cannot communicate with the pci card anyway.
987 */
988 if (pci_channel_offline(phba->pcidev)) {
989 spin_lock_irq(&phba->hbalock);
990 phba->hba_flag &= ~DEFER_ERATT;
991 spin_unlock_irq(&phba->hbalock);
992 return;
993 }
994
983 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 995 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
984 "0479 Deferred Adapter Hardware Error " 996 "0479 Deferred Adapter Hardware Error "
985 "Data: x%x x%x x%x\n", 997 "Data: x%x x%x x%x\n",
@@ -987,7 +999,7 @@ lpfc_handle_deferred_eratt(struct lpfc_hba *phba)
987 phba->work_status[0], phba->work_status[1]); 999 phba->work_status[0], phba->work_status[1]);
988 1000
989 spin_lock_irq(&phba->hbalock); 1001 spin_lock_irq(&phba->hbalock);
990 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 1002 psli->sli_flag &= ~LPFC_SLI_ACTIVE;
991 spin_unlock_irq(&phba->hbalock); 1003 spin_unlock_irq(&phba->hbalock);
992 1004
993 1005
@@ -1097,7 +1109,7 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba)
1097 phba->work_status[0], phba->work_status[1]); 1109 phba->work_status[0], phba->work_status[1]);
1098 1110
1099 spin_lock_irq(&phba->hbalock); 1111 spin_lock_irq(&phba->hbalock);
1100 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 1112 psli->sli_flag &= ~LPFC_SLI_ACTIVE;
1101 spin_unlock_irq(&phba->hbalock); 1113 spin_unlock_irq(&phba->hbalock);
1102 1114
1103 /* 1115 /*
diff --git a/drivers/scsi/lpfc/lpfc_logmsg.h b/drivers/scsi/lpfc/lpfc_logmsg.h
index db1ba22b8016..954ba57970a3 100644
--- a/drivers/scsi/lpfc/lpfc_logmsg.h
+++ b/drivers/scsi/lpfc/lpfc_logmsg.h
@@ -18,33 +18,39 @@
18 * included with this package. * 18 * included with this package. *
19 *******************************************************************/ 19 *******************************************************************/
20 20
21#define LOG_ELS 0x1 /* ELS events */ 21#define LOG_ELS 0x00000001 /* ELS events */
22#define LOG_DISCOVERY 0x2 /* Link discovery events */ 22#define LOG_DISCOVERY 0x00000002 /* Link discovery events */
23#define LOG_MBOX 0x4 /* Mailbox events */ 23#define LOG_MBOX 0x00000004 /* Mailbox events */
24#define LOG_INIT 0x8 /* Initialization events */ 24#define LOG_INIT 0x00000008 /* Initialization events */
25#define LOG_LINK_EVENT 0x10 /* Link events */ 25#define LOG_LINK_EVENT 0x00000010 /* Link events */
26#define LOG_IP 0x20 /* IP traffic history */ 26#define LOG_IP 0x00000020 /* IP traffic history */
27#define LOG_FCP 0x40 /* FCP traffic history */ 27#define LOG_FCP 0x00000040 /* FCP traffic history */
28#define LOG_NODE 0x80 /* Node table events */ 28#define LOG_NODE 0x00000080 /* Node table events */
29#define LOG_TEMP 0x100 /* Temperature sensor events */ 29#define LOG_TEMP 0x00000100 /* Temperature sensor events */
30#define LOG_BG 0x200 /* BlockGuard events */ 30#define LOG_BG 0x00000200 /* BlockGuard events */
31#define LOG_MISC 0x400 /* Miscellaneous events */ 31#define LOG_MISC 0x00000400 /* Miscellaneous events */
32#define LOG_SLI 0x800 /* SLI events */ 32#define LOG_SLI 0x00000800 /* SLI events */
33#define LOG_FCP_ERROR 0x1000 /* log errors, not underruns */ 33#define LOG_FCP_ERROR 0x00001000 /* log errors, not underruns */
34#define LOG_LIBDFC 0x2000 /* Libdfc events */ 34#define LOG_LIBDFC 0x00002000 /* Libdfc events */
35#define LOG_VPORT 0x4000 /* NPIV events */ 35#define LOG_VPORT 0x00004000 /* NPIV events */
36#define LOG_ALL_MSG 0xffff /* LOG all messages */ 36#define LOF_SECURITY 0x00008000 /* Security events */
37#define LOG_EVENT 0x00010000 /* CT,TEMP,DUMP, logging */
38#define LOG_ALL_MSG 0xffffffff /* LOG all messages */
37 39
38#define lpfc_printf_vlog(vport, level, mask, fmt, arg...) \ 40#define lpfc_printf_vlog(vport, level, mask, fmt, arg...) \
39 do { \ 41do { \
40 { if (((mask) &(vport)->cfg_log_verbose) || (level[1] <= '3')) \ 42 { if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '3')) \
41 dev_printk(level, &((vport)->phba->pcidev)->dev, "%d:(%d):" \ 43 dev_printk(level, &((vport)->phba->pcidev)->dev, "%d:(%d):" \
42 fmt, (vport)->phba->brd_no, vport->vpi, ##arg); } \ 44 fmt, (vport)->phba->brd_no, vport->vpi, ##arg); } \
43 } while (0) 45} while (0)
44 46
45#define lpfc_printf_log(phba, level, mask, fmt, arg...) \ 47#define lpfc_printf_log(phba, level, mask, fmt, arg...) \
46 do { \ 48do { \
47 { if (((mask) &(phba)->pport->cfg_log_verbose) || (level[1] <= '3')) \ 49 { uint32_t log_verbose = (phba)->pport ? \
50 (phba)->pport->cfg_log_verbose : \
51 (phba)->cfg_log_verbose; \
52 if (((mask) & log_verbose) || (level[1] <= '3')) \
48 dev_printk(level, &((phba)->pcidev)->dev, "%d:" \ 53 dev_printk(level, &((phba)->pcidev)->dev, "%d:" \
49 fmt, phba->brd_no, ##arg); } \ 54 fmt, phba->brd_no, ##arg); \
50 } while (0) 55 } \
56} while (0)
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index a53c267a067b..ff04daf18f48 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -3272,7 +3272,7 @@ void lpfc_reset_barrier(struct lpfc_hba *phba)
3272 mdelay(1); 3272 mdelay(1);
3273 3273
3274 if (readl(resp_buf + 1) != ~(BARRIER_TEST_PATTERN)) { 3274 if (readl(resp_buf + 1) != ~(BARRIER_TEST_PATTERN)) {
3275 if (phba->sli.sli_flag & LPFC_SLI2_ACTIVE || 3275 if (phba->sli.sli_flag & LPFC_SLI_ACTIVE ||
3276 phba->pport->stopped) 3276 phba->pport->stopped)
3277 goto restore_hc; 3277 goto restore_hc;
3278 else 3278 else
@@ -3353,7 +3353,9 @@ lpfc_sli_brdkill(struct lpfc_hba *phba)
3353 return 1; 3353 return 1;
3354 } 3354 }
3355 3355
3356 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 3356 spin_lock_irq(&phba->hbalock);
3357 psli->sli_flag &= ~LPFC_SLI_ACTIVE;
3358 spin_unlock_irq(&phba->hbalock);
3357 3359
3358 mempool_free(pmb, phba->mbox_mem_pool); 3360 mempool_free(pmb, phba->mbox_mem_pool);
3359 3361
@@ -4643,7 +4645,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba)
4643 spin_unlock_irq(&phba->pport->work_port_lock); 4645 spin_unlock_irq(&phba->pport->work_port_lock);
4644 spin_lock_irq(&phba->hbalock); 4646 spin_lock_irq(&phba->hbalock);
4645 phba->link_state = LPFC_LINK_UNKNOWN; 4647 phba->link_state = LPFC_LINK_UNKNOWN;
4646 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 4648 psli->sli_flag &= ~LPFC_SLI_ACTIVE;
4647 spin_unlock_irq(&phba->hbalock); 4649 spin_unlock_irq(&phba->hbalock);
4648 4650
4649 pring = &psli->ring[psli->fcp_ring]; 4651 pring = &psli->ring[psli->fcp_ring];
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h
index e6c88ee8ee96..7d37eb7459bf 100644
--- a/drivers/scsi/lpfc/lpfc_sli.h
+++ b/drivers/scsi/lpfc/lpfc_sli.h
@@ -244,7 +244,7 @@ struct lpfc_sli {
244 244
245 /* Additional sli_flags */ 245 /* Additional sli_flags */
246#define LPFC_SLI_MBOX_ACTIVE 0x100 /* HBA mailbox is currently active */ 246#define LPFC_SLI_MBOX_ACTIVE 0x100 /* HBA mailbox is currently active */
247#define LPFC_SLI2_ACTIVE 0x200 /* SLI2 overlay in firmware is active */ 247#define LPFC_SLI_ACTIVE 0x200 /* SLI in firmware is active */
248#define LPFC_PROCESS_LA 0x400 /* Able to process link attention */ 248#define LPFC_PROCESS_LA 0x400 /* Able to process link attention */
249#define LPFC_BLOCK_MGMT_IO 0x800 /* Don't allow mgmt mbx or iocb cmds */ 249#define LPFC_BLOCK_MGMT_IO 0x800 /* Don't allow mgmt mbx or iocb cmds */
250#define LPFC_MENLO_MAINT 0x1000 /* need for menl fw download */ 250#define LPFC_MENLO_MAINT 0x1000 /* need for menl fw download */
diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c
index 59e67f7ee531..a415ec0b9a86 100644
--- a/drivers/scsi/lpfc/lpfc_vport.c
+++ b/drivers/scsi/lpfc/lpfc_vport.c
@@ -121,7 +121,7 @@ lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport)
121 if (!pmb) { 121 if (!pmb) {
122 return -ENOMEM; 122 return -ENOMEM;
123 } 123 }
124 mb = &pmb->mb; 124 mb = &pmb->u.mb;
125 125
126 lpfc_read_sparam(phba, pmb, vport->vpi); 126 lpfc_read_sparam(phba, pmb, vport->vpi);
127 /* 127 /*