diff options
author | Vlad Zolotarov <vladz@broadcom.com> | 2011-06-14 07:33:44 -0400 |
---|---|---|
committer | David S. Miller <davem@conan.davemloft.net> | 2011-06-15 10:56:37 -0400 |
commit | 619c5cb6885b936c44ae1422ef805b69c6291485 (patch) | |
tree | 4604ae08f1eb12c6ad1f65106879c2e73946ae12 /drivers/scsi/bnx2fc/bnx2fc_tgt.c | |
parent | 042181f5aa8833a8918e1a91cfaf292146ffc62c (diff) |
New 7.0 FW: bnx2x, cnic, bnx2i, bnx2fc
New FW/HSI (7.0):
- Added support to 578xx chips
- Improved HSI - much less driver's direct access to the FW internal
memory needed.
New implementation of the HSI handling layer in the bnx2x (bnx2x_sp.c):
- Introduced chip dependent objects that have chip independent interfaces
for configuration of MACs, multicast addresses, Rx mode, indirection table,
fast path queues and function initialization/cleanup.
- Objects functionality is based on the private function pointers, which
allows not only a per-chip but also PF/VF differentiation while still
preserving the same interface towards the driver.
- Objects interface is not influenced by the HSI changes which do not require
providing new parameters keeping the code outside the bnx2x_sp.c invariant
with regard to such HSI chnages.
Changes in a CNIC, bnx2fc and bnx2i modules due to the new HSI.
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_tgt.c')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_tgt.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_tgt.c index a2e3830bd268..3e892bd66fbe 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c +++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c | |||
@@ -133,6 +133,8 @@ retry_ofld: | |||
133 | /* upload will take care of cleaning up sess resc */ | 133 | /* upload will take care of cleaning up sess resc */ |
134 | lport->tt.rport_logoff(rdata); | 134 | lport->tt.rport_logoff(rdata); |
135 | } | 135 | } |
136 | /* Arm CQ */ | ||
137 | bnx2fc_arm_cq(tgt); | ||
136 | return; | 138 | return; |
137 | 139 | ||
138 | ofld_err: | 140 | ofld_err: |
@@ -315,6 +317,8 @@ static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt, | |||
315 | 317 | ||
316 | struct fc_rport *rport = rdata->rport; | 318 | struct fc_rport *rport = rdata->rport; |
317 | struct bnx2fc_hba *hba = port->priv; | 319 | struct bnx2fc_hba *hba = port->priv; |
320 | struct b577xx_doorbell_set_prod *sq_db = &tgt->sq_db; | ||
321 | struct b577xx_fcoe_rx_doorbell *rx_db = &tgt->rx_db; | ||
318 | 322 | ||
319 | tgt->rport = rport; | 323 | tgt->rport = rport; |
320 | tgt->rdata = rdata; | 324 | tgt->rdata = rdata; |
@@ -335,6 +339,7 @@ static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt, | |||
335 | tgt->max_sqes = BNX2FC_SQ_WQES_MAX; | 339 | tgt->max_sqes = BNX2FC_SQ_WQES_MAX; |
336 | tgt->max_rqes = BNX2FC_RQ_WQES_MAX; | 340 | tgt->max_rqes = BNX2FC_RQ_WQES_MAX; |
337 | tgt->max_cqes = BNX2FC_CQ_WQES_MAX; | 341 | tgt->max_cqes = BNX2FC_CQ_WQES_MAX; |
342 | atomic_set(&tgt->free_sqes, BNX2FC_SQ_WQES_MAX); | ||
338 | 343 | ||
339 | /* Initialize the toggle bit */ | 344 | /* Initialize the toggle bit */ |
340 | tgt->sq_curr_toggle_bit = 1; | 345 | tgt->sq_curr_toggle_bit = 1; |
@@ -345,7 +350,17 @@ static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt, | |||
345 | tgt->rq_cons_idx = 0; | 350 | tgt->rq_cons_idx = 0; |
346 | atomic_set(&tgt->num_active_ios, 0); | 351 | atomic_set(&tgt->num_active_ios, 0); |
347 | 352 | ||
348 | tgt->work_time_slice = 2; | 353 | /* initialize sq doorbell */ |
354 | sq_db->header.header = B577XX_DOORBELL_HDR_DB_TYPE; | ||
355 | sq_db->header.header |= B577XX_FCOE_CONNECTION_TYPE << | ||
356 | B577XX_DOORBELL_HDR_CONN_TYPE_SHIFT; | ||
357 | /* initialize rx doorbell */ | ||
358 | rx_db->hdr.header = ((0x1 << B577XX_DOORBELL_HDR_RX_SHIFT) | | ||
359 | (0x1 << B577XX_DOORBELL_HDR_DB_TYPE_SHIFT) | | ||
360 | (B577XX_FCOE_CONNECTION_TYPE << | ||
361 | B577XX_DOORBELL_HDR_CONN_TYPE_SHIFT)); | ||
362 | rx_db->params = (0x2 << B577XX_FCOE_RX_DOORBELL_NEGATIVE_ARM_SHIFT) | | ||
363 | (0x3 << B577XX_FCOE_RX_DOORBELL_OPCODE_SHIFT); | ||
349 | 364 | ||
350 | spin_lock_init(&tgt->tgt_lock); | 365 | spin_lock_init(&tgt->tgt_lock); |
351 | spin_lock_init(&tgt->cq_lock); | 366 | spin_lock_init(&tgt->cq_lock); |
@@ -758,8 +773,6 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba, | |||
758 | } | 773 | } |
759 | memset(tgt->lcq, 0, tgt->lcq_mem_size); | 774 | memset(tgt->lcq, 0, tgt->lcq_mem_size); |
760 | 775 | ||
761 | /* Arm CQ */ | ||
762 | tgt->conn_db->cq_arm.lo = -1; | ||
763 | tgt->conn_db->rq_prod = 0x8000; | 776 | tgt->conn_db->rq_prod = 0x8000; |
764 | 777 | ||
765 | return 0; | 778 | return 0; |
@@ -787,6 +800,8 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba, | |||
787 | iounmap(tgt->ctx_base); | 800 | iounmap(tgt->ctx_base); |
788 | tgt->ctx_base = NULL; | 801 | tgt->ctx_base = NULL; |
789 | } | 802 | } |
803 | |||
804 | spin_lock_bh(&tgt->cq_lock); | ||
790 | /* Free LCQ */ | 805 | /* Free LCQ */ |
791 | if (tgt->lcq) { | 806 | if (tgt->lcq) { |
792 | dma_free_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, | 807 | dma_free_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, |
@@ -828,17 +843,16 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba, | |||
828 | tgt->rq = NULL; | 843 | tgt->rq = NULL; |
829 | } | 844 | } |
830 | /* Free CQ */ | 845 | /* Free CQ */ |
831 | spin_lock_bh(&tgt->cq_lock); | ||
832 | if (tgt->cq) { | 846 | if (tgt->cq) { |
833 | dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size, | 847 | dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size, |
834 | tgt->cq, tgt->cq_dma); | 848 | tgt->cq, tgt->cq_dma); |
835 | tgt->cq = NULL; | 849 | tgt->cq = NULL; |
836 | } | 850 | } |
837 | spin_unlock_bh(&tgt->cq_lock); | ||
838 | /* Free SQ */ | 851 | /* Free SQ */ |
839 | if (tgt->sq) { | 852 | if (tgt->sq) { |
840 | dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size, | 853 | dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size, |
841 | tgt->sq, tgt->sq_dma); | 854 | tgt->sq, tgt->sq_dma); |
842 | tgt->sq = NULL; | 855 | tgt->sq = NULL; |
843 | } | 856 | } |
857 | spin_unlock_bh(&tgt->cq_lock); | ||
844 | } | 858 | } |