aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/bfa/bfa_svc.c')
-rw-r--r--drivers/scsi/bfa/bfa_svc.c53
1 files changed, 10 insertions, 43 deletions
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 16d9a5f61c18..d1674c6058ed 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -750,23 +750,6 @@ hal_fcxp_send_comp(struct bfa_s *bfa, struct bfi_fcxp_send_rsp_s *fcxp_rsp)
750} 750}
751 751
752static void 752static void
753hal_fcxp_set_local_sges(struct bfi_sge_s *sge, u32 reqlen, u64 req_pa)
754{
755 union bfi_addr_u sga_zero = { {0} };
756
757 sge->sg_len = reqlen;
758 sge->flags = BFI_SGE_DATA_LAST;
759 bfa_dma_addr_set(sge[0].sga, req_pa);
760 bfa_sge_to_be(sge);
761 sge++;
762
763 sge->sga = sga_zero;
764 sge->sg_len = reqlen;
765 sge->flags = BFI_SGE_PGDLEN;
766 bfa_sge_to_be(sge);
767}
768
769static void
770hal_fcxp_tx_plog(struct bfa_s *bfa, u32 reqlen, struct bfa_fcxp_s *fcxp, 753hal_fcxp_tx_plog(struct bfa_s *bfa, u32 reqlen, struct bfa_fcxp_s *fcxp,
771 struct fchs_s *fchs) 754 struct fchs_s *fchs)
772{ 755{
@@ -873,18 +856,16 @@ bfa_fcxp_queue(struct bfa_fcxp_s *fcxp, struct bfi_fcxp_send_req_s *send_req)
873 * setup req sgles 856 * setup req sgles
874 */ 857 */
875 if (fcxp->use_ireqbuf == 1) { 858 if (fcxp->use_ireqbuf == 1) {
876 hal_fcxp_set_local_sges(send_req->req_sge, reqi->req_tot_len, 859 bfa_alen_set(&send_req->req_alen, reqi->req_tot_len,
877 BFA_FCXP_REQ_PLD_PA(fcxp)); 860 BFA_FCXP_REQ_PLD_PA(fcxp));
878 } else { 861 } else {
879 if (fcxp->nreq_sgles > 0) { 862 if (fcxp->nreq_sgles > 0) {
880 WARN_ON(fcxp->nreq_sgles != 1); 863 WARN_ON(fcxp->nreq_sgles != 1);
881 hal_fcxp_set_local_sges(send_req->req_sge, 864 bfa_alen_set(&send_req->req_alen, reqi->req_tot_len,
882 reqi->req_tot_len, 865 fcxp->req_sga_cbfn(fcxp->caller, 0));
883 fcxp->req_sga_cbfn(fcxp->caller,
884 0));
885 } else { 866 } else {
886 WARN_ON(reqi->req_tot_len != 0); 867 WARN_ON(reqi->req_tot_len != 0);
887 hal_fcxp_set_local_sges(send_req->rsp_sge, 0, 0); 868 bfa_alen_set(&send_req->rsp_alen, 0, 0);
888 } 869 }
889 } 870 }
890 871
@@ -894,19 +875,17 @@ bfa_fcxp_queue(struct bfa_fcxp_s *fcxp, struct bfi_fcxp_send_req_s *send_req)
894 if (fcxp->use_irspbuf == 1) { 875 if (fcxp->use_irspbuf == 1) {
895 WARN_ON(rspi->rsp_maxlen > BFA_FCXP_MAX_LBUF_SZ); 876 WARN_ON(rspi->rsp_maxlen > BFA_FCXP_MAX_LBUF_SZ);
896 877
897 hal_fcxp_set_local_sges(send_req->rsp_sge, rspi->rsp_maxlen, 878 bfa_alen_set(&send_req->rsp_alen, rspi->rsp_maxlen,
898 BFA_FCXP_RSP_PLD_PA(fcxp)); 879 BFA_FCXP_RSP_PLD_PA(fcxp));
899
900 } else { 880 } else {
901 if (fcxp->nrsp_sgles > 0) { 881 if (fcxp->nrsp_sgles > 0) {
902 WARN_ON(fcxp->nrsp_sgles != 1); 882 WARN_ON(fcxp->nrsp_sgles != 1);
903 hal_fcxp_set_local_sges(send_req->rsp_sge, 883 bfa_alen_set(&send_req->rsp_alen, rspi->rsp_maxlen,
904 rspi->rsp_maxlen, 884 fcxp->rsp_sga_cbfn(fcxp->caller, 0));
905 fcxp->rsp_sga_cbfn(fcxp->caller, 885
906 0));
907 } else { 886 } else {
908 WARN_ON(rspi->rsp_maxlen != 0); 887 WARN_ON(rspi->rsp_maxlen != 0);
909 hal_fcxp_set_local_sges(send_req->rsp_sge, 0, 0); 888 bfa_alen_set(&send_req->rsp_alen, 0, 0);
910 } 889 }
911 } 890 }
912 891
@@ -4801,8 +4780,6 @@ static void
4801claim_uf_post_msgs(struct bfa_uf_mod_s *ufm, struct bfa_meminfo_s *mi) 4780claim_uf_post_msgs(struct bfa_uf_mod_s *ufm, struct bfa_meminfo_s *mi)
4802{ 4781{
4803 struct bfi_uf_buf_post_s *uf_bp_msg; 4782 struct bfi_uf_buf_post_s *uf_bp_msg;
4804 struct bfi_sge_s *sge;
4805 union bfi_addr_u sga_zero = { {0} };
4806 u16 i; 4783 u16 i;
4807 u16 buf_len; 4784 u16 buf_len;
4808 4785
@@ -4818,17 +4795,7 @@ claim_uf_post_msgs(struct bfa_uf_mod_s *ufm, struct bfa_meminfo_s *mi)
4818 uf_bp_msg->buf_len = cpu_to_be16(buf_len); 4795 uf_bp_msg->buf_len = cpu_to_be16(buf_len);
4819 bfi_h2i_set(uf_bp_msg->mh, BFI_MC_UF, BFI_UF_H2I_BUF_POST, 4796 bfi_h2i_set(uf_bp_msg->mh, BFI_MC_UF, BFI_UF_H2I_BUF_POST,
4820 bfa_lpuid(ufm->bfa)); 4797 bfa_lpuid(ufm->bfa));
4821 4798 bfa_alen_set(&uf_bp_msg->alen, buf_len, ufm_pbs_pa(ufm, i));
4822 sge = uf_bp_msg->sge;
4823 sge[0].sg_len = buf_len;
4824 sge[0].flags = BFI_SGE_DATA_LAST;
4825 bfa_dma_addr_set(sge[0].sga, ufm_pbs_pa(ufm, i));
4826 bfa_sge_to_be(sge);
4827
4828 sge[1].sg_len = buf_len;
4829 sge[1].flags = BFI_SGE_PGDLEN;
4830 sge[1].sga = sga_zero;
4831 bfa_sge_to_be(&sge[1]);
4832 } 4799 }
4833 4800
4834 /* 4801 /*