diff options
author | Jayamohan Kallickal <jayamohank@gmail.com> | 2013-04-05 23:38:27 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-05-02 11:09:25 -0400 |
commit | ef9e1b9bdca82d9b692da77e35595c2d4b87a4b5 (patch) | |
tree | c10ff361bcb094d8947fe1ecc25af7bdd6b6efae | |
parent | 2c9dfd364929585e0685f4f69d10130f3ca7acdd (diff) |
[SCSI] be2iscsi: Fix support for DEFQ extension
Fix support for DEFQ extension which will be used by latest
adapters
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/be2iscsi/be_cmds.c | 42 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_cmds.h | 14 |
2 files changed, 44 insertions, 12 deletions
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c index db6c50bc8c02..4f3c93a11c50 100644 --- a/drivers/scsi/be2iscsi/be_cmds.c +++ b/drivers/scsi/be2iscsi/be_cmds.c | |||
@@ -1021,6 +1021,7 @@ int be_cmd_create_default_pdu_queue(struct be_ctrl_info *ctrl, | |||
1021 | struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); | 1021 | struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); |
1022 | struct be_defq_create_req *req = embedded_payload(wrb); | 1022 | struct be_defq_create_req *req = embedded_payload(wrb); |
1023 | struct be_dma_mem *q_mem = &dq->dma_mem; | 1023 | struct be_dma_mem *q_mem = &dq->dma_mem; |
1024 | struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); | ||
1024 | void *ctxt = &req->context; | 1025 | void *ctxt = &req->context; |
1025 | int status; | 1026 | int status; |
1026 | 1027 | ||
@@ -1033,17 +1034,36 @@ int be_cmd_create_default_pdu_queue(struct be_ctrl_info *ctrl, | |||
1033 | OPCODE_COMMON_ISCSI_DEFQ_CREATE, sizeof(*req)); | 1034 | OPCODE_COMMON_ISCSI_DEFQ_CREATE, sizeof(*req)); |
1034 | 1035 | ||
1035 | req->num_pages = PAGES_4K_SPANNED(q_mem->va, q_mem->size); | 1036 | req->num_pages = PAGES_4K_SPANNED(q_mem->va, q_mem->size); |
1036 | AMAP_SET_BITS(struct amap_be_default_pdu_context, rx_pdid, ctxt, 0); | 1037 | |
1037 | AMAP_SET_BITS(struct amap_be_default_pdu_context, rx_pdid_valid, ctxt, | 1038 | if (is_chip_be2_be3r(phba)) { |
1038 | 1); | 1039 | AMAP_SET_BITS(struct amap_be_default_pdu_context, |
1039 | AMAP_SET_BITS(struct amap_be_default_pdu_context, pci_func_id, ctxt, | 1040 | rx_pdid, ctxt, 0); |
1040 | PCI_FUNC(ctrl->pdev->devfn)); | 1041 | AMAP_SET_BITS(struct amap_be_default_pdu_context, |
1041 | AMAP_SET_BITS(struct amap_be_default_pdu_context, ring_size, ctxt, | 1042 | rx_pdid_valid, ctxt, 1); |
1042 | be_encoded_q_len(length / sizeof(struct phys_addr))); | 1043 | AMAP_SET_BITS(struct amap_be_default_pdu_context, |
1043 | AMAP_SET_BITS(struct amap_be_default_pdu_context, default_buffer_size, | 1044 | pci_func_id, ctxt, PCI_FUNC(ctrl->pdev->devfn)); |
1044 | ctxt, entry_size); | 1045 | AMAP_SET_BITS(struct amap_be_default_pdu_context, |
1045 | AMAP_SET_BITS(struct amap_be_default_pdu_context, cq_id_recv, ctxt, | 1046 | ring_size, ctxt, |
1046 | cq->id); | 1047 | be_encoded_q_len(length / |
1048 | sizeof(struct phys_addr))); | ||
1049 | AMAP_SET_BITS(struct amap_be_default_pdu_context, | ||
1050 | default_buffer_size, ctxt, entry_size); | ||
1051 | AMAP_SET_BITS(struct amap_be_default_pdu_context, | ||
1052 | cq_id_recv, ctxt, cq->id); | ||
1053 | } else { | ||
1054 | AMAP_SET_BITS(struct amap_default_pdu_context_ext, | ||
1055 | rx_pdid, ctxt, 0); | ||
1056 | AMAP_SET_BITS(struct amap_default_pdu_context_ext, | ||
1057 | rx_pdid_valid, ctxt, 1); | ||
1058 | AMAP_SET_BITS(struct amap_default_pdu_context_ext, | ||
1059 | ring_size, ctxt, | ||
1060 | be_encoded_q_len(length / | ||
1061 | sizeof(struct phys_addr))); | ||
1062 | AMAP_SET_BITS(struct amap_default_pdu_context_ext, | ||
1063 | default_buffer_size, ctxt, entry_size); | ||
1064 | AMAP_SET_BITS(struct amap_default_pdu_context_ext, | ||
1065 | cq_id_recv, ctxt, cq->id); | ||
1066 | } | ||
1047 | 1067 | ||
1048 | be_dws_cpu_to_le(ctxt, sizeof(req->context)); | 1068 | be_dws_cpu_to_le(ctxt, sizeof(req->context)); |
1049 | 1069 | ||
diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h index a338625868e5..9b64b3603576 100644 --- a/drivers/scsi/be2iscsi/be_cmds.h +++ b/drivers/scsi/be2iscsi/be_cmds.h | |||
@@ -756,6 +756,18 @@ struct amap_be_default_pdu_context { | |||
756 | u8 rsvd4[32]; /* dword 3 */ | 756 | u8 rsvd4[32]; /* dword 3 */ |
757 | } __packed; | 757 | } __packed; |
758 | 758 | ||
759 | struct amap_default_pdu_context_ext { | ||
760 | u8 rsvd0[16]; /* dword 0 */ | ||
761 | u8 ring_size[4]; /* dword 0 */ | ||
762 | u8 rsvd1[12]; /* dword 0 */ | ||
763 | u8 rsvd2[22]; /* dword 1 */ | ||
764 | u8 rx_pdid[9]; /* dword 1 */ | ||
765 | u8 rx_pdid_valid; /* dword 1 */ | ||
766 | u8 default_buffer_size[16]; /* dword 2 */ | ||
767 | u8 cq_id_recv[16]; /* dword 2 */ | ||
768 | u8 rsvd3[32]; /* dword 3 */ | ||
769 | } __packed; | ||
770 | |||
759 | struct be_defq_create_req { | 771 | struct be_defq_create_req { |
760 | struct be_cmd_req_hdr hdr; | 772 | struct be_cmd_req_hdr hdr; |
761 | u16 num_pages; | 773 | u16 num_pages; |
@@ -901,7 +913,7 @@ struct amap_it_dmsg_cqe_v2 { | |||
901 | * stack to notify the | 913 | * stack to notify the |
902 | * controller of a posted Work Request Block | 914 | * controller of a posted Work Request Block |
903 | */ | 915 | */ |
904 | #define DB_WRB_POST_CID_MASK 0x3FF /* bits 0 - 9 */ | 916 | #define DB_WRB_POST_CID_MASK 0xFFFF /* bits 0 - 16 */ |
905 | #define DB_DEF_PDU_WRB_INDEX_MASK 0xFF /* bits 0 - 9 */ | 917 | #define DB_DEF_PDU_WRB_INDEX_MASK 0xFF /* bits 0 - 9 */ |
906 | 918 | ||
907 | #define DB_DEF_PDU_WRB_INDEX_SHIFT 16 | 919 | #define DB_DEF_PDU_WRB_INDEX_SHIFT 16 |