diff options
author | James Smart <James.Smart@Emulex.Com> | 2009-05-22 14:53:12 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-08 12:26:01 -0400 |
commit | f4b4c68f74dcd5da03df851090cad28ad4e8d7cc (patch) | |
tree | c9ae4867a01cbdb11c008c23830ddd7c7220bee8 /drivers/scsi/lpfc/lpfc_attr.c | |
parent | d8e93df13c8f7bde45a7756944aab528c58df4cf (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>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 55 |
1 files changed, 30 insertions, 25 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 | */ |
2063 | LPFC_VPORT_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0xffff, | 2050 | LPFC_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 | **/ | ||
4025 | static void | ||
4026 | lpfc_hba_log_verbose_init(struct lpfc_hba *phba, uint32_t verbose) | ||
4027 | { | ||
4028 | phba->cfg_log_verbose = verbose; | ||
4029 | } | ||
4030 | |||
4026 | struct fc_function_template lpfc_transport_functions = { | 4031 | struct 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, |