aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bnx2fc/bnx2fc_tgt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_tgt.c')
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_tgt.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
index 4d93177dfb53..d9bae5672273 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
@@ -673,7 +673,8 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
673 673
674 /* Allocate and map SQ */ 674 /* Allocate and map SQ */
675 tgt->sq_mem_size = tgt->max_sqes * BNX2FC_SQ_WQE_SIZE; 675 tgt->sq_mem_size = tgt->max_sqes * BNX2FC_SQ_WQE_SIZE;
676 tgt->sq_mem_size = (tgt->sq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 676 tgt->sq_mem_size = (tgt->sq_mem_size + (CNIC_PAGE_SIZE - 1)) &
677 CNIC_PAGE_MASK;
677 678
678 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size, 679 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size,
679 &tgt->sq_dma, GFP_KERNEL); 680 &tgt->sq_dma, GFP_KERNEL);
@@ -686,7 +687,8 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
686 687
687 /* Allocate and map CQ */ 688 /* Allocate and map CQ */
688 tgt->cq_mem_size = tgt->max_cqes * BNX2FC_CQ_WQE_SIZE; 689 tgt->cq_mem_size = tgt->max_cqes * BNX2FC_CQ_WQE_SIZE;
689 tgt->cq_mem_size = (tgt->cq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 690 tgt->cq_mem_size = (tgt->cq_mem_size + (CNIC_PAGE_SIZE - 1)) &
691 CNIC_PAGE_MASK;
690 692
691 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size, 693 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size,
692 &tgt->cq_dma, GFP_KERNEL); 694 &tgt->cq_dma, GFP_KERNEL);
@@ -699,7 +701,8 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
699 701
700 /* Allocate and map RQ and RQ PBL */ 702 /* Allocate and map RQ and RQ PBL */
701 tgt->rq_mem_size = tgt->max_rqes * BNX2FC_RQ_WQE_SIZE; 703 tgt->rq_mem_size = tgt->max_rqes * BNX2FC_RQ_WQE_SIZE;
702 tgt->rq_mem_size = (tgt->rq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 704 tgt->rq_mem_size = (tgt->rq_mem_size + (CNIC_PAGE_SIZE - 1)) &
705 CNIC_PAGE_MASK;
703 706
704 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size, 707 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size,
705 &tgt->rq_dma, GFP_KERNEL); 708 &tgt->rq_dma, GFP_KERNEL);
@@ -710,8 +713,9 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
710 } 713 }
711 memset(tgt->rq, 0, tgt->rq_mem_size); 714 memset(tgt->rq, 0, tgt->rq_mem_size);
712 715
713 tgt->rq_pbl_size = (tgt->rq_mem_size / PAGE_SIZE) * sizeof(void *); 716 tgt->rq_pbl_size = (tgt->rq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *);
714 tgt->rq_pbl_size = (tgt->rq_pbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 717 tgt->rq_pbl_size = (tgt->rq_pbl_size + (CNIC_PAGE_SIZE - 1)) &
718 CNIC_PAGE_MASK;
715 719
716 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, 720 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size,
717 &tgt->rq_pbl_dma, GFP_KERNEL); 721 &tgt->rq_pbl_dma, GFP_KERNEL);
@@ -722,7 +726,7 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
722 } 726 }
723 727
724 memset(tgt->rq_pbl, 0, tgt->rq_pbl_size); 728 memset(tgt->rq_pbl, 0, tgt->rq_pbl_size);
725 num_pages = tgt->rq_mem_size / PAGE_SIZE; 729 num_pages = tgt->rq_mem_size / CNIC_PAGE_SIZE;
726 page = tgt->rq_dma; 730 page = tgt->rq_dma;
727 pbl = (u32 *)tgt->rq_pbl; 731 pbl = (u32 *)tgt->rq_pbl;
728 732
@@ -731,13 +735,13 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
731 pbl++; 735 pbl++;
732 *pbl = (u32)((u64)page >> 32); 736 *pbl = (u32)((u64)page >> 32);
733 pbl++; 737 pbl++;
734 page += PAGE_SIZE; 738 page += CNIC_PAGE_SIZE;
735 } 739 }
736 740
737 /* Allocate and map XFERQ */ 741 /* Allocate and map XFERQ */
738 tgt->xferq_mem_size = tgt->max_sqes * BNX2FC_XFERQ_WQE_SIZE; 742 tgt->xferq_mem_size = tgt->max_sqes * BNX2FC_XFERQ_WQE_SIZE;
739 tgt->xferq_mem_size = (tgt->xferq_mem_size + (PAGE_SIZE - 1)) & 743 tgt->xferq_mem_size = (tgt->xferq_mem_size + (CNIC_PAGE_SIZE - 1)) &
740 PAGE_MASK; 744 CNIC_PAGE_MASK;
741 745
742 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev, tgt->xferq_mem_size, 746 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev, tgt->xferq_mem_size,
743 &tgt->xferq_dma, GFP_KERNEL); 747 &tgt->xferq_dma, GFP_KERNEL);
@@ -750,8 +754,8 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
750 754
751 /* Allocate and map CONFQ & CONFQ PBL */ 755 /* Allocate and map CONFQ & CONFQ PBL */
752 tgt->confq_mem_size = tgt->max_sqes * BNX2FC_CONFQ_WQE_SIZE; 756 tgt->confq_mem_size = tgt->max_sqes * BNX2FC_CONFQ_WQE_SIZE;
753 tgt->confq_mem_size = (tgt->confq_mem_size + (PAGE_SIZE - 1)) & 757 tgt->confq_mem_size = (tgt->confq_mem_size + (CNIC_PAGE_SIZE - 1)) &
754 PAGE_MASK; 758 CNIC_PAGE_MASK;
755 759
756 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev, tgt->confq_mem_size, 760 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev, tgt->confq_mem_size,
757 &tgt->confq_dma, GFP_KERNEL); 761 &tgt->confq_dma, GFP_KERNEL);
@@ -763,9 +767,9 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
763 memset(tgt->confq, 0, tgt->confq_mem_size); 767 memset(tgt->confq, 0, tgt->confq_mem_size);
764 768
765 tgt->confq_pbl_size = 769 tgt->confq_pbl_size =
766 (tgt->confq_mem_size / PAGE_SIZE) * sizeof(void *); 770 (tgt->confq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *);
767 tgt->confq_pbl_size = 771 tgt->confq_pbl_size =
768 (tgt->confq_pbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 772 (tgt->confq_pbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK;
769 773
770 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev, 774 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev,
771 tgt->confq_pbl_size, 775 tgt->confq_pbl_size,
@@ -777,7 +781,7 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
777 } 781 }
778 782
779 memset(tgt->confq_pbl, 0, tgt->confq_pbl_size); 783 memset(tgt->confq_pbl, 0, tgt->confq_pbl_size);
780 num_pages = tgt->confq_mem_size / PAGE_SIZE; 784 num_pages = tgt->confq_mem_size / CNIC_PAGE_SIZE;
781 page = tgt->confq_dma; 785 page = tgt->confq_dma;
782 pbl = (u32 *)tgt->confq_pbl; 786 pbl = (u32 *)tgt->confq_pbl;
783 787
@@ -786,7 +790,7 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
786 pbl++; 790 pbl++;
787 *pbl = (u32)((u64)page >> 32); 791 *pbl = (u32)((u64)page >> 32);
788 pbl++; 792 pbl++;
789 page += PAGE_SIZE; 793 page += CNIC_PAGE_SIZE;
790 } 794 }
791 795
792 /* Allocate and map ConnDB */ 796 /* Allocate and map ConnDB */
@@ -805,8 +809,8 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
805 809
806 /* Allocate and map LCQ */ 810 /* Allocate and map LCQ */
807 tgt->lcq_mem_size = (tgt->max_sqes + 8) * BNX2FC_SQ_WQE_SIZE; 811 tgt->lcq_mem_size = (tgt->max_sqes + 8) * BNX2FC_SQ_WQE_SIZE;
808 tgt->lcq_mem_size = (tgt->lcq_mem_size + (PAGE_SIZE - 1)) & 812 tgt->lcq_mem_size = (tgt->lcq_mem_size + (CNIC_PAGE_SIZE - 1)) &
809 PAGE_MASK; 813 CNIC_PAGE_MASK;
810 814
811 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, 815 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size,
812 &tgt->lcq_dma, GFP_KERNEL); 816 &tgt->lcq_dma, GFP_KERNEL);