aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2012-08-14 14:25:29 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-09-14 12:59:22 -0400
commit8aa134a836061c54f64775ffc4006bdce8bea4a8 (patch)
tree8143c2f80592c7e9b7fde591477e9981a30bd0e6 /drivers/scsi/lpfc
parent086a345f9d53dbc57243ee8d7764e255cb6bbd64 (diff)
[SCSI] lpfc 8.3.34: Add SLI-4 V1 Capacity and Resource Descriptor support
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_hw4.h17
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c25
2 files changed, 31 insertions, 11 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h
index 35af35b5ab97..dc13612b8f3b 100644
--- a/drivers/scsi/lpfc/lpfc_hw4.h
+++ b/drivers/scsi/lpfc/lpfc_hw4.h
@@ -2573,7 +2573,7 @@ struct lpfc_mbx_get_sli4_parameters {
2573}; 2573};
2574 2574
2575struct lpfc_rscr_desc_generic { 2575struct lpfc_rscr_desc_generic {
2576#define LPFC_RSRC_DESC_WSIZE 18 2576#define LPFC_RSRC_DESC_WSIZE 22
2577 uint32_t desc[LPFC_RSRC_DESC_WSIZE]; 2577 uint32_t desc[LPFC_RSRC_DESC_WSIZE];
2578}; 2578};
2579 2579
@@ -2583,6 +2583,9 @@ struct lpfc_rsrc_desc_pcie {
2583#define lpfc_rsrc_desc_pcie_type_MASK 0x000000ff 2583#define lpfc_rsrc_desc_pcie_type_MASK 0x000000ff
2584#define lpfc_rsrc_desc_pcie_type_WORD word0 2584#define lpfc_rsrc_desc_pcie_type_WORD word0
2585#define LPFC_RSRC_DESC_TYPE_PCIE 0x40 2585#define LPFC_RSRC_DESC_TYPE_PCIE 0x40
2586#define lpfc_rsrc_desc_pcie_length_SHIFT 8
2587#define lpfc_rsrc_desc_pcie_length_MASK 0x000000ff
2588#define lpfc_rsrc_desc_pcie_length_WORD word0
2586 uint32_t word1; 2589 uint32_t word1;
2587#define lpfc_rsrc_desc_pcie_pfnum_SHIFT 0 2590#define lpfc_rsrc_desc_pcie_pfnum_SHIFT 0
2588#define lpfc_rsrc_desc_pcie_pfnum_MASK 0x000000ff 2591#define lpfc_rsrc_desc_pcie_pfnum_MASK 0x000000ff
@@ -2610,6 +2613,12 @@ struct lpfc_rsrc_desc_fcfcoe {
2610#define lpfc_rsrc_desc_fcfcoe_type_MASK 0x000000ff 2613#define lpfc_rsrc_desc_fcfcoe_type_MASK 0x000000ff
2611#define lpfc_rsrc_desc_fcfcoe_type_WORD word0 2614#define lpfc_rsrc_desc_fcfcoe_type_WORD word0
2612#define LPFC_RSRC_DESC_TYPE_FCFCOE 0x43 2615#define LPFC_RSRC_DESC_TYPE_FCFCOE 0x43
2616#define lpfc_rsrc_desc_fcfcoe_length_SHIFT 8
2617#define lpfc_rsrc_desc_fcfcoe_length_MASK 0x000000ff
2618#define lpfc_rsrc_desc_fcfcoe_length_WORD word0
2619#define LPFC_RSRC_DESC_TYPE_FCFCOE_V0_RSVD 0
2620#define LPFC_RSRC_DESC_TYPE_FCFCOE_V0_LENGTH 72
2621#define LPFC_RSRC_DESC_TYPE_FCFCOE_V1_LENGTH 88
2613 uint32_t word1; 2622 uint32_t word1;
2614#define lpfc_rsrc_desc_fcfcoe_vfnum_SHIFT 0 2623#define lpfc_rsrc_desc_fcfcoe_vfnum_SHIFT 0
2615#define lpfc_rsrc_desc_fcfcoe_vfnum_MASK 0x000000ff 2624#define lpfc_rsrc_desc_fcfcoe_vfnum_MASK 0x000000ff
@@ -2668,6 +2677,12 @@ struct lpfc_rsrc_desc_fcfcoe {
2668#define lpfc_rsrc_desc_fcfcoe_eq_cnt_SHIFT 16 2677#define lpfc_rsrc_desc_fcfcoe_eq_cnt_SHIFT 16
2669#define lpfc_rsrc_desc_fcfcoe_eq_cnt_MASK 0x0000ffff 2678#define lpfc_rsrc_desc_fcfcoe_eq_cnt_MASK 0x0000ffff
2670#define lpfc_rsrc_desc_fcfcoe_eq_cnt_WORD word13 2679#define lpfc_rsrc_desc_fcfcoe_eq_cnt_WORD word13
2680/* extended FC/FCoE Resource Descriptor when length = 88 bytes */
2681 uint32_t bw_min;
2682 uint32_t bw_max;
2683 uint32_t iops_min;
2684 uint32_t iops_max;
2685 uint32_t reserved[4];
2671}; 2686};
2672 2687
2673struct lpfc_func_cfg { 2688struct lpfc_func_cfg {
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index cb2749a67c69..d81fec832b98 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -6299,8 +6299,9 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)
6299 uint32_t shdr_status, shdr_add_status; 6299 uint32_t shdr_status, shdr_add_status;
6300 struct lpfc_mbx_get_func_cfg *get_func_cfg; 6300 struct lpfc_mbx_get_func_cfg *get_func_cfg;
6301 struct lpfc_rsrc_desc_fcfcoe *desc; 6301 struct lpfc_rsrc_desc_fcfcoe *desc;
6302 char *pdesc_0;
6302 uint32_t desc_count; 6303 uint32_t desc_count;
6303 int length, i, rc = 0; 6304 int length, i, rc = 0, rc2;
6304 6305
6305 pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 6306 pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
6306 if (!pmb) { 6307 if (!pmb) {
@@ -6412,18 +6413,17 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)
6412 LPFC_MBOX_OPCODE_GET_FUNCTION_CONFIG, 6413 LPFC_MBOX_OPCODE_GET_FUNCTION_CONFIG,
6413 length, LPFC_SLI4_MBX_EMBED); 6414 length, LPFC_SLI4_MBX_EMBED);
6414 6415
6415 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); 6416 rc2 = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
6416 shdr = (union lpfc_sli4_cfg_shdr *) 6417 shdr = (union lpfc_sli4_cfg_shdr *)
6417 &pmb->u.mqe.un.sli4_config.header.cfg_shdr; 6418 &pmb->u.mqe.un.sli4_config.header.cfg_shdr;
6418 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); 6419 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
6419 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); 6420 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
6420 if (rc || shdr_status || shdr_add_status) { 6421 if (rc2 || shdr_status || shdr_add_status) {
6421 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 6422 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
6422 "3026 Mailbox failed , mbxCmd x%x " 6423 "3026 Mailbox failed , mbxCmd x%x "
6423 "GET_FUNCTION_CONFIG, mbxStatus x%x\n", 6424 "GET_FUNCTION_CONFIG, mbxStatus x%x\n",
6424 bf_get(lpfc_mqe_command, &pmb->u.mqe), 6425 bf_get(lpfc_mqe_command, &pmb->u.mqe),
6425 bf_get(lpfc_mqe_status, &pmb->u.mqe)); 6426 bf_get(lpfc_mqe_status, &pmb->u.mqe));
6426 rc = -EIO;
6427 goto read_cfg_out; 6427 goto read_cfg_out;
6428 } 6428 }
6429 6429
@@ -6431,11 +6431,18 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)
6431 get_func_cfg = &pmb->u.mqe.un.get_func_cfg; 6431 get_func_cfg = &pmb->u.mqe.un.get_func_cfg;
6432 desc_count = get_func_cfg->func_cfg.rsrc_desc_count; 6432 desc_count = get_func_cfg->func_cfg.rsrc_desc_count;
6433 6433
6434 pdesc_0 = (char *)&get_func_cfg->func_cfg.desc[0];
6435 desc = (struct lpfc_rsrc_desc_fcfcoe *)pdesc_0;
6436 length = bf_get(lpfc_rsrc_desc_fcfcoe_length, desc);
6437 if (length == LPFC_RSRC_DESC_TYPE_FCFCOE_V0_RSVD)
6438 length = LPFC_RSRC_DESC_TYPE_FCFCOE_V0_LENGTH;
6439 else if (length != LPFC_RSRC_DESC_TYPE_FCFCOE_V1_LENGTH)
6440 goto read_cfg_out;
6441
6434 for (i = 0; i < LPFC_RSRC_DESC_MAX_NUM; i++) { 6442 for (i = 0; i < LPFC_RSRC_DESC_MAX_NUM; i++) {
6435 desc = (struct lpfc_rsrc_desc_fcfcoe *) 6443 desc = (struct lpfc_rsrc_desc_fcfcoe *)(pdesc_0 + length * i);
6436 &get_func_cfg->func_cfg.desc[i];
6437 if (LPFC_RSRC_DESC_TYPE_FCFCOE == 6444 if (LPFC_RSRC_DESC_TYPE_FCFCOE ==
6438 bf_get(lpfc_rsrc_desc_pcie_type, desc)) { 6445 bf_get(lpfc_rsrc_desc_fcfcoe_type, desc)) {
6439 phba->sli4_hba.iov.pf_number = 6446 phba->sli4_hba.iov.pf_number =
6440 bf_get(lpfc_rsrc_desc_fcfcoe_pfnum, desc); 6447 bf_get(lpfc_rsrc_desc_fcfcoe_pfnum, desc);
6441 phba->sli4_hba.iov.vf_number = 6448 phba->sli4_hba.iov.vf_number =
@@ -6449,13 +6456,11 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)
6449 "3027 GET_FUNCTION_CONFIG: pf_number:%d, " 6456 "3027 GET_FUNCTION_CONFIG: pf_number:%d, "
6450 "vf_number:%d\n", phba->sli4_hba.iov.pf_number, 6457 "vf_number:%d\n", phba->sli4_hba.iov.pf_number,
6451 phba->sli4_hba.iov.vf_number); 6458 phba->sli4_hba.iov.vf_number);
6452 else { 6459 else
6453 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 6460 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
6454 "3028 GET_FUNCTION_CONFIG: failed to find " 6461 "3028 GET_FUNCTION_CONFIG: failed to find "
6455 "Resrouce Descriptor:x%x\n", 6462 "Resrouce Descriptor:x%x\n",
6456 LPFC_RSRC_DESC_TYPE_FCFCOE); 6463 LPFC_RSRC_DESC_TYPE_FCFCOE);
6457 rc = -EIO;
6458 }
6459 6464
6460read_cfg_out: 6465read_cfg_out:
6461 mempool_free(pmb, phba->mbox_mem_pool); 6466 mempool_free(pmb, phba->mbox_mem_pool);