diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_ct.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_ct.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index a51a41b7f15d..34a9e3bb2614 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2006 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2007 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * * | 7 | * * |
@@ -334,21 +334,22 @@ lpfc_ns_rsp(struct lpfc_hba * phba, struct lpfc_dmabuf * mp, uint32_t Size) | |||
334 | 334 | ||
335 | lpfc_set_disctmo(phba); | 335 | lpfc_set_disctmo(phba); |
336 | 336 | ||
337 | Cnt = Size > FCELSSIZE ? FCELSSIZE : Size; | ||
338 | 337 | ||
339 | list_add_tail(&head, &mp->list); | 338 | list_add_tail(&head, &mp->list); |
340 | list_for_each_entry_safe(mp, next_mp, &head, list) { | 339 | list_for_each_entry_safe(mp, next_mp, &head, list) { |
341 | mlast = mp; | 340 | mlast = mp; |
342 | 341 | ||
342 | Cnt = Size > FCELSSIZE ? FCELSSIZE : Size; | ||
343 | |||
343 | Size -= Cnt; | 344 | Size -= Cnt; |
344 | 345 | ||
345 | if (!ctptr) | 346 | if (!ctptr) { |
346 | ctptr = (uint32_t *) mlast->virt; | 347 | ctptr = (uint32_t *) mlast->virt; |
347 | else | 348 | } else |
348 | Cnt -= 16; /* subtract length of CT header */ | 349 | Cnt -= 16; /* subtract length of CT header */ |
349 | 350 | ||
350 | /* Loop through entire NameServer list of DIDs */ | 351 | /* Loop through entire NameServer list of DIDs */ |
351 | while (Cnt) { | 352 | while (Cnt >= sizeof (uint32_t)) { |
352 | 353 | ||
353 | /* Get next DID from NameServer List */ | 354 | /* Get next DID from NameServer List */ |
354 | CTentry = *ctptr++; | 355 | CTentry = *ctptr++; |
@@ -442,10 +443,8 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, | |||
442 | if (phba->fc_ns_retry < LPFC_MAX_NS_RETRY) { | 443 | if (phba->fc_ns_retry < LPFC_MAX_NS_RETRY) { |
443 | phba->fc_ns_retry++; | 444 | phba->fc_ns_retry++; |
444 | /* CT command is being retried */ | 445 | /* CT command is being retried */ |
445 | ndlp = | 446 | ndlp = lpfc_findnode_did(phba, NameServer_DID); |
446 | lpfc_findnode_did(phba, NLP_SEARCH_UNMAPPED, | 447 | if (ndlp && ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) { |
447 | NameServer_DID); | ||
448 | if (ndlp) { | ||
449 | if (lpfc_ns_cmd(phba, ndlp, SLI_CTNS_GID_FT) == | 448 | if (lpfc_ns_cmd(phba, ndlp, SLI_CTNS_GID_FT) == |
450 | 0) { | 449 | 0) { |
451 | goto out; | 450 | goto out; |
@@ -729,7 +728,7 @@ lpfc_cmpl_ct_cmd_fdmi(struct lpfc_hba * phba, | |||
729 | uint16_t fdmi_cmd = CTcmd->CommandResponse.bits.CmdRsp; | 728 | uint16_t fdmi_cmd = CTcmd->CommandResponse.bits.CmdRsp; |
730 | uint16_t fdmi_rsp = CTrsp->CommandResponse.bits.CmdRsp; | 729 | uint16_t fdmi_rsp = CTrsp->CommandResponse.bits.CmdRsp; |
731 | 730 | ||
732 | ndlp = lpfc_findnode_did(phba, NLP_SEARCH_ALL, FDMI_DID); | 731 | ndlp = lpfc_findnode_did(phba, FDMI_DID); |
733 | if (fdmi_rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) { | 732 | if (fdmi_rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) { |
734 | /* FDMI rsp failed */ | 733 | /* FDMI rsp failed */ |
735 | lpfc_printf_log(phba, | 734 | lpfc_printf_log(phba, |
@@ -1039,6 +1038,9 @@ lpfc_fdmi_cmd(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, int cmdcode) | |||
1039 | case LA_4GHZ_LINK: | 1038 | case LA_4GHZ_LINK: |
1040 | ae->un.PortSpeed = HBA_PORTSPEED_4GBIT; | 1039 | ae->un.PortSpeed = HBA_PORTSPEED_4GBIT; |
1041 | break; | 1040 | break; |
1041 | case LA_8GHZ_LINK: | ||
1042 | ae->un.PortSpeed = HBA_PORTSPEED_8GBIT; | ||
1043 | break; | ||
1042 | default: | 1044 | default: |
1043 | ae->un.PortSpeed = | 1045 | ae->un.PortSpeed = |
1044 | HBA_PORTSPEED_UNKNOWN; | 1046 | HBA_PORTSPEED_UNKNOWN; |
@@ -1161,7 +1163,7 @@ lpfc_fdmi_tmo_handler(struct lpfc_hba *phba) | |||
1161 | { | 1163 | { |
1162 | struct lpfc_nodelist *ndlp; | 1164 | struct lpfc_nodelist *ndlp; |
1163 | 1165 | ||
1164 | ndlp = lpfc_findnode_did(phba, NLP_SEARCH_ALL, FDMI_DID); | 1166 | ndlp = lpfc_findnode_did(phba, FDMI_DID); |
1165 | if (ndlp) { | 1167 | if (ndlp) { |
1166 | if (init_utsname()->nodename[0] != '\0') { | 1168 | if (init_utsname()->nodename[0] != '\0') { |
1167 | lpfc_fdmi_cmd(phba, ndlp, SLI_MGMT_DHBA); | 1169 | lpfc_fdmi_cmd(phba, ndlp, SLI_MGMT_DHBA); |